9remote 0.1.52 → 0.1.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.cjs CHANGED
@@ -1,67 +1,68 @@
1
1
  const __importMetaUrl = require('url').pathToFileURL(__filename).href;
2
- var Z0=Object.create;var In=Object.defineProperty;var Q0=Object.getOwnPropertyDescriptor;var ey=Object.getOwnPropertyNames;var ty=Object.getPrototypeOf,iy=Object.prototype.hasOwnProperty;var Si=(i,e)=>()=>(i&&(e=i(i=0)),e);var T=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),Ei=(i,e)=>{for(var t in e)In(i,t,{get:e[t],enumerable:!0})},$u=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ey(e))!iy.call(i,n)&&n!==t&&In(i,n,{get:()=>e[n],enumerable:!(r=Q0(e,n))||r.enumerable});return i};var L=(i,e,t)=>(t=i!=null?Z0(ty(i)):{},$u(e||!i||!i.__esModule?In(t,"default",{value:i,enumerable:!0}):t,i)),ry=i=>$u(In({},"__esModule",{value:!0}),i);var Yu=T((Pk,la)=>{"use strict";la.exports=Gu;la.exports.preferredCharsets=Gu;var ny=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function sy(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var n=oy(e[t].trim(),t);n&&(e[r++]=n)}return e.length=r,e}function oy(i,e){var t=ny.exec(i);if(!t)return null;var r=t[1],n=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var c=s[o].trim().split("=");if(c[0]==="q"){n=parseFloat(c[1]);break}}return{charset:r,q:n,i:e}}function ay(i,e,t){for(var r={o:-1,q:0,s:0},n=0;n<e.length;n++){var s=cy(i,e[n],t);s&&(r.s-s.s||r.q-s.q||r.o-s.o)<0&&(r=s)}return r}function cy(i,e,t){var r=0;if(e.charset.toLowerCase()===i.toLowerCase())r|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}function Gu(i,e){var t=sy(i===void 0?"*":i||"");if(!e)return t.filter(Ku).sort(Vu).map(ly);var r=e.map(function(s,o){return ay(s,t,o)});return r.filter(Ku).sort(Vu).map(function(s){return e[r.indexOf(s)]})}function Vu(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function ly(i){return i.charset}function Ku(i){return i.q>0}});var ep=T((Bk,ua)=>{"use strict";ua.exports=Qu;ua.exports.preferredEncodings=Qu;var uy=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function py(i){for(var e=i.split(","),t=!1,r=1,n=0,s=0;n<e.length;n++){var o=dy(e[n].trim(),n);o&&(e[s++]=o,t=t||Zu("identity",o),r=Math.min(r,o.q||1))}return t||(e[s++]={encoding:"identity",q:r,i:n}),e.length=s,e}function dy(i,e){var t=uy.exec(i);if(!t)return null;var r=t[1],n=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var c=s[o].trim().split("=");if(c[0]==="q"){n=parseFloat(c[1]);break}}return{encoding:r,q:n,i:e}}function fy(i,e,t){for(var r={o:-1,q:0,s:0},n=0;n<e.length;n++){var s=Zu(i,e[n],t);s&&(r.s-s.s||r.q-s.q||r.o-s.o)<0&&(r=s)}return r}function Zu(i,e,t){var r=0;if(e.encoding.toLowerCase()===i.toLowerCase())r|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}function Qu(i,e){var t=py(i||"");if(!e)return t.filter(Xu).sort(Ju).map(hy);var r=e.map(function(s,o){return fy(s,t,o)});return r.filter(Xu).sort(Ju).map(function(s){return e[r.indexOf(s)]})}function Ju(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function hy(i){return i.encoding}function Xu(i){return i.q>0}});var sp=T((Nk,pa)=>{"use strict";pa.exports=np;pa.exports.preferredLanguages=np;var my=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function vy(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var n=rp(e[t].trim(),t);n&&(e[r++]=n)}return e.length=r,e}function rp(i,e){var t=my.exec(i);if(!t)return null;var r=t[1],n=t[2],s=r;n&&(s+="-"+n);var o=1;if(t[3])for(var c=t[3].split(";"),u=0;u<c.length;u++){var d=c[u].split("=");d[0]==="q"&&(o=parseFloat(d[1]))}return{prefix:r,suffix:n,q:o,i:e,full:s}}function gy(i,e,t){for(var r={o:-1,q:0,s:0},n=0;n<e.length;n++){var s=xy(i,e[n],t);s&&(r.s-s.s||r.q-s.q||r.o-s.o)<0&&(r=s)}return r}function xy(i,e,t){var r=rp(i);if(!r)return null;var n=0;if(e.full.toLowerCase()===r.full.toLowerCase())n|=4;else if(e.prefix.toLowerCase()===r.full.toLowerCase())n|=2;else if(e.full.toLowerCase()===r.prefix.toLowerCase())n|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function np(i,e){var t=vy(i===void 0?"*":i||"");if(!e)return t.filter(ip).sort(tp).map(yy);var r=e.map(function(s,o){return gy(s,t,o)});return r.filter(ip).sort(tp).map(function(s){return e[r.indexOf(s)]})}function tp(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function yy(i){return i.full}function ip(i){return i.q>0}});var pp=T((Ik,da)=>{"use strict";da.exports=lp;da.exports.preferredMediaTypes=lp;var by=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function wy(i){for(var e=Ty(i),t=0,r=0;t<e.length;t++){var n=cp(e[t].trim(),t);n&&(e[r++]=n)}return e.length=r,e}function cp(i,e){var t=by.exec(i);if(!t)return null;var r=Object.create(null),n=1,s=t[2],o=t[1];if(t[3])for(var c=ky(t[3]).map(Cy),u=0;u<c.length;u++){var d=c[u],f=d[0].toLowerCase(),v=d[1],_=v&&v[0]==='"'&&v[v.length-1]==='"'?v.substr(1,v.length-2):v;if(f==="q"){n=parseFloat(_);break}r[f]=_}return{type:o,subtype:s,params:r,q:n,i:e}}function _y(i,e,t){for(var r={o:-1,q:0,s:0},n=0;n<e.length;n++){var s=Sy(i,e[n],t);s&&(r.s-s.s||r.q-s.q||r.o-s.o)<0&&(r=s)}return r}function Sy(i,e,t){var r=cp(i),n=0;if(!r)return null;if(e.type.toLowerCase()==r.type.toLowerCase())n|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==r.subtype.toLowerCase())n|=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()==(r.params[o]||"").toLowerCase()}))n|=1;else return null;return{i:t,o:e.i,q:e.q,s:n}}function lp(i,e){var t=wy(i===void 0?"*/*":i||"");if(!e)return t.filter(ap).sort(op).map(Ey);var r=e.map(function(s,o){return _y(s,t,o)});return r.filter(ap).sort(op).map(function(s){return e[r.indexOf(s)]})}function op(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function Ey(i){return i.type+"/"+i.subtype}function ap(i){return i.q>0}function up(i){for(var e=0,t=0;(t=i.indexOf('"',t))!==-1;)e++,t++;return e}function Cy(i){var e=i.indexOf("="),t,r;return e===-1?t=i:(t=i.substr(0,e),r=i.substr(e+1)),[t,r]}function Ty(i){for(var e=i.split(","),t=1,r=0;t<e.length;t++)up(e[r])%2==0?e[++r]=e[t]:e[r]+=","+e[t];return e.length=r+1,e}function ky(i){for(var e=i.split(";"),t=1,r=0;t<e.length;t++)up(e[r])%2==0?e[++r]=e[t]:e[r]+=";"+e[t];e.length=r+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}});var dp=T((Dk,fa)=>{"use strict";var My=Yu(),Oy=ep(),Ay=sp(),Ry=pp();fa.exports=H;fa.exports.Negotiator=H;function H(i){if(!(this instanceof H))return new H(i);this.request=i}H.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};H.prototype.charsets=function(e){return My(this.request.headers["accept-charset"],e)};H.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};H.prototype.encodings=function(e){return Oy(this.request.headers["accept-encoding"],e)};H.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};H.prototype.languages=function(e){return Ay(this.request.headers["accept-language"],e)};H.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};H.prototype.mediaTypes=function(e){return Ry(this.request.headers.accept,e)};H.prototype.preferredCharset=H.prototype.charset;H.prototype.preferredCharsets=H.prototype.charsets;H.prototype.preferredEncoding=H.prototype.encoding;H.prototype.preferredEncodings=H.prototype.encodings;H.prototype.preferredLanguage=H.prototype.language;H.prototype.preferredLanguages=H.prototype.languages;H.prototype.preferredMediaType=H.prototype.mediaType;H.prototype.preferredMediaTypes=H.prototype.mediaTypes});var fp=T((jk,Py)=>{Py.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 mp=T((Lk,hp)=>{hp.exports=fp()});var xp=T(it=>{"use strict";var Dn=mp(),By=require("path").extname,vp=/^\s*([^;\s]*)(?:;|\s|$)/,Ny=/^text\//i;it.charset=gp;it.charsets={lookup:gp};it.contentType=Iy;it.extension=Dy;it.extensions=Object.create(null);it.lookup=jy;it.types=Object.create(null);Ly(it.extensions,it.types);function gp(i){if(!i||typeof i!="string")return!1;var e=vp.exec(i),t=e&&Dn[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&Ny.test(e[1])?"UTF-8":!1}function Iy(i){if(!i||typeof i!="string")return!1;var e=i.indexOf("/")===-1?it.lookup(i):i;if(!e)return!1;if(e.indexOf("charset")===-1){var t=it.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function Dy(i){if(!i||typeof i!="string")return!1;var e=vp.exec(i),t=e&&it.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function jy(i){if(!i||typeof i!="string")return!1;var e=By("x."+i).toLowerCase().substr(1);return e&&it.types[e]||!1}function Ly(i,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Dn).forEach(function(n){var s=Dn[n],o=s.extensions;if(!(!o||!o.length)){i[n]=o;for(var c=0;c<o.length;c++){var u=o[c];if(e[u]){var d=t.indexOf(Dn[e[u]].source),f=t.indexOf(s.source);if(e[u]!=="application/octet-stream"&&(d>f||d===f&&e[u].substr(0,12)==="application/"))continue}e[u]=n}}})}});var jn=T((Fk,yp)=>{"use strict";var qy=dp(),Fy=xp();yp.exports=lt;function lt(i){if(!(this instanceof lt))return new lt(i);this.headers=i.headers,this.negotiator=new qy(i)}lt.prototype.type=lt.prototype.types=function(i){var e=i;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 r=e.map(Uy),n=this.negotiator.mediaTypes(r.filter(Hy)),s=n[0];return s?e[r.indexOf(s)]:!1};lt.prototype.encoding=lt.prototype.encodings=function(i){var e=i;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};lt.prototype.charset=lt.prototype.charsets=function(i){var e=i;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};lt.prototype.lang=lt.prototype.langs=lt.prototype.language=lt.prototype.languages=function(i){var e=i;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 Uy(i){return i.indexOf("/")===-1?Fy.lookup(i):i}function Hy(i){return typeof i=="string"}});var ma=T((bp,wp)=>{var Yr=require("crypto"),ha=function(){};ha.prototype.getRandomBytes=function(i){var e=4096,t=this;if(i=i||12,i>e)return Yr.randomBytes(i);var r=parseInt(e/i),n=parseInt(r*.85);if(!n||(this.bytesBufferIndex==null&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==r&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(this.bytesBufferIndex==-1||this.bytesBufferIndex>n)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,Yr.randomBytes(e,function(o,c){t.bytesBuffer=c,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return Yr.randomBytes(i);var s=this.bytesBuffer.slice(i*this.bytesBufferIndex,i*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,s};ha.prototype.generateId=function(){var i=Buffer.alloc(15);return i.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,i.writeInt32BE(this.sequenceNumber,11),Yr.randomBytes?this.getRandomBytes(12).copy(i):[0,4,8].forEach(function(e){i.writeInt32BE(Math.random()*Math.pow(2,32)|0,e)}),i.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()};bp=wp.exports=new ha});var Ln=T(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.ERROR_PACKET=pi.PACKET_TYPES_REVERSE=pi.PACKET_TYPES=void 0;var Ut=Object.create(null);pi.PACKET_TYPES=Ut;Ut.open="0";Ut.close="1";Ut.ping="2";Ut.pong="3";Ut.message="4";Ut.upgrade="5";Ut.noop="6";var _p=Object.create(null);pi.PACKET_TYPES_REVERSE=_p;Object.keys(Ut).forEach(i=>{_p[Ut[i]]=i});var zy={type:"error",data:"parser error"};pi.ERROR_PACKET=zy});var Ep=T(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.encodePacket=void 0;Yi.encodePacketToBinary=Vy;var Wy=Ln(),$y=({type:i,data:e},t,r)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?r(t?e:"b"+Sp(e,!0).toString("base64")):r(Wy.PACKET_TYPES[i]+(e||""));Yi.encodePacket=$y;var Sp=(i,e)=>Buffer.isBuffer(i)||i instanceof Uint8Array&&!e?i:i instanceof ArrayBuffer?Buffer.from(i):Buffer.from(i.buffer,i.byteOffset,i.byteLength),va;function Vy(i,e){if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return e(Sp(i.data,!1));(0,Yi.encodePacket)(i,!0,t=>{va||(va=new TextEncoder),e(va.encode(t))})}});var Tp=T(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.decodePacket=void 0;var qn=Ln(),Ky=(i,e)=>{if(typeof i!="string")return{type:"message",data:Cp(i,e)};let t=i.charAt(0);if(t==="b"){let r=Buffer.from(i.substring(1),"base64");return{type:"message",data:Cp(r,e)}}return qn.PACKET_TYPES_REVERSE[t]?i.length>1?{type:qn.PACKET_TYPES_REVERSE[t],data:i.substring(1)}:{type:qn.PACKET_TYPES_REVERSE[t]}:qn.ERROR_PACKET};Fn.decodePacket=Ky;var Cp=(i,e)=>e==="arraybuffer"?i instanceof ArrayBuffer?i:Buffer.isBuffer(i)?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i.buffer:Buffer.isBuffer(i)?i:Buffer.from(i)});var Jr=T(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.decodePayload=rt.decodePacket=rt.encodePayload=rt.encodePacket=rt.protocol=void 0;rt.createPacketEncoderStream=Jy;rt.createPacketDecoderStream=Xy;var xa=Ep();Object.defineProperty(rt,"encodePacket",{enumerable:!0,get:function(){return xa.encodePacket}});var ya=Tp();Object.defineProperty(rt,"decodePacket",{enumerable:!0,get:function(){return ya.decodePacket}});var kp=Ln(),Mp="",Gy=(i,e)=>{let t=i.length,r=new Array(t),n=0;i.forEach((s,o)=>{(0,xa.encodePacket)(s,!1,c=>{r[o]=c,++n===t&&e(r.join(Mp))})})};rt.encodePayload=Gy;var Yy=(i,e)=>{let t=i.split(Mp),r=[];for(let n=0;n<t.length;n++){let s=(0,ya.decodePacket)(t[n],e);if(r.push(s),s.type==="error")break}return r};rt.decodePayload=Yy;function Jy(){return new TransformStream({transform(i,e){(0,xa.encodePacketToBinary)(i,t=>{let r=t.length,n;if(r<126)n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,r);else if(r<65536){n=new Uint8Array(3);let s=new DataView(n.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{n=new Uint8Array(9);let s=new DataView(n.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}i.data&&typeof i.data!="string"&&(n[0]|=128),e.enqueue(n),e.enqueue(t)})}})}var ga;function Un(i){return i.reduce((e,t)=>e+t.length,0)}function Hn(i,e){if(i[0].length===e)return i.shift();let t=new Uint8Array(e),r=0;for(let n=0;n<e;n++)t[n]=i[0][r++],r===i[0].length&&(i.shift(),r=0);return i.length&&r<i[0].length&&(i[0]=i[0].slice(r)),t}function Xy(i,e){ga||(ga=new TextDecoder);let t=[],r=0,n=-1,s=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(r===0){if(Un(t)<1)break;let u=Hn(t,1);s=(u[0]&128)===128,n=u[0]&127,n<126?r=3:n===126?r=1:r=2}else if(r===1){if(Un(t)<2)break;let u=Hn(t,2);n=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(Un(t)<8)break;let u=Hn(t,8),d=new DataView(u.buffer,u.byteOffset,u.length),f=d.getUint32(0);if(f>Math.pow(2,21)-1){c.enqueue(kp.ERROR_PACKET);break}n=f*Math.pow(2,32)+d.getUint32(4),r=3}else{if(Un(t)<n)break;let u=Hn(t,n);c.enqueue((0,ya.decodePacket)(s?u:ga.decode(u),e)),r=0}if(n===0||n>i){c.enqueue(kp.ERROR_PACKET);break}}}})}rt.protocol=4});var Pp=T(($k,Rp)=>{var di=String.fromCharCode;function Op(i){for(var e=[],t=0,r=i.length,n,s;t<r;)n=i.charCodeAt(t++),n>=55296&&n<=56319&&t<r?(s=i.charCodeAt(t++),(s&64512)==56320?e.push(((n&1023)<<10)+(s&1023)+65536):(e.push(n),t--)):e.push(n);return e}function Zy(i){for(var e=i.length,t=-1,r,n="";++t<e;)r=i[t],r>65535&&(r-=65536,n+=di(r>>>10&1023|55296),r=56320|r&1023),n+=di(r);return n}function Ap(i,e){if(i>=55296&&i<=57343){if(e)throw Error("Lone surrogate U+"+i.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function ba(i,e){return di(i>>e&63|128)}function Qy(i,e){if((i&4294967168)==0)return di(i);var t="";return(i&4294965248)==0?t=di(i>>6&31|192):(i&4294901760)==0?(Ap(i,e)||(i=65533),t=di(i>>12&15|224),t+=ba(i,6)):(i&4292870144)==0&&(t=di(i>>18&7|240),t+=ba(i,12),t+=ba(i,6)),t+=di(i&63|128),t}function eb(i,e){e=e||{};for(var t=e.strict!==!1,r=Op(i),n=r.length,s=-1,o,c="";++s<n;)o=r[s],c+=Qy(o,t);return c}function Ji(){if(fi>=Wn)throw Error("Invalid byte index");var i=zn[fi]&255;if(fi++,(i&192)==128)return i&63;throw Error("Invalid continuation byte")}function tb(i){var e,t,r,n,s;if(fi>Wn)throw Error("Invalid byte index");if(fi==Wn)return!1;if(e=zn[fi]&255,fi++,(e&128)==0)return e;if((e&224)==192){if(t=Ji(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=Ji(),r=Ji(),s=(e&15)<<12|t<<6|r,s>=2048)return Ap(s,i)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=Ji(),r=Ji(),n=Ji(),s=(e&7)<<18|t<<12|r<<6|n,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var zn,Wn,fi;function ib(i,e){e=e||{};var t=e.strict!==!1;zn=Op(i),Wn=zn.length,fi=0;for(var r=[],n;(n=tb(t))!==!1;)r.push(n);return Zy(r)}Rp.exports={version:"2.1.2",encode:eb,decode:ib}});var Fp=T(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.packets=Fe.protocol=void 0;Fe.encodePacket=wa;Fe.encodeBase64Packet=Ip;Fe.decodePacket=_a;Fe.decodeBase64Packet=Dp;Fe.encodePayload=ob;Fe.decodePayload=cb;Fe.encodePayloadAsBinary=Lp;Fe.decodePayloadAsBinary=qp;var Np=Pp();Fe.protocol=3;var rb=i=>{for(let e of i)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};Fe.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Xi=Object.keys(Fe.packets),Rt={type:"error",data:"parser error"},nb=Buffer.concat([]);function wa(i,e,t,r){if(typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t=null),Buffer.isBuffer(i.data))return Bp(i,e,r);if(i.data&&(i.data.buffer||i.data)instanceof ArrayBuffer)return Bp({type:i.type,data:Sa(i.data)},e,r);var n=Fe.packets[i.type];return i.data!==void 0&&(n+=t?Np.encode(String(i.data),{strict:!1}):String(i.data)),r(""+n)}function Bp(i,e,t){if(!e)return Ip(i,t);var r=i.data,n=Buffer.allocUnsafe(1);return n[0]=Fe.packets[i.type],t(Buffer.concat([n,r]))}function Ip(i,e){var t=Buffer.isBuffer(i.data)?i.data:Sa(i.data),r="b"+Fe.packets[i.type];return r+=t.toString("base64"),e(r)}function _a(i,e,t){if(i===void 0)return Rt;let r;if(typeof i=="string")return r=i.charAt(0),r==="b"?Dp(i.slice(1),e):t&&(i=sb(i),i===!1)||Number(r)!=r||!Xi[r]?Rt:i.length>1?{type:Xi[r],data:i.slice(1)}:{type:Xi[r]};if(e==="arraybuffer"){var n=new Uint8Array(i);return r=n[0],{type:Xi[r],data:n.buffer.slice(1)}}return i instanceof ArrayBuffer&&(i=Sa(i)),r=i[0],{type:Xi[r],data:i.slice(1)}}function sb(i){try{i=Np.decode(i,{strict:!1})}catch{return!1}return i}function Dp(i,e){var t=Xi[i.charAt(0)],r=Buffer.from(i.slice(1),"base64");if(e==="arraybuffer"){for(var n=new Uint8Array(r.length),s=0;s<n.length;s++)n[s]=r[s];r=n.buffer}return{type:t,data:r}}function ob(i,e,t){if(typeof e=="function"&&(t=e,e=null),e&&rb(i))return Lp(i,t);if(!i.length)return t("0:");function r(n,s){wa(n,e,!1,function(o){s(null,ab(o))})}jp(i,r,function(n,s){return t(s.join(""))})}function ab(i){return i.length+":"+i}function jp(i,e,t){let r=new Array(i.length),n=0;for(let s=0;s<i.length;s++)e(i[s],(o,c)=>{r[s]=c,++n===i.length&&t(null,r)})}function cb(i,e,t){if(typeof i!="string")return qp(i,e,t);if(typeof e=="function"&&(t=e,e=null),i==="")return t(Rt,0,1);for(var r="",n,s,o,c=0,u=i.length;c<u;c++){var d=i.charAt(c);if(d!==":"){r+=d;continue}if(r===""||r!=(n=Number(r))||(s=i.slice(c+1,c+1+n),r!=s.length))return t(Rt,0,1);if(s.length){if(o=_a(s,e,!1),Rt.type===o.type&&Rt.data===o.data)return t(Rt,0,1);var f=t(o,c+n,u);if(f===!1)return}c+=n,r=""}if(r!=="")return t(Rt,0,1)}function lb(i){for(var e="",t=0,r=i.length;t<r;t++)e+=String.fromCharCode(i[t]);return e}function ub(i){for(var e=Buffer.allocUnsafe(i.length),t=0,r=i.length;t<r;t++)e.writeUInt8(i.charCodeAt(t),t);return e}function Sa(i){var e=i.byteLength||i.length,t=i.byteOffset||0;return Buffer.from(i.buffer||i,t,e)}function Lp(i,e){if(!i.length)return e(nb);jp(i,pb,function(t,r){return e(Buffer.concat(r))})}function pb(i,e){function t(r){var n=""+r.length,s;if(typeof r=="string"){s=Buffer.allocUnsafe(n.length+2),s[0]=0;for(var o=0;o<n.length;o++)s[o+1]=parseInt(n[o],10);return s[s.length-1]=255,e(null,Buffer.concat([s,ub(r)]))}s=Buffer.allocUnsafe(n.length+2),s[0]=1;for(var o=0;o<n.length;o++)s[o+1]=parseInt(n[o],10);s[s.length-1]=255,e(null,Buffer.concat([s,r]))}wa(i,!0,!0,t)}function qp(i,e,t){typeof e=="function"&&(t=e,e=null);for(var r=i,n=[],s;r.length>0;){var o="",c=r[0]===0;for(s=1;r[s]!==255;s++){if(o.length>310)return t(Rt,0,1);o+=""+r[s]}r=r.slice(o.length+1);var u=parseInt(o,10),d=r.slice(1,u+1);c&&(d=lb(d)),n.push(d),r=r.slice(u+1)}var f=n.length;for(s=0;s<f;s++){var v=n[s];t(_a(v,e,!0),s,f)}}});var Hp=T((Kk,Up)=>{var Zi=1e3,Qi=Zi*60,er=Qi*60,Ci=er*24,db=Ci*7,fb=Ci*365.25;Up.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return hb(i);if(t==="number"&&isFinite(i))return e.long?vb(i):mb(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function hb(i){if(i=String(i),!(i.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(i);if(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*fb;case"weeks":case"week":case"w":return t*db;case"days":case"day":case"d":return t*Ci;case"hours":case"hour":case"hrs":case"hr":case"h":return t*er;case"minutes":case"minute":case"mins":case"min":case"m":return t*Qi;case"seconds":case"second":case"secs":case"sec":case"s":return t*Zi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function mb(i){var e=Math.abs(i);return e>=Ci?Math.round(i/Ci)+"d":e>=er?Math.round(i/er)+"h":e>=Qi?Math.round(i/Qi)+"m":e>=Zi?Math.round(i/Zi)+"s":i+"ms"}function vb(i){var e=Math.abs(i);return e>=Ci?$n(i,e,Ci,"day"):e>=er?$n(i,e,er,"hour"):e>=Qi?$n(i,e,Qi,"minute"):e>=Zi?$n(i,e,Zi,"second"):i+" ms"}function $n(i,e,t,r){var n=e>=t*1.5;return Math.round(i/t)+" "+r+(n?"s":"")}});var Ea=T((Gk,zp)=>{function gb(i){t.debug=t,t.default=t,t.coerce=u,t.disable=o,t.enable=n,t.enabled=c,t.humanize=Hp(),t.destroy=d,Object.keys(i).forEach(f=>{t[f]=i[f]}),t.names=[],t.skips=[],t.formatters={};function e(f){let v=0;for(let _=0;_<f.length;_++)v=(v<<5)-v+f.charCodeAt(_),v|=0;return t.colors[Math.abs(v)%t.colors.length]}t.selectColor=e;function t(f){let v,_=null,E,C;function k(...M){if(!k.enabled)return;let O=k,A=Number(new Date),I=A-(v||A);O.diff=I,O.prev=v,O.curr=A,v=A,M[0]=t.coerce(M[0]),typeof M[0]!="string"&&M.unshift("%O");let U=0;M[0]=M[0].replace(/%([a-zA-Z%])/g,(te,Le)=>{if(te==="%%")return"%";U++;let q=t.formatters[Le];if(typeof q=="function"){let qe=M[U];te=q.call(O,qe),M.splice(U,1),U--}return te}),t.formatArgs.call(O,M),(O.log||t.log).apply(O,M)}return k.namespace=f,k.useColors=t.useColors(),k.color=t.selectColor(f),k.extend=r,k.destroy=t.destroy,Object.defineProperty(k,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(E!==t.namespaces&&(E=t.namespaces,C=t.enabled(f)),C),set:M=>{_=M}}),typeof t.init=="function"&&t.init(k),k}function r(f,v){let _=t(this.namespace+(typeof v>"u"?":":v)+f);return _.log=this.log,_}function n(f){t.save(f),t.namespaces=f,t.names=[],t.skips=[];let v=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let _ of v)_[0]==="-"?t.skips.push(_.slice(1)):t.names.push(_)}function s(f,v){let _=0,E=0,C=-1,k=0;for(;_<f.length;)if(E<v.length&&(v[E]===f[_]||v[E]==="*"))v[E]==="*"?(C=E,k=_,E++):(_++,E++);else if(C!==-1)E=C+1,k++,_=k;else return!1;for(;E<v.length&&v[E]==="*";)E++;return E===v.length}function o(){let f=[...t.names,...t.skips.map(v=>"-"+v)].join(",");return t.enable(""),f}function c(f){for(let v of t.skips)if(s(f,v))return!1;for(let v of t.names)if(s(f,v))return!0;return!1}function u(f){return f instanceof Error?f.stack||f.message:f}function d(){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}zp.exports=gb});var Wp=T((nt,Vn)=>{nt.formatArgs=yb;nt.save=bb;nt.load=wb;nt.useColors=xb;nt.storage=_b();nt.destroy=(()=>{let i=!1;return()=>{i||(i=!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`."))}})();nt.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 xb(){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 i;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&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function yb(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+Vn.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,r=0;i[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(r=t))}),i.splice(r,0,e)}nt.log=console.debug||console.log||(()=>{});function bb(i){try{i?nt.storage.setItem("debug",i):nt.storage.removeItem("debug")}catch{}}function wb(){let i;try{i=nt.storage.getItem("debug")||nt.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function _b(){try{return localStorage}catch{}}Vn.exports=Ea()(nt);var{formatters:Sb}=Vn.exports;Sb.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Vp=T((Yk,$p)=>{"use strict";$p.exports=(i,e=process.argv)=>{let t=i.startsWith("-")?"":i.length===1?"-":"--",r=e.indexOf(t+i),n=e.indexOf("--");return r!==-1&&(n===-1||r<n)}});var Yp=T((Jk,Gp)=>{"use strict";var Eb=require("os"),Kp=require("tty"),vt=Vp(),{env:Ue}=process,hi;vt("no-color")||vt("no-colors")||vt("color=false")||vt("color=never")?hi=0:(vt("color")||vt("colors")||vt("color=true")||vt("color=always"))&&(hi=1);"FORCE_COLOR"in Ue&&(Ue.FORCE_COLOR==="true"?hi=1:Ue.FORCE_COLOR==="false"?hi=0:hi=Ue.FORCE_COLOR.length===0?1:Math.min(parseInt(Ue.FORCE_COLOR,10),3));function Ca(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function Ta(i,e){if(hi===0)return 0;if(vt("color=16m")||vt("color=full")||vt("color=truecolor"))return 3;if(vt("color=256"))return 2;if(i&&!e&&hi===void 0)return 0;let t=hi||0;if(Ue.TERM==="dumb")return t;if(process.platform==="win32"){let r=Eb.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Ue)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Ue)||Ue.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Ue)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ue.TEAMCITY_VERSION)?1:0;if(Ue.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Ue){let r=parseInt((Ue.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ue.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ue.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ue.TERM)||"COLORTERM"in Ue?1:t}function Cb(i){let e=Ta(i,i&&i.isTTY);return Ca(e)}Gp.exports={supportsColor:Cb,stdout:Ca(Ta(!0,Kp.isatty(1))),stderr:Ca(Ta(!0,Kp.isatty(2)))}});var Xp=T((He,Gn)=>{var Tb=require("tty"),Kn=require("util");He.init=Bb;He.log=Ab;He.formatArgs=Mb;He.save=Rb;He.load=Pb;He.useColors=kb;He.destroy=Kn.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");He.colors=[6,2,3,4,5,1];try{let i=Yp();i&&(i.stderr||i).level>=2&&(He.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{}He.inspectOpts=Object.keys(process.env).filter(i=>/^debug_/i.test(i)).reduce((i,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(n,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),i[t]=r,i},{});function kb(){return"colors"in He.inspectOpts?!!He.inspectOpts.colors:Tb.isatty(process.stderr.fd)}function Mb(i){let{namespace:e,useColors:t}=this;if(t){let r=this.color,n="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${n};1m${e} \x1B[0m`;i[0]=s+i[0].split(`
2
+ var Ay=Object.create;var Vr=Object.defineProperty;var Ry=Object.getOwnPropertyDescriptor;var Py=Object.getOwnPropertyNames;var Iy=Object.getPrototypeOf,Ny=Object.prototype.hasOwnProperty;var Mi=(i,e)=>()=>(i&&(e=i(i=0)),e);var O=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),Ai=(i,e)=>{for(var t in e)Vr(i,t,{get:e[t],enumerable:!0})},mp=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Py(e))!Ny.call(i,r)&&r!==t&&Vr(i,r,{get:()=>e[r],enumerable:!(n=Ry(e,r))||n.enumerable});return i};var z=(i,e,t)=>(t=i!=null?Ay(Iy(i)):{},mp(e||!i||!i.__esModule?Vr(t,"default",{value:i,enumerable:!0}):t,i)),By=i=>mp(Vr({},"__esModule",{value:!0}),i);var yp=O((yO,Ca)=>{"use strict";Ca.exports=xp;Ca.exports.preferredCharsets=xp;var jy=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function Dy(i){for(var e=i.split(","),t=0,n=0;t<e.length;t++){var r=Ly(e[t].trim(),t);r&&(e[n++]=r)}return e.length=n,e}function Ly(i,e){var t=jy.exec(i);if(!t)return null;var n=t[1],r=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"){r=parseFloat(a[1]);break}}return{charset:n,q:r,i:e}}function qy(i,e,t){for(var n={o:-1,q:0,s:0},r=0;r<e.length;r++){var s=Fy(i,e[r],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function Fy(i,e,t){var n=0;if(e.charset.toLowerCase()===i.toLowerCase())n|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function xp(i,e){var t=Dy(i===void 0?"*":i||"");if(!e)return t.filter(gp).sort(vp).map(Uy);var n=e.map(function(s,o){return qy(s,t,o)});return n.filter(gp).sort(vp).map(function(s){return e[n.indexOf(s)]})}function vp(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function Uy(i){return i.charset}function gp(i){return i.q>0}});var Ep=O((bO,Ta)=>{"use strict";Ta.exports=Sp;Ta.exports.preferredEncodings=Sp;var Hy=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function zy(i){for(var e=i.split(","),t=!1,n=1,r=0,s=0;r<e.length;r++){var o=Wy(e[r].trim(),r);o&&(e[s++]=o,t=t||_p("identity",o),n=Math.min(n,o.q||1))}return t||(e[s++]={encoding:"identity",q:n,i:r}),e.length=s,e}function Wy(i,e){var t=Hy.exec(i);if(!t)return null;var n=t[1],r=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"){r=parseFloat(a[1]);break}}return{encoding:n,q:r,i:e}}function $y(i,e,t){for(var n={o:-1,q:0,s:0},r=0;r<e.length;r++){var s=_p(i,e[r],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function _p(i,e,t){var n=0;if(e.encoding.toLowerCase()===i.toLowerCase())n|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function Sp(i,e){var t=zy(i||"");if(!e)return t.filter(wp).sort(bp).map(Ky);var n=e.map(function(s,o){return $y(s,t,o)});return n.filter(wp).sort(bp).map(function(s){return e[n.indexOf(s)]})}function bp(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function Ky(i){return i.encoding}function wp(i){return i.q>0}});var Mp=O((wO,ka)=>{"use strict";ka.exports=Op;ka.exports.preferredLanguages=Op;var Vy=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function Gy(i){for(var e=i.split(","),t=0,n=0;t<e.length;t++){var r=kp(e[t].trim(),t);r&&(e[n++]=r)}return e.length=n,e}function kp(i,e){var t=Vy.exec(i);if(!t)return null;var n=t[1],r=t[2],s=n;r&&(s+="-"+r);var o=1;if(t[3])for(var a=t[3].split(";"),l=0;l<a.length;l++){var p=a[l].split("=");p[0]==="q"&&(o=parseFloat(p[1]))}return{prefix:n,suffix:r,q:o,i:e,full:s}}function Jy(i,e,t){for(var n={o:-1,q:0,s:0},r=0;r<e.length;r++){var s=Yy(i,e[r],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function Yy(i,e,t){var n=kp(i);if(!n)return null;var r=0;if(e.full.toLowerCase()===n.full.toLowerCase())r|=4;else if(e.prefix.toLowerCase()===n.full.toLowerCase())r|=2;else if(e.full.toLowerCase()===n.prefix.toLowerCase())r|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}function Op(i,e){var t=Gy(i===void 0?"*":i||"");if(!e)return t.filter(Tp).sort(Cp).map(Xy);var n=e.map(function(s,o){return Jy(s,t,o)});return n.filter(Tp).sort(Cp).map(function(s){return e[n.indexOf(s)]})}function Cp(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function Xy(i){return i.full}function Tp(i){return i.q>0}});var Bp=O((_O,Oa)=>{"use strict";Oa.exports=Ip;Oa.exports.preferredMediaTypes=Ip;var Zy=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function Qy(i){for(var e=rb(i),t=0,n=0;t<e.length;t++){var r=Pp(e[t].trim(),t);r&&(e[n++]=r)}return e.length=n,e}function Pp(i,e){var t=Zy.exec(i);if(!t)return null;var n=Object.create(null),r=1,s=t[2],o=t[1];if(t[3])for(var a=sb(t[3]).map(nb),l=0;l<a.length;l++){var p=a[l],d=p[0].toLowerCase(),h=p[1],g=h&&h[0]==='"'&&h[h.length-1]==='"'?h.substr(1,h.length-2):h;if(d==="q"){r=parseFloat(g);break}n[d]=g}return{type:o,subtype:s,params:n,q:r,i:e}}function eb(i,e,t){for(var n={o:-1,q:0,s:0},r=0;r<e.length;r++){var s=tb(i,e[r],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function tb(i,e,t){var n=Pp(i),r=0;if(!n)return null;if(e.type.toLowerCase()==n.type.toLowerCase())r|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==n.subtype.toLowerCase())r|=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()}))r|=1;else return null;return{i:t,o:e.i,q:e.q,s:r}}function Ip(i,e){var t=Qy(i===void 0?"*/*":i||"");if(!e)return t.filter(Rp).sort(Ap).map(ib);var n=e.map(function(s,o){return eb(s,t,o)});return n.filter(Rp).sort(Ap).map(function(s){return e[n.indexOf(s)]})}function Ap(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}function ib(i){return i.type+"/"+i.subtype}function Rp(i){return i.q>0}function Np(i){for(var e=0,t=0;(t=i.indexOf('"',t))!==-1;)e++,t++;return e}function nb(i){var e=i.indexOf("="),t,n;return e===-1?t=i:(t=i.substr(0,e),n=i.substr(e+1)),[t,n]}function rb(i){for(var e=i.split(","),t=1,n=0;t<e.length;t++)Np(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function sb(i){for(var e=i.split(";"),t=1,n=0;t<e.length;t++)Np(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 jp=O((SO,Ma)=>{"use strict";var ob=yp(),ab=Ep(),cb=Mp(),lb=Bp();Ma.exports=J;Ma.exports.Negotiator=J;function J(i){if(!(this instanceof J))return new J(i);this.request=i}J.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};J.prototype.charsets=function(e){return ob(this.request.headers["accept-charset"],e)};J.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};J.prototype.encodings=function(e){return ab(this.request.headers["accept-encoding"],e)};J.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};J.prototype.languages=function(e){return cb(this.request.headers["accept-language"],e)};J.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};J.prototype.mediaTypes=function(e){return lb(this.request.headers.accept,e)};J.prototype.preferredCharset=J.prototype.charset;J.prototype.preferredCharsets=J.prototype.charsets;J.prototype.preferredEncoding=J.prototype.encoding;J.prototype.preferredEncodings=J.prototype.encodings;J.prototype.preferredLanguage=J.prototype.language;J.prototype.preferredLanguages=J.prototype.languages;J.prototype.preferredMediaType=J.prototype.mediaType;J.prototype.preferredMediaTypes=J.prototype.mediaTypes});var Dp=O((EO,ub)=>{ub.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 qp=O((CO,Lp)=>{Lp.exports=Dp()});var Hp=O(ot=>{"use strict";var Gr=qp(),pb=require("path").extname,Fp=/^\s*([^;\s]*)(?:;|\s|$)/,fb=/^text\//i;ot.charset=Up;ot.charsets={lookup:Up};ot.contentType=db;ot.extension=hb;ot.extensions=Object.create(null);ot.lookup=mb;ot.types=Object.create(null);vb(ot.extensions,ot.types);function Up(i){if(!i||typeof i!="string")return!1;var e=Fp.exec(i),t=e&&Gr[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&fb.test(e[1])?"UTF-8":!1}function db(i){if(!i||typeof i!="string")return!1;var e=i.indexOf("/")===-1?ot.lookup(i):i;if(!e)return!1;if(e.indexOf("charset")===-1){var t=ot.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function hb(i){if(!i||typeof i!="string")return!1;var e=Fp.exec(i),t=e&&ot.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function mb(i){if(!i||typeof i!="string")return!1;var e=pb("x."+i).toLowerCase().substr(1);return e&&ot.types[e]||!1}function vb(i,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Gr).forEach(function(r){var s=Gr[r],o=s.extensions;if(!(!o||!o.length)){i[r]=o;for(var a=0;a<o.length;a++){var l=o[a];if(e[l]){var p=t.indexOf(Gr[e[l]].source),d=t.indexOf(s.source);if(e[l]!=="application/octet-stream"&&(p>d||p===d&&e[l].substr(0,12)==="application/"))continue}e[l]=r}}})}});var Jr=O((kO,zp)=>{"use strict";var gb=jp(),xb=Hp();zp.exports=ht;function ht(i){if(!(this instanceof ht))return new ht(i);this.headers=i.headers,this.negotiator=new gb(i)}ht.prototype.type=ht.prototype.types=function(i){var e=i;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(yb),r=this.negotiator.mediaTypes(n.filter(bb)),s=r[0];return s?e[n.indexOf(s)]:!1};ht.prototype.encoding=ht.prototype.encodings=function(i){var e=i;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};ht.prototype.charset=ht.prototype.charsets=function(i){var e=i;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};ht.prototype.lang=ht.prototype.langs=ht.prototype.language=ht.prototype.languages=function(i){var e=i;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 yb(i){return i.indexOf("/")===-1?xb.lookup(i):i}function bb(i){return typeof i=="string"}});var Ra=O((Wp,$p)=>{var sr=require("crypto"),Aa=function(){};Aa.prototype.getRandomBytes=function(i){var e=4096,t=this;if(i=i||12,i>e)return sr.randomBytes(i);var n=parseInt(e/i),r=parseInt(n*.85);if(!r||(this.bytesBufferIndex==null&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==n&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(this.bytesBufferIndex==-1||this.bytesBufferIndex>r)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,sr.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return sr.randomBytes(i);var s=this.bytesBuffer.slice(i*this.bytesBufferIndex,i*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,s};Aa.prototype.generateId=function(){var i=Buffer.alloc(15);return i.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,i.writeInt32BE(this.sequenceNumber,11),sr.randomBytes?this.getRandomBytes(12).copy(i):[0,4,8].forEach(function(e){i.writeInt32BE(Math.random()*Math.pow(2,32)|0,e)}),i.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()};Wp=$p.exports=new Aa});var Yr=O(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.ERROR_PACKET=vi.PACKET_TYPES_REVERSE=vi.PACKET_TYPES=void 0;var Kt=Object.create(null);vi.PACKET_TYPES=Kt;Kt.open="0";Kt.close="1";Kt.ping="2";Kt.pong="3";Kt.message="4";Kt.upgrade="5";Kt.noop="6";var Kp=Object.create(null);vi.PACKET_TYPES_REVERSE=Kp;Object.keys(Kt).forEach(i=>{Kp[Kt[i]]=i});var wb={type:"error",data:"parser error"};vi.ERROR_PACKET=wb});var Gp=O(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.encodePacket=void 0;tn.encodePacketToBinary=Eb;var _b=Yr(),Sb=({type:i,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+Vp(e,!0).toString("base64")):n(_b.PACKET_TYPES[i]+(e||""));tn.encodePacket=Sb;var Vp=(i,e)=>Buffer.isBuffer(i)||i instanceof Uint8Array&&!e?i:i instanceof ArrayBuffer?Buffer.from(i):Buffer.from(i.buffer,i.byteOffset,i.byteLength),Pa;function Eb(i,e){if(i.data instanceof ArrayBuffer||ArrayBuffer.isView(i.data))return e(Vp(i.data,!1));(0,tn.encodePacket)(i,!0,t=>{Pa||(Pa=new TextEncoder),e(Pa.encode(t))})}});var Yp=O(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.decodePacket=void 0;var Xr=Yr(),Cb=(i,e)=>{if(typeof i!="string")return{type:"message",data:Jp(i,e)};let t=i.charAt(0);if(t==="b"){let n=Buffer.from(i.substring(1),"base64");return{type:"message",data:Jp(n,e)}}return Xr.PACKET_TYPES_REVERSE[t]?i.length>1?{type:Xr.PACKET_TYPES_REVERSE[t],data:i.substring(1)}:{type:Xr.PACKET_TYPES_REVERSE[t]}:Xr.ERROR_PACKET};Zr.decodePacket=Cb;var Jp=(i,e)=>e==="arraybuffer"?i instanceof ArrayBuffer?i:Buffer.isBuffer(i)?i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength):i.buffer:Buffer.isBuffer(i)?i:Buffer.from(i)});var or=O(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.decodePayload=at.decodePacket=at.encodePayload=at.encodePacket=at.protocol=void 0;at.createPacketEncoderStream=Ob;at.createPacketDecoderStream=Mb;var Na=Gp();Object.defineProperty(at,"encodePacket",{enumerable:!0,get:function(){return Na.encodePacket}});var Ba=Yp();Object.defineProperty(at,"decodePacket",{enumerable:!0,get:function(){return Ba.decodePacket}});var Xp=Yr(),Zp="",Tb=(i,e)=>{let t=i.length,n=new Array(t),r=0;i.forEach((s,o)=>{(0,Na.encodePacket)(s,!1,a=>{n[o]=a,++r===t&&e(n.join(Zp))})})};at.encodePayload=Tb;var kb=(i,e)=>{let t=i.split(Zp),n=[];for(let r=0;r<t.length;r++){let s=(0,Ba.decodePacket)(t[r],e);if(n.push(s),s.type==="error")break}return n};at.decodePayload=kb;function Ob(){return new TransformStream({transform(i,e){(0,Na.encodePacketToBinary)(i,t=>{let n=t.length,r;if(n<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,n);else if(n<65536){r=new Uint8Array(3);let s=new DataView(r.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{r=new Uint8Array(9);let s=new DataView(r.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}i.data&&typeof i.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(t)})}})}var Ia;function Qr(i){return i.reduce((e,t)=>e+t.length,0)}function es(i,e){if(i[0].length===e)return i.shift();let t=new Uint8Array(e),n=0;for(let r=0;r<e;r++)t[r]=i[0][n++],n===i[0].length&&(i.shift(),n=0);return i.length&&n<i[0].length&&(i[0]=i[0].slice(n)),t}function Mb(i,e){Ia||(Ia=new TextDecoder);let t=[],n=0,r=-1,s=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(Qr(t)<1)break;let l=es(t,1);s=(l[0]&128)===128,r=l[0]&127,r<126?n=3:r===126?n=1:n=2}else if(n===1){if(Qr(t)<2)break;let l=es(t,2);r=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),n=3}else if(n===2){if(Qr(t)<8)break;let l=es(t,8),p=new DataView(l.buffer,l.byteOffset,l.length),d=p.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(Xp.ERROR_PACKET);break}r=d*Math.pow(2,32)+p.getUint32(4),n=3}else{if(Qr(t)<r)break;let l=es(t,r);a.enqueue((0,Ba.decodePacket)(s?l:Ia.decode(l),e)),n=0}if(r===0||r>i){a.enqueue(Xp.ERROR_PACKET);break}}}})}at.protocol=4});var nf=O((PO,tf)=>{var gi=String.fromCharCode;function Qp(i){for(var e=[],t=0,n=i.length,r,s;t<n;)r=i.charCodeAt(t++),r>=55296&&r<=56319&&t<n?(s=i.charCodeAt(t++),(s&64512)==56320?e.push(((r&1023)<<10)+(s&1023)+65536):(e.push(r),t--)):e.push(r);return e}function Ab(i){for(var e=i.length,t=-1,n,r="";++t<e;)n=i[t],n>65535&&(n-=65536,r+=gi(n>>>10&1023|55296),n=56320|n&1023),r+=gi(n);return r}function ef(i,e){if(i>=55296&&i<=57343){if(e)throw Error("Lone surrogate U+"+i.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function ja(i,e){return gi(i>>e&63|128)}function Rb(i,e){if((i&4294967168)==0)return gi(i);var t="";return(i&4294965248)==0?t=gi(i>>6&31|192):(i&4294901760)==0?(ef(i,e)||(i=65533),t=gi(i>>12&15|224),t+=ja(i,6)):(i&4292870144)==0&&(t=gi(i>>18&7|240),t+=ja(i,12),t+=ja(i,6)),t+=gi(i&63|128),t}function Pb(i,e){e=e||{};for(var t=e.strict!==!1,n=Qp(i),r=n.length,s=-1,o,a="";++s<r;)o=n[s],a+=Rb(o,t);return a}function nn(){if(xi>=is)throw Error("Invalid byte index");var i=ts[xi]&255;if(xi++,(i&192)==128)return i&63;throw Error("Invalid continuation byte")}function Ib(i){var e,t,n,r,s;if(xi>is)throw Error("Invalid byte index");if(xi==is)return!1;if(e=ts[xi]&255,xi++,(e&128)==0)return e;if((e&224)==192){if(t=nn(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=nn(),n=nn(),s=(e&15)<<12|t<<6|n,s>=2048)return ef(s,i)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=nn(),n=nn(),r=nn(),s=(e&7)<<18|t<<12|n<<6|r,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var ts,is,xi;function Nb(i,e){e=e||{};var t=e.strict!==!1;ts=Qp(i),is=ts.length,xi=0;for(var n=[],r;(r=Ib(t))!==!1;)n.push(r);return Ab(n)}tf.exports={version:"2.1.2",encode:Pb,decode:Nb}});var pf=O(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.packets=He.protocol=void 0;He.encodePacket=Da;He.encodeBase64Packet=of;He.decodePacket=La;He.decodeBase64Packet=af;He.encodePayload=Lb;He.decodePayload=Fb;He.encodePayloadAsBinary=lf;He.decodePayloadAsBinary=uf;var sf=nf();He.protocol=3;var Bb=i=>{for(let e of i)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};He.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var rn=Object.keys(He.packets),Dt={type:"error",data:"parser error"},jb=Buffer.concat([]);function Da(i,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(i.data))return rf(i,e,n);if(i.data&&(i.data.buffer||i.data)instanceof ArrayBuffer)return rf({type:i.type,data:qa(i.data)},e,n);var r=He.packets[i.type];return i.data!==void 0&&(r+=t?sf.encode(String(i.data),{strict:!1}):String(i.data)),n(""+r)}function rf(i,e,t){if(!e)return of(i,t);var n=i.data,r=Buffer.allocUnsafe(1);return r[0]=He.packets[i.type],t(Buffer.concat([r,n]))}function of(i,e){var t=Buffer.isBuffer(i.data)?i.data:qa(i.data),n="b"+He.packets[i.type];return n+=t.toString("base64"),e(n)}function La(i,e,t){if(i===void 0)return Dt;let n;if(typeof i=="string")return n=i.charAt(0),n==="b"?af(i.slice(1),e):t&&(i=Db(i),i===!1)||Number(n)!=n||!rn[n]?Dt:i.length>1?{type:rn[n],data:i.slice(1)}:{type:rn[n]};if(e==="arraybuffer"){var r=new Uint8Array(i);return n=r[0],{type:rn[n],data:r.buffer.slice(1)}}return i instanceof ArrayBuffer&&(i=qa(i)),n=i[0],{type:rn[n],data:i.slice(1)}}function Db(i){try{i=sf.decode(i,{strict:!1})}catch{return!1}return i}function af(i,e){var t=rn[i.charAt(0)],n=Buffer.from(i.slice(1),"base64");if(e==="arraybuffer"){for(var r=new Uint8Array(n.length),s=0;s<r.length;s++)r[s]=n[s];n=r.buffer}return{type:t,data:n}}function Lb(i,e,t){if(typeof e=="function"&&(t=e,e=null),e&&Bb(i))return lf(i,t);if(!i.length)return t("0:");function n(r,s){Da(r,e,!1,function(o){s(null,qb(o))})}cf(i,n,function(r,s){return t(s.join(""))})}function qb(i){return i.length+":"+i}function cf(i,e,t){let n=new Array(i.length),r=0;for(let s=0;s<i.length;s++)e(i[s],(o,a)=>{n[s]=a,++r===i.length&&t(null,n)})}function Fb(i,e,t){if(typeof i!="string")return uf(i,e,t);if(typeof e=="function"&&(t=e,e=null),i==="")return t(Dt,0,1);for(var n="",r,s,o,a=0,l=i.length;a<l;a++){var p=i.charAt(a);if(p!==":"){n+=p;continue}if(n===""||n!=(r=Number(n))||(s=i.slice(a+1,a+1+r),n!=s.length))return t(Dt,0,1);if(s.length){if(o=La(s,e,!1),Dt.type===o.type&&Dt.data===o.data)return t(Dt,0,1);var d=t(o,a+r,l);if(d===!1)return}a+=r,n=""}if(n!=="")return t(Dt,0,1)}function Ub(i){for(var e="",t=0,n=i.length;t<n;t++)e+=String.fromCharCode(i[t]);return e}function Hb(i){for(var e=Buffer.allocUnsafe(i.length),t=0,n=i.length;t<n;t++)e.writeUInt8(i.charCodeAt(t),t);return e}function qa(i){var e=i.byteLength||i.length,t=i.byteOffset||0;return Buffer.from(i.buffer||i,t,e)}function lf(i,e){if(!i.length)return e(jb);cf(i,zb,function(t,n){return e(Buffer.concat(n))})}function zb(i,e){function t(n){var r=""+n.length,s;if(typeof n=="string"){s=Buffer.allocUnsafe(r.length+2),s[0]=0;for(var o=0;o<r.length;o++)s[o+1]=parseInt(r[o],10);return s[s.length-1]=255,e(null,Buffer.concat([s,Hb(n)]))}s=Buffer.allocUnsafe(r.length+2),s[0]=1;for(var o=0;o<r.length;o++)s[o+1]=parseInt(r[o],10);s[s.length-1]=255,e(null,Buffer.concat([s,n]))}Da(i,!0,!0,t)}function uf(i,e,t){typeof e=="function"&&(t=e,e=null);for(var n=i,r=[],s;n.length>0;){var o="",a=n[0]===0;for(s=1;n[s]!==255;s++){if(o.length>310)return t(Dt,0,1);o+=""+n[s]}n=n.slice(o.length+1);var l=parseInt(o,10),p=n.slice(1,l+1);a&&(p=Ub(p)),r.push(p),n=n.slice(l+1)}var d=r.length;for(s=0;s<d;s++){var h=r[s];t(La(h,e,!0),s,d)}}});var df=O((NO,ff)=>{var sn=1e3,on=sn*60,an=on*60,Ri=an*24,Wb=Ri*7,$b=Ri*365.25;ff.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return Kb(i);if(t==="number"&&isFinite(i))return e.long?Gb(i):Vb(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function Kb(i){if(i=String(i),!(i.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(i);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*$b;case"weeks":case"week":case"w":return t*Wb;case"days":case"day":case"d":return t*Ri;case"hours":case"hour":case"hrs":case"hr":case"h":return t*an;case"minutes":case"minute":case"mins":case"min":case"m":return t*on;case"seconds":case"second":case"secs":case"sec":case"s":return t*sn;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Vb(i){var e=Math.abs(i);return e>=Ri?Math.round(i/Ri)+"d":e>=an?Math.round(i/an)+"h":e>=on?Math.round(i/on)+"m":e>=sn?Math.round(i/sn)+"s":i+"ms"}function Gb(i){var e=Math.abs(i);return e>=Ri?ns(i,e,Ri,"day"):e>=an?ns(i,e,an,"hour"):e>=on?ns(i,e,on,"minute"):e>=sn?ns(i,e,sn,"second"):i+" ms"}function ns(i,e,t,n){var r=e>=t*1.5;return Math.round(i/t)+" "+n+(r?"s":"")}});var Fa=O((BO,hf)=>{function Jb(i){t.debug=t,t.default=t,t.coerce=l,t.disable=o,t.enable=r,t.enabled=a,t.humanize=df(),t.destroy=p,Object.keys(i).forEach(d=>{t[d]=i[d]}),t.names=[],t.skips=[],t.formatters={};function e(d){let h=0;for(let g=0;g<d.length;g++)h=(h<<5)-h+d.charCodeAt(g),h|=0;return t.colors[Math.abs(h)%t.colors.length]}t.selectColor=e;function t(d){let h,g=null,_,S;function T(...A){if(!T.enabled)return;let P=T,R=Number(new Date),N=R-(h||R);P.diff=N,P.prev=h,P.curr=R,h=R,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let D=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(B,U)=>{if(B==="%%")return"%";D++;let L=t.formatters[U];if(typeof L=="function"){let $=A[D];B=L.call(P,$),A.splice(D,1),D--}return B}),t.formatArgs.call(P,A),(P.log||t.log).apply(P,A)}return T.namespace=d,T.useColors=t.useColors(),T.color=t.selectColor(d),T.extend=n,T.destroy=t.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(_!==t.namespaces&&(_=t.namespaces,S=t.enabled(d)),S),set:A=>{g=A}}),typeof t.init=="function"&&t.init(T),T}function n(d,h){let g=t(this.namespace+(typeof h>"u"?":":h)+d);return g.log=this.log,g}function r(d){t.save(d),t.namespaces=d,t.names=[],t.skips=[];let h=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let g of h)g[0]==="-"?t.skips.push(g.slice(1)):t.names.push(g)}function s(d,h){let g=0,_=0,S=-1,T=0;for(;g<d.length;)if(_<h.length&&(h[_]===d[g]||h[_]==="*"))h[_]==="*"?(S=_,T=g,_++):(g++,_++);else if(S!==-1)_=S+1,T++,g=T;else return!1;for(;_<h.length&&h[_]==="*";)_++;return _===h.length}function o(){let d=[...t.names,...t.skips.map(h=>"-"+h)].join(",");return t.enable(""),d}function a(d){for(let h of t.skips)if(s(d,h))return!1;for(let h of t.names)if(s(d,h))return!0;return!1}function l(d){return d instanceof Error?d.stack||d.message:d}function p(){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}hf.exports=Jb});var mf=O((ct,rs)=>{ct.formatArgs=Xb;ct.save=Zb;ct.load=Qb;ct.useColors=Yb;ct.storage=ew();ct.destroy=(()=>{let i=!1;return()=>{i||(i=!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`."))}})();ct.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 Yb(){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 i;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&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Xb(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+rs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,n=0;i[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(t++,r==="%c"&&(n=t))}),i.splice(n,0,e)}ct.log=console.debug||console.log||(()=>{});function Zb(i){try{i?ct.storage.setItem("debug",i):ct.storage.removeItem("debug")}catch{}}function Qb(){let i;try{i=ct.storage.getItem("debug")||ct.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function ew(){try{return localStorage}catch{}}rs.exports=Fa()(ct);var{formatters:tw}=rs.exports;tw.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var gf=O((jO,vf)=>{"use strict";vf.exports=(i,e=process.argv)=>{let t=i.startsWith("-")?"":i.length===1?"-":"--",n=e.indexOf(t+i),r=e.indexOf("--");return n!==-1&&(r===-1||n<r)}});var bf=O((DO,yf)=>{"use strict";var iw=require("os"),xf=require("tty"),wt=gf(),{env:ze}=process,yi;wt("no-color")||wt("no-colors")||wt("color=false")||wt("color=never")?yi=0:(wt("color")||wt("colors")||wt("color=true")||wt("color=always"))&&(yi=1);"FORCE_COLOR"in ze&&(ze.FORCE_COLOR==="true"?yi=1:ze.FORCE_COLOR==="false"?yi=0:yi=ze.FORCE_COLOR.length===0?1:Math.min(parseInt(ze.FORCE_COLOR,10),3));function Ua(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function Ha(i,e){if(yi===0)return 0;if(wt("color=16m")||wt("color=full")||wt("color=truecolor"))return 3;if(wt("color=256"))return 2;if(i&&!e&&yi===void 0)return 0;let t=yi||0;if(ze.TERM==="dumb")return t;if(process.platform==="win32"){let n=iw.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in ze)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in ze)||ze.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ze.TEAMCITY_VERSION)?1:0;if(ze.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ze){let n=parseInt((ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ze.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ze.TERM)||"COLORTERM"in ze?1:t}function nw(i){let e=Ha(i,i&&i.isTTY);return Ua(e)}yf.exports={supportsColor:nw,stdout:Ua(Ha(!0,xf.isatty(1))),stderr:Ua(Ha(!0,xf.isatty(2)))}});var _f=O((We,os)=>{var rw=require("tty"),ss=require("util");We.init=pw;We.log=cw;We.formatArgs=ow;We.save=lw;We.load=uw;We.useColors=sw;We.destroy=ss.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");We.colors=[6,2,3,4,5,1];try{let i=bf();i&&(i.stderr||i).level>=2&&(We.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{}We.inspectOpts=Object.keys(process.env).filter(i=>/^debug_/i.test(i)).reduce((i,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(r,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),i[t]=n,i},{});function sw(){return"colors"in We.inspectOpts?!!We.inspectOpts.colors:rw.isatty(process.stderr.fd)}function ow(i){let{namespace:e,useColors:t}=this;if(t){let n=this.color,r="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${r};1m${e} \x1B[0m`;i[0]=s+i[0].split(`
3
3
  `).join(`
4
- `+s),i.push(n+"m+"+Gn.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=Ob()+e+" "+i[0]}function Ob(){return He.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Ab(...i){return process.stderr.write(Kn.formatWithOptions(He.inspectOpts,...i)+`
5
- `)}function Rb(i){i?process.env.DEBUG=i:delete process.env.DEBUG}function Pb(){return process.env.DEBUG}function Bb(i){i.inspectOpts={};let e=Object.keys(He.inspectOpts);for(let t=0;t<e.length;t++)i.inspectOpts[e[t]]=He.inspectOpts[e[t]]}Gn.exports=Ea()(He);var{formatters:Jp}=Gn.exports;Jp.o=function(i){return this.inspectOpts.colors=this.useColors,Kn.inspect(i,this.inspectOpts).split(`
6
- `).map(e=>e.trim()).join(" ")};Jp.O=function(i){return this.inspectOpts.colors=this.useColors,Kn.inspect(i,this.inspectOpts)}});var ie=T((Xk,ka)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?ka.exports=Wp():ka.exports=Xp()});var Ti=T(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.Transport=void 0;var Nb=require("events"),Ib=Jr(),Db=Fp(),jb=ie(),Zp=(0,jb.default)("engine:transport");function Lb(){}var Yn=class extends Nb.EventEmitter{get readyState(){return this._readyState}set readyState(e){Zp("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?Ib:Db,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||Lb))}onError(e,t){if(this.listeners("error").length){let r=new Error(e);r.type="TransportError",r.description=t,this.emit("error",r)}else Zp("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")}};Jn.Transport=Yn;Yn.upgradesTo=[]});var Oa=T(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.Polling=void 0;var qb=Ti(),Qp=require("zlib"),Fb=jn(),Ub=ie(),ut=(0,Ub.default)("engine:polling"),Hb={gzip:Qp.createGzip,deflate:Qp.createDeflate},Ma=class extends qb.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){ut("request overlap"),this.onError("overlap from client"),t.writeHead(400),t.end();return}ut("setting request"),this.req=e,this.res=t;let r=()=>{this.onError("poll connection closed prematurely")},n=()=>{e.removeListener("close",r),this.req=this.res=null};e.cleanup=n,e.on("close",r),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(ut("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 r=e.headers["content-type"]==="application/octet-stream";if(r&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let n=r?Buffer.concat([]):"",s=()=>{e.removeListener("data",c),e.removeListener("end",u),e.removeListener("close",o),this.dataReq=this.dataRes=n=null},o=()=>{s(),this.onError("data request connection closed prematurely")},c=d=>{let f;r?(n=Buffer.concat([n,d]),f=n.length):(n+=d,f=Buffer.byteLength(n)),f>this.maxHttpBufferSize&&(t.writeHead(413).end(),s())},u=()=>{this.onData(n);let d={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,d)),t.end("ok"),s()};e.on("close",o),r||e.setEncoding("utf8"),e.on("data",c),e.on("end",u)}onData(e){ut('received "%s"',e);let t=r=>{if(r.type==="close")return ut("got xhr close packet"),this.onClose(),!1;this.onPacket(r)};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&&(ut("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=r=>{let n=e.some(s=>s.options&&s.options.compress);this.write(r,{compress:n})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){ut('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,r){let n=typeof e=="string",o={"Content-Type":n?"text/plain; charset=UTF-8":"application/octet-stream"},c=f=>{o["Content-Length"]=typeof f=="string"?Buffer.byteLength(f):f.length,this.res.writeHead(200,this.headers(this.req,o)),this.res.end(f),r()};if(!this.httpCompression||!t.compress){c(e);return}if((n?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){c(e);return}let d=Fb(this.req).encodings(["gzip","deflate"]);if(!d){c(e);return}this.compress(e,d,(f,v)=>{if(f){this.res.writeHead(500),this.res.end(),r(f);return}o["Content-Encoding"]=d,c(v)})}compress(e,t,r){ut("compressing");let n=[],s=0;Hb[t](this.httpCompression).on("error",r).on("data",function(o){n.push(o),s+=o.length}).on("end",function(){r(null,Buffer.concat(n,s))}).end(e)}doClose(e){ut("closing");let t;this.dataReq&&(ut("aborting ongoing data request"),this.dataReq.destroy());let r=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(ut("transport writable - closing right away"),this.send([{type:"close"}]),r()):this.discarded?(ut("transport discarded - closing right away"),r()):(ut("transport not writable - buffering orderly close"),this.shouldClose=r,t=setTimeout(r,this.closeTimeout))}headers(e,t={}){let r=e.headers["user-agent"];return r&&(~r.indexOf(";MSIE")||~r.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};Xn.Polling=Ma});var ed=T(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.JSONP=void 0;var zb=Oa(),Wb=require("querystring"),$b=/\\\\n/g,Vb=/(\\)?\\n/g,Aa=class extends zb.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=Wb.parse(e).d,typeof e=="string"&&(e=e.replace(Vb,function(t,r){return r?t:`
7
- `}),super.onData(e.replace($b,"\\n")))}doWrite(e,t,r){let n=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+n+this.foot,super.doWrite(e,t,r)}};Zn.JSONP=Aa});var id=T(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.WebSocket=void 0;var Kb=Ti(),Gb=ie(),td=(0,Gb.default)("engine:ws"),Ra=class extends Kb.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,r)=>{let n=r?t:t.toString();td('received "%s"',n),super.onData(n)}),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let r=e[t],n=t+1===e.length;this._canSendPreEncodedFrame(r)?this.socket._sender.sendFrame(r.options.wsPreEncodedFrame,n?this._onSentLast:this._onSent):this.parser.encodePacket(r,this.supportsBinary,n?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(e){var t,r,n;return!this.perMessageDeflate&&typeof((r=(t=this.socket)===null||t===void 0?void 0:t._sender)===null||r===void 0?void 0:r.sendFrame)=="function"&&((n=e.options)===null||n===void 0?void 0:n.wsPreEncodedFrame)!==void 0}doClose(e){td("closing"),this.socket.close(),e&&e()}};Qn.WebSocket=Ra});var Ba=T(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.WebTransport=void 0;var Yb=Ti(),Jb=ie(),Xb=Jr(),tr=(0,Jb.default)("engine:webtransport"),Pa=class extends Yb.Transport{constructor(e,t,r){super({_query:{EIO:"4"}}),this.session=e;let n=(0,Xb.createPacketEncoderStream)();n.readable.pipeTo(t.writable).catch(()=>{tr("the stream was closed")}),this.writer=n.writable.getWriter(),(async()=>{try{for(;;){let{value:s,done:o}=await r.read();if(o){tr("session is closed");break}tr("received chunk: %o",s),this.onPacket(s)}}catch(s){tr("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 r=e[t];await this.writer.write(r)}}catch(t){tr("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){tr("closing WebTransport session"),this.session.close(),e&&e()}};es.WebTransport=Pa});var Ia=T(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var Zb=Oa(),Qb=ed(),ew=id(),tw=Ba();Na.default={polling:rd,websocket:ew.WebSocket,webtransport:tw.WebTransport};function rd(i){return typeof i._query.j=="string"?new Qb.JSONP(i):new Zb.Polling(i)}rd.upgradesTo=["websocket","webtransport"]});var ja=T(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.Socket=void 0;var iw=require("events"),rw=ie(),Jt=require("timers"),re=(0,rw.default)("engine:socket"),Da=class extends iw.EventEmitter{get readyState(){return this._readyState}set readyState(e){re("readyState updated from %s to %s",this._readyState,e),this._readyState=e}constructor(e,t,r,n,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=n,this.protocol=s,n&&(n.websocket&&n.websocket._socket?this.remoteAddress=n.websocket._socket.remoteAddress:this.remoteAddress=n.connection.remoteAddress),this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(r),this.onOpen()}onOpen(){this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket&&this.sendPacket("message",this.server.opts.initialPacket),this.emit("open"),this.protocol===3?this.resetPingTimeout():this.schedulePing()}onPacket(e){if(this.readyState!=="open")return re("packet received with closed socket");switch(re(`received packet ${e.type}`),this.emit("packet",e),e.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}re("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}re("got pong"),(0,Jt.clearTimeout)(this.pingTimeoutTimer),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",e.data),this.emit("message",e.data);break}}onError(e){re("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,Jt.setTimeout)(()=>{re("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,Jt.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,Jt.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),r=()=>this.flush(),n=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",r),this.transport.on("packet",n),this.transport.on("drain",s),this.transport.once("close",o),this.cleanupFn.push(function(){e.removeListener("error",t),e.removeListener("ready",r),e.removeListener("packet",n),e.removeListener("drain",s),e.removeListener("close",o)})}onDrain(){if(this.sentCallbackFn.length>0){re("executing batch send callback");let e=this.sentCallbackFn.shift();if(e)for(let t=0;t<e.length;t++)e[t](this.transport)}}_maybeUpgrade(e){re('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,Jt.setTimeout)(()=>{re("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),r,n=f=>{f.type==="ping"&&f.data==="probe"?(re("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(r),r=setInterval(s,100)):f.type==="upgrade"&&this.readyState!=="closed"?(re("got upgrade packet - upgrading"),o(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(e),this.emit("upgrade",e),this.flush(),this.readyState==="closing"&&e.close(()=>{this.onClose("forced close")})):(o(),e.close())},s=()=>{this.transport.name==="polling"&&this.transport.writable&&(re("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(r),(0,Jt.clearTimeout)(t),e.removeListener("packet",n),e.removeListener("close",u),e.removeListener("error",c),this.removeListener("close",d)},c=f=>{re("client did not complete upgrade - %s",f),o(),e.close(),e=null},u=()=>{c("transport closed")},d=()=>{c("socket closed")};e.on("packet",n),e.once("close",u),e.once("error",c),this.once("close",d)}clearTransport(){let e,t=this.cleanupFn.length;for(let r=0;r<t;r++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){re("error triggered by discarded transport")}),this.transport.close(),(0,Jt.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,Jt.clearTimeout)(this.pingIntervalTimer),(0,Jt.clearTimeout)(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",e,t))}send(e,t,r){return this.sendPacket("message",e,t,r),this}write(e,t,r){return this.sendPacket("message",e,t,r),this}sendPacket(e,t,r={},n){if(typeof r=="function"&&(n=r,r={}),this.readyState!=="closing"&&this.readyState!=="closed"){re('sending packet "%s" (%s)',e,t),r.compress=r.compress!==!1;let s={type:e,options:r};t&&(s.data=t),this.emit("packetCreate",s),this.writeBuffer.push(s),typeof n=="function"&&this.packetsFn.push(n),this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){re("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let e=this.writeBuffer;this.writeBuffer=[],this.packetsFn.length?(this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[]):this.sentCallbackFn.push(null),this.transport.send(e),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let e=[],t=this.server.upgrades(this.transport.name);for(let r=0;r<t.length;++r){let n=t[r];this.server.opts.transports.indexOf(n)!==-1&&e.push(n)}return e}close(e){if(e&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(e);if(this.readyState==="open"){if(this.readyState="closing",this.writeBuffer.length){re("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{re("all packets have been sent, closing the transport"),this.closeTransport(e)});return}re("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){re("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};ts.Socket=Da});var od=T(La=>{"use strict";La.parse=uw;La.serialize=pw;var nw=Object.prototype.toString,sw=Object.prototype.hasOwnProperty,ow=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,aw=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,cw=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,lw=/^[\u0020-\u003A\u003D-\u007E]*$/;function uw(i,e){if(typeof i!="string")throw new TypeError("argument str must be a string");var t={},r=i.length;if(r<2)return t;var n=e&&e.decode||dw,s=0,o=0,c=0;do{if(o=i.indexOf("=",s),o===-1)break;if(c=i.indexOf(";",s),c===-1)c=r;else if(o>c){s=i.lastIndexOf(";",o-1)+1;continue}var u=nd(i,s,o),d=sd(i,o,u),f=i.slice(u,d);if(!sw.call(t,f)){var v=nd(i,o+1,c),_=sd(i,c,v);i.charCodeAt(v)===34&&i.charCodeAt(_-1)===34&&(v++,_--);var E=i.slice(v,_);t[f]=hw(E,n)}s=c+1}while(s<r);return t}function nd(i,e,t){do{var r=i.charCodeAt(e);if(r!==32&&r!==9)return e}while(++e<t);return t}function sd(i,e,t){for(;e>t;){var r=i.charCodeAt(--e);if(r!==32&&r!==9)return e+1}return t}function pw(i,e,t){var r=t&&t.encode||encodeURIComponent;if(typeof r!="function")throw new TypeError("option encode is invalid");if(!ow.test(i))throw new TypeError("argument name is invalid");var n=r(e);if(!aw.test(n))throw new TypeError("argument val is invalid");var s=i+"="+n;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(!cw.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!lw.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var c=t.expires;if(!fw(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+c.toUTCString()}if(t.httpOnly&&(s+="; HttpOnly"),t.secure&&(s+="; Secure"),t.partitioned&&(s+="; Partitioned"),t.priority){var u=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(u){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 d=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(d){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 dw(i){return i.indexOf("%")!==-1?decodeURIComponent(i):i}function fw(i){return nw.call(i)==="[object Date]"}function hw(i,e){try{return e(i)}catch{return i}}});var Xt=T((oM,ld)=>{"use strict";var ad=["nodebuffer","arraybuffer","fragments"],cd=typeof Blob<"u";cd&&ad.push("blob");ld.exports={BINARY_TYPES:ad,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:cd,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Cd=T((aM,Ed)=>{var fd=require("fs"),Zt=require("path"),hd=require("os"),md=typeof __webpack_require__=="function"?__non_webpack_require__:require,mw=process.config&&process.config.variables||{},vw=!!process.env.PREBUILDS_ONLY,ud=process.versions.modules,qa=yw()?"electron":xw()?"node-webkit":"node",Fa=process.env.npm_config_arch||hd.arch(),Ua=process.env.npm_config_platform||hd.platform(),vd=process.env.LIBC||(bw(Ua)?"musl":"glibc"),Ha=process.env.ARM_VERSION||(Fa==="arm64"?"8":mw.arm_version)||"",gd=(process.versions.uv||"").split(".")[0];Ed.exports=Ht;function Ht(i){return md(Ht.resolve(i))}Ht.resolve=Ht.path=function(i){i=Zt.resolve(i||".");try{var e=md(Zt.join(i,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(i=process.env[e+"_PREBUILD"])}catch{}if(!vw){var t=pd(Zt.join(i,"build/Release"),dd);if(t)return t;var r=pd(Zt.join(i,"build/Debug"),dd);if(r)return r}var n=c(i);if(n)return n;var s=c(Zt.dirname(process.execPath));if(s)return s;var o=["platform="+Ua,"arch="+Fa,"runtime="+qa,"abi="+ud,"uv="+gd,Ha?"armv="+Ha:"","libc="+vd,"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+`
4
+ `+s),i.push(r+"m+"+os.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=aw()+e+" "+i[0]}function aw(){return We.inspectOpts.hideDate?"":new Date().toISOString()+" "}function cw(...i){return process.stderr.write(ss.formatWithOptions(We.inspectOpts,...i)+`
5
+ `)}function lw(i){i?process.env.DEBUG=i:delete process.env.DEBUG}function uw(){return process.env.DEBUG}function pw(i){i.inspectOpts={};let e=Object.keys(We.inspectOpts);for(let t=0;t<e.length;t++)i.inspectOpts[e[t]]=We.inspectOpts[e[t]]}os.exports=Fa()(We);var{formatters:wf}=os.exports;wf.o=function(i){return this.inspectOpts.colors=this.useColors,ss.inspect(i,this.inspectOpts).split(`
6
+ `).map(e=>e.trim()).join(" ")};wf.O=function(i){return this.inspectOpts.colors=this.useColors,ss.inspect(i,this.inspectOpts)}});var ue=O((LO,za)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?za.exports=mf():za.exports=_f()});var Pi=O(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.Transport=void 0;var fw=require("events"),dw=or(),hw=pf(),mw=ue(),Sf=(0,mw.default)("engine:transport");function vw(){}var as=class extends fw.EventEmitter{get readyState(){return this._readyState}set readyState(e){Sf("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?dw:hw,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||vw))}onError(e,t){if(this.listeners("error").length){let n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else Sf("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")}};cs.Transport=as;as.upgradesTo=[]});var $a=O(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.Polling=void 0;var gw=Pi(),Ef=require("zlib"),xw=Jr(),yw=ue(),mt=(0,yw.default)("engine:polling"),bw={gzip:Ef.createGzip,deflate:Ef.createDeflate},Wa=class extends gw.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){mt("request overlap"),this.onError("overlap from client"),t.writeHead(400),t.end();return}mt("setting request"),this.req=e,this.res=t;let n=()=>{this.onError("poll connection closed prematurely")},r=()=>{e.removeListener("close",n),this.req=this.res=null};e.cleanup=r,e.on("close",n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(mt("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 r=n?Buffer.concat([]):"",s=()=>{e.removeListener("data",a),e.removeListener("end",l),e.removeListener("close",o),this.dataReq=this.dataRes=r=null},o=()=>{s(),this.onError("data request connection closed prematurely")},a=p=>{let d;n?(r=Buffer.concat([r,p]),d=r.length):(r+=p,d=Buffer.byteLength(r)),d>this.maxHttpBufferSize&&(t.writeHead(413).end(),s())},l=()=>{this.onData(r);let p={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,p)),t.end("ok"),s()};e.on("close",o),n||e.setEncoding("utf8"),e.on("data",a),e.on("end",l)}onData(e){mt('received "%s"',e);let t=n=>{if(n.type==="close")return mt("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&&(mt("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let r=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:r})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){mt('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let r=typeof e=="string",o={"Content-Type":r?"text/plain; charset=UTF-8":"application/octet-stream"},a=d=>{o["Content-Length"]=typeof d=="string"?Buffer.byteLength(d):d.length,this.res.writeHead(200,this.headers(this.req,o)),this.res.end(d),n()};if(!this.httpCompression||!t.compress){a(e);return}if((r?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let p=xw(this.req).encodings(["gzip","deflate"]);if(!p){a(e);return}this.compress(e,p,(d,h)=>{if(d){this.res.writeHead(500),this.res.end(),n(d);return}o["Content-Encoding"]=p,a(h)})}compress(e,t,n){mt("compressing");let r=[],s=0;bw[t](this.httpCompression).on("error",n).on("data",function(o){r.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(r,s))}).end(e)}doClose(e){mt("closing");let t;this.dataReq&&(mt("aborting ongoing data request"),this.dataReq.destroy());let n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(mt("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(mt("transport discarded - closing right away"),n()):(mt("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}};ls.Polling=Wa});var Cf=O(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.JSONP=void 0;var ww=$a(),_w=require("querystring"),Sw=/\\\\n/g,Ew=/(\\)?\\n/g,Ka=class extends ww.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=_w.parse(e).d,typeof e=="string"&&(e=e.replace(Ew,function(t,n){return n?t:`
7
+ `}),super.onData(e.replace(Sw,"\\n")))}doWrite(e,t,n){let r=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+r+this.foot,super.doWrite(e,t,n)}};us.JSONP=Ka});var kf=O(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.WebSocket=void 0;var Cw=Pi(),Tw=ue(),Tf=(0,Tw.default)("engine:ws"),Va=class extends Cw.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 r=n?t:t.toString();Tf('received "%s"',r),super.onData(r)}),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],r=t+1===e.length;this._canSendPreEncodedFrame(n)?this.socket._sender.sendFrame(n.options.wsPreEncodedFrame,r?this._onSentLast:this._onSent):this.parser.encodePacket(n,this.supportsBinary,r?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(e){var t,n,r;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"&&((r=e.options)===null||r===void 0?void 0:r.wsPreEncodedFrame)!==void 0}doClose(e){Tf("closing"),this.socket.close(),e&&e()}};ps.WebSocket=Va});var Ja=O(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.WebTransport=void 0;var kw=Pi(),Ow=ue(),Mw=or(),cn=(0,Ow.default)("engine:webtransport"),Ga=class extends kw.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let r=(0,Mw.createPacketEncoderStream)();r.readable.pipeTo(t.writable).catch(()=>{cn("the stream was closed")}),this.writer=r.writable.getWriter(),(async()=>{try{for(;;){let{value:s,done:o}=await n.read();if(o){cn("session is closed");break}cn("received chunk: %o",s),this.onPacket(s)}}catch(s){cn("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){cn("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){cn("closing WebTransport session"),this.session.close(),e&&e()}};fs.WebTransport=Ga});var Xa=O(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});var Aw=$a(),Rw=Cf(),Pw=kf(),Iw=Ja();Ya.default={polling:Of,websocket:Pw.WebSocket,webtransport:Iw.WebTransport};function Of(i){return typeof i._query.j=="string"?new Rw.JSONP(i):new Aw.Polling(i)}Of.upgradesTo=["websocket","webtransport"]});var Qa=O(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.Socket=void 0;var Nw=require("events"),Bw=ue(),ti=require("timers"),pe=(0,Bw.default)("engine:socket"),Za=class extends Nw.EventEmitter{get readyState(){return this._readyState}set readyState(e){pe("readyState updated from %s to %s",this._readyState,e),this._readyState=e}constructor(e,t,n,r,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=r,this.protocol=s,r&&(r.websocket&&r.websocket._socket?this.remoteAddress=r.websocket._socket.remoteAddress:this.remoteAddress=r.connection.remoteAddress),this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(n),this.onOpen()}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 pe("packet received with closed socket");switch(pe(`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}pe("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}pe("got pong"),(0,ti.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){pe("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,ti.setTimeout)(()=>{pe("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,ti.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,ti.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(),r=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",r),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",r),e.removeListener("drain",s),e.removeListener("close",o)})}onDrain(){if(this.sentCallbackFn.length>0){pe("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){pe('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,ti.setTimeout)(()=>{pe("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,r=d=>{d.type==="ping"&&d.data==="probe"?(pe("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(s,100)):d.type==="upgrade"&&this.readyState!=="closed"?(pe("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&&(pe("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,ti.clearTimeout)(t),e.removeListener("packet",r),e.removeListener("close",l),e.removeListener("error",a),this.removeListener("close",p)},a=d=>{pe("client did not complete upgrade - %s",d),o(),e.close(),e=null},l=()=>{a("transport closed")},p=()=>{a("socket closed")};e.on("packet",r),e.once("close",l),e.once("error",a),this.once("close",p)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){pe("error triggered by discarded transport")}),this.transport.close(),(0,ti.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,ti.clearTimeout)(this.pingIntervalTimer),(0,ti.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={},r){if(typeof n=="function"&&(r=n,n={}),this.readyState!=="closing"&&this.readyState!=="closed"){pe('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 r=="function"&&this.packetsFn.push(r),this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){pe("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 r=t[n];this.server.opts.transports.indexOf(r)!==-1&&e.push(r)}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){pe("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{pe("all packets have been sent, closing the transport"),this.closeTransport(e)});return}pe("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){pe("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};ds.Socket=Za});var Rf=O(ec=>{"use strict";ec.parse=Hw;ec.serialize=zw;var jw=Object.prototype.toString,Dw=Object.prototype.hasOwnProperty,Lw=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,qw=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,Fw=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Uw=/^[\u0020-\u003A\u003D-\u007E]*$/;function Hw(i,e){if(typeof i!="string")throw new TypeError("argument str must be a string");var t={},n=i.length;if(n<2)return t;var r=e&&e.decode||Ww,s=0,o=0,a=0;do{if(o=i.indexOf("=",s),o===-1)break;if(a=i.indexOf(";",s),a===-1)a=n;else if(o>a){s=i.lastIndexOf(";",o-1)+1;continue}var l=Mf(i,s,o),p=Af(i,o,l),d=i.slice(l,p);if(!Dw.call(t,d)){var h=Mf(i,o+1,a),g=Af(i,a,h);i.charCodeAt(h)===34&&i.charCodeAt(g-1)===34&&(h++,g--);var _=i.slice(h,g);t[d]=Kw(_,r)}s=a+1}while(s<n);return t}function Mf(i,e,t){do{var n=i.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function Af(i,e,t){for(;e>t;){var n=i.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function zw(i,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!Lw.test(i))throw new TypeError("argument name is invalid");var r=n(e);if(!qw.test(r))throw new TypeError("argument val is invalid");var s=i+"="+r;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(!Fw.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!Uw.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var a=t.expires;if(!$w(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 l=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(l){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 p=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(p){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 Ww(i){return i.indexOf("%")!==-1?decodeURIComponent(i):i}function $w(i){return jw.call(i)==="[object Date]"}function Kw(i,e){try{return e(i)}catch{return i}}});var ii=O((VO,Nf)=>{"use strict";var Pf=["nodebuffer","arraybuffer","fragments"],If=typeof Blob<"u";If&&Pf.push("blob");Nf.exports={BINARY_TYPES:Pf,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:If,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Yf=O((GO,Jf)=>{var Lf=require("fs"),ni=require("path"),qf=require("os"),Ff=typeof __webpack_require__=="function"?__non_webpack_require__:require,Vw=process.config&&process.config.variables||{},Gw=!!process.env.PREBUILDS_ONLY,Bf=process.versions.modules,tc=Xw()?"electron":Yw()?"node-webkit":"node",ic=process.env.npm_config_arch||qf.arch(),nc=process.env.npm_config_platform||qf.platform(),Uf=process.env.LIBC||(Zw(nc)?"musl":"glibc"),rc=process.env.ARM_VERSION||(ic==="arm64"?"8":Vw.arm_version)||"",Hf=(process.versions.uv||"").split(".")[0];Jf.exports=Vt;function Vt(i){return Ff(Vt.resolve(i))}Vt.resolve=Vt.path=function(i){i=ni.resolve(i||".");try{var e=Ff(ni.join(i,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(i=process.env[e+"_PREBUILD"])}catch{}if(!Gw){var t=jf(ni.join(i,"build/Release"),Df);if(t)return t;var n=jf(ni.join(i,"build/Debug"),Df);if(n)return n}var r=a(i);if(r)return r;var s=a(ni.dirname(process.execPath));if(s)return s;var o=["platform="+nc,"arch="+ic,"runtime="+tc,"abi="+Bf,"uv="+Hf,rc?"armv="+rc:"","libc="+Uf,"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+`
8
8
  loaded from: `+i+`
9
- `);function c(u){var d=za(Zt.join(u,"prebuilds")).map(xd),f=d.filter(yd(Ua,Fa)).sort(bd)[0];if(f){var v=Zt.join(u,"prebuilds",f.name),_=za(v).map(wd),E=_.filter(_d(qa,ud)),C=E.sort(Sd(qa))[0];if(C)return Zt.join(v,C.file)}}};function za(i){try{return fd.readdirSync(i)}catch{return[]}}function pd(i,e){var t=za(i).filter(e);return t[0]&&Zt.join(i,t[0])}function dd(i){return/\.node$/.test(i)}function xd(i){var e=i.split("-");if(e.length===2){var t=e[0],r=e[1].split("+");if(t&&r.length&&r.every(Boolean))return{name:i,platform:t,architectures:r}}}function yd(i,e){return function(t){return t==null||t.platform!==i?!1:t.architectures.includes(e)}}function bd(i,e){return i.architectures.length-e.architectures.length}function wd(i){var e=i.split("."),t=e.pop(),r={file:i,specificity:0};if(t==="node"){for(var n=0;n<e.length;n++){var s=e[n];if(s==="node"||s==="electron"||s==="node-webkit")r.runtime=s;else if(s==="napi")r.napi=!0;else if(s.slice(0,3)==="abi")r.abi=s.slice(3);else if(s.slice(0,2)==="uv")r.uv=s.slice(2);else if(s.slice(0,4)==="armv")r.armv=s.slice(4);else if(s==="glibc"||s==="musl")r.libc=s;else continue;r.specificity++}return r}}function _d(i,e){return function(t){return!(t==null||t.runtime&&t.runtime!==i&&!gw(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==gd||t.armv&&t.armv!==Ha||t.libc&&t.libc!==vd)}}function gw(i){return i.runtime==="node"&&i.napi}function Sd(i){return function(e,t){return e.runtime!==t.runtime?e.runtime===i?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function xw(){return!!(process.versions&&process.versions.nw)}function yw(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function bw(i){return i==="linux"&&fd.existsSync("/etc/alpine-release")}Ht.parseTags=wd;Ht.matchTags=_d;Ht.compareTags=Sd;Ht.parseTuple=xd;Ht.matchTuple=yd;Ht.compareTuples=bd});var Va=T((cM,$a)=>{var Wa=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof Wa.addon=="function"?$a.exports=Wa.addon.bind(Wa):$a.exports=Cd()});var kd=T((lM,Td)=>{"use strict";var ww=(i,e,t,r,n)=>{for(var s=0;s<n;s++)t[r+s]=i[s]^e[s&3]},_w=(i,e)=>{let t=i.length;for(var r=0;r<t;r++)i[r]^=e[r&3]};Td.exports={mask:ww,unmask:_w}});var Md=T((uM,Ka)=>{"use strict";try{Ka.exports=Va()(__dirname)}catch{Ka.exports=kd()}});var Xr=T((pM,is)=>{"use strict";var{EMPTY_BUFFER:Sw}=Xt(),Ga=Buffer[Symbol.species];function Ew(i,e){if(i.length===0)return Sw;if(i.length===1)return i[0];let t=Buffer.allocUnsafe(e),r=0;for(let n=0;n<i.length;n++){let s=i[n];t.set(s,r),r+=s.length}return r<e?new Ga(t.buffer,t.byteOffset,r):t}function Od(i,e,t,r,n){for(let s=0;s<n;s++)t[r+s]=i[s]^e[s&3]}function Ad(i,e){for(let t=0;t<i.length;t++)i[t]^=e[t&3]}function Cw(i){return i.length===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.length)}function Ya(i){if(Ya.readOnly=!0,Buffer.isBuffer(i))return i;let e;return i instanceof ArrayBuffer?e=new Ga(i):ArrayBuffer.isView(i)?e=new Ga(i.buffer,i.byteOffset,i.byteLength):(e=Buffer.from(i),Ya.readOnly=!1),e}is.exports={concat:Ew,mask:Od,toArrayBuffer:Cw,toBuffer:Ya,unmask:Ad};if(!process.env.WS_NO_BUFFER_UTIL)try{let i=Md();is.exports.mask=function(e,t,r,n,s){s<48?Od(e,t,r,n,s):i.mask(e,t,r,n,s)},is.exports.unmask=function(e,t){e.length<32?Ad(e,t):i.unmask(e,t)}}catch{}});var Bd=T((dM,Pd)=>{"use strict";var Rd=Symbol("kDone"),Ja=Symbol("kRun"),Xa=class{constructor(e){this[Rd]=()=>{this.pending--,this[Ja]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Ja]()}[Ja](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[Rd])}}};Pd.exports=Xa});var Qr=T((fM,jd)=>{"use strict";var Zr=require("zlib"),Nd=Xr(),Tw=Bd(),{kStatusCode:Id}=Xt(),kw=Buffer[Symbol.species],Mw=Buffer.from([0,0,255,255]),ns=Symbol("permessage-deflate"),Qt=Symbol("total-length"),ir=Symbol("callback"),mi=Symbol("buffers"),rr=Symbol("error"),rs,Za=class{constructor(e,t,r){if(this._maxPayload=r|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,!rs){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;rs=new Tw(n)}}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[ir];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,r=e.find(n=>!(t.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>n.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(r.server_no_context_takeover=!0),t.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(r.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?r.client_max_window_bits=t.clientMaxWindowBits:(r.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}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(r=>{let n=t[r];if(n.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(n=n[0],r==="client_max_window_bits"){if(n!==!0){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else if(r==="server_max_window_bits"){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else throw new Error(`Unknown parameter "${r}"`);t[r]=n})}),e}decompress(e,t,r){rs.add(n=>{this._decompress(e,t,(s,o)=>{n(),r(s,o)})})}compress(e,t,r){rs.add(n=>{this._compress(e,t,(s,o)=>{n(),r(s,o)})})}_decompress(e,t,r){let n=this._isServer?"client":"server";if(!this._inflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?Zr.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Zr.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[ns]=this,this._inflate[Qt]=0,this._inflate[mi]=[],this._inflate.on("error",Aw),this._inflate.on("data",Dd)}this._inflate[ir]=r,this._inflate.write(e),t&&this._inflate.write(Mw),this._inflate.flush(()=>{let s=this._inflate[rr];if(s){this._inflate.close(),this._inflate=null,r(s);return}let o=Nd.concat(this._inflate[mi],this._inflate[Qt]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Qt]=0,this._inflate[mi]=[],t&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),r(null,o)})}_compress(e,t,r){let n=this._isServer?"server":"client";if(!this._deflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?Zr.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Zr.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[Qt]=0,this._deflate[mi]=[],this._deflate.on("data",Ow)}this._deflate[ir]=r,this._deflate.write(e),this._deflate.flush(Zr.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Nd.concat(this._deflate[mi],this._deflate[Qt]);t&&(s=new kw(s.buffer,s.byteOffset,s.length-4)),this._deflate[ir]=null,this._deflate[Qt]=0,this._deflate[mi]=[],t&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};jd.exports=Za;function Ow(i){this[mi].push(i),this[Qt]+=i.length}function Dd(i){if(this[Qt]+=i.length,this[ns]._maxPayload<1||this[Qt]<=this[ns]._maxPayload){this[mi].push(i);return}this[rr]=new RangeError("Max payload size exceeded"),this[rr].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[rr][Id]=1009,this.removeListener("data",Dd),this.reset()}function Aw(i){if(this[ns]._inflate=null,this[rr]){this[ir](this[rr]);return}i[Id]=1007,this[ir](i)}});var qd=T((hM,Ld)=>{"use strict";function Rw(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}Ld.exports=Rw});var Fd=T((mM,Qa)=>{"use strict";try{Qa.exports=Va()(__dirname)}catch{Qa.exports=qd()}});var nr=T((vM,ss)=>{"use strict";var{isUtf8:Ud}=require("buffer"),{hasBlob:Pw}=Xt(),Bw=[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 Nw(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function ec(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}function Iw(i){return Pw&&typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&(i[Symbol.toStringTag]==="Blob"||i[Symbol.toStringTag]==="File")}ss.exports={isBlob:Iw,isValidStatusCode:Nw,isValidUTF8:ec,tokenChars:Bw};if(Ud)ss.exports.isValidUTF8=function(i){return i.length<24?ec(i):Ud(i)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let i=Fd();ss.exports.isValidUTF8=function(e){return e.length<32?ec(e):i(e)}}catch{}});var sc=T((gM,Gd)=>{"use strict";var{Writable:Dw}=require("stream"),Hd=Qr(),{BINARY_TYPES:jw,EMPTY_BUFFER:zd,kStatusCode:Lw,kWebSocket:qw}=Xt(),{concat:tc,toArrayBuffer:Fw,unmask:Uw}=Xr(),{isValidStatusCode:Hw,isValidUTF8:Wd}=nr(),os=Buffer[Symbol.species],gt=0,$d=1,Vd=2,Kd=3,ic=4,rc=5,as=6,nc=class extends Dw{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||jw[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[qw]=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=gt}_write(e,t,r){if(this._opcode===8&&this._state==gt)return r();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new os(r.buffer,r.byteOffset+e,r.length-e),new os(r.buffer,r.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let r=this._buffers[0],n=t.length-e;e>=r.length?t.set(this._buffers.shift(),n):(t.set(new Uint8Array(r.buffer,r.byteOffset,e),n),this._buffers[0]=new os(r.buffer,r.byteOffset+e,r.length-e)),e-=r.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case gt:this.getInfo(e);break;case $d:this.getPayloadLength16(e);break;case Vd:this.getPayloadLength64(e);break;case Kd:this.getMask();break;case ic:this.getData(e);break;case rc:case as: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 n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(n);return}let r=(t[0]&64)===64;if(r&&!this._extensions[Hd.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(r){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(n);return}if(r){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(n);return}this._payloadLength===126?this._state=$d:this._payloadLength===127?this._state=Vd: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),r=t.readUInt32BE(0);if(r>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(n);return}this._payloadLength=r*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=Kd:this._state=ic}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=ic}getData(e){let t=zd;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&&Uw(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=rc,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Hd.extensionName].decompress(e,this._fin,(n,s)=>{if(n)return t(n);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===gt&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=gt;return}let t=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=tc(r,t):this._binaryType==="arraybuffer"?n=Fw(tc(r,t)):this._binaryType==="blob"?n=new Blob(r):n=r,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=gt):(this._state=as,setImmediate(()=>{this.emit("message",n,!0),this._state=gt,this.startLoop(e)}))}else{let n=tc(r,t);if(!this._skipUTF8Validation&&!Wd(n)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===rc||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=gt):(this._state=as,setImmediate(()=>{this.emit("message",n,!1),this._state=gt,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,zd),this.end();else{let r=e.readUInt16BE(0);if(!Hw(r)){let s=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let n=new os(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Wd(n)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",r,n),this.end()}this._state=gt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=gt):(this._state=as,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=gt,this.startLoop(t)}))}createError(e,t,r,n,s){this._loop=!1,this._errored=!0;let o=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[Lw]=n,o}};Gd.exports=nc});var cc=T((yM,Xd)=>{"use strict";var{Duplex:xM}=require("stream"),{randomFillSync:zw}=require("crypto"),Yd=Qr(),{EMPTY_BUFFER:Ww,kWebSocket:$w,NOOP:Vw}=Xt(),{isBlob:sr,isValidStatusCode:Kw}=nr(),{mask:Jd,toBuffer:ki}=Xr(),xt=Symbol("kByteLength"),Gw=Buffer.alloc(4),cs=8*1024,Mi,or=cs,Pt=0,Yw=1,Jw=2,oc=class i{constructor(e,t,r){this._extensions=t||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Pt,this.onerror=Vw,this[$w]=void 0}static frame(e,t){let r,n=!1,s=2,o=!1;t.mask&&(r=t.maskBuffer||Gw,t.generateMask?t.generateMask(r):(or===cs&&(Mi===void 0&&(Mi=Buffer.alloc(cs)),zw(Mi,0,cs),or=0),r[0]=Mi[or++],r[1]=Mi[or++],r[2]=Mi[or++],r[3]=Mi[or++]),o=(r[0]|r[1]|r[2]|r[3])===0,s=6);let c;typeof e=="string"?(!t.mask||o)&&t[xt]!==void 0?c=t[xt]:(e=Buffer.from(e),c=e.length):(c=e.length,n=t.mask&&t.readOnly&&!o);let u=c;c>=65536?(s+=8,u=127):c>125&&(s+=2,u=126);let d=Buffer.allocUnsafe(n?c+s:s);return d[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(d[0]|=64),d[1]=u,u===126?d.writeUInt16BE(c,2):u===127&&(d[2]=d[3]=0,d.writeUIntBE(c,4,6)),t.mask?(d[1]|=128,d[s-4]=r[0],d[s-3]=r[1],d[s-2]=r[2],d[s-1]=r[3],o?[d,e]:n?(Jd(e,r,d,s,c),[d]):(Jd(e,r,e,0,c),[d,e])):[d,e]}close(e,t,r,n){let s;if(e===void 0)s=Ww;else{if(typeof e!="number"||!Kw(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 c=Buffer.byteLength(t);if(c>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+c),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[xt]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Pt?this.enqueue([this.dispatch,s,!1,o,n]):this.sendFrame(i.frame(s,o),n)}ping(e,t,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):sr(e)?(n=e.size,s=!1):(e=ki(e),n=e.length,s=ki.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[xt]:n,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};sr(e)?this._state!==Pt?this.enqueue([this.getBlobData,e,!1,o,r]):this.getBlobData(e,!1,o,r):this._state!==Pt?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(i.frame(e,o),r)}pong(e,t,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):sr(e)?(n=e.size,s=!1):(e=ki(e),n=e.length,s=ki.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[xt]:n,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};sr(e)?this._state!==Pt?this.enqueue([this.getBlobData,e,!1,o,r]):this.getBlobData(e,!1,o,r):this._state!==Pt?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(i.frame(e,o),r)}send(e,t,r){let n=this._extensions[Yd.extensionName],s=t.binary?2:1,o=t.compress,c,u;typeof e=="string"?(c=Buffer.byteLength(e),u=!1):sr(e)?(c=e.size,u=!1):(e=ki(e),c=e.length,u=ki.readOnly),this._firstFragment?(this._firstFragment=!1,o&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=c>=n._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let d={[xt]:c,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:u,rsv1:o};sr(e)?this._state!==Pt?this.enqueue([this.getBlobData,e,this._compress,d,r]):this.getBlobData(e,this._compress,d,r):this._state!==Pt?this.enqueue([this.dispatch,e,this._compress,d,r]):this.dispatch(e,this._compress,d,r)}getBlobData(e,t,r,n){this._bufferedBytes+=r[xt],this._state=Jw,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let c=new Error("The socket was closed while the blob was being read");process.nextTick(ac,this,c,n);return}this._bufferedBytes-=r[xt];let o=ki(s);t?this.dispatch(o,t,r,n):(this._state=Pt,this.sendFrame(i.frame(o,r),n),this.dequeue())}).catch(s=>{process.nextTick(Xw,this,s,n)})}dispatch(e,t,r,n){if(!t){this.sendFrame(i.frame(e,r),n);return}let s=this._extensions[Yd.extensionName];this._bufferedBytes+=r[xt],this._state=Yw,s.compress(e,r.fin,(o,c)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");ac(this,u,n);return}this._bufferedBytes-=r[xt],this._state=Pt,r.readOnly=!1,this.sendFrame(i.frame(c,r),n),this.dequeue()})}dequeue(){for(;this._state===Pt&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][xt],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][xt],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)}};Xd.exports=oc;function ac(i,e,t){typeof t=="function"&&t(e);for(let r=0;r<i._queue.length;r++){let n=i._queue[r],s=n[n.length-1];typeof s=="function"&&s(e)}}function Xw(i,e,t){ac(i,e,t),i.onerror(e)}});var af=T((bM,of)=>{"use strict";var{kForOnEventAttribute:en,kListener:lc}=Xt(),Zd=Symbol("kCode"),Qd=Symbol("kData"),ef=Symbol("kError"),tf=Symbol("kMessage"),rf=Symbol("kReason"),ar=Symbol("kTarget"),nf=Symbol("kType"),sf=Symbol("kWasClean"),ei=class{constructor(e){this[ar]=null,this[nf]=e}get target(){return this[ar]}get type(){return this[nf]}};Object.defineProperty(ei.prototype,"target",{enumerable:!0});Object.defineProperty(ei.prototype,"type",{enumerable:!0});var Oi=class extends ei{constructor(e,t={}){super(e),this[Zd]=t.code===void 0?0:t.code,this[rf]=t.reason===void 0?"":t.reason,this[sf]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Zd]}get reason(){return this[rf]}get wasClean(){return this[sf]}};Object.defineProperty(Oi.prototype,"code",{enumerable:!0});Object.defineProperty(Oi.prototype,"reason",{enumerable:!0});Object.defineProperty(Oi.prototype,"wasClean",{enumerable:!0});var cr=class extends ei{constructor(e,t={}){super(e),this[ef]=t.error===void 0?null:t.error,this[tf]=t.message===void 0?"":t.message}get error(){return this[ef]}get message(){return this[tf]}};Object.defineProperty(cr.prototype,"error",{enumerable:!0});Object.defineProperty(cr.prototype,"message",{enumerable:!0});var tn=class extends ei{constructor(e,t={}){super(e),this[Qd]=t.data===void 0?null:t.data}get data(){return this[Qd]}};Object.defineProperty(tn.prototype,"data",{enumerable:!0});var Zw={addEventListener(i,e,t={}){for(let n of this.listeners(i))if(!t[en]&&n[lc]===e&&!n[en])return;let r;if(i==="message")r=function(s,o){let c=new tn("message",{data:o?s:s.toString()});c[ar]=this,ls(e,this,c)};else if(i==="close")r=function(s,o){let c=new Oi("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});c[ar]=this,ls(e,this,c)};else if(i==="error")r=function(s){let o=new cr("error",{error:s,message:s.message});o[ar]=this,ls(e,this,o)};else if(i==="open")r=function(){let s=new ei("open");s[ar]=this,ls(e,this,s)};else return;r[en]=!!t[en],r[lc]=e,t.once?this.once(i,r):this.on(i,r)},removeEventListener(i,e){for(let t of this.listeners(i))if(t[lc]===e&&!t[en]){this.removeListener(i,t);break}}};of.exports={CloseEvent:Oi,ErrorEvent:cr,Event:ei,EventTarget:Zw,MessageEvent:tn};function ls(i,e,t){typeof i=="object"&&i.handleEvent?i.handleEvent.call(i,t):i.call(e,t)}});var uc=T((wM,cf)=>{"use strict";var{tokenChars:rn}=nr();function zt(i,e,t){i[e]===void 0?i[e]=[t]:i[e].push(t)}function Qw(i){let e=Object.create(null),t=Object.create(null),r=!1,n=!1,s=!1,o,c,u=-1,d=-1,f=-1,v=0;for(;v<i.length;v++)if(d=i.charCodeAt(v),o===void 0)if(f===-1&&rn[d]===1)u===-1&&(u=v);else if(v!==0&&(d===32||d===9))f===-1&&u!==-1&&(f=v);else if(d===59||d===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${v}`);f===-1&&(f=v);let E=i.slice(u,f);d===44?(zt(e,E,t),t=Object.create(null)):o=E,u=f=-1}else throw new SyntaxError(`Unexpected character at index ${v}`);else if(c===void 0)if(f===-1&&rn[d]===1)u===-1&&(u=v);else if(d===32||d===9)f===-1&&u!==-1&&(f=v);else if(d===59||d===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${v}`);f===-1&&(f=v),zt(t,i.slice(u,f),!0),d===44&&(zt(e,o,t),t=Object.create(null),o=void 0),u=f=-1}else if(d===61&&u!==-1&&f===-1)c=i.slice(u,v),u=f=-1;else throw new SyntaxError(`Unexpected character at index ${v}`);else if(n){if(rn[d]!==1)throw new SyntaxError(`Unexpected character at index ${v}`);u===-1?u=v:r||(r=!0),n=!1}else if(s)if(rn[d]===1)u===-1&&(u=v);else if(d===34&&u!==-1)s=!1,f=v;else if(d===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${v}`);else if(d===34&&i.charCodeAt(v-1)===61)s=!0;else if(f===-1&&rn[d]===1)u===-1&&(u=v);else if(u!==-1&&(d===32||d===9))f===-1&&(f=v);else if(d===59||d===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${v}`);f===-1&&(f=v);let E=i.slice(u,f);r&&(E=E.replace(/\\/g,""),r=!1),zt(t,c,E),d===44&&(zt(e,o,t),t=Object.create(null),o=void 0),c=void 0,u=f=-1}else throw new SyntaxError(`Unexpected character at index ${v}`);if(u===-1||s||d===32||d===9)throw new SyntaxError("Unexpected end of input");f===-1&&(f=v);let _=i.slice(u,f);return o===void 0?zt(e,_,t):(c===void 0?zt(t,_,!0):r?zt(t,c,_.replace(/\\/g,"")):zt(t,c,_),zt(e,o,t)),e}function e_(i){return Object.keys(i).map(e=>{let t=i[e];return Array.isArray(t)||(t=[t]),t.map(r=>[e].concat(Object.keys(r).map(n=>{let s=r[n];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?n:`${n}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}cf.exports={format:e_,parse:Qw}});var fs=T((EM,bf)=>{"use strict";var t_=require("events"),i_=require("https"),r_=require("http"),pf=require("net"),n_=require("tls"),{randomBytes:s_,createHash:o_}=require("crypto"),{Duplex:_M,Readable:SM}=require("stream"),{URL:pc}=require("url"),vi=Qr(),a_=sc(),c_=cc(),{isBlob:l_}=nr(),{BINARY_TYPES:lf,EMPTY_BUFFER:us,GUID:u_,kForOnEventAttribute:dc,kListener:p_,kStatusCode:d_,kWebSocket:ze,NOOP:df}=Xt(),{EventTarget:{addEventListener:f_,removeEventListener:h_}}=af(),{format:m_,parse:v_}=uc(),{toBuffer:g_}=Xr(),x_=30*1e3,ff=Symbol("kAborted"),fc=[8,13],ti=["CONNECTING","OPEN","CLOSING","CLOSED"],y_=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,J=class i extends t_{constructor(e,t,r){super(),this._binaryType=lf[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=us,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=i.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?(r=t,t=[]):t=[t]),hf(this,e,t,r)):(this._autoPong=r.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){lf.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,r){let n=new a_({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),s=new c_(e,this._extensions,r.generateMask);this._receiver=n,this._sender=s,this._socket=e,n[ze]=this,s[ze]=this,e[ze]=this,n.on("conclude",__),n.on("drain",S_),n.on("error",E_),n.on("message",C_),n.on("ping",T_),n.on("pong",k_),s.onerror=M_,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",gf),e.on("data",ds),e.on("end",xf),e.on("error",yf),this._readyState=i.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[vi.extensionName]&&this._extensions[vi.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){pt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===i.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=i.CLOSING,this._sender.close(e,t,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),vf(this)}}pause(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=t=void 0):typeof t=="function"&&(r=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){hc(this,e,r);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||us,t,r)}pong(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=t=void 0):typeof t=="function"&&(r=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){hc(this,e,r);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||us,t,r)}resume(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,r){if(this.readyState===i.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(r=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==i.OPEN){hc(this,e,r);return}let n={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[vi.extensionName]||(n.compress=!1),this._sender.send(e||us,n,r)}terminate(){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){pt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=i.CLOSING,this._socket.destroy())}}};Object.defineProperty(J,"CONNECTING",{enumerable:!0,value:ti.indexOf("CONNECTING")});Object.defineProperty(J.prototype,"CONNECTING",{enumerable:!0,value:ti.indexOf("CONNECTING")});Object.defineProperty(J,"OPEN",{enumerable:!0,value:ti.indexOf("OPEN")});Object.defineProperty(J.prototype,"OPEN",{enumerable:!0,value:ti.indexOf("OPEN")});Object.defineProperty(J,"CLOSING",{enumerable:!0,value:ti.indexOf("CLOSING")});Object.defineProperty(J.prototype,"CLOSING",{enumerable:!0,value:ti.indexOf("CLOSING")});Object.defineProperty(J,"CLOSED",{enumerable:!0,value:ti.indexOf("CLOSED")});Object.defineProperty(J.prototype,"CLOSED",{enumerable:!0,value:ti.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(i=>{Object.defineProperty(J.prototype,i,{enumerable:!0})});["open","error","close","message"].forEach(i=>{Object.defineProperty(J.prototype,`on${i}`,{enumerable:!0,get(){for(let e of this.listeners(i))if(e[dc])return e[p_];return null},set(e){for(let t of this.listeners(i))if(t[dc]){this.removeListener(i,t);break}typeof e=="function"&&this.addEventListener(i,e,{[dc]:!0})}})});J.prototype.addEventListener=f_;J.prototype.removeEventListener=h_;bf.exports=J;function hf(i,e,t,r){let n={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:fc[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(i._autoPong=n.autoPong,!fc.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${fc.join(", ")})`);let s;if(e instanceof pc)s=e;else try{s=new pc(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),i._url=s.href;let o=s.protocol==="wss:",c=s.protocol==="ws+unix:",u;if(s.protocol!=="ws:"&&!o&&!c?u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:c&&!s.pathname?u="The URL's pathname is empty":s.hash&&(u="The URL contains a fragment identifier"),u){let k=new SyntaxError(u);if(i._redirects===0)throw k;ps(i,k);return}let d=o?443:80,f=s_(16).toString("base64"),v=o?i_.request:r_.request,_=new Set,E;if(n.createConnection=n.createConnection||(o?w_:b_),n.defaultPort=n.defaultPort||d,n.port=s.port||d,n.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"},n.path=s.pathname+s.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(E=new vi(n.perMessageDeflate!==!0?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=m_({[vi.extensionName]:E.offer()})),t.length){for(let k of t){if(typeof k!="string"||!y_.test(k)||_.has(k))throw new SyntaxError("An invalid or duplicated subprotocol was specified");_.add(k)}n.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(s.username||s.password)&&(n.auth=`${s.username}:${s.password}`),c){let k=n.path.split(":");n.socketPath=k[0],n.path=k[1]}let C;if(n.followRedirects){if(i._redirects===0){i._originalIpc=c,i._originalSecure=o,i._originalHostOrSocketPath=c?n.socketPath:s.host;let k=r&&r.headers;if(r={...r,headers:{}},k)for(let[M,O]of Object.entries(k))r.headers[M.toLowerCase()]=O}else if(i.listenerCount("redirect")===0){let k=c?i._originalIpc?n.socketPath===i._originalHostOrSocketPath:!1:i._originalIpc?!1:s.host===i._originalHostOrSocketPath;(!k||i._originalSecure&&!o)&&(delete n.headers.authorization,delete n.headers.cookie,k||delete n.headers.host,n.auth=void 0)}n.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),C=i._req=v(n),i._redirects&&i.emit("redirect",i.url,C)}else C=i._req=v(n);n.timeout&&C.on("timeout",()=>{pt(i,C,"Opening handshake has timed out")}),C.on("error",k=>{C===null||C[ff]||(C=i._req=null,ps(i,k))}),C.on("response",k=>{let M=k.headers.location,O=k.statusCode;if(M&&n.followRedirects&&O>=300&&O<400){if(++i._redirects>n.maxRedirects){pt(i,C,"Maximum redirects exceeded");return}C.abort();let A;try{A=new pc(M,e)}catch{let U=new SyntaxError(`Invalid URL: ${M}`);ps(i,U);return}hf(i,A,t,r)}else i.emit("unexpected-response",C,k)||pt(i,C,`Unexpected server response: ${k.statusCode}`)}),C.on("upgrade",(k,M,O)=>{if(i.emit("upgrade",k),i.readyState!==J.CONNECTING)return;C=i._req=null;let A=k.headers.upgrade;if(A===void 0||A.toLowerCase()!=="websocket"){pt(i,M,"Invalid Upgrade header");return}let I=o_("sha1").update(f+u_).digest("base64");if(k.headers["sec-websocket-accept"]!==I){pt(i,M,"Invalid Sec-WebSocket-Accept header");return}let U=k.headers["sec-websocket-protocol"],Xe;if(U!==void 0?_.size?_.has(U)||(Xe="Server sent an invalid subprotocol"):Xe="Server sent a subprotocol but none was requested":_.size&&(Xe="Server sent no subprotocol"),Xe){pt(i,M,Xe);return}U&&(i._protocol=U);let te=k.headers["sec-websocket-extensions"];if(te!==void 0){if(!E){pt(i,M,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Le;try{Le=v_(te)}catch{pt(i,M,"Invalid Sec-WebSocket-Extensions header");return}let q=Object.keys(Le);if(q.length!==1||q[0]!==vi.extensionName){pt(i,M,"Server indicated an extension that was not requested");return}try{E.accept(Le[vi.extensionName])}catch{pt(i,M,"Invalid Sec-WebSocket-Extensions header");return}i._extensions[vi.extensionName]=E}i.setSocket(M,O,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(C,i):C.end()}function ps(i,e){i._readyState=J.CLOSING,i._errorEmitted=!0,i.emit("error",e),i.emitClose()}function b_(i){return i.path=i.socketPath,pf.connect(i)}function w_(i){return i.path=void 0,!i.servername&&i.servername!==""&&(i.servername=pf.isIP(i.host)?"":i.host),n_.connect(i)}function pt(i,e,t){i._readyState=J.CLOSING;let r=new Error(t);Error.captureStackTrace(r,pt),e.setHeader?(e[ff]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(ps,i,r)):(e.destroy(r),e.once("error",i.emit.bind(i,"error")),e.once("close",i.emitClose.bind(i)))}function hc(i,e,t){if(e){let r=l_(e)?e.size:g_(e).length;i._socket?i._sender._bufferedBytes+=r:i._bufferedAmount+=r}if(t){let r=new Error(`WebSocket is not open: readyState ${i.readyState} (${ti[i.readyState]})`);process.nextTick(t,r)}}function __(i,e){let t=this[ze];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=i,t._socket[ze]!==void 0&&(t._socket.removeListener("data",ds),process.nextTick(mf,t._socket),i===1005?t.close():t.close(i,e))}function S_(){let i=this[ze];i.isPaused||i._socket.resume()}function E_(i){let e=this[ze];e._socket[ze]!==void 0&&(e._socket.removeListener("data",ds),process.nextTick(mf,e._socket),e.close(i[d_])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i))}function uf(){this[ze].emitClose()}function C_(i,e){this[ze].emit("message",i,e)}function T_(i){let e=this[ze];e._autoPong&&e.pong(i,!this._isServer,df),e.emit("ping",i)}function k_(i){this[ze].emit("pong",i)}function mf(i){i.resume()}function M_(i){let e=this[ze];e.readyState!==J.CLOSED&&(e.readyState===J.OPEN&&(e._readyState=J.CLOSING,vf(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i)))}function vf(i){i._closeTimer=setTimeout(i._socket.destroy.bind(i._socket),x_)}function gf(){let i=this[ze];this.removeListener("close",gf),this.removeListener("data",ds),this.removeListener("end",xf),i._readyState=J.CLOSING;let e;!this._readableState.endEmitted&&!i._closeFrameReceived&&!i._receiver._writableState.errorEmitted&&(e=i._socket.read())!==null&&i._receiver.write(e),i._receiver.end(),this[ze]=void 0,clearTimeout(i._closeTimer),i._receiver._writableState.finished||i._receiver._writableState.errorEmitted?i.emitClose():(i._receiver.on("error",uf),i._receiver.on("finish",uf))}function ds(i){this[ze]._receiver.write(i)||this.pause()}function xf(){let i=this[ze];i._readyState=J.CLOSING,i._receiver.end(),this.end()}function yf(){let i=this[ze];this.removeListener("error",yf),this.on("error",df),i&&(i._readyState=J.CLOSING,this.destroy())}});var Ef=T((TM,Sf)=>{"use strict";var CM=fs(),{Duplex:O_}=require("stream");function wf(i){i.emit("close")}function A_(){!this.destroyed&&this._writableState.finished&&this.destroy()}function _f(i){this.removeListener("error",_f),this.destroy(),this.listenerCount("error")===0&&this.emit("error",i)}function R_(i,e){let t=!0,r=new O_({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(s,o){let c=!o&&r._readableState.objectMode?s.toString():s;r.push(c)||i.pause()}),i.once("error",function(s){r.destroyed||(t=!1,r.destroy(s))}),i.once("close",function(){r.destroyed||r.push(null)}),r._destroy=function(n,s){if(i.readyState===i.CLOSED){s(n),process.nextTick(wf,r);return}let o=!1;i.once("error",function(u){o=!0,s(u)}),i.once("close",function(){o||s(n),process.nextTick(wf,r)}),t&&i.terminate()},r._final=function(n){if(i.readyState===i.CONNECTING){i.once("open",function(){r._final(n)});return}i._socket!==null&&(i._socket._writableState.finished?(n(),r._readableState.endEmitted&&r.destroy()):(i._socket.once("finish",function(){n()}),i.close()))},r._read=function(){i.isPaused&&i.resume()},r._write=function(n,s,o){if(i.readyState===i.CONNECTING){i.once("open",function(){r._write(n,s,o)});return}i.send(n,o)},r.on("end",A_),r.on("error",_f),r}Sf.exports=R_});var Tf=T((kM,Cf)=>{"use strict";var{tokenChars:P_}=nr();function B_(i){let e=new Set,t=-1,r=-1,n=0;for(n;n<i.length;n++){let o=i.charCodeAt(n);if(r===-1&&P_[o]===1)t===-1&&(t=n);else if(n!==0&&(o===32||o===9))r===-1&&t!==-1&&(r=n);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${n}`);r===-1&&(r=n);let c=i.slice(t,r);if(e.has(c))throw new SyntaxError(`The "${c}" subprotocol is duplicated`);e.add(c),t=r=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(t===-1||r!==-1)throw new SyntaxError("Unexpected end of input");let s=i.slice(t,n);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}Cf.exports={parse:B_}});var Bf=T((OM,Pf)=>{"use strict";var N_=require("events"),hs=require("http"),{Duplex:MM}=require("stream"),{createHash:I_}=require("crypto"),kf=uc(),Ai=Qr(),D_=Tf(),j_=fs(),{GUID:L_,kWebSocket:q_}=Xt(),F_=/^[+/0-9A-Za-z]{22}==$/,Mf=0,Of=1,Rf=2,mc=class extends N_{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:j_,...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=hs.createServer((r,n)=>{let s=hs.STATUS_CODES[426];n.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),n.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=U_(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,s,o)=>{this.handleUpgrade(n,s,o,r)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Mf}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===Rf){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(nn,this);return}if(e&&this.once("close",e),this._state!==Of)if(this._state=Of,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(nn,this):process.nextTick(nn,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{nn(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,r,n){t.on("error",Af);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,c=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Ri(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){Ri(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!F_.test(s)){Ri(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(c!==13&&c!==8){Ri(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){sn(t,400);return}let u=e.headers["sec-websocket-protocol"],d=new Set;if(u!==void 0)try{d=D_.parse(u)}catch{Ri(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let f=e.headers["sec-websocket-extensions"],v={};if(this.options.perMessageDeflate&&f!==void 0){let _=new Ai(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let E=kf.parse(f);E[Ai.extensionName]&&(_.accept(E[Ai.extensionName]),v[Ai.extensionName]=_)}catch{Ri(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let _={origin:e.headers[`${c===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(_,(E,C,k,M)=>{if(!E)return sn(t,C||401,k,M);this.completeUpgrade(v,s,d,e,t,r,n)});return}if(!this.options.verifyClient(_))return sn(t,401)}this.completeUpgrade(v,s,d,e,t,r,n)}completeUpgrade(e,t,r,n,s,o,c){if(!s.readable||!s.writable)return s.destroy();if(s[q_])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Mf)return sn(s,503);let d=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${I_("sha1").update(t+L_).digest("base64")}`],f=new this.options.WebSocket(null,void 0,this.options);if(r.size){let v=this.options.handleProtocols?this.options.handleProtocols(r,n):r.values().next().value;v&&(d.push(`Sec-WebSocket-Protocol: ${v}`),f._protocol=v)}if(e[Ai.extensionName]){let v=e[Ai.extensionName].params,_=kf.format({[Ai.extensionName]:[v]});d.push(`Sec-WebSocket-Extensions: ${_}`),f._extensions=e}this.emit("headers",d,n),s.write(d.concat(`\r
9
+ `);function a(l){var p=sc(ni.join(l,"prebuilds")).map(zf),d=p.filter(Wf(nc,ic)).sort($f)[0];if(d){var h=ni.join(l,"prebuilds",d.name),g=sc(h).map(Kf),_=g.filter(Vf(tc,Bf)),S=_.sort(Gf(tc))[0];if(S)return ni.join(h,S.file)}}};function sc(i){try{return Lf.readdirSync(i)}catch{return[]}}function jf(i,e){var t=sc(i).filter(e);return t[0]&&ni.join(i,t[0])}function Df(i){return/\.node$/.test(i)}function zf(i){var e=i.split("-");if(e.length===2){var t=e[0],n=e[1].split("+");if(t&&n.length&&n.every(Boolean))return{name:i,platform:t,architectures:n}}}function Wf(i,e){return function(t){return t==null||t.platform!==i?!1:t.architectures.includes(e)}}function $f(i,e){return i.architectures.length-e.architectures.length}function Kf(i){var e=i.split("."),t=e.pop(),n={file:i,specificity:0};if(t==="node"){for(var r=0;r<e.length;r++){var s=e[r];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 Vf(i,e){return function(t){return!(t==null||t.runtime&&t.runtime!==i&&!Jw(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==Hf||t.armv&&t.armv!==rc||t.libc&&t.libc!==Uf)}}function Jw(i){return i.runtime==="node"&&i.napi}function Gf(i){return function(e,t){return e.runtime!==t.runtime?e.runtime===i?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function Yw(){return!!(process.versions&&process.versions.nw)}function Xw(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function Zw(i){return i==="linux"&&Lf.existsSync("/etc/alpine-release")}Vt.parseTags=Kf;Vt.matchTags=Vf;Vt.compareTags=Gf;Vt.parseTuple=zf;Vt.matchTuple=Wf;Vt.compareTuples=$f});var cc=O((JO,ac)=>{var oc=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof oc.addon=="function"?ac.exports=oc.addon.bind(oc):ac.exports=Yf()});var Zf=O((YO,Xf)=>{"use strict";var Qw=(i,e,t,n,r)=>{for(var s=0;s<r;s++)t[n+s]=i[s]^e[s&3]},e_=(i,e)=>{let t=i.length;for(var n=0;n<t;n++)i[n]^=e[n&3]};Xf.exports={mask:Qw,unmask:e_}});var Qf=O((XO,lc)=>{"use strict";try{lc.exports=cc()(__dirname)}catch{lc.exports=Zf()}});var ar=O((ZO,hs)=>{"use strict";var{EMPTY_BUFFER:t_}=ii(),uc=Buffer[Symbol.species];function i_(i,e){if(i.length===0)return t_;if(i.length===1)return i[0];let t=Buffer.allocUnsafe(e),n=0;for(let r=0;r<i.length;r++){let s=i[r];t.set(s,n),n+=s.length}return n<e?new uc(t.buffer,t.byteOffset,n):t}function ed(i,e,t,n,r){for(let s=0;s<r;s++)t[n+s]=i[s]^e[s&3]}function td(i,e){for(let t=0;t<i.length;t++)i[t]^=e[t&3]}function n_(i){return i.length===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.length)}function pc(i){if(pc.readOnly=!0,Buffer.isBuffer(i))return i;let e;return i instanceof ArrayBuffer?e=new uc(i):ArrayBuffer.isView(i)?e=new uc(i.buffer,i.byteOffset,i.byteLength):(e=Buffer.from(i),pc.readOnly=!1),e}hs.exports={concat:i_,mask:ed,toArrayBuffer:n_,toBuffer:pc,unmask:td};if(!process.env.WS_NO_BUFFER_UTIL)try{let i=Qf();hs.exports.mask=function(e,t,n,r,s){s<48?ed(e,t,n,r,s):i.mask(e,t,n,r,s)},hs.exports.unmask=function(e,t){e.length<32?td(e,t):i.unmask(e,t)}}catch{}});var rd=O((QO,nd)=>{"use strict";var id=Symbol("kDone"),fc=Symbol("kRun"),dc=class{constructor(e){this[id]=()=>{this.pending--,this[fc]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[fc]()}[fc](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[id])}}};nd.exports=dc});var lr=O((eM,cd)=>{"use strict";var cr=require("zlib"),sd=ar(),r_=rd(),{kStatusCode:od}=ii(),s_=Buffer[Symbol.species],o_=Buffer.from([0,0,255,255]),vs=Symbol("permessage-deflate"),ri=Symbol("total-length"),ln=Symbol("callback"),bi=Symbol("buffers"),un=Symbol("error"),ms,hc=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,!ms){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ms=new r_(r)}}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[ln];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(r=>!(t.serverNoContextTakeover===!1&&r.server_no_context_takeover||r.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>r.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!r.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 r=t[n];if(r.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(r=r[0],n==="client_max_window_bits"){if(r!==!0){let s=+r;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${r}`);r=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${r}`)}else if(n==="server_max_window_bits"){let s=+r;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${r}`);r=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(r!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${r}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=r})}),e}decompress(e,t,n){ms.add(r=>{this._decompress(e,t,(s,o)=>{r(),n(s,o)})})}compress(e,t,n){ms.add(r=>{this._compress(e,t,(s,o)=>{r(),n(s,o)})})}_decompress(e,t,n){let r=this._isServer?"client":"server";if(!this._inflate){let s=`${r}_max_window_bits`,o=typeof this.params[s]!="number"?cr.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=cr.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[vs]=this,this._inflate[ri]=0,this._inflate[bi]=[],this._inflate.on("error",c_),this._inflate.on("data",ad)}this._inflate[ln]=n,this._inflate.write(e),t&&this._inflate.write(o_),this._inflate.flush(()=>{let s=this._inflate[un];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=sd.concat(this._inflate[bi],this._inflate[ri]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[ri]=0,this._inflate[bi]=[],t&&this.params[`${r}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let r=this._isServer?"server":"client";if(!this._deflate){let s=`${r}_max_window_bits`,o=typeof this.params[s]!="number"?cr.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=cr.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[ri]=0,this._deflate[bi]=[],this._deflate.on("data",a_)}this._deflate[ln]=n,this._deflate.write(e),this._deflate.flush(cr.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=sd.concat(this._deflate[bi],this._deflate[ri]);t&&(s=new s_(s.buffer,s.byteOffset,s.length-4)),this._deflate[ln]=null,this._deflate[ri]=0,this._deflate[bi]=[],t&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};cd.exports=hc;function a_(i){this[bi].push(i),this[ri]+=i.length}function ad(i){if(this[ri]+=i.length,this[vs]._maxPayload<1||this[ri]<=this[vs]._maxPayload){this[bi].push(i);return}this[un]=new RangeError("Max payload size exceeded"),this[un].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[un][od]=1009,this.removeListener("data",ad),this.reset()}function c_(i){if(this[vs]._inflate=null,this[un]){this[ln](this[un]);return}i[od]=1007,this[ln](i)}});var ud=O((tM,ld)=>{"use strict";function l_(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}ld.exports=l_});var pd=O((iM,mc)=>{"use strict";try{mc.exports=cc()(__dirname)}catch{mc.exports=ud()}});var pn=O((nM,gs)=>{"use strict";var{isUtf8:fd}=require("buffer"),{hasBlob:u_}=ii(),p_=[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 f_(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function vc(i){let e=i.length,t=0;for(;t<e;)if((i[t]&128)===0)t++;else if((i[t]&224)===192){if(t+1===e||(i[t+1]&192)!==128||(i[t]&254)===192)return!1;t+=2}else if((i[t]&240)===224){if(t+2>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||i[t]===224&&(i[t+1]&224)===128||i[t]===237&&(i[t+1]&224)===160)return!1;t+=3}else if((i[t]&248)===240){if(t+3>=e||(i[t+1]&192)!==128||(i[t+2]&192)!==128||(i[t+3]&192)!==128||i[t]===240&&(i[t+1]&240)===128||i[t]===244&&i[t+1]>143||i[t]>244)return!1;t+=4}else return!1;return!0}function d_(i){return u_&&typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&(i[Symbol.toStringTag]==="Blob"||i[Symbol.toStringTag]==="File")}gs.exports={isBlob:d_,isValidStatusCode:f_,isValidUTF8:vc,tokenChars:p_};if(fd)gs.exports.isValidUTF8=function(i){return i.length<24?vc(i):fd(i)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let i=pd();gs.exports.isValidUTF8=function(e){return e.length<32?vc(e):i(e)}}catch{}});var wc=O((rM,yd)=>{"use strict";var{Writable:h_}=require("stream"),dd=lr(),{BINARY_TYPES:m_,EMPTY_BUFFER:hd,kStatusCode:v_,kWebSocket:g_}=ii(),{concat:gc,toArrayBuffer:x_,unmask:y_}=ar(),{isValidStatusCode:b_,isValidUTF8:md}=pn(),xs=Buffer[Symbol.species],_t=0,vd=1,gd=2,xd=3,xc=4,yc=5,ys=6,bc=class extends h_{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||m_[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[g_]=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=_t}_write(e,t,n){if(this._opcode===8&&this._state==_t)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 xs(n.buffer,n.byteOffset+e,n.length-e),new xs(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],r=t.length-e;e>=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=new xs(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 _t:this.getInfo(e);break;case vd:this.getPayloadLength16(e);break;case gd:this.getPayloadLength64(e);break;case xd:this.getMask();break;case xc:this.getData(e);break;case yc:case ys: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 r=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(r);return}let n=(t[0]&64)===64;if(n&&!this._extensions[dd.extensionName]){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(!this._fragmented){let r=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let r=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let r=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(r);return}if(n){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let r=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(r);return}}else{let r=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let r=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(r);return}}else if(this._masked){let r=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(r);return}this._payloadLength===126?this._state=vd:this._payloadLength===127?this._state=gd: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 r=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(r);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=xd:this._state=xc}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=xc}getData(e){let t=hd;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&&y_(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=yc,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[dd.extensionName].decompress(e,this._fin,(r,s)=>{if(r)return t(r);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===_t&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=_t;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let r;this._binaryType==="nodebuffer"?r=gc(n,t):this._binaryType==="arraybuffer"?r=x_(gc(n,t)):this._binaryType==="blob"?r=new Blob(n):r=n,this._allowSynchronousEvents?(this.emit("message",r,!0),this._state=_t):(this._state=ys,setImmediate(()=>{this.emit("message",r,!0),this._state=_t,this.startLoop(e)}))}else{let r=gc(n,t);if(!this._skipUTF8Validation&&!md(r)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===yc||this._allowSynchronousEvents?(this.emit("message",r,!1),this._state=_t):(this._state=ys,setImmediate(()=>{this.emit("message",r,!1),this._state=_t,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,hd),this.end();else{let n=e.readUInt16BE(0);if(!b_(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let r=new xs(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!md(r)){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,r),this.end()}this._state=_t;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=_t):(this._state=ys,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=_t,this.startLoop(t)}))}createError(e,t,n,r,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[v_]=r,o}};yd.exports=bc});var Ec=O((oM,_d)=>{"use strict";var{Duplex:sM}=require("stream"),{randomFillSync:w_}=require("crypto"),bd=lr(),{EMPTY_BUFFER:__,kWebSocket:S_,NOOP:E_}=ii(),{isBlob:fn,isValidStatusCode:C_}=pn(),{mask:wd,toBuffer:Ii}=ar(),St=Symbol("kByteLength"),T_=Buffer.alloc(4),bs=8*1024,Ni,dn=bs,Lt=0,k_=1,O_=2,_c=class i{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=Lt,this.onerror=E_,this[S_]=void 0}static frame(e,t){let n,r=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||T_,t.generateMask?t.generateMask(n):(dn===bs&&(Ni===void 0&&(Ni=Buffer.alloc(bs)),w_(Ni,0,bs),dn=0),n[0]=Ni[dn++],n[1]=Ni[dn++],n[2]=Ni[dn++],n[3]=Ni[dn++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[St]!==void 0?a=t[St]:(e=Buffer.from(e),a=e.length):(a=e.length,r=t.mask&&t.readOnly&&!o);let l=a;a>=65536?(s+=8,l=127):a>125&&(s+=2,l=126);let p=Buffer.allocUnsafe(r?a+s:s);return p[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(p[0]|=64),p[1]=l,l===126?p.writeUInt16BE(a,2):l===127&&(p[2]=p[3]=0,p.writeUIntBE(a,4,6)),t.mask?(p[1]|=128,p[s-4]=n[0],p[s-3]=n[1],p[s-2]=n[2],p[s-1]=n[3],o?[p,e]:r?(wd(e,n,p,s,a),[p]):(wd(e,n,e,0,a),[p,e])):[p,e]}close(e,t,n,r){let s;if(e===void 0)s=__;else{if(typeof e!="number"||!C_(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={[St]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Lt?this.enqueue([this.dispatch,s,!1,o,r]):this.sendFrame(i.frame(s,o),r)}ping(e,t,n){let r,s;if(typeof e=="string"?(r=Buffer.byteLength(e),s=!1):fn(e)?(r=e.size,s=!1):(e=Ii(e),r=e.length,s=Ii.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[St]:r,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};fn(e)?this._state!==Lt?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Lt?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(i.frame(e,o),n)}pong(e,t,n){let r,s;if(typeof e=="string"?(r=Buffer.byteLength(e),s=!1):fn(e)?(r=e.size,s=!1):(e=Ii(e),r=e.length,s=Ii.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[St]:r,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};fn(e)?this._state!==Lt?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Lt?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(i.frame(e,o),n)}send(e,t,n){let r=this._extensions[bd.extensionName],s=t.binary?2:1,o=t.compress,a,l;typeof e=="string"?(a=Buffer.byteLength(e),l=!1):fn(e)?(a=e.size,l=!1):(e=Ii(e),a=e.length,l=Ii.readOnly),this._firstFragment?(this._firstFragment=!1,o&&r&&r.params[r._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=r._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let p={[St]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:l,rsv1:o};fn(e)?this._state!==Lt?this.enqueue([this.getBlobData,e,this._compress,p,n]):this.getBlobData(e,this._compress,p,n):this._state!==Lt?this.enqueue([this.dispatch,e,this._compress,p,n]):this.dispatch(e,this._compress,p,n)}getBlobData(e,t,n,r){this._bufferedBytes+=n[St],this._state=O_,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Sc,this,a,r);return}this._bufferedBytes-=n[St];let o=Ii(s);t?this.dispatch(o,t,n,r):(this._state=Lt,this.sendFrame(i.frame(o,n),r),this.dequeue())}).catch(s=>{process.nextTick(M_,this,s,r)})}dispatch(e,t,n,r){if(!t){this.sendFrame(i.frame(e,n),r);return}let s=this._extensions[bd.extensionName];this._bufferedBytes+=n[St],this._state=k_,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");Sc(this,l,r);return}this._bufferedBytes-=n[St],this._state=Lt,n.readOnly=!1,this.sendFrame(i.frame(a,n),r),this.dequeue()})}dequeue(){for(;this._state===Lt&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][St],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][St],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};_d.exports=_c;function Sc(i,e,t){typeof t=="function"&&t(e);for(let n=0;n<i._queue.length;n++){let r=i._queue[n],s=r[r.length-1];typeof s=="function"&&s(e)}}function M_(i,e,t){Sc(i,e,t),i.onerror(e)}});var Rd=O((aM,Ad)=>{"use strict";var{kForOnEventAttribute:ur,kListener:Cc}=ii(),Sd=Symbol("kCode"),Ed=Symbol("kData"),Cd=Symbol("kError"),Td=Symbol("kMessage"),kd=Symbol("kReason"),hn=Symbol("kTarget"),Od=Symbol("kType"),Md=Symbol("kWasClean"),si=class{constructor(e){this[hn]=null,this[Od]=e}get target(){return this[hn]}get type(){return this[Od]}};Object.defineProperty(si.prototype,"target",{enumerable:!0});Object.defineProperty(si.prototype,"type",{enumerable:!0});var Bi=class extends si{constructor(e,t={}){super(e),this[Sd]=t.code===void 0?0:t.code,this[kd]=t.reason===void 0?"":t.reason,this[Md]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Sd]}get reason(){return this[kd]}get wasClean(){return this[Md]}};Object.defineProperty(Bi.prototype,"code",{enumerable:!0});Object.defineProperty(Bi.prototype,"reason",{enumerable:!0});Object.defineProperty(Bi.prototype,"wasClean",{enumerable:!0});var mn=class extends si{constructor(e,t={}){super(e),this[Cd]=t.error===void 0?null:t.error,this[Td]=t.message===void 0?"":t.message}get error(){return this[Cd]}get message(){return this[Td]}};Object.defineProperty(mn.prototype,"error",{enumerable:!0});Object.defineProperty(mn.prototype,"message",{enumerable:!0});var pr=class extends si{constructor(e,t={}){super(e),this[Ed]=t.data===void 0?null:t.data}get data(){return this[Ed]}};Object.defineProperty(pr.prototype,"data",{enumerable:!0});var A_={addEventListener(i,e,t={}){for(let r of this.listeners(i))if(!t[ur]&&r[Cc]===e&&!r[ur])return;let n;if(i==="message")n=function(s,o){let a=new pr("message",{data:o?s:s.toString()});a[hn]=this,ws(e,this,a)};else if(i==="close")n=function(s,o){let a=new Bi("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[hn]=this,ws(e,this,a)};else if(i==="error")n=function(s){let o=new mn("error",{error:s,message:s.message});o[hn]=this,ws(e,this,o)};else if(i==="open")n=function(){let s=new si("open");s[hn]=this,ws(e,this,s)};else return;n[ur]=!!t[ur],n[Cc]=e,t.once?this.once(i,n):this.on(i,n)},removeEventListener(i,e){for(let t of this.listeners(i))if(t[Cc]===e&&!t[ur]){this.removeListener(i,t);break}}};Ad.exports={CloseEvent:Bi,ErrorEvent:mn,Event:si,EventTarget:A_,MessageEvent:pr};function ws(i,e,t){typeof i=="object"&&i.handleEvent?i.handleEvent.call(i,t):i.call(e,t)}});var Tc=O((cM,Pd)=>{"use strict";var{tokenChars:fr}=pn();function Gt(i,e,t){i[e]===void 0?i[e]=[t]:i[e].push(t)}function R_(i){let e=Object.create(null),t=Object.create(null),n=!1,r=!1,s=!1,o,a,l=-1,p=-1,d=-1,h=0;for(;h<i.length;h++)if(p=i.charCodeAt(h),o===void 0)if(d===-1&&fr[p]===1)l===-1&&(l=h);else if(h!==0&&(p===32||p===9))d===-1&&l!==-1&&(d=h);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${h}`);d===-1&&(d=h);let _=i.slice(l,d);p===44?(Gt(e,_,t),t=Object.create(null)):o=_,l=d=-1}else throw new SyntaxError(`Unexpected character at index ${h}`);else if(a===void 0)if(d===-1&&fr[p]===1)l===-1&&(l=h);else if(p===32||p===9)d===-1&&l!==-1&&(d=h);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${h}`);d===-1&&(d=h),Gt(t,i.slice(l,d),!0),p===44&&(Gt(e,o,t),t=Object.create(null),o=void 0),l=d=-1}else if(p===61&&l!==-1&&d===-1)a=i.slice(l,h),l=d=-1;else throw new SyntaxError(`Unexpected character at index ${h}`);else if(r){if(fr[p]!==1)throw new SyntaxError(`Unexpected character at index ${h}`);l===-1?l=h:n||(n=!0),r=!1}else if(s)if(fr[p]===1)l===-1&&(l=h);else if(p===34&&l!==-1)s=!1,d=h;else if(p===92)r=!0;else throw new SyntaxError(`Unexpected character at index ${h}`);else if(p===34&&i.charCodeAt(h-1)===61)s=!0;else if(d===-1&&fr[p]===1)l===-1&&(l=h);else if(l!==-1&&(p===32||p===9))d===-1&&(d=h);else if(p===59||p===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${h}`);d===-1&&(d=h);let _=i.slice(l,d);n&&(_=_.replace(/\\/g,""),n=!1),Gt(t,a,_),p===44&&(Gt(e,o,t),t=Object.create(null),o=void 0),a=void 0,l=d=-1}else throw new SyntaxError(`Unexpected character at index ${h}`);if(l===-1||s||p===32||p===9)throw new SyntaxError("Unexpected end of input");d===-1&&(d=h);let g=i.slice(l,d);return o===void 0?Gt(e,g,t):(a===void 0?Gt(t,g,!0):n?Gt(t,a,g.replace(/\\/g,"")):Gt(t,a,g),Gt(e,o,t)),e}function P_(i){return Object.keys(i).map(e=>{let t=i[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(r=>{let s=n[r];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?r:`${r}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Pd.exports={format:P_,parse:R_}});var Cs=O((pM,Wd)=>{"use strict";var I_=require("events"),N_=require("https"),B_=require("http"),Bd=require("net"),j_=require("tls"),{randomBytes:D_,createHash:L_}=require("crypto"),{Duplex:lM,Readable:uM}=require("stream"),{URL:kc}=require("url"),wi=lr(),q_=wc(),F_=Ec(),{isBlob:U_}=pn(),{BINARY_TYPES:Id,EMPTY_BUFFER:_s,GUID:H_,kForOnEventAttribute:Oc,kListener:z_,kStatusCode:W_,kWebSocket:$e,NOOP:jd}=ii(),{EventTarget:{addEventListener:$_,removeEventListener:K_}}=Rd(),{format:V_,parse:G_}=Tc(),{toBuffer:J_}=ar(),Y_=30*1e3,Dd=Symbol("kAborted"),Mc=[8,13],oi=["CONNECTING","OPEN","CLOSING","CLOSED"],X_=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,se=class i extends I_{constructor(e,t,n){super(),this._binaryType=Id[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=_s,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=i.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]),Ld(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Id.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 r=new q_({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new F_(e,this._extensions,n.generateMask);this._receiver=r,this._sender=s,this._socket=e,r[$e]=this,s[$e]=this,e[$e]=this,r.on("conclude",eS),r.on("drain",tS),r.on("error",iS),r.on("message",nS),r.on("ping",rS),r.on("pong",sS),s.onerror=oS,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",Ud),e.on("data",Es),e.on("end",Hd),e.on("error",zd),this._readyState=i.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[wi.extensionName]&&this._extensions[wi.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=i.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){vt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===i.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=i.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Fd(this)}}pause(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===i.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!==i.OPEN){Ac(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||_s,t,n)}pong(e,t,n){if(this.readyState===i.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!==i.OPEN){Ac(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||_s,t,n)}resume(){this.readyState===i.CONNECTING||this.readyState===i.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===i.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!==i.OPEN){Ac(this,e,n);return}let r={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[wi.extensionName]||(r.compress=!1),this._sender.send(e||_s,r,n)}terminate(){if(this.readyState!==i.CLOSED){if(this.readyState===i.CONNECTING){vt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=i.CLOSING,this._socket.destroy())}}};Object.defineProperty(se,"CONNECTING",{enumerable:!0,value:oi.indexOf("CONNECTING")});Object.defineProperty(se.prototype,"CONNECTING",{enumerable:!0,value:oi.indexOf("CONNECTING")});Object.defineProperty(se,"OPEN",{enumerable:!0,value:oi.indexOf("OPEN")});Object.defineProperty(se.prototype,"OPEN",{enumerable:!0,value:oi.indexOf("OPEN")});Object.defineProperty(se,"CLOSING",{enumerable:!0,value:oi.indexOf("CLOSING")});Object.defineProperty(se.prototype,"CLOSING",{enumerable:!0,value:oi.indexOf("CLOSING")});Object.defineProperty(se,"CLOSED",{enumerable:!0,value:oi.indexOf("CLOSED")});Object.defineProperty(se.prototype,"CLOSED",{enumerable:!0,value:oi.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(i=>{Object.defineProperty(se.prototype,i,{enumerable:!0})});["open","error","close","message"].forEach(i=>{Object.defineProperty(se.prototype,`on${i}`,{enumerable:!0,get(){for(let e of this.listeners(i))if(e[Oc])return e[z_];return null},set(e){for(let t of this.listeners(i))if(t[Oc]){this.removeListener(i,t);break}typeof e=="function"&&this.addEventListener(i,e,{[Oc]:!0})}})});se.prototype.addEventListener=$_;se.prototype.removeEventListener=K_;Wd.exports=se;function Ld(i,e,t,n){let r={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Mc[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(i._autoPong=r.autoPong,!Mc.includes(r.protocolVersion))throw new RangeError(`Unsupported protocol version: ${r.protocolVersion} (supported versions: ${Mc.join(", ")})`);let s;if(e instanceof kc)s=e;else try{s=new kc(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),i._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",l;if(s.protocol!=="ws:"&&!o&&!a?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?l="The URL's pathname is empty":s.hash&&(l="The URL contains a fragment identifier"),l){let T=new SyntaxError(l);if(i._redirects===0)throw T;Ss(i,T);return}let p=o?443:80,d=D_(16).toString("base64"),h=o?N_.request:B_.request,g=new Set,_;if(r.createConnection=r.createConnection||(o?Q_:Z_),r.defaultPort=r.defaultPort||p,r.port=s.port||p,r.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,r.headers={...r.headers,"Sec-WebSocket-Version":r.protocolVersion,"Sec-WebSocket-Key":d,Connection:"Upgrade",Upgrade:"websocket"},r.path=s.pathname+s.search,r.timeout=r.handshakeTimeout,r.perMessageDeflate&&(_=new wi(r.perMessageDeflate!==!0?r.perMessageDeflate:{},!1,r.maxPayload),r.headers["Sec-WebSocket-Extensions"]=V_({[wi.extensionName]:_.offer()})),t.length){for(let T of t){if(typeof T!="string"||!X_.test(T)||g.has(T))throw new SyntaxError("An invalid or duplicated subprotocol was specified");g.add(T)}r.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(r.origin&&(r.protocolVersion<13?r.headers["Sec-WebSocket-Origin"]=r.origin:r.headers.Origin=r.origin),(s.username||s.password)&&(r.auth=`${s.username}:${s.password}`),a){let T=r.path.split(":");r.socketPath=T[0],r.path=T[1]}let S;if(r.followRedirects){if(i._redirects===0){i._originalIpc=a,i._originalSecure=o,i._originalHostOrSocketPath=a?r.socketPath:s.host;let T=n&&n.headers;if(n={...n,headers:{}},T)for(let[A,P]of Object.entries(T))n.headers[A.toLowerCase()]=P}else if(i.listenerCount("redirect")===0){let T=a?i._originalIpc?r.socketPath===i._originalHostOrSocketPath:!1:i._originalIpc?!1:s.host===i._originalHostOrSocketPath;(!T||i._originalSecure&&!o)&&(delete r.headers.authorization,delete r.headers.cookie,T||delete r.headers.host,r.auth=void 0)}r.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(r.auth).toString("base64")),S=i._req=h(r),i._redirects&&i.emit("redirect",i.url,S)}else S=i._req=h(r);r.timeout&&S.on("timeout",()=>{vt(i,S,"Opening handshake has timed out")}),S.on("error",T=>{S===null||S[Dd]||(S=i._req=null,Ss(i,T))}),S.on("response",T=>{let A=T.headers.location,P=T.statusCode;if(A&&r.followRedirects&&P>=300&&P<400){if(++i._redirects>r.maxRedirects){vt(i,S,"Maximum redirects exceeded");return}S.abort();let R;try{R=new kc(A,e)}catch{let D=new SyntaxError(`Invalid URL: ${A}`);Ss(i,D);return}Ld(i,R,t,n)}else i.emit("unexpected-response",S,T)||vt(i,S,`Unexpected server response: ${T.statusCode}`)}),S.on("upgrade",(T,A,P)=>{if(i.emit("upgrade",T),i.readyState!==se.CONNECTING)return;S=i._req=null;let R=T.headers.upgrade;if(R===void 0||R.toLowerCase()!=="websocket"){vt(i,A,"Invalid Upgrade header");return}let N=L_("sha1").update(d+H_).digest("base64");if(T.headers["sec-websocket-accept"]!==N){vt(i,A,"Invalid Sec-WebSocket-Accept header");return}let D=T.headers["sec-websocket-protocol"],K;if(D!==void 0?g.size?g.has(D)||(K="Server sent an invalid subprotocol"):K="Server sent a subprotocol but none was requested":g.size&&(K="Server sent no subprotocol"),K){vt(i,A,K);return}D&&(i._protocol=D);let B=T.headers["sec-websocket-extensions"];if(B!==void 0){if(!_){vt(i,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let U;try{U=G_(B)}catch{vt(i,A,"Invalid Sec-WebSocket-Extensions header");return}let L=Object.keys(U);if(L.length!==1||L[0]!==wi.extensionName){vt(i,A,"Server indicated an extension that was not requested");return}try{_.accept(U[wi.extensionName])}catch{vt(i,A,"Invalid Sec-WebSocket-Extensions header");return}i._extensions[wi.extensionName]=_}i.setSocket(A,P,{allowSynchronousEvents:r.allowSynchronousEvents,generateMask:r.generateMask,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation})}),r.finishRequest?r.finishRequest(S,i):S.end()}function Ss(i,e){i._readyState=se.CLOSING,i._errorEmitted=!0,i.emit("error",e),i.emitClose()}function Z_(i){return i.path=i.socketPath,Bd.connect(i)}function Q_(i){return i.path=void 0,!i.servername&&i.servername!==""&&(i.servername=Bd.isIP(i.host)?"":i.host),j_.connect(i)}function vt(i,e,t){i._readyState=se.CLOSING;let n=new Error(t);Error.captureStackTrace(n,vt),e.setHeader?(e[Dd]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Ss,i,n)):(e.destroy(n),e.once("error",i.emit.bind(i,"error")),e.once("close",i.emitClose.bind(i)))}function Ac(i,e,t){if(e){let n=U_(e)?e.size:J_(e).length;i._socket?i._sender._bufferedBytes+=n:i._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${i.readyState} (${oi[i.readyState]})`);process.nextTick(t,n)}}function eS(i,e){let t=this[$e];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=i,t._socket[$e]!==void 0&&(t._socket.removeListener("data",Es),process.nextTick(qd,t._socket),i===1005?t.close():t.close(i,e))}function tS(){let i=this[$e];i.isPaused||i._socket.resume()}function iS(i){let e=this[$e];e._socket[$e]!==void 0&&(e._socket.removeListener("data",Es),process.nextTick(qd,e._socket),e.close(i[W_])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i))}function Nd(){this[$e].emitClose()}function nS(i,e){this[$e].emit("message",i,e)}function rS(i){let e=this[$e];e._autoPong&&e.pong(i,!this._isServer,jd),e.emit("ping",i)}function sS(i){this[$e].emit("pong",i)}function qd(i){i.resume()}function oS(i){let e=this[$e];e.readyState!==se.CLOSED&&(e.readyState===se.OPEN&&(e._readyState=se.CLOSING,Fd(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",i)))}function Fd(i){i._closeTimer=setTimeout(i._socket.destroy.bind(i._socket),Y_)}function Ud(){let i=this[$e];this.removeListener("close",Ud),this.removeListener("data",Es),this.removeListener("end",Hd),i._readyState=se.CLOSING;let e;!this._readableState.endEmitted&&!i._closeFrameReceived&&!i._receiver._writableState.errorEmitted&&(e=i._socket.read())!==null&&i._receiver.write(e),i._receiver.end(),this[$e]=void 0,clearTimeout(i._closeTimer),i._receiver._writableState.finished||i._receiver._writableState.errorEmitted?i.emitClose():(i._receiver.on("error",Nd),i._receiver.on("finish",Nd))}function Es(i){this[$e]._receiver.write(i)||this.pause()}function Hd(){let i=this[$e];i._readyState=se.CLOSING,i._receiver.end(),this.end()}function zd(){let i=this[$e];this.removeListener("error",zd),this.on("error",jd),i&&(i._readyState=se.CLOSING,this.destroy())}});var Gd=O((dM,Vd)=>{"use strict";var fM=Cs(),{Duplex:aS}=require("stream");function $d(i){i.emit("close")}function cS(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Kd(i){this.removeListener("error",Kd),this.destroy(),this.listenerCount("error")===0&&this.emit("error",i)}function lS(i,e){let t=!0,n=new aS({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||i.pause()}),i.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),i.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(r,s){if(i.readyState===i.CLOSED){s(r),process.nextTick($d,n);return}let o=!1;i.once("error",function(l){o=!0,s(l)}),i.once("close",function(){o||s(r),process.nextTick($d,n)}),t&&i.terminate()},n._final=function(r){if(i.readyState===i.CONNECTING){i.once("open",function(){n._final(r)});return}i._socket!==null&&(i._socket._writableState.finished?(r(),n._readableState.endEmitted&&n.destroy()):(i._socket.once("finish",function(){r()}),i.close()))},n._read=function(){i.isPaused&&i.resume()},n._write=function(r,s,o){if(i.readyState===i.CONNECTING){i.once("open",function(){n._write(r,s,o)});return}i.send(r,o)},n.on("end",cS),n.on("error",Kd),n}Vd.exports=lS});var Yd=O((hM,Jd)=>{"use strict";var{tokenChars:uS}=pn();function pS(i){let e=new Set,t=-1,n=-1,r=0;for(r;r<i.length;r++){let o=i.charCodeAt(r);if(n===-1&&uS[o]===1)t===-1&&(t=r);else if(r!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=r);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${r}`);n===-1&&(n=r);let a=i.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 ${r}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=i.slice(t,r);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}Jd.exports={parse:pS}});var nh=O((vM,ih)=>{"use strict";var fS=require("events"),Ts=require("http"),{Duplex:mM}=require("stream"),{createHash:dS}=require("crypto"),Xd=Tc(),ji=lr(),hS=Yd(),mS=Cs(),{GUID:vS,kWebSocket:gS}=ii(),xS=/^[+/0-9A-Za-z]{22}==$/,Zd=0,Qd=1,th=2,Rc=class extends fS{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:mS,...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=Ts.createServer((n,r)=>{let s=Ts.STATUS_CODES[426];r.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),r.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=yS(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(r,s,o)=>{this.handleUpgrade(r,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Zd}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===th){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(dr,this);return}if(e&&this.once("close",e),this._state!==Qd)if(this._state=Qd,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(dr,this):process.nextTick(dr,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{dr(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,r){t.on("error",eh);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Di(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){Di(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!xS.test(s)){Di(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Di(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){hr(t,400);return}let l=e.headers["sec-websocket-protocol"],p=new Set;if(l!==void 0)try{p=hS.parse(l)}catch{Di(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let d=e.headers["sec-websocket-extensions"],h={};if(this.options.perMessageDeflate&&d!==void 0){let g=new ji(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let _=Xd.parse(d);_[ji.extensionName]&&(g.accept(_[ji.extensionName]),h[ji.extensionName]=g)}catch{Di(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let g={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(g,(_,S,T,A)=>{if(!_)return hr(t,S||401,T,A);this.completeUpgrade(h,s,p,e,t,n,r)});return}if(!this.options.verifyClient(g))return hr(t,401)}this.completeUpgrade(h,s,p,e,t,n,r)}completeUpgrade(e,t,n,r,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[gS])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Zd)return hr(s,503);let p=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${dS("sha1").update(t+vS).digest("base64")}`],d=new this.options.WebSocket(null,void 0,this.options);if(n.size){let h=this.options.handleProtocols?this.options.handleProtocols(n,r):n.values().next().value;h&&(p.push(`Sec-WebSocket-Protocol: ${h}`),d._protocol=h)}if(e[ji.extensionName]){let h=e[ji.extensionName].params,g=Xd.format({[ji.extensionName]:[h]});p.push(`Sec-WebSocket-Extensions: ${g}`),d._extensions=e}this.emit("headers",p,r),s.write(p.concat(`\r
10
10
  `).join(`\r
11
- `)),s.removeListener("error",Af),f.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(f),f.on("close",()=>{this.clients.delete(f),this._shouldEmitClose&&!this.clients.size&&process.nextTick(nn,this)})),c(f,n)}};Pf.exports=mc;function U_(i,e){for(let t of Object.keys(e))i.on(t,e[t]);return function(){for(let r of Object.keys(e))i.removeListener(r,e[r])}}function nn(i){i._state=Rf,i.emit("close")}function Af(){this.destroy()}function sn(i,e,t,r){t=t||hs.STATUS_CODES[e],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...r},i.once("finish",i.destroy),i.end(`HTTP/1.1 ${e} ${hs.STATUS_CODES[e]}\r
12
- `+Object.keys(r).map(n=>`${n}: ${r[n]}`).join(`\r
11
+ `)),s.removeListener("error",eh),d.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on("close",()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(dr,this)})),a(d,r)}};ih.exports=Rc;function yS(i,e){for(let t of Object.keys(e))i.on(t,e[t]);return function(){for(let n of Object.keys(e))i.removeListener(n,e[n])}}function dr(i){i._state=th,i.emit("close")}function eh(){this.destroy()}function hr(i,e,t,n){t=t||Ts.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},i.once("finish",i.destroy),i.end(`HTTP/1.1 ${e} ${Ts.STATUS_CODES[e]}\r
12
+ `+Object.keys(n).map(r=>`${r}: ${n[r]}`).join(`\r
13
13
  `)+`\r
14
14
  \r
15
- `+t)}function Ri(i,e,t,r,n,s){if(i.listenerCount("wsClientError")){let o=new Error(n);Error.captureStackTrace(o,Ri),i.emit("wsClientError",o,t,e)}else sn(t,r,n,s)}});var vc=T((AM,Nf)=>{"use strict";var ii=fs();ii.createWebSocketStream=Ef();ii.Server=Bf();ii.Receiver=sc();ii.Sender=cc();ii.WebSocket=ii;ii.WebSocketServer=ii.Server;Nf.exports=ii});var jf=T((RM,Df)=>{"use strict";var If=Object.getOwnPropertySymbols,H_=Object.prototype.hasOwnProperty,z_=Object.prototype.propertyIsEnumerable;function W_(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function $_(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var r=Object.getOwnPropertyNames(e).map(function(s){return e[s]});if(r.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(s){n[s]=s}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Df.exports=$_()?Object.assign:function(i,e){for(var t,r=W_(i),n,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)H_.call(t,o)&&(r[o]=t[o]);if(If){n=If(t);for(var c=0;c<n.length;c++)z_.call(t,n[c])&&(r[n[c]]=t[n[c]])}}return r}});var Ff=T((PM,gc)=>{"use strict";gc.exports=K_;gc.exports.append=qf;var V_=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function qf(i,e){if(typeof i!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var t=Array.isArray(e)?e:Lf(String(e)),r=0;r<t.length;r++)if(!V_.test(t[r]))throw new TypeError("field argument contains an invalid header name");if(i==="*")return i;var n=i,s=Lf(i.toLowerCase());if(t.indexOf("*")!==-1||s.indexOf("*")!==-1)return"*";for(var o=0;o<t.length;o++){var c=t[o].toLowerCase();s.indexOf(c)===-1&&(s.push(c),n=n?n+", "+t[o]:t[o])}return n}function Lf(i){for(var e=0,t=[],r=0,n=0,s=i.length;n<s;n++)switch(i.charCodeAt(n)){case 32:r===e&&(r=e=n+1);break;case 44:t.push(i.substring(r,e)),r=e=n+1;break;default:e=n+1;break}return t.push(i.substring(r,e)),t}function K_(i,e){if(!i||!i.getHeader||!i.setHeader)throw new TypeError("res argument is required");var t=i.getHeader("Vary")||"",r=Array.isArray(t)?t.join(", "):String(t);(t=qf(r,e))&&i.setHeader("Vary",t)}});var xc=T((BM,Uf)=>{(function(){"use strict";var i=jf(),e=Ff(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function r(C){return typeof C=="string"||C instanceof String}function n(C,k){if(Array.isArray(k)){for(var M=0;M<k.length;++M)if(n(C,k[M]))return!0;return!1}else return r(k)?C===k:k instanceof RegExp?k.test(C):!!k}function s(C,k){var M=k.headers.origin,O=[],A;return!C.origin||C.origin==="*"?O.push([{key:"Access-Control-Allow-Origin",value:"*"}]):r(C.origin)?(O.push([{key:"Access-Control-Allow-Origin",value:C.origin}]),O.push([{key:"Vary",value:"Origin"}])):(A=n(M,C.origin),O.push([{key:"Access-Control-Allow-Origin",value:A?M:!1}]),O.push([{key:"Vary",value:"Origin"}])),O}function o(C){var k=C.methods;return k.join&&(k=C.methods.join(",")),{key:"Access-Control-Allow-Methods",value:k}}function c(C){return C.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function u(C,k){var M=C.allowedHeaders||C.headers,O=[];return M?M.join&&(M=M.join(",")):(M=k.headers["access-control-request-headers"],O.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),M&&M.length&&O.push([{key:"Access-Control-Allow-Headers",value:M}]),O}function d(C){var k=C.exposedHeaders;if(k)k.join&&(k=k.join(","));else return null;return k&&k.length?{key:"Access-Control-Expose-Headers",value:k}:null}function f(C){var k=(typeof C.maxAge=="number"||C.maxAge)&&C.maxAge.toString();return k&&k.length?{key:"Access-Control-Max-Age",value:k}:null}function v(C,k){for(var M=0,O=C.length;M<O;M++){var A=C[M];A&&(Array.isArray(A)?v(A,k):A.key==="Vary"&&A.value?e(k,A.value):A.value&&k.setHeader(A.key,A.value))}}function _(C,k,M,O){var A=[],I=k.method&&k.method.toUpperCase&&k.method.toUpperCase();I==="OPTIONS"?(A.push(s(C,k)),A.push(c(C)),A.push(o(C)),A.push(u(C,k)),A.push(f(C)),A.push(d(C)),v(A,M),C.preflightContinue?O():(M.statusCode=C.optionsSuccessStatus,M.setHeader("Content-Length","0"),M.end())):(A.push(s(C,k)),A.push(c(C)),A.push(d(C)),v(A,M),O())}function E(C){var k=null;return typeof C=="function"?k=C:k=function(M,O){O(null,C)},function(O,A,I){k(O,function(U,Xe){if(U)I(U);else{var te=i({},t,Xe),Le=null;te.origin&&typeof te.origin=="function"?Le=te.origin:te.origin&&(Le=function(q,qe){qe(null,te.origin)}),Le?Le(O.headers.origin,function(q,qe){q||!qe?I(q):(te.origin=qe,_(te,O,A,I))}):I()}})}}Uf.exports=E})()});var bc=T(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.Server=pr.BaseServer=void 0;var Hf=ma(),ms=Ia(),G_=require("events"),zf=ja(),Y_=ie(),J_=od(),X_=vc(),Wf=Ba(),Z_=Jr(),j=(0,Y_.default)("engine"),lr=Symbol("responseHeaders");function Q_(i){try{let e=JSON.parse(i);if(typeof e.sid=="string")return e.sid}catch{}}var ur=class extends G_.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:X_.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(xc()(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?ms.default[e].upgradesTo||[]:[]}verify(e,t,r){let n=e._query.transport;if(!~this.opts.transports.indexOf(n)||n==="webtransport")return j('unknown transport "%s"',n),r(G.errors.UNKNOWN_TRANSPORT,{transport:n});if(eS(e.headers.origin)){let c=e.headers.origin;return e.headers.origin=null,j("origin header invalid"),r(G.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:c})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return j('unknown sid "%s"',o),r(G.errors.UNKNOWN_SID,{sid:o});let c=this.clients[o].transport.name;if(!t&&c!==n)return j("bad request: unexpected transport without upgrade"),r(G.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:n,previousTransport:c})}else return e.method!=="GET"?r(G.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):n==="websocket"&&!t?(j("invalid transport upgrade"),r(G.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(c,u)=>{if(!u)return r(G.errors.FORBIDDEN,{message:c});r()}):r();r()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,r){if(this.middlewares.length===0)return j("no middleware to apply, skipping"),r();let n=s=>{j("applying middleware n\xB0%d",s+1),this.middlewares[s](e,t,o=>{if(o)return r(o);s+1<this.middlewares.length?n(s+1):r()})};n(0)}close(){j("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 Hf.generateId()}async handshake(e,t,r){let n=t._query.EIO==="4"?4:3;if(n===3&&!this.opts.allowEIO3){j("unsupported protocol version"),this.emit("connection_error",{req:t,code:G.errors.UNSUPPORTED_PROTOCOL_VERSION,message:G.errorMessages[G.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:n}}),r(G.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(u){j("error while generating an id"),this.emit("connection_error",{req:t,code:G.errors.BAD_REQUEST,message:G.errorMessages[G.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:u}}),r(G.errors.BAD_REQUEST);return}j('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(u){j('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:G.errors.BAD_REQUEST,message:G.errorMessages[G.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:u}}),r(G.errors.BAD_REQUEST);return}let c=new zf.Socket(s,this,o,t,n);return o.on("headers",(u,d)=>{!d._query.sid&&(this.opts.cookie&&(u["Set-Cookie"]=[(0,J_.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",u,d)),this.emit("headers",u,d)}),o.onRequest(t),this.clients[s]=c,this.clientsCount++,c.once("close",()=>{delete this.clients[s],this.clientsCount--}),this.emit("connection",c),o}async onWebTransportSession(e){let t=setTimeout(()=>{j("the client failed to establish a bidirectional stream in the given period"),e.close()},this.opts.upgradeTimeout),n=await e.incomingBidirectionalStreams.getReader().read();if(n.done){j("session is closed");return}let s=n.value,o=(0,Z_.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),c=s.readable.pipeThrough(o).getReader(),{value:u,done:d}=await c.read();if(d){j("stream is closed");return}if(clearTimeout(t),u.type!=="open")return j("invalid WebTransport handshake"),e.close();if(u.data===void 0){let _=new Wf.WebTransport(e,s,c),E=Hf.generateId();j('handshaking client "%s" (WebTransport)',E);let C=new zf.Socket(E,this,_,null,4);this.clients[E]=C,this.clientsCount++,C.once("close",()=>{delete this.clients[E],this.clientsCount--}),this.emit("connection",C);return}let f=Q_(u.data);if(!f)return j("invalid WebTransport handshake"),e.close();let v=this.clients[f];if(!v)j("upgrade attempt for closed client"),e.close();else if(v.upgrading)j("transport has already been trying to upgrade"),e.close();else if(v.upgraded)j("transport had already been upgraded"),e.close();else{j("upgrading existing transport");let _=new Wf.WebTransport(e,s,c);v._maybeUpgrade(_)}}};pr.BaseServer=ur;ur.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};ur.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var yc=class{constructor(e,t){this.req=e,this.socket=t,e[lr]={}}setHeader(e,t){this.req[lr][e]=t}getHeader(e){return this.req[lr][e]}removeHeader(e){delete this.req[lr][e]}write(){}writeHead(){}end(){this.socket.destroy()}},G=class i extends ur{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 r=t[lr]||{};delete t[lr],!t._query.sid&&this.emit("initial_headers",r,t),this.emit("headers",r,t),j("writing headers: %j",r),Object.keys(r).forEach(s=>{e.push(`${s}: ${r[s]}`)})}))}cleanup(){this.ws&&(j("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 ms.default[e](t)}handleRequest(e,t){j('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let r=(n,s)=>{if(n!==void 0){this.emit("connection_error",{req:e,code:n,message:i.errorMessages[n],context:s}),$f(t,n,s);return}if(e._query.sid)j("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(c,u)=>$f(t,c,u);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,n=>{n?r(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,r)})}handleUpgrade(e,t,r){this.prepare(e);let n=new yc(e,t),s=(o,c)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:i.errorMessages[o],context:c}),Vf(t,o,c);return}let u=Buffer.from(r);r=null,n.writeHead(),this.ws.handleUpgrade(e,t,u,d=>{this.onWebSocket(e,t,d)})};this._applyMiddlewares(e,n,o=>{o?s(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,s)})}onWebSocket(e,t,r){if(r.on("error",s),ms.default[e._query.transport]!==void 0&&!ms.default[e._query.transport].prototype.handlesUpgrades){j("transport doesnt handle upgraded requests"),r.close();return}let n=e._query.sid;if(e.websocket=r,n){let o=this.clients[n];if(!o)j("upgrade attempt for closed client"),r.close();else if(o.upgrading)j("transport has already been trying to upgrade"),r.close();else if(o.upgraded)j("transport had already been upgraded"),r.close();else{j("upgrading existing transport"),r.removeListener("error",s);let c=this.createTransport(e._query.transport,e);c.perMessageDeflate=this.opts.perMessageDeflate,o._maybeUpgrade(c)}}else{let o=(c,u)=>Vf(t,c,u);this.handshake(e._query.transport,e,o)}function s(){j("websocket error before upgrade")}}attach(e,t={}){let r=this._computePath(t),n=t.destroyUpgradeTimeout||1e3;function s(c){return r===c.url.slice(0,r.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",(c,u)=>{if(s(c))j('intercepting request for path "%s"',r),this.handleRequest(c,u);else{let d=0,f=o.length;for(;d<f;d++)o[d].call(e,c,u)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(c,u,d)=>{s(c)?this.handleUpgrade(c,u,d):t.destroyUpgrade!==!1&&setTimeout(function(){if(u.writable&&u.bytesWritten<=0)return u.on("error",f=>{j("error while destroying upgrade: %s",f.message)}),u.end()},n)})}};pr.Server=G;function $f(i,e,t){let r=e===G.errors.FORBIDDEN?403:400,n=t&&t.message?t.message:G.errorMessages[e];i.writeHead(r,{"Content-Type":"application/json"}),i.end(JSON.stringify({code:e,message:n}))}function Vf(i,e,t={}){if(i.on("error",()=>{j("ignoring error from closed connection")}),i.writable){let r=t.message||G.errorMessages[e],n=Buffer.byteLength(r);i.write(`HTTP/1.1 400 Bad Request\r
15
+ `+t)}function Di(i,e,t,n,r,s){if(i.listenerCount("wsClientError")){let o=new Error(r);Error.captureStackTrace(o,Di),i.emit("wsClientError",o,t,e)}else hr(t,n,r,s)}});var Pc=O((gM,rh)=>{"use strict";var ai=Cs();ai.createWebSocketStream=Gd();ai.Server=nh();ai.Receiver=wc();ai.Sender=Ec();ai.WebSocket=ai;ai.WebSocketServer=ai.Server;rh.exports=ai});var ah=O((xM,oh)=>{"use strict";var sh=Object.getOwnPropertySymbols,bS=Object.prototype.hasOwnProperty,wS=Object.prototype.propertyIsEnumerable;function _S(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function SS(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[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 r={};return"abcdefghijklmnopqrst".split("").forEach(function(s){r[s]=s}),Object.keys(Object.assign({},r)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}oh.exports=SS()?Object.assign:function(i,e){for(var t,n=_S(i),r,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)bS.call(t,o)&&(n[o]=t[o]);if(sh){r=sh(t);for(var a=0;a<r.length;a++)wS.call(t,r[a])&&(n[r[a]]=t[r[a]])}}return n}});var uh=O((yM,Ic)=>{"use strict";Ic.exports=CS;Ic.exports.append=lh;var ES=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function lh(i,e){if(typeof i!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var t=Array.isArray(e)?e:ch(String(e)),n=0;n<t.length;n++)if(!ES.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(i==="*")return i;var r=i,s=ch(i.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),r=r?r+", "+t[o]:t[o])}return r}function ch(i){for(var e=0,t=[],n=0,r=0,s=i.length;r<s;r++)switch(i.charCodeAt(r)){case 32:n===e&&(n=e=r+1);break;case 44:t.push(i.substring(n,e)),n=e=r+1;break;default:e=r+1;break}return t.push(i.substring(n,e)),t}function CS(i,e){if(!i||!i.getHeader||!i.setHeader)throw new TypeError("res argument is required");var t=i.getHeader("Vary")||"",n=Array.isArray(t)?t.join(", "):String(t);(t=lh(n,e))&&i.setHeader("Vary",t)}});var Nc=O((bM,ph)=>{(function(){"use strict";var i=ah(),e=uh(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(S){return typeof S=="string"||S instanceof String}function r(S,T){if(Array.isArray(T)){for(var A=0;A<T.length;++A)if(r(S,T[A]))return!0;return!1}else return n(T)?S===T:T instanceof RegExp?T.test(S):!!T}function s(S,T){var A=T.headers.origin,P=[],R;return!S.origin||S.origin==="*"?P.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(S.origin)?(P.push([{key:"Access-Control-Allow-Origin",value:S.origin}]),P.push([{key:"Vary",value:"Origin"}])):(R=r(A,S.origin),P.push([{key:"Access-Control-Allow-Origin",value:R?A:!1}]),P.push([{key:"Vary",value:"Origin"}])),P}function o(S){var T=S.methods;return T.join&&(T=S.methods.join(",")),{key:"Access-Control-Allow-Methods",value:T}}function a(S){return S.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function l(S,T){var A=S.allowedHeaders||S.headers,P=[];return A?A.join&&(A=A.join(",")):(A=T.headers["access-control-request-headers"],P.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),A&&A.length&&P.push([{key:"Access-Control-Allow-Headers",value:A}]),P}function p(S){var T=S.exposedHeaders;if(T)T.join&&(T=T.join(","));else return null;return T&&T.length?{key:"Access-Control-Expose-Headers",value:T}:null}function d(S){var T=(typeof S.maxAge=="number"||S.maxAge)&&S.maxAge.toString();return T&&T.length?{key:"Access-Control-Max-Age",value:T}:null}function h(S,T){for(var A=0,P=S.length;A<P;A++){var R=S[A];R&&(Array.isArray(R)?h(R,T):R.key==="Vary"&&R.value?e(T,R.value):R.value&&T.setHeader(R.key,R.value))}}function g(S,T,A,P){var R=[],N=T.method&&T.method.toUpperCase&&T.method.toUpperCase();N==="OPTIONS"?(R.push(s(S,T)),R.push(a(S)),R.push(o(S)),R.push(l(S,T)),R.push(d(S)),R.push(p(S)),h(R,A),S.preflightContinue?P():(A.statusCode=S.optionsSuccessStatus,A.setHeader("Content-Length","0"),A.end())):(R.push(s(S,T)),R.push(a(S)),R.push(p(S)),h(R,A),P())}function _(S){var T=null;return typeof S=="function"?T=S:T=function(A,P){P(null,S)},function(P,R,N){T(P,function(D,K){if(D)N(D);else{var B=i({},t,K),U=null;B.origin&&typeof B.origin=="function"?U=B.origin:B.origin&&(U=function(L,$){$(null,B.origin)}),U?U(P.headers.origin,function(L,$){L||!$?N(L):(B.origin=$,g(B,P,R,N))}):N()}})}}ph.exports=_})()});var jc=O(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.Server=xn.BaseServer=void 0;var fh=Ra(),ks=Xa(),TS=require("events"),dh=Qa(),kS=ue(),OS=Rf(),MS=Pc(),hh=Ja(),AS=or(),W=(0,kS.default)("engine"),vn=Symbol("responseHeaders");function RS(i){try{let e=JSON.parse(i);if(typeof e.sid=="string")return e.sid}catch{}}var gn=class extends TS.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:MS.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(Nc()(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?ks.default[e].upgradesTo||[]:[]}verify(e,t,n){let r=e._query.transport;if(!~this.opts.transports.indexOf(r)||r==="webtransport")return W('unknown transport "%s"',r),n(ne.errors.UNKNOWN_TRANSPORT,{transport:r});if(PS(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,W("origin header invalid"),n(ne.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return W('unknown sid "%s"',o),n(ne.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==r)return W("bad request: unexpected transport without upgrade"),n(ne.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:r,previousTransport:a})}else return e.method!=="GET"?n(ne.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):r==="websocket"&&!t?(W("invalid transport upgrade"),n(ne.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,l)=>{if(!l)return n(ne.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return W("no middleware to apply, skipping"),n();let r=s=>{W("applying middleware n\xB0%d",s+1),this.middlewares[s](e,t,o=>{if(o)return n(o);s+1<this.middlewares.length?r(s+1):n()})};r(0)}close(){W("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 fh.generateId()}async handshake(e,t,n){let r=t._query.EIO==="4"?4:3;if(r===3&&!this.opts.allowEIO3){W("unsupported protocol version"),this.emit("connection_error",{req:t,code:ne.errors.UNSUPPORTED_PROTOCOL_VERSION,message:ne.errorMessages[ne.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:r}}),n(ne.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(l){W("error while generating an id"),this.emit("connection_error",{req:t,code:ne.errors.BAD_REQUEST,message:ne.errorMessages[ne.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:l}}),n(ne.errors.BAD_REQUEST);return}W('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(l){W('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:ne.errors.BAD_REQUEST,message:ne.errorMessages[ne.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:l}}),n(ne.errors.BAD_REQUEST);return}let a=new dh.Socket(s,this,o,t,r);return o.on("headers",(l,p)=>{!p._query.sid&&(this.opts.cookie&&(l["Set-Cookie"]=[(0,OS.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",l,p)),this.emit("headers",l,p)}),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(()=>{W("the client failed to establish a bidirectional stream in the given period"),e.close()},this.opts.upgradeTimeout),r=await e.incomingBidirectionalStreams.getReader().read();if(r.done){W("session is closed");return}let s=r.value,o=(0,AS.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=s.readable.pipeThrough(o).getReader(),{value:l,done:p}=await a.read();if(p){W("stream is closed");return}if(clearTimeout(t),l.type!=="open")return W("invalid WebTransport handshake"),e.close();if(l.data===void 0){let g=new hh.WebTransport(e,s,a),_=fh.generateId();W('handshaking client "%s" (WebTransport)',_);let S=new dh.Socket(_,this,g,null,4);this.clients[_]=S,this.clientsCount++,S.once("close",()=>{delete this.clients[_],this.clientsCount--}),this.emit("connection",S);return}let d=RS(l.data);if(!d)return W("invalid WebTransport handshake"),e.close();let h=this.clients[d];if(!h)W("upgrade attempt for closed client"),e.close();else if(h.upgrading)W("transport has already been trying to upgrade"),e.close();else if(h.upgraded)W("transport had already been upgraded"),e.close();else{W("upgrading existing transport");let g=new hh.WebTransport(e,s,a);h._maybeUpgrade(g)}}};xn.BaseServer=gn;gn.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};gn.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var Bc=class{constructor(e,t){this.req=e,this.socket=t,e[vn]={}}setHeader(e,t){this.req[vn][e]=t}getHeader(e){return this.req[vn][e]}removeHeader(e){delete this.req[vn][e]}write(){}writeHead(){}end(){this.socket.destroy()}},ne=class i extends gn{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[vn]||{};delete t[vn],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),W("writing headers: %j",n),Object.keys(n).forEach(s=>{e.push(`${s}: ${n[s]}`)})}))}cleanup(){this.ws&&(W("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 ks.default[e](t)}handleRequest(e,t){W('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let n=(r,s)=>{if(r!==void 0){this.emit("connection_error",{req:e,code:r,message:i.errorMessages[r],context:s}),mh(t,r,s);return}if(e._query.sid)W("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,l)=>mh(t,a,l);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,r=>{r?n(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,n)})}handleUpgrade(e,t,n){this.prepare(e);let r=new Bc(e,t),s=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:i.errorMessages[o],context:a}),vh(t,o,a);return}let l=Buffer.from(n);n=null,r.writeHead(),this.ws.handleUpgrade(e,t,l,p=>{this.onWebSocket(e,t,p)})};this._applyMiddlewares(e,r,o=>{o?s(i.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,s)})}onWebSocket(e,t,n){if(n.on("error",s),ks.default[e._query.transport]!==void 0&&!ks.default[e._query.transport].prototype.handlesUpgrades){W("transport doesnt handle upgraded requests"),n.close();return}let r=e._query.sid;if(e.websocket=n,r){let o=this.clients[r];if(!o)W("upgrade attempt for closed client"),n.close();else if(o.upgrading)W("transport has already been trying to upgrade"),n.close();else if(o.upgraded)W("transport had already been upgraded"),n.close();else{W("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,l)=>vh(t,a,l);this.handshake(e._query.transport,e,o)}function s(){W("websocket error before upgrade")}}attach(e,t={}){let n=this._computePath(t),r=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,l)=>{if(s(a))W('intercepting request for path "%s"',n),this.handleRequest(a,l);else{let p=0,d=o.length;for(;p<d;p++)o[p].call(e,a,l)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,l,p)=>{s(a)?this.handleUpgrade(a,l,p):t.destroyUpgrade!==!1&&setTimeout(function(){if(l.writable&&l.bytesWritten<=0)return l.on("error",d=>{W("error while destroying upgrade: %s",d.message)}),l.end()},r)})}};xn.Server=ne;function mh(i,e,t){let n=e===ne.errors.FORBIDDEN?403:400,r=t&&t.message?t.message:ne.errorMessages[e];i.writeHead(n,{"Content-Type":"application/json"}),i.end(JSON.stringify({code:e,message:r}))}function vh(i,e,t={}){if(i.on("error",()=>{W("ignoring error from closed connection")}),i.writable){let n=t.message||ne.errorMessages[e],r=Buffer.byteLength(n);i.write(`HTTP/1.1 400 Bad Request\r
16
16
  Connection: close\r
17
17
  Content-type: text/html\r
18
- Content-Length: `+n+`\r
18
+ Content-Length: `+r+`\r
19
19
  \r
20
- `+r)}i.destroy()}var on=[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 eS(i){if(i+="",i.length<1)return!1;if(!on[i.charCodeAt(0)])return j('invalid header, index 0, char "%s"',i.charCodeAt(0)),!0;if(i.length<2)return!1;if(!on[i.charCodeAt(1)])return j('invalid header, index 1, char "%s"',i.charCodeAt(1)),!0;if(i.length<3)return!1;if(!on[i.charCodeAt(2)])return j('invalid header, index 2, char "%s"',i.charCodeAt(2)),!0;if(i.length<4)return!1;if(!on[i.charCodeAt(3)])return j('invalid header, index 3, char "%s"',i.charCodeAt(3)),!0;for(let e=4;e<i.length;++e)if(!on[i.charCodeAt(e)])return j('invalid header, index "%i", char "%s"',e,i.charCodeAt(e)),!0;return!1}});var Gf=T(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.Polling=void 0;var tS=Ti(),Kf=require("zlib"),iS=jn(),rS=ie(),yt=(0,rS.default)("engine:polling"),nS={gzip:Kf.createGzip,deflate:Kf.createDeflate},wc=class extends tS.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){yt("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}yt("setting request"),this.req=e,this.res=t;let r=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},n=()=>{this.req=this.res=null};e.cleanup=n,t.onAborted(r),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(yt("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}let r=Number(e.headers["content-length"]);if(!r){this.onError("content-length header required"),t.writeStatus("411 Length Required").end();return}if(r>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,c={"Content-Type":"text/html"};this.headers(e,c);for(let d in c)t.writeHeader(d,String(c[d]));let u=d=>{this.onData(d.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((d,f)=>{let v=o+d.byteLength;if(v>r){this.onError("content-length mismatch"),t.close();return}if(!s){if(f){u(Buffer.from(d));return}s=Buffer.allocUnsafe(r)}if(Buffer.from(d).copy(s,o),f){if(v!=r){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}u(s);return}o=v})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){yt('received "%s"',e);let t=r=>{if(r.type==="close")return yt("got xhr close packet"),this.onClose(),!1;this.onPacket(r)};this.protocol===3?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(yt("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=r=>{let n=e.some(s=>s.options&&s.options.compress);this.write(r,{compress:n})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){yt('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,r){let n=typeof e=="string",o={"Content-Type":n?"text/plain; charset=UTF-8":"application/octet-stream"},c=f=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(v=>{this.res.writeHeader(v,String(o[v]))}),this.res.end(f)}),r()};if(!this.httpCompression||!t.compress){c(e);return}if((n?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){c(e);return}let d=iS(this.req).encodings(["gzip","deflate"]);if(!d){c(e);return}this.compress(e,d,(f,v)=>{if(f){this.res.writeStatus("500 Internal Server Error"),this.res.end(),r(f);return}o["Content-Encoding"]=d,c(v)})}compress(e,t,r){yt("compressing");let n=[],s=0;nS[t](this.httpCompression).on("error",r).on("data",function(o){n.push(o),s+=o.length}).on("end",function(){r(null,Buffer.concat(n,s))}).end(e)}doClose(e){yt("closing");let t,r=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(yt("transport writable - closing right away"),this.send([{type:"close"}]),r()):this.discarded?(yt("transport discarded - closing right away"),r()):(yt("transport not writable - buffering orderly close"),this.shouldClose=r,t=setTimeout(r,this.closeTimeout))}headers(e,t){t=t||{};let r=e.headers["user-agent"];return r&&(~r.indexOf(";MSIE")||~r.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};vs.Polling=wc});var Jf=T(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.WebSocket=void 0;var sS=Ti(),oS=ie(),Yf=(0,oS.default)("engine:ws"),_c=class extends sS.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 r=e[t],n=t+1===e.length,s=o=>{let c=typeof o!="string",u=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;Yf('writing "%s"',o),this.socket.send(o,c,u),n&&(this.emit("drain"),this.writable=!0,this.emit("ready"))};r.options&&typeof r.options.wsPreEncoded=="string"?s(r.options.wsPreEncoded):this.parser.encodePacket(r,this.supportsBinary,s)}}doClose(e){Yf("closing"),e&&e(),this.socket.end()}};gs.WebSocket=_c});var Xf=T(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});var aS=Gf(),cS=Jf();Sc.default={polling:aS.Polling,websocket:cS.WebSocket}});var Zf=T(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.uServer=void 0;var lS=ie(),Pi=bc(),uS=Xf(),gi=(0,lS.default)("engine:uws"),Ec=class extends Pi.BaseServer{init(){}cleanup(){}prepare(e,t){e.method=e.getMethod().toUpperCase(),e.url=e.getUrl();let r=new URLSearchParams(e.getQuery());e._query=Object.fromEntries(r.entries()),e.headers={},e.forEach((n,s)=>{e.headers[n]=s}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{gi("response has been aborted")})}createTransport(e,t){return new uS.default[e](t)}attach(e,t={}){let r=this._computePath(t);e.any(r,this.handleRequest.bind(this)).ws(r,{compression:t.compression,idleTimeout:t.idleTimeout,maxBackpressure:t.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:n=>{let s=n.getUserData().transport;s.socket=n,s.writable=!0,s.emit("ready")},message:(n,s,o)=>{n.getUserData().transport.onData(o?s:Buffer.from(s).toString())},close:(n,s,o)=>{n.getUserData().transport.onClose(s,o)}})}_applyMiddlewares(e,t,r){if(this.middlewares.length===0)return r();e.res=new Cc(t),super._applyMiddlewares(e,e.res,n=>{e.res.writeHead(),r(n)})}handleRequest(e,t){gi('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let r=(n,s)=>{if(n!==void 0){this.emit("connection_error",{req:t,code:n,message:Pi.Server.errorMessages[n],context:s}),this.abortRequest(t.res,n,s);return}if(t._query.sid)gi("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(c,u)=>this.abortRequest(e,c,u);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,n=>{n?r(Pi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,r)})}handleUpgrade(e,t,r){gi("on upgrade"),this.prepare(t,e),t.res=e;let n=async(s,o)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:Pi.Server.errorMessages[s],context:o}),this.abortRequest(e,s,o);return}let c=t._query.sid,u;if(c){let d=this.clients[c];if(d){if(d.upgrading)return gi("transport has already been trying to upgrade"),e.close();if(d.upgraded)return gi("transport had already been upgraded"),e.close();gi("upgrading existing transport"),u=this.createTransport(t._query.transport,t),d._maybeUpgrade(u)}else return gi("upgrade attempt for closed client"),e.close()}else if(u=await this.handshake(t._query.transport,t,(d,f)=>this.abortRequest(e,d,f)),!u)return;t.res.writeStatus("101 Switching Protocols"),e.upgrade({transport:u},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),r)};this._applyMiddlewares(t,e,s=>{s?n(Pi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,n)})}abortRequest(e,t,r){let n=t===Pi.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=r&&r.message?r.message:Pi.Server.errorMessages[t];e.writeStatus(n),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};xs.uServer=Ec;var Cc=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(r=>{this.writeHeader(e,r)}):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 ih=T(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.protocol=We.Transport=We.Socket=We.uServer=We.parser=We.transports=We.Server=void 0;We.listen=vS;We.attach=th;var pS=require("http"),Qf=bc();Object.defineProperty(We,"Server",{enumerable:!0,get:function(){return Qf.Server}});var dS=Ia();We.transports=dS.default;var eh=Jr();We.parser=eh;var fS=Zf();Object.defineProperty(We,"uServer",{enumerable:!0,get:function(){return fS.uServer}});var hS=ja();Object.defineProperty(We,"Socket",{enumerable:!0,get:function(){return hS.Socket}});var mS=Ti();Object.defineProperty(We,"Transport",{enumerable:!0,get:function(){return mS.Transport}});We.protocol=eh.protocol;function vS(i,e,t){typeof e=="function"&&(t=e,e={});let r=(0,pS.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),n=th(r,e);return n.httpServer=r,r.listen(i,t),n}function th(i,e){let t=new Qf.Server(e);return t.attach(i,e),t}});var nh=T(rh=>{rh.Emitter=Ze;function Ze(i){if(i)return gS(i)}function gS(i){for(var e in Ze.prototype)i[e]=Ze.prototype[e];return i}Ze.prototype.on=Ze.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this};Ze.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return t.fn=e,this.on(i,t),this};Ze.prototype.off=Ze.prototype.removeListener=Ze.prototype.removeAllListeners=Ze.prototype.removeEventListener=function(i,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+i];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var r,n=0;n<t.length;n++)if(r=t[n],r===e||r.fn===e){t.splice(n,1);break}return t.length===0&&delete this._callbacks["$"+i],this};Ze.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(t){t=t.slice(0);for(var r=0,n=t.length;r<n;++r)t[r].apply(this,e)}return this};Ze.prototype.emitReserved=Ze.prototype.emit;Ze.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};Ze.prototype.hasListeners=function(i){return!!this.listeners(i).length}});var Tc=T(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.isBinary=oh;bs.hasBinary=ys;var xS=typeof ArrayBuffer=="function",yS=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,sh=Object.prototype.toString,bS=typeof Blob=="function"||typeof Blob<"u"&&sh.call(Blob)==="[object BlobConstructor]",wS=typeof File=="function"||typeof File<"u"&&sh.call(File)==="[object FileConstructor]";function oh(i){return xS&&(i instanceof ArrayBuffer||yS(i))||bS&&i instanceof Blob||wS&&i instanceof File}function ys(i,e){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let t=0,r=i.length;t<r;t++)if(ys(i[t]))return!0;return!1}if(oh(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return ys(i.toJSON(),!0);for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&ys(i[t]))return!0;return!1}});var ah=T(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.deconstructPacket=SS;ws.reconstructPacket=ES;var _S=Tc();function SS(i){let e=[],t=i.data,r=i;return r.data=kc(t,e),r.attachments=e.length,{packet:r,buffers:e}}function kc(i,e){if(!i)return i;if((0,_S.isBinary)(i)){let t={_placeholder:!0,num:e.length};return e.push(i),t}else if(Array.isArray(i)){let t=new Array(i.length);for(let r=0;r<i.length;r++)t[r]=kc(i[r],e);return t}else if(typeof i=="object"&&!(i instanceof Date)){let t={};for(let r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=kc(i[r],e));return t}return i}function ES(i,e){return i.data=Mc(i.data,e),delete i.attachments,i}function Mc(i,e){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<e.length)return e[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let t=0;t<i.length;t++)i[t]=Mc(i[t],e);else if(typeof i=="object")for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[t]=Mc(i[t],e));return i}});var an=T(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.Decoder=Bt.Encoder=Bt.PacketType=Bt.protocol=void 0;Bt.isPacketValid=RS;var CS=nh(),ch=ah(),lh=Tc(),TS=ie(),Oc=(0,TS.default)("socket.io-parser"),uh=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Bt.protocol=5;var z;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(z||(Bt.PacketType=z={}));var Ac=class{constructor(e){this.replacer=e}encode(e){return Oc("encoding packet %j",e),(e.type===z.EVENT||e.type===z.ACK)&&(0,lh.hasBinary)(e)?this.encodeAsBinary({type:e.type===z.EVENT?z.BINARY_EVENT:z.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===z.BINARY_EVENT||e.type===z.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)),Oc("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,ch.deconstructPacket)(e),r=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(r),n}};Bt.Encoder=Ac;var Rc=class i extends CS.Emitter{constructor(e){super(),this.reviver=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 r=t.type===z.BINARY_EVENT;r||t.type===z.BINARY_ACK?(t.type=r?z.EVENT:z.ACK,this.reconstructor=new Pc(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,lh.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,r={type:Number(e.charAt(0))};if(z[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===z.BINARY_EVENT||r.type===z.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");r.attachments=Number(o)}if(e.charAt(t+1)==="/"){let s=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););r.nsp=e.substring(s,t)}else r.nsp="/";let n=e.charAt(t+1);if(n!==""&&Number(n)==n){let s=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}r.id=Number(e.substring(s,t+1))}if(e.charAt(++t)){let s=this.tryParse(e.substr(t));if(i.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return Oc("decoded %s as %j",e,r),r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case z.CONNECT:return _s(t);case z.DISCONNECT:return t===void 0;case z.CONNECT_ERROR:return typeof t=="string"||_s(t);case z.EVENT:case z.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&uh.indexOf(t[0])===-1);case z.ACK:case z.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Bt.Decoder=Rc;var Pc=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,ch.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function kS(i){return typeof i=="string"}var MS=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function OS(i){return i===void 0||MS(i)}function _s(i){return Object.prototype.toString.call(i)==="[object Object]"}function AS(i,e){switch(i){case z.CONNECT:return e===void 0||_s(e);case z.DISCONNECT:return e===void 0;case z.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&uh.indexOf(e[0])===-1);case z.ACK:return Array.isArray(e);case z.CONNECT_ERROR:return typeof e=="string"||_s(e);default:return!1}}function RS(i){return kS(i.nsp)&&OS(i.id)&&AS(i.type,i.data)}});var ph=T(dr=>{"use strict";var PS=dr&&dr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(dr,"__esModule",{value:!0});dr.Client=void 0;var Ss=an(),BS=PS(ie()),Nt=(0,BS.default)("socket.io:client"),Bc=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?(Nt("no namespace joined yet, close the client"),this.close()):Nt("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Nt("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,r=>{r?this.doConnect(e,t):(Nt("creation of namespace %s was denied",e),this._packet({type:Ss.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))})}doConnect(e,t){let r=this.server.of(e);r._add(this,t,n=>{this.sockets.set(n.id,n),this.nsps.set(r.name,n),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 Nt("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Nt("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Nt("ignoring packet write %j",e);return}let r=t.preEncoded?e:this.encoder.encode(e);this.writeToEngine(r,t)}writeToEngine(e,t){if(t.volatile&&!this.conn.transport.writable){Nt("volatile packet is discarded since the transport is not currently writable");return}let r=Array.isArray(e)?e:[e];for(let n of r)this.conn.write(n,t)}ondata(e){try{this.decoder.add(e)}catch(t){Nt("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:r}=this._parseNamespace(e),n=this.nsps.get(t);!n&&e.type===Ss.PacketType.CONNECT?this.connect(t,r):n&&e.type!==Ss.PacketType.CONNECT&&e.type!==Ss.PacketType.CONNECT_ERROR?process.nextTick(function(){n._onpacket(e)}):(Nt("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){Nt("client close with reason %s",e),this.destroy();for(let r of this.sockets.values())r._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)}};dr.Client=Bc});var Cs=T(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.StrictEventEmitter=void 0;var NS=require("events"),Nc=class extends NS.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)}};Es.StrictEventEmitter=Nc});var Ic=T(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.RESERVED_EVENTS=void 0;Ts.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var Dc=T(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.RemoteSocket=fr.BroadcastOperator=void 0;var IS=Ic(),DS=an(),ks=class i{constructor(e,t=new Set,r=new Set,n={}){this.adapter=e,this.rooms=t,this.exceptRooms=r,this.flags=n}to(e){let t=new Set(this.rooms);return Array.isArray(e)?e.forEach(r=>t.add(r)):t.add(e),new i(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(r=>t.add(r)):t.add(e),new i(this.adapter,this.rooms,t,this.flags)}compress(e){let t=Object.assign({},this.flags,{compress:e});return new i(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){let e=Object.assign({},this.flags,{volatile:!0});return new i(this.adapter,this.rooms,this.exceptRooms,e)}get local(){let e=Object.assign({},this.flags,{local:!0});return new i(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){let t=Object.assign({},this.flags,{timeout:e});return new i(this.adapter,this.rooms,this.exceptRooms,t)}emit(e,...t){if(IS.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let r=[e,...t],n={type:DS.PacketType.EVENT,data:r};if(!(typeof r[r.length-1]=="function"))return this.adapter.broadcast(n,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=r.pop(),c=!1,u=[],d=setTimeout(()=>{c=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:u])},this.flags.timeout),f=-1,v=0,_=0,E=()=>{!c&&f===v&&u.length===_&&(clearTimeout(d),o.apply(this,[null,this.flags.expectSingleResponse?u[0]:u]))};return this.adapter.broadcastWithAck(n,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},C=>{_+=C,v++,E()},C=>{u.push(C),E()}),this.adapter.serverCount().then(C=>{f=C,E()}),!0}emitWithAck(e,...t){return new Promise((r,n)=>{t.push((s,o)=>s?(s.responses=o,n(s)):r(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 Ms(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)}};fr.BroadcastOperator=ks;var Ms=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 ks(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}};fr.RemoteSocket=Ms});var Lc=T(hr=>{"use strict";var hh=hr&&hr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(hr,"__esModule",{value:!0});hr.Socket=void 0;var bt=an(),jS=hh(ie()),LS=Cs(),dh=hh(ma()),qS=Dc(),FS=Ic(),Ke=(0,jS.default)("socket.io:socket"),US=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function fh(){}var jc=class extends LS.StrictEventEmitter{constructor(e,t,r,n){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,n?(this.id=n.sid,this.pid=n.pid,n.rooms.forEach(s=>this.join(s)),this.data=n.data,n.missedPackets.forEach(s=>{this.packet({type:bt.PacketType.EVENT,data:s})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=dh.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=dh.default.generateId())),this.handshake=this.buildHandshake(r),this.on("error",fh)}buildHandshake(e){var t,r,n,s;return{headers:((t=this.request)===null||t===void 0?void 0:t.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!(!((r=this.request)===null||r===void 0)&&r.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(n=this.request)===null||n===void 0?void 0:n.url,query:((s=this.request)===null||s===void 0?void 0:s._query)||{},auth:e}}emit(e,...t){if(FS.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let r=[e,...t],n={type:bt.PacketType.EVENT,data:r};if(typeof r[r.length-1]=="function"){let o=this.nsp._ids++;Ke("emitting packet with ack id %d",o),this.registerAckCallback(o,r.pop()),n.id=o}let s=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(n,{rooms:new Set([this.id]),except:new Set,flags:s}):(this.notifyOutgoingListeners(n),this.packet(n,s)),!0}emitWithAck(e,...t){let r=this.flags.timeout!==void 0;return new Promise((n,s)=>{t.push((o,c)=>r?o?s(o):n(c):n(o)),this.emit(e,...t)})}registerAckCallback(e,t){let r=this.flags.timeout;if(r===void 0){this.acks.set(e,t);return}let n=setTimeout(()=>{Ke("event with ack id %d has timed out after %d ms",e,r),this.acks.delete(e),t.call(this,new Error("operation has timed out"))},r);this.acks.set(e,(...s)=>{clearTimeout(n),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 Ke("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return Ke("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){Ke("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:bt.PacketType.CONNECT}):this.packet({type:bt.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(Ke("got packet %j",e),e.type){case bt.PacketType.EVENT:this.onevent(e);break;case bt.PacketType.BINARY_EVENT:this.onevent(e);break;case bt.PacketType.ACK:this.onack(e);break;case bt.PacketType.BINARY_ACK:this.onack(e);break;case bt.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(Ke("emitting event %j",t),e.id!=null&&(Ke("attaching ack callback to event"),t.push(this.ack(e.id))),this._anyListeners&&this._anyListeners.length){let r=this._anyListeners.slice();for(let n of r)n.apply(this,t)}this.dispatch(t)}ack(e){let t=this,r=!1;return function(){if(r)return;let n=Array.prototype.slice.call(arguments);Ke("sending ack %j",n),t.packet({id:e,type:bt.PacketType.ACK,data:n}),r=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(Ke("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):Ke("bad ack %s",e.id)}ondisconnect(){Ke("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;Ke("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&US.has(e)&&(Ke("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=fh}_error(e){this.packet({type:bt.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:bt.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){Ke("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):Ke("ignore packet received after disconnection")})})}use(e){return this.fns.push(e),this}run(e,t){if(!this.fns.length)return t();let r=this.fns.slice(0);function n(s){r[s](e,o=>{if(o)return t(o);if(!r[s+1])return t();n(s+1)})}n(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 r=0;r<t.length;r++)if(e===t[r])return t.splice(r,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 r=0;r<t.length;r++)if(e===t[r])return t.splice(r,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 r of t)r.apply(this,e.data)}}newBroadcastOperator(){let e=Object.assign({},this.flags);return this.flags={},new qS.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};hr.Socket=jc});var Fc=T(ri=>{"use strict";var HS=ri&&ri.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ri,"__esModule",{value:!0});ri.Namespace=ri.RESERVED_EVENTS=void 0;var mh=Lc(),zS=Cs(),WS=HS(ie()),dt=Dc(),mr=(0,WS.default)("socket.io:namespace");ri.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var qc=class extends zS.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=>{mr("error while initializing adapter: %s",e)})}use(e){return this._fns.push(e),this}run(e,t){if(!this._fns.length)return t();let r=this._fns.slice(0);function n(s){r[s](e,o=>{if(o)return t(o);if(!r[s+1])return t();n(s+1)})}n(0)}to(e){return new dt.BroadcastOperator(this.adapter).to(e)}in(e){return new dt.BroadcastOperator(this.adapter).in(e)}except(e){return new dt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,r){var n;mr("adding socket to nsp %s",this.name);let s=await this._createSocket(e,t);if(this._preConnectSockets.set(s.id,s),!((n=this.server.opts.connectionStateRecovery)===null||n===void 0)&&n.skipMiddlewares&&s.recovered&&e.conn.readyState==="open")return this._doConnect(s,r);this.run(s,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){mr("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return mr("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,r)})})}async _createSocket(e,t){let r=t.pid,n=t.offset;if(this.server.opts.connectionStateRecovery&&typeof r=="string"&&typeof n=="string"){let s;try{s=await this.adapter.restoreSession(r,n)}catch(o){mr("error while restoring session: %s",o)}if(s)return mr("connection state recovered for sid %s",s.sid),new mh.Socket(this,e,t,s)}return new mh.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 dt.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(ri.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((r,n)=>{t.push((s,o)=>s?(s.responses=o,n(s)):r(o)),this.serverSideEmit(e,...t)})}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new dt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new dt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new dt.BroadcastOperator(this.adapter).volatile}get local(){return new dt.BroadcastOperator(this.adapter).local}timeout(e){return new dt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new dt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new dt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new dt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new dt.BroadcastOperator(this.adapter).disconnectSockets(e)}};ri.Namespace=qc});var bh=T(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.encode=Uc;cn.decode=$S;cn.yeast=VS;var xh="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Os=64,yh={},vh=0,xi=0,gh;function Uc(i){let e="";do e=xh[i%Os]+e,i=Math.floor(i/Os);while(i>0);return e}function $S(i){let e=0;for(xi=0;xi<i.length;xi++)e=e*Os+yh[i.charAt(xi)];return e}function VS(){let i=Uc(+new Date);return i!==gh?(vh=0,gh=i):i+"."+Uc(vh++)}for(;xi<Os;xi++)yh[xh[xi]]=xi});var Wc=T(vr=>{"use strict";var Hc;Object.defineProperty(vr,"__esModule",{value:!0});vr.SessionAwareAdapter=vr.Adapter=void 0;var KS=require("events"),GS=bh(),As=vc(),YS=typeof((Hc=As?.Sender)===null||Hc===void 0?void 0:Hc.frame)=="function",Rs=class extends KS.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 r of t)this.sids.get(e).add(r),this.rooms.has(r)||(this.rooms.set(r,new Set),this.emit("create-room",r)),this.rooms.get(r).has(e)||(this.rooms.get(r).add(e),this.emit("join-room",r,e))}del(e,t){this.sids.has(e)&&this.sids.get(e).delete(t),this._del(t,e)}_del(e,t){let r=this.rooms.get(e);r!=null&&(r.delete(t)&&this.emit("leave-room",e,t),r.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 r=t.flags||{},n={preEncoded:!0,volatile:r.volatile,compress:r.compress};e.nsp=this.nsp.name;let s=this._encode(e,n);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(s,n)})}broadcastWithAck(e,t,r,n){let s=t.flags||{},o={preEncoded:!0,volatile:s.volatile,compress:s.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let c=this._encode(e,o),u=0;this.apply(t,d=>{u++,d.acks.set(e.id,n),typeof d.notifyOutgoingListeners=="function"&&d.notifyOutgoingListeners(e),d.client.writeToEngine(c,o)}),r(u)}_encode(e,t){let r=this.encoder.encode(e);if(YS&&r.length===1&&typeof r[0]=="string"){let n=Buffer.from("4"+r[0]);t.wsPreEncodedFrame=As.Sender.frame(n,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return r}sockets(e){let t=new Set;return this.apply({rooms:e},r=>{t.add(r.id)}),Promise.resolve(t)}socketRooms(e){return this.sids.get(e)}fetchSockets(e){let t=[];return this.apply(e,r=>{t.push(r)}),Promise.resolve(t)}addSockets(e,t){this.apply(e,r=>{r.join(t)})}delSockets(e,t){this.apply(e,r=>{t.forEach(n=>r.leave(n))})}disconnectSockets(e,t){this.apply(e,r=>{r.disconnect(t)})}apply(e,t){let r=e.rooms,n=this.computeExceptSids(e.except);if(r.size){let s=new Set;for(let o of r)if(this.rooms.has(o))for(let c of this.rooms.get(o)){if(s.has(c)||n.has(c))continue;let u=this.nsp.sockets.get(c);u&&(t(u),s.add(c))}}else for(let[s]of this.sids){if(n.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 r of e)this.rooms.has(r)&&this.rooms.get(r).forEach(n=>t.add(n));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}};vr.Adapter=Rs;var zc=class extends Rs{constructor(e){super(e),this.nsp=e,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=e.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let r=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((n,s)=>{n.disconnectedAt<r&&this.sessions.delete(s)});for(let n=this.packets.length-1;n>=0;n--)if(this.packets[n].emittedAt<r){this.packets.splice(0,n+1);break}},60*1e3).unref()}persistSession(e){e.disconnectedAt=Date.now(),this.sessions.set(e.pid,e)}restoreSession(e,t){let r=this.sessions.get(e);if(!r)return null;if(r.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(e),null;let s=this.packets.findIndex(c=>c.id===t);if(s===-1)return null;let o=[];for(let c=s+1;c<this.packets.length;c++){let u=this.packets[c];JS(r.rooms,u.opts)&&o.push(u.data)}return Promise.resolve(Object.assign(Object.assign({},r),{missedPackets:o}))}broadcast(e,t){var r;let n=e.type===2,s=e.id===void 0,o=((r=t.flags)===null||r===void 0?void 0:r.volatile)===void 0;if(n&&s&&o){let c=(0,GS.yeast)();e.data.push(c),this.packets.push({id:c,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};vr.SessionAwareAdapter=zc;function JS(i,e){let t=e.rooms.size===0||i.some(n=>e.rooms.has(n)),r=i.every(n=>!e.except.has(n));return t&&r}});var wh=T(Wt=>{"use strict";var XS=Wt&&Wt.__rest||function(i,e){var t={};for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&e.indexOf(r)<0&&(t[r]=i[r]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(i);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(i,r[n])&&(t[r[n]]=i[r[n]]);return t};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.ClusterAdapterWithHeartbeat=Wt.ClusterAdapter=Wt.MessageType=void 0;var ZS=Wc(),QS=ie(),e1=require("crypto"),Q=(0,QS.debug)("socket.io-adapter"),t1="emitter",Ps=5e3;function xr(){return(0,e1.randomBytes)(8).toString("hex")}var N;(function(i){i[i.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",i[i.HEARTBEAT=2]="HEARTBEAT",i[i.BROADCAST=3]="BROADCAST",i[i.SOCKETS_JOIN=4]="SOCKETS_JOIN",i[i.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",i[i.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",i[i.FETCH_SOCKETS=7]="FETCH_SOCKETS",i[i.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",i[i.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",i[i.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",i[i.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",i[i.BROADCAST_ACK=12]="BROADCAST_ACK",i[i.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(N||(Wt.MessageType=N={}));function Bi(i){return{rooms:[...i.rooms],except:[...i.except],flags:i.flags}}function gr(i){return{rooms:new Set(i.rooms),except:new Set(i.except),flags:i.flags}}var Bs=class extends ZS.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=xr()}onMessage(e,t){if(e.uid===this.uid)return Q("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return Q("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(Q("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case N.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,gr(e.data.opts),n=>{Q("[%s] waiting for %d client acknowledgements",this.uid,n),this.publishResponse(e.uid,{type:N.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:n}})},n=>{Q("[%s] received acknowledgement with value %j",this.uid,n),this.publishResponse(e.uid,{type:N.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:n}})});else{let n=e.data.packet,s=gr(e.data.opts);this.addOffsetIfNecessary(n,s,t),super.broadcast(n,s)}break}case N.SOCKETS_JOIN:super.addSockets(gr(e.data.opts),e.data.rooms);break;case N.SOCKETS_LEAVE:super.delSockets(gr(e.data.opts),e.data.rooms);break;case N.DISCONNECT_SOCKETS:super.disconnectSockets(gr(e.data.opts),e.data.close);break;case N.FETCH_SOCKETS:{Q("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(gr(e.data.opts)).then(r=>{this.publishResponse(e.uid,{type:N.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:r.map(n=>{let s=n.handshake,{sessionStore:o}=s,c=XS(s,["sessionStore"]);return{id:n.id,handshake:c,rooms:[...n.rooms],data:n.data}})}})});break}case N.SERVER_SIDE_EMIT:{let r=e.data.packet;if(!(e.data.requestId!==void 0)){this.nsp._onServerSideEmit(r);return}let s=!1,o=c=>{s||(s=!0,Q("[%s] calling acknowledgement with %j",this.uid,c),this.publishResponse(e.uid,{type:N.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:c}}))};this.nsp._onServerSideEmit([...r,o]);break}case N.BROADCAST_CLIENT_COUNT:case N.BROADCAST_ACK:case N.FETCH_SOCKETS_RESPONSE:case N.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:Q("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,r;let n=e.data.requestId;switch(Q("[%s] received response %s to request %s",this.uid,e.type,n),e.type){case N.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(n))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case N.BROADCAST_ACK:{(r=this.ackRequests.get(n))===null||r===void 0||r.ack(e.data.packet);break}case N.FETCH_SOCKETS_RESPONSE:{let s=this.requests.get(n);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(n));break}case N.SERVER_SIDE_EMIT_RESPONSE:{let s=this.requests.get(n);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(n));break}default:Q("[%s] unknown response type: %s",this.uid,e.type)}}async broadcast(e,t){var r;if(!((r=t.flags)===null||r===void 0?void 0:r.local))try{let s=await this.publishAndReturnOffset({type:N.BROADCAST,data:{packet:e,opts:Bi(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return Q("[%s] error while broadcasting message: %s",this.uid,s.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,r){var n;if(!this.nsp.server.opts.connectionStateRecovery)return;let s=e.type===2,o=e.id===void 0,c=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;s&&o&&c&&e.data.push(r)}broadcastWithAck(e,t,r,n){var s;if(!((s=t?.flags)===null||s===void 0?void 0:s.local)){let c=xr();this.ackRequests.set(c,{clientCountCallback:r,ack:n}),this.publish({type:N.BROADCAST,data:{packet:e,requestId:c,opts:Bi(t)}}),setTimeout(()=>{this.ackRequests.delete(c)},t.flags.timeout)}super.broadcastWithAck(e,t,r,n)}async addSockets(e,t){var r;if(!((r=e.flags)===null||r===void 0?void 0:r.local))try{await this.publishAndReturnOffset({type:N.SOCKETS_JOIN,data:{opts:Bi(e),rooms:t}})}catch(s){Q("[%s] error while publishing message: %s",this.uid,s.message)}super.addSockets(e,t)}async delSockets(e,t){var r;if(!((r=e.flags)===null||r===void 0?void 0:r.local))try{await this.publishAndReturnOffset({type:N.SOCKETS_LEAVE,data:{opts:Bi(e),rooms:t}})}catch(s){Q("[%s] error while publishing message: %s",this.uid,s.message)}super.delSockets(e,t)}async disconnectSockets(e,t){var r;if(!((r=e.flags)===null||r===void 0?void 0:r.local))try{await this.publishAndReturnOffset({type:N.DISCONNECT_SOCKETS,data:{opts:Bi(e),close:t}})}catch(s){Q("[%s] error while publishing message: %s",this.uid,s.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[r,n]=await Promise.all([super.fetchSockets(e),this.serverCount()]),s=n-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return r;let o=xr();return new Promise((c,u)=>{let d=setTimeout(()=>{let v=this.requests.get(o);v&&(u(new Error(`timeout reached: only ${v.current} responses received out of ${v.expected}`)),this.requests.delete(o))},e.flags.timeout||Ps),f={type:N.FETCH_SOCKETS,resolve:c,timeout:d,current:0,expected:s,responses:r};this.requests.set(o,f),this.publish({type:N.FETCH_SOCKETS,data:{opts:Bi(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:N.SERVER_SIDE_EMIT,data:{packet:e}});let r=e.pop(),n=await this.serverCount()-1;if(Q('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,n),n<=0)return r(null,[]);let s=xr(),o=setTimeout(()=>{let u=this.requests.get(s);u&&(r(new Error(`timeout reached: only ${u.current} responses received out of ${u.expected}`),u.responses),this.requests.delete(s))},Ps),c={type:N.SERVER_SIDE_EMIT,resolve:r,timeout:o,current:0,expected:n,responses:[]};this.requests.set(s,c),this.publish({type:N.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}publish(e){Q("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{Q("[%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,Q("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(r=>{Q("[%s] error while publishing response: %s",this.uid,r)})}};Wt.ClusterAdapter=Bs;var $c=class extends Bs{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 r=Date.now();this.nodesMap.forEach((n,s)=>{r-n>this._opts.heartbeatTimeout&&(Q("[%s] node %s seems down",this.uid,s),this.removeNode(s))})},1e3)}init(){this.publish({type:N.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:N.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:N.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return Q("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==t1&&this.nodesMap.set(e.uid,Date.now()),e.type){case N.INITIAL_HEARTBEAT:this.publish({type:N.HEARTBEAT});break;case N.HEARTBEAT:break;case N.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:N.SERVER_SIDE_EMIT,data:{packet:e}});let r=e.pop(),n=this.nodesMap.size;if(Q('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,n),n<=0)return r(null,[]);let s=xr(),o=setTimeout(()=>{let u=this.customRequests.get(s);u&&(r(new Error(`timeout reached: missing ${u.missingUids.size} responses`),u.responses),this.customRequests.delete(s))},Ps),c={type:N.SERVER_SIDE_EMIT,resolve:r,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(s,c),this.publish({type:N.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}async fetchSockets(e){var t;let[r,n]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),s=n-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return r;let o=xr();return new Promise((c,u)=>{let d=setTimeout(()=>{let v=this.customRequests.get(o);v&&(u(new Error(`timeout reached: missing ${v.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||Ps),f={type:N.FETCH_SOCKETS,resolve:c,timeout:d,missingUids:new Set([...this.nodesMap.keys()]),responses:r};this.customRequests.set(o,f),this.publish({type:N.FETCH_SOCKETS,data:{opts:Bi(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(Q("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case N.FETCH_SOCKETS_RESPONSE:{let r=this.customRequests.get(t);if(!r)return;e.data.sockets.forEach(n=>r.responses.push(n)),r.missingUids.delete(e.uid),r.missingUids.size===0&&(clearTimeout(r.timeout),r.resolve(r.responses),this.customRequests.delete(t));break}case N.SERVER_SIDE_EMIT_RESPONSE:{let r=this.customRequests.get(t);if(!r)return;r.responses.push(e.data.packet),r.missingUids.delete(e.uid),r.missingUids.size===0&&(clearTimeout(r.timeout),r.resolve(null,r.responses),this.customRequests.delete(t));break}default:super.onResponse(e)}}removeNode(e){this.customRequests.forEach((t,r)=>{t.missingUids.delete(e),t.missingUids.size===0&&(clearTimeout(t.timeout),t.type===N.FETCH_SOCKETS?t.resolve(t.responses):t.type===N.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(r))}),this.nodesMap.delete(e)}};Wt.ClusterAdapterWithHeartbeat=$c});var Ns=T(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.MessageType=wt.ClusterAdapterWithHeartbeat=wt.ClusterAdapter=wt.SessionAwareAdapter=wt.Adapter=void 0;var _h=Wc();Object.defineProperty(wt,"Adapter",{enumerable:!0,get:function(){return _h.Adapter}});Object.defineProperty(wt,"SessionAwareAdapter",{enumerable:!0,get:function(){return _h.SessionAwareAdapter}});var Vc=wh();Object.defineProperty(wt,"ClusterAdapter",{enumerable:!0,get:function(){return Vc.ClusterAdapter}});Object.defineProperty(wt,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Vc.ClusterAdapterWithHeartbeat}});Object.defineProperty(wt,"MessageType",{enumerable:!0,get:function(){return Vc.MessageType}})});var Ch=T(yr=>{"use strict";var i1=yr&&yr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(yr,"__esModule",{value:!0});yr.ParentNamespace=void 0;var Sh=Fc(),r1=Ns(),n1=i1(ie()),Eh=(0,n1.default)("socket.io:parent-namespace"),Is=class i extends Sh.Namespace{constructor(e){super(e,"/_"+i.count++),this.children=new Set}_initAdapter(){this.adapter=new Kc(this)}emit(e,...t){return this.children.forEach(r=>{r.emit(e,...t)}),!0}createChild(e){Eh("creating child namespace %s",e);let t=new Sh.Namespace(this.server,e);if(this._fns.forEach(r=>t.use(r)),this.listeners("connect").forEach(r=>t.on("connect",r)),this.listeners("connection").forEach(r=>t.on("connection",r)),this.children.add(t),this.server._opts.cleanupEmptyChildNamespaces){let r=t._remove;t._remove=n=>{r.call(t,n),t.sockets.size===0&&(Eh("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")}};yr.ParentNamespace=Is;Is.count=0;var Kc=class extends r1.Adapter{broadcast(e,t){this.nsp.children.forEach(r=>{r.adapter.broadcast(e,t)})}}});var Rh=T(Ii=>{"use strict";var s1=Ii&&Ii.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.patchAdapter=a1;Ii.restoreAdapter=c1;Ii.serveFile=u1;var Ni=Ns(),Th=require("fs"),o1=s1(ie()),Ds=(0,o1.default)("socket.io:adapter-uws"),Gc="",{addAll:Mh,del:Oh,broadcast:Ah}=Ni.Adapter.prototype;function a1(i){Ni.Adapter.prototype.addAll=function(e,t){let r=!this.sids.has(e);Mh.call(this,e,t);let n=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(n){if(n.conn.transport.name==="websocket"){kh(this.nsp.name,n,r,t);return}r&&n.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&kh(this.nsp.name,n,r,s)})}},Ni.Adapter.prototype.del=function(e,t){Oh.call(this,e,t);let r=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(r&&r.conn.transport.name==="websocket"){let n=r.conn.id,s=r.conn.transport.socket,o=`${this.nsp.name}${Gc}${t}`;Ds("unsubscribe connection %s from topic %s",n,o),s.unsubscribe(o)}},Ni.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){Ah.call(this,e,t);return}let n=t.flags||{},s={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let o=this.encoder.encode(e),c=t.rooms.size===0?this.nsp.name:`${this.nsp.name}${Gc}${t.rooms.keys().next().value}`;Ds("fast publish to %s",c),o.forEach(u=>{let d=typeof u!="string";i.publish(c,d?u:"4"+u,d)}),this.apply(t,u=>{u.conn.transport.name!=="websocket"&&u.client.writeToEngine(o,s)})}}function kh(i,e,t,r){let n=e.conn.id,s=e.conn.transport.socket;t&&(Ds("subscribe connection %s to topic %s",n,i),s.subscribe(i)),r.forEach(o=>{let c=`${i}${Gc}${o}`;Ds("subscribe connection %s to topic %s",n,c),s.subscribe(c)})}function c1(){Ni.Adapter.prototype.addAll=Mh,Ni.Adapter.prototype.del=Oh,Ni.Adapter.prototype.broadcast=Ah}var l1=i=>{let{buffer:e,byteOffset:t,byteLength:r}=i;return e.slice(t,t+r)};function u1(i,e){let{size:t}=(0,Th.statSync)(e),r=(0,Th.createReadStream)(e),n=()=>!r.destroyed&&r.destroy(),s=c=>{throw n(),c},o=c=>{let u=l1(c);i.cork(()=>{let d=i.getWriteOffset(),[f,v]=i.tryEnd(u,t);!v&&!f&&(r.pause(),i.onWritable(_=>{let[E,C]=i.tryEnd(u.slice(_-d),t);return!C&&E&&r.resume(),E}))})};i.onAborted(n),r.on("data",o).on("error",s).on("end",n)}});var Ph=T((iO,p1)=>{p1.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 Fh=T((Ge,ln)=>{"use strict";var d1=Ge&&Ge.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),f1=Ge&&Ge.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),h1=Ge&&Ge.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&d1(e,i,t);return f1(e,i),e},Xc=Ge&&Ge.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.Namespace=Ge.Socket=Ge.Server=void 0;var m1=Xc(require("http")),v1=require("fs"),Yc=require("zlib"),g1=jn(),js=require("stream"),Bh=require("path"),Nh=ih(),x1=ph(),Ih=require("events"),Zc=Fc();Object.defineProperty(Ge,"Namespace",{enumerable:!0,get:function(){return Zc.Namespace}});var y1=Ch(),Dh=Ns(),b1=h1(an()),w1=Xc(ie()),qh=Lc();Object.defineProperty(Ge,"Socket",{enumerable:!0,get:function(){return qh.Socket}});var _1=Cs(),Jc=Rh(),S1=Xc(xc()),Qe=(0,w1.default)("socket.io:server"),jh=Ph().version,Lh=/\.map/,br=class i extends _1.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||b1,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||Dh.SessionAwareAdapter)):this.adapter(t.adapter||Dh.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,S1.default)(this.opts.cors))}get _opts(){return this.opts}serveClient(e){return arguments.length?(this._serveClient=e,this):this._serveClient}_checkNamespace(e,t,r){if(this.parentNsps.size===0)return r(!1);let n=this.parentNsps.keys(),s=()=>{let o=n.next();if(o.done)return r(!1);o.value(e,t,(c,u)=>{if(c||!u)return s();if(this._nsps.has(e))return Qe("dynamic namespace %s already exists",e),r(this._nsps.get(e));let d=this.parentNsps.get(o.value).createChild(e);Qe("dynamic namespace %s was created",e),r(d)})};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 r="You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.";throw new Error(r)}if(Number(e)==e&&(e=Number(e)),typeof e=="number"){Qe("creating http server and binding to %d",e);let r=e;e=m1.default.createServer((n,s)=>{s.writeHead(404),s.end()}),e.listen(r)}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,Qe("creating uWebSockets.js-based engine with opts %j",t);let r=new Nh.uServer(t);r.attach(e,t),this.bind(r),this._serveClient&&e.get(`${this._path}/*`,(n,s)=>{if(!this.clientPathRegex.test(s.getUrl())){s.setYield(!0);return}let o=s.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),c=Lh.test(o),u=c?"map":"source",d='"'+jh+'"',f="W/"+d,v=s.getHeader("if-none-match");if(v&&(d===v||f===v)){Qe("serve client %s 304",u),n.writeStatus("304 Not Modified"),n.end();return}Qe("serve client %s",u),n.writeHeader("cache-control","public, max-age=0"),n.writeHeader("content-type","application/"+(c?"json":"javascript")+"; charset=utf-8"),n.writeHeader("etag",d);let _=Bh.join(__dirname,"../client-dist/",o);(0,Jc.serveFile)(n,_)}),(0,Jc.patchAdapter)(e)}initEngine(e,t){Qe("creating engine.io instance with opts %j",t),this.eio=(0,Nh.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){Qe("attaching client serving req handler");let t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",(r,n)=>{if(this.clientPathRegex.test(r.url))this._corsMiddleware?this._corsMiddleware(r,n,()=>{this.serve(r,n)}):this.serve(r,n);else for(let s=0;s<t.length;s++)t[s].call(e,r,n)})}serve(e,t){let r=e.url.replace(this._path,"").replace(/\?.*$/,""),n=Lh.test(r),s=n?"map":"source",o='"'+jh+'"',c="W/"+o,u=e.headers["if-none-match"];if(u&&(o===u||c===u)){Qe("serve client %s 304",s),t.writeHead(304),t.end();return}Qe("serve client %s",s),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(n?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),i.sendFile(r,e,t)}static sendFile(e,t,r){let n=(0,v1.createReadStream)(Bh.join(__dirname,"../client-dist/",e)),s=g1(t).encodings(["br","gzip","deflate"]),o=c=>{c&&r.end()};switch(s){case"br":r.writeHead(200,{"content-encoding":"br"}),(0,js.pipeline)(n,(0,Yc.createBrotliCompress)(),r,o);break;case"gzip":r.writeHead(200,{"content-encoding":"gzip"}),(0,js.pipeline)(n,(0,Yc.createGzip)(),r,o);break;case"deflate":r.writeHead(200,{"content-encoding":"deflate"}),(0,js.pipeline)(n,(0,Yc.createDeflate)(),r,o);break;default:r.writeHead(200),(0,js.pipeline)(n,r,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){Qe("incoming connection with id %s",e.id);let t=new x1.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let n=new y1.ParentNamespace(this);return Qe("initializing parent namespace %s",n.name),typeof e=="function"?this.parentNsps.set(e,n):(this.parentNsps.set((s,o,c)=>c(null,e.test(s)),n),this.parentNamespacesFromRegExp.set(e,n)),t&&n.on("connect",t),n}String(e)[0]!=="/"&&(e="/"+e);let r=this._nsps.get(e);if(!r){for(let[n,s]of this.parentNamespacesFromRegExp)if(n.test(e))return Qe("attaching namespace %s to parent namespace %s",e,n),s.createChild(e);Qe("initializing namespace %s",e),r=new Zc.Namespace(this,e),this._nsps.set(e,r),e!=="/"&&this.sockets.emitReserved("new_namespace",r)}return t&&r.on("connect",t),r}async close(e){if(await Promise.allSettled([...this._nsps.values()].map(async t=>{t.sockets.forEach(r=>{r._onclose("server shutting down")}),await t.adapter.close()})),this.engine.close(),(0,Jc.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(r=>{e&&e(r),r&&Qe("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)}};Ge.Server=br;var E1=Object.keys(Ih.EventEmitter.prototype).filter(function(i){return typeof Ih.EventEmitter.prototype[i]=="function"});E1.forEach(function(i){br.prototype[i]=function(){return this.sockets[i].apply(this.sockets,arguments)}});ln.exports=(i,e)=>new br(i,e);ln.exports.Server=br;ln.exports.Namespace=Zc.Namespace;ln.exports.Socket=qh.Socket});var $e,kr=Si(()=>{$e={webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:828e5,dcMaxMessageSize:65536,dcBufferThreshold:65536,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:12e4,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50},streaming:{activeInterval:60,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5}}});var vm={};Ei(vm,{TileManager:()=>cl});var Gs,Mr,Js,Ys,mm,K1,G1,cl,gm=Si(()=>{Gs=L(require("sharp"),1),Mr=L(require("fs"),1),Js=L(require("path"),1),Ys=require("child_process"),mm=require("url"),K1=(0,mm.fileURLToPath)(__importMetaUrl),G1=Js.default.dirname(K1),cl=class{constructor(e){this.robot=e,this.tileSize=128,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=Js.default.join(G1,"../../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=1,this.compressionQuality=50,Mr.default.existsSync(this.tempDir)||Mr.default.mkdirSync(this.tempDir,{recursive:!0}),this.initializeScreenDimensions()}initializeScreenDimensions(){try{let{width:e,height:t}=this.robot.getScreenSize();this.screenWidth=e,this.screenHeight=t,this.detectDpiScale(),this.scaledWidth=Math.floor(e*this.scaleFactor),this.scaledHeight=Math.floor(t*this.scaleFactor),this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn;let r=100;if(this.totalTiles>r){let n=Math.ceil(Math.sqrt(this.scaledWidth*this.scaledHeight/r));this.tileSize=Math.max(n,120),this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}console.log(`\u{1F5A5}\uFE0F [TileManager Init] Logical: ${e}x${t} | DPI Scale: ${this.dpiScale}x | Capture: ${this.captureWidth}x${this.captureHeight} | Scaled: ${this.scaledWidth}x${this.scaledHeight} | Tiles: ${this.totalTiles}`)}catch(e){console.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),r=e.byteWidth/e.bytesPerPixel/this.screenWidth;r>=1.9&&r<=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(){console.log(`\u{1F50D} [DPI Detection] screenWidth from robot: ${this.screenWidth}x${this.screenHeight}`);try{let e=(0,Ys.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(console.log(`\u{1F50D} [DPI Detection] Strategy 1 (Registry AppliedDPI): ${t} DPI`),t>=96){let r=t/96;return console.log(`\u2705 [DPI Detection] Using registry scale: ${r}x (${t}/96)`),r}}catch(e){console.log("\u274C [DPI Detection] Strategy 1 failed:",e.message)}try{let e=(0,Ys.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(console.log(`\u{1F50D} [DPI Detection] Strategy 2 (WMI): physical width = ${t}px`),t>0&&t>this.screenWidth){let r=t/this.screenWidth;return console.log(`\u2705 [DPI Detection] Using WMI scale: ${r}x (${t}/${this.screenWidth})`),r}}catch(e){console.log("\u274C [DPI Detection] Strategy 2 failed:",e.message)}try{let e=(0,Ys.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(console.log(`\u{1F50D} [DPI Detection] Strategy 3 (EnumDisplaySettings): physical width = ${t}px`),t>0&&t>this.screenWidth){let r=t/this.screenWidth;return console.log(`\u2705 [DPI Detection] Using EnumDisplaySettings scale: ${r}x (${t}/${this.screenWidth})`),r}}catch(e){console.log("\u274C [DPI Detection] Strategy 3 failed:",e.message)}return console.log("\u26A0\uFE0F [DPI Detection] All strategies failed, fallback to 1x"),1}async captureFullScreen(){let e=this.robot.screen.capture(0,0,this.captureWidth,this.captureHeight),t=e.byteWidth/e.bytesPerPixel,r=e.height,n=Buffer.from(e.image),s=new Uint32Array(n.buffer,n.byteOffset,n.length>>2);for(let d=0;d<s.length;d++){let f=s[d];s[d]=f&4278255360|(f&16711680)>>16|(f&255)<<16}let o=n,c=t,u=r;if(this.dpiScale>1||this.scaleFactor<1){let d=Math.floor(this.screenWidth*this.scaleFactor),f=Math.floor(this.screenHeight*this.scaleFactor);o=await(0,Gs.default)(n,{raw:{width:t,height:r,channels:e.bytesPerPixel}}).resize(d,f,{kernel:Gs.default.kernel.lanczos3,fit:"fill",fastShrinkOnLoad:!1}).raw().toBuffer(),c=d,u=f}return{buffer:o,width:c,height:u,channels:e.bytesPerPixel}}async getSharedScreenCapture(){let e=Date.now();return this.sharedScreenCache&&e-this.lastCaptureTime<this.CACHE_TTL?this.sharedScreenCache:(this.sharedScreenCache=await this.captureFullScreen(),this.lastCaptureTime=e,this.sharedScreenCache)}clearScreenCache(){}async detectChangedTiles(){return(await this.detectChangedTilesWithHashes()).tiles}async detectChangedTilesWithHashes(){if(this.isProcessing)return{tiles:[],currentHashes:Array.from(this.lastTileChecksums.values())};this.isProcessing=!0;try{let e=await this.getSharedScreenCapture(),t=[],r=[],n=new Map;this.frameCount++;for(let c=0;c<this.totalTiles;c++){let u=this.calculateTileChecksumDirect(e,c);n.set(c,u)}let s=Array.from(n.values());if(this.lastTileChecksums.size===0){let c=[];for(let d=0;d<this.totalTiles;d++)this.lastTileChecksums.set(d,n.get(d)),c.push(this.processTileAsync(e,d));let u=await Promise.all(c);return t.push(...u),{tiles:t,currentHashes:s}}for(let c=0;c<this.totalTiles;c++){let u=n.get(c),d=this.lastTileChecksums.get(c);u!==d&&(r.push(c),this.lastTileChecksums.set(c,u))}if(r.length/this.totalTiles>this.changeThreshold){let c=[];for(let d=0;d<this.totalTiles;d++)c.push(this.processTileAsync(e,d));let u=await Promise.all(c);t.push(...u.map(d=>({...d,fullRefresh:!0})))}else if(r.length>0){let c=r.map(d=>this.processTileAsync(e,d)),u=await Promise.all(c);t.push(...u)}return{tiles:t,currentHashes:s}}finally{this.isProcessing=!1}}async processTileAsync(e,t,r=null){let n=r||this.extractTile(e,t),s=await this.compressTileImage(n.buffer,n.width,n.height),{row:o,col:c}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:c*this.tileSize,y:o*this.tileSize,width:n.width,height:n.height,imageBuffer:s,timestamp:Date.now(),frameCount:this.frameCount}}calculateTileChecksumDirect(e,t){let{row:r,col:n}=this.getTilePosition(t),s=n*this.tileSize,o=r*this.tileSize,c=Math.min(s+this.tileSize,e.width),u=Math.min(o+this.tileSize,e.height),d=c-s,f=u-o,v=e.channels,_=e.width*v,E=0,C=16;for(let k=0;k<f;k+=4){let M=(o+k)*_+s*v;for(let O=0;O<d;O+=C){let A=M+O*v;E+=e.buffer[A]||0,E^=e.buffer[A+1]||0,E+=(e.buffer[A+2]||0)<<1,E^=(e.buffer[A+3]||0)<<2}}return E>>>0}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}extractTile(e,t){let{row:r,col:n}=this.getTilePosition(t),s=n*this.tileSize,o=r*this.tileSize,c=Math.min(s+this.tileSize,e.width),u=Math.min(o+this.tileSize,e.height),d=c-s,f=u-o,v=e.channels,_=d*v,E=Buffer.alloc(d*f*v);for(let C=0;C<f;C++){let k=((o+C)*e.width+s)*v,M=C*_;e.buffer.copy(E,M,k,k+_)}return{buffer:E,width:d,height:f,channels:v,tileIndex:t,x:s,y:o}}async compressTileImage(e,t,r){return(0,Gs.default)(e,{raw:{width:t,height:r,channels:4}}).jpeg({quality:this.compressionQuality}).toBuffer()}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){console.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(),r=[],n=[];this.frameCount++;let s=new Map;for(let c=0;c<this.totalTiles;c++){let u=this.calculateTileChecksumDirect(t,c);s.set(c,u),this.lastTileChecksums.set(c,u)}if(!e||e.length===0){let c=[];for(let d=0;d<this.totalTiles;d++)c.push(this.processTileAsync(t,d));let u=await Promise.all(c);return r.push(...u),{tiles:r,currentHashes:Array.from(s.values())}}for(let c=0;c<this.totalTiles;c++)e[c]!==s.get(c)&&n.push(c);if(n.length/this.totalTiles>this.changeThreshold){let c=[];for(let d=0;d<this.totalTiles;d++)c.push(this.processTileAsync(t,d));let u=await Promise.all(c);r.push(...u.map(d=>({...d,fullRefresh:!0})))}else if(n.length>0){let c=n.map(d=>this.processTileAsync(t,d)),u=await Promise.all(c);r.push(...u)}return{tiles:r,currentHashes:Array.from(s.values()),changedIndices:n}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear()}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{Mr.default.existsSync(this.tempDir)&&Mr.default.readdirSync(this.tempDir).forEach(t=>Mr.default.unlinkSync(Js.default.join(this.tempDir,t)))}catch(e){console.warn("Cleanup error:",e)}}}});var xm={};Ei(xm,{ResourceManager:()=>ll});var ll,ym=Si(()=>{kr();ll=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>$e.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},$e.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=$e.resourceManagement.inactiveTimeout;for(let[r,n]of this.activeClients.entries())e-n.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${r}`),this.cleanupClientResources(r,n),this.activeClients.delete(r))}cleanupClientResources(e,t){try{t.isStreaming=!1,t?.streamingTimeout&&(clearTimeout(t.streamingTimeout),t.streamingTimeout=null),t?.screenInterval&&(clearInterval(t.screenInterval),t.screenInterval=null);let r=this.activeTimers.get(e);r&&(r.forEach(s=>clearTimeout(s)),this.activeTimers.delete(e));let n=this.chunkTimers.get(e);n&&(n.forEach(s=>clearTimeout(s)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset())}catch(r){console.error(`Error cleaning up ${e}:`,r.message)}}getStreamingConfig(){return $e.streaming}getWebRTCConfig(){return $e.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 bm={};Ei(bm,{ScreenUpdateHelper:()=>ul});var ul,wm=Si(()=>{kr();ul=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,r,n=!1){if(!t||t.length===0)return;let s=$e.streaming.chunkSize,o=[];for(let u=0;u<t.length;u+=s)o.push(t.slice(u,u+s));let c=this.resourceManager.getChunkTimers(e.id);for(let u=0;u<o.length;u++){let d=o[u],f=u===o.length-1,v=setTimeout(()=>{c.delete(v),e.connected&&e.emit("tiles-data",{tiles:d,timestamp:r,forceRefresh:!1,userAction:n,chunkInfo:{chunkIndex:u,totalChunks:o.length,isLastChunk:f}})},u*$e.streaming.chunkDelay);c.add(v)}}}});var _m={};Ei(_m,{MouseHandler:()=>pl});var pl,Sm=Si(()=>{kr();pl=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastMouseMove=0}setupMouseHandlers(e,t){let r=this.robot;e.on("mouse-move",t(n=>{let s=Date.now();if(!(s-this.lastMouseMove<$e.throttling.mouseThrottle)){this.lastMouseMove=s;try{let o=r.getScreenSize(),c=Math.round(n.x/100*o.width),u=Math.round(n.y/100*o.height),d=Math.max(0,Math.min(o.width-1,c)),f=Math.max(0,Math.min(o.height-1,u));r.moveMouse(d,f),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async n=>{try{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=r.getScreenSize(),c=Math.round(n.x/100*o.width),u=Math.round(n.y/100*o.height),d=Math.max(0,Math.min(o.width-1,c)),f=Math.max(0,Math.min(o.height-1,u));r.moveMouse(d,f),r.mouseClick(n.button||"left",n.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 n=>{try{if(!this.resourceManager.getClient(e.id))return;let o=r.getScreenSize(),c=Math.round(n.x/100*o.width),u=Math.round(n.y/100*o.height),d=Math.max(0,Math.min(o.width-1,c)),f=Math.max(0,Math.min(o.height-1,u));r.moveMouse(d,f),r.mouseToggle("down",n.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse press error:",s.message)}})),e.on("mouse-release",t(async n=>{try{if(!this.resourceManager.getClient(e.id))return;let o=r.getScreenSize(),c=Math.round(n.x/100*o.width),u=Math.round(n.y/100*o.height),d=Math.max(0,Math.min(o.width-1,c)),f=Math.max(0,Math.min(o.height-1,u));r.moveMouse(d,f),r.mouseToggle("up",n.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse release error:",s.message)}})),e.on("scroll",t(async n=>{try{let{direction:s,amount:o=60,horizontal:c=!1}=n,u=this.resourceManager.getClient(e.id);if(!u)return;let d=0,f=0;c||s==="left"||s==="right"?d=s==="right"?o:-o:f=s==="down"?-o:o,r.scrollMouse(d,f),u.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Scroll error:",s.message)}})),e.on("mouse-drag-select",t(n=>{try{let{startX:s,startY:o,endX:c,endY:u}=n,d=r.getScreenSize(),f=Math.round(s/100*d.width),v=Math.round(o/100*d.height),_=Math.round(c/100*d.width),E=Math.round(u/100*d.height),C=Math.max(0,Math.min(d.width-1,f)),k=Math.max(0,Math.min(d.height-1,v)),M=Math.max(0,Math.min(d.width-1,_)),O=Math.max(0,Math.min(d.height-1,E));r.moveMouse(C,k),r.mouseToggle("down","left"),r.dragMouse(M,O),r.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var Em={};Ei(Em,{KeyboardHandler:()=>dl});var dl,Cm=Si(()=>{kr();dl=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastKeyPress=0,this.lastTypeText=0}setupKeyboardHandlers(e,t){let r=this.robot;e.on("key-press",t(n=>{let s=Date.now();if(!(s-this.lastKeyPress<$e.throttling.keyThrottle)){this.lastKeyPress=s;try{if(!n.key||typeof n.key!="string")return;let o=this.resourceManager.getClient(e.id),c=n.key;if(c.length===1){r.keyTap(c,n.modifier||[]);for(let u of n.modifier||[])r.keyToggle(u,"up")}else switch(c.toLowerCase()){case"enter":case"return":r.keyTap("enter");break;case"space":r.keyTap(" ");break;case"backspace":r.keyTap("backspace");break;case"tab":r.keyTap("tab");break;case"escape":r.keyTap("escape");break;default:r.keyTap(c,n.modifier||[])}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("type-text",t(n=>{let s=Date.now();if(!(s-this.lastTypeText<$e.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!n.text||typeof n.text!="string")return;let o=n.text;o.length>$e.throttling.maxTextLength&&(o=o.substring(0,$e.throttling.maxTextLength));let c=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),u=this.resourceManager.getClient(e.id);setTimeout(()=>{try{r.typeString(c),this.resourceManager.updateClientActivity(e.id),u&&(u.idleFrameCount=0,u.tileManager&&u.tileManager.clearScreenCache())}catch(d){console.error("Robot typeString error:",d.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var Tm={};Ei(Tm,{ScreenHandler:()=>hl});function Y1(i){let e=Buffer.alloc(24);return e.writeUInt32LE(i.tileIndex,0),e.writeUInt32LE(i.x,4),e.writeUInt32LE(i.y,8),e.writeUInt32LE(i.width,12),e.writeUInt32LE(i.height,16),e.writeUInt32LE(i.imageBuffer.length,20),Buffer.concat([e,i.imageBuffer])}function fl(i,e){let t=Buffer.alloc(12);return t.writeUInt32LE(i.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...i.map(Y1)])}var hl,km=Si(()=>{hl=class{constructor(e,t){this.resourceManager=e,this.screenUpdateHelper=t}setupScreenHandlers(e,t,r){e.on("request-screen",t(async()=>{let n=this.resourceManager.getClient(e.id);if(n)try{let s=await n.tileManager.detectChangedTiles();s.length>0&&r.sendTiles({tiles:s,timestamp:Date.now()},fl),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Tile capture error:",s),r.emit("screen-error",{error:s.message})}})),e.on("request-screen-with-hashes",t(async n=>{let s=this.resourceManager.getClient(e.id);if(s)try{let o=n.tileHashes||[],c=await s.tileManager.compareClientTileHashes(o);c?.tiles?.length>0?r.sendTiles({tiles:c.tiles,timestamp:Date.now(),currentHashes:c.currentHashes,changedIndices:c.changedIndices},fl):r.emit("tiles-data",{tiles:[],timestamp:Date.now(),currentHashes:c.currentHashes,changedIndices:[]}),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Tile capture with hashes error:",o),r.emit("screen-error",{error:o.message})}})),e.on("start-streaming",t(async()=>{let n=this.resourceManager.getClient(e.id);if(!n)return;n.streamingTimeout&&(clearTimeout(n.streamingTimeout),n.streamingTimeout=null),console.log("\u{1F680} Remote streaming started"),n.idleFrameCount=0,n.isStreaming=!0,n.tileManager.lastTileChecksums.clear();try{let o=await n.tileManager.getScreenDimensions();r.emit("screen-dimensions",o)}catch(o){console.error("Get dimensions error:",o.message)}let s=async()=>{if(!e.connected||!n.isStreaming){n.streamingTimeout=null;return}try{let o=performance.now(),c=await n.tileManager.detectChangedTilesWithHashes();c.tiles.length>0&&e.connected?(r.sendTiles({tiles:c.tiles,timestamp:Date.now(),currentHashes:c.currentHashes},fl),n.idleFrameCount=0):n.idleFrameCount++;let{activeInterval:u,idleInterval:d,idleThreshold:f}=this.resourceManager.getStreamingConfig(),v=n.idleFrameCount>=f?d:u,_=Math.max(0,v-(performance.now()-o));n.streamingTimeout=setTimeout(s,_)}catch(o){console.error("Auto streaming error:",o),n.streamingTimeout=setTimeout(s,200)}};s()})),e.on("stop-streaming",()=>{let n=this.resourceManager.getClient(e.id);n&&(n.isStreaming=!1,n.streamingTimeout&&(clearTimeout(n.streamingTimeout),n.streamingTimeout=null),console.log("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let n=this.resourceManager.getClient(e.id);if(n)try{let s=await n.tileManager.getScreenDimensions();r.emit("screen-dimensions",s)}catch(s){console.error("Get dimensions error:",s),r.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let n=this.resourceManager.getClient(e.id);n&&(n.idleFrameCount=0)}))}}});var El=T((iv,Sl)=>{(function(i,e){"use strict";function t(b,a){if(!b)throw new Error(a||"Assertion failed")}function r(b,a){b.super_=a;var p=function(){};p.prototype=a.prototype,b.prototype=new p,b.prototype.constructor=b}function n(b,a,p){if(n.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((a==="le"||a==="be")&&(p=a,a=10),this._init(b||0,a||10,p||"be"))}typeof i=="object"?i.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}n.isBN=function(a){return a instanceof n?!0:a!==null&&typeof a=="object"&&a.constructor.wordSize===n.wordSize&&Array.isArray(a.words)},n.max=function(a,p){return a.cmp(p)>0?a:p},n.min=function(a,p){return a.cmp(p)<0?a:p},n.prototype._init=function(a,p,h){if(typeof a=="number")return this._initNumber(a,p,h);if(typeof a=="object")return this._initArray(a,p,h);p==="hex"&&(p=16),t(p===(p|0)&&p>=2&&p<=36),a=a.toString().replace(/\s+/g,"");var m=0;a[0]==="-"&&(m++,this.negative=1),m<a.length&&(p===16?this._parseHex(a,m,h):(this._parseBase(a,p,m),h==="le"&&this._initArray(this.toArray(),p,h)))},n.prototype._initNumber=function(a,p,h){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[a&67108863],this.length=1):a<4503599627370496?(this.words=[a&67108863,a/67108864&67108863],this.length=2):(t(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),p,h)},n.prototype._initArray=function(a,p,h){if(t(typeof a.length=="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var y,w,S=0;if(h==="be")for(m=a.length-1,y=0;m>=0;m-=3)w=a[m]|a[m-1]<<8|a[m-2]<<16,this.words[y]|=w<<S&67108863,this.words[y+1]=w>>>26-S&67108863,S+=24,S>=26&&(S-=26,y++);else if(h==="le")for(m=0,y=0;m<a.length;m+=3)w=a[m]|a[m+1]<<8|a[m+2]<<16,this.words[y]|=w<<S&67108863,this.words[y+1]=w>>>26-S&67108863,S+=24,S>=26&&(S-=26,y++);return this.strip()};function o(b,a){var p=b.charCodeAt(a);return p>=65&&p<=70?p-55:p>=97&&p<=102?p-87:p-48&15}function c(b,a,p){var h=o(b,p);return p-1>=a&&(h|=o(b,p-1)<<4),h}n.prototype._parseHex=function(a,p,h){this.length=Math.ceil((a.length-p)/6),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var y=0,w=0,S;if(h==="be")for(m=a.length-1;m>=p;m-=2)S=c(a,p,m)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8;else{var g=a.length-p;for(m=g%2===0?p+1:p;m<a.length;m+=2)S=c(a,p,m)<<y,this.words[w]|=S&67108863,y>=18?(y-=18,w+=1,this.words[w]|=S>>>26):y+=8}this.strip()};function u(b,a,p,h){for(var m=0,y=Math.min(b.length,p),w=a;w<y;w++){var S=b.charCodeAt(w)-48;m*=h,S>=49?m+=S-49+10:S>=17?m+=S-17+10:m+=S}return m}n.prototype._parseBase=function(a,p,h){this.words=[0],this.length=1;for(var m=0,y=1;y<=67108863;y*=p)m++;m--,y=y/p|0;for(var w=a.length-h,S=w%m,g=Math.min(w,w-S)+h,l=0,x=h;x<g;x+=m)l=u(a,x,x+m,p),this.imuln(y),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(S!==0){var R=1;for(l=u(a,x,a.length,p),x=0;x<S;x++)R*=p;this.imuln(R),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},n.prototype.copy=function(a){a.words=new Array(this.length);for(var p=0;p<this.length;p++)a.words[p]=this.words[p];a.length=this.length,a.negative=this.negative,a.red=this.red},n.prototype.clone=function(){var a=new n(null);return this.copy(a),a},n.prototype._expand=function(a){for(;this.length<a;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","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"],f=[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],v=[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];n.prototype.toString=function(a,p){a=a||10,p=p|0||1;var h;if(a===16||a==="hex"){h="";for(var m=0,y=0,w=0;w<this.length;w++){var S=this.words[w],g=((S<<m|y)&16777215).toString(16);y=S>>>24-m&16777215,m+=2,m>=26&&(m-=26,w--),y!==0||w!==this.length-1?h=d[6-g.length]+g+h:h=g+h}for(y!==0&&(h=y.toString(16)+h);h.length%p!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(a===(a|0)&&a>=2&&a<=36){var l=f[a],x=v[a];h="";var R=this.clone();for(R.negative=0;!R.isZero();){var P=R.modn(x).toString(a);R=R.idivn(x),R.isZero()?h=P+h:h=d[l-P.length]+P+h}for(this.isZero()&&(h="0"+h);h.length%p!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}t(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var a=this.words[0];return this.length===2?a+=this.words[1]*67108864:this.length===3&&this.words[2]===1?a+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-a:a},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(a,p){return t(typeof s<"u"),this.toArrayLike(s,a,p)},n.prototype.toArray=function(a,p){return this.toArrayLike(Array,a,p)},n.prototype.toArrayLike=function(a,p,h){var m=this.byteLength(),y=h||Math.max(1,m);t(m<=y,"byte array longer than desired length"),t(y>0,"Requested array length <= 0"),this.strip();var w=p==="le",S=new a(y),g,l,x=this.clone();if(w){for(l=0;!x.isZero();l++)g=x.andln(255),x.iushrn(8),S[l]=g;for(;l<y;l++)S[l]=0}else{for(l=0;l<y-m;l++)S[l]=0;for(l=0;!x.isZero();l++)g=x.andln(255),x.iushrn(8),S[y-l-1]=g}return S},Math.clz32?n.prototype._countBits=function(a){return 32-Math.clz32(a)}:n.prototype._countBits=function(a){var p=a,h=0;return p>=4096&&(h+=13,p>>>=13),p>=64&&(h+=7,p>>>=7),p>=8&&(h+=4,p>>>=4),p>=2&&(h+=2,p>>>=2),h+p},n.prototype._zeroBits=function(a){if(a===0)return 26;var p=a,h=0;return(p&8191)===0&&(h+=13,p>>>=13),(p&127)===0&&(h+=7,p>>>=7),(p&15)===0&&(h+=4,p>>>=4),(p&3)===0&&(h+=2,p>>>=2),(p&1)===0&&h++,h},n.prototype.bitLength=function(){var a=this.words[this.length-1],p=this._countBits(a);return(this.length-1)*26+p};function _(b){for(var a=new Array(b.bitLength()),p=0;p<a.length;p++){var h=p/26|0,m=p%26;a[p]=(b.words[h]&1<<m)>>>m}return a}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,p=0;p<this.length;p++){var h=this._zeroBits(this.words[p]);if(a+=h,h!==26)break}return a},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(a){return this.negative!==0?this.abs().inotn(a).iaddn(1):this.clone()},n.prototype.fromTwos=function(a){return this.testn(a-1)?this.notn(a).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(a){for(;this.length<a.length;)this.words[this.length++]=0;for(var p=0;p<a.length;p++)this.words[p]=this.words[p]|a.words[p];return this.strip()},n.prototype.ior=function(a){return t((this.negative|a.negative)===0),this.iuor(a)},n.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},n.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},n.prototype.iuand=function(a){var p;this.length>a.length?p=a:p=this;for(var h=0;h<p.length;h++)this.words[h]=this.words[h]&a.words[h];return this.length=p.length,this.strip()},n.prototype.iand=function(a){return t((this.negative|a.negative)===0),this.iuand(a)},n.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},n.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},n.prototype.iuxor=function(a){var p,h;this.length>a.length?(p=this,h=a):(p=a,h=this);for(var m=0;m<h.length;m++)this.words[m]=p.words[m]^h.words[m];if(this!==p)for(;m<p.length;m++)this.words[m]=p.words[m];return this.length=p.length,this.strip()},n.prototype.ixor=function(a){return t((this.negative|a.negative)===0),this.iuxor(a)},n.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},n.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},n.prototype.inotn=function(a){t(typeof a=="number"&&a>=0);var p=Math.ceil(a/26)|0,h=a%26;this._expand(p),h>0&&p--;for(var m=0;m<p;m++)this.words[m]=~this.words[m]&67108863;return h>0&&(this.words[m]=~this.words[m]&67108863>>26-h),this.strip()},n.prototype.notn=function(a){return this.clone().inotn(a)},n.prototype.setn=function(a,p){t(typeof a=="number"&&a>=0);var h=a/26|0,m=a%26;return this._expand(h+1),p?this.words[h]=this.words[h]|1<<m:this.words[h]=this.words[h]&~(1<<m),this.strip()},n.prototype.iadd=function(a){var p;if(this.negative!==0&&a.negative===0)return this.negative=0,p=this.isub(a),this.negative^=1,this._normSign();if(this.negative===0&&a.negative!==0)return a.negative=0,p=this.isub(a),a.negative=1,p._normSign();var h,m;this.length>a.length?(h=this,m=a):(h=a,m=this);for(var y=0,w=0;w<m.length;w++)p=(h.words[w]|0)+(m.words[w]|0)+y,this.words[w]=p&67108863,y=p>>>26;for(;y!==0&&w<h.length;w++)p=(h.words[w]|0)+y,this.words[w]=p&67108863,y=p>>>26;if(this.length=h.length,y!==0)this.words[this.length]=y,this.length++;else if(h!==this)for(;w<h.length;w++)this.words[w]=h.words[w];return this},n.prototype.add=function(a){var p;return a.negative!==0&&this.negative===0?(a.negative=0,p=this.sub(a),a.negative^=1,p):a.negative===0&&this.negative!==0?(this.negative=0,p=a.sub(this),this.negative=1,p):this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},n.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var p=this.iadd(a);return a.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var h=this.cmp(a);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,y;h>0?(m=this,y=a):(m=a,y=this);for(var w=0,S=0;S<y.length;S++)p=(m.words[S]|0)-(y.words[S]|0)+w,w=p>>26,this.words[S]=p&67108863;for(;w!==0&&S<m.length;S++)p=(m.words[S]|0)+w,w=p>>26,this.words[S]=p&67108863;if(w===0&&S<m.length&&m!==this)for(;S<m.length;S++)this.words[S]=m.words[S];return this.length=Math.max(this.length,S),m!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(a){return this.clone().isub(a)};function E(b,a,p){p.negative=a.negative^b.negative;var h=b.length+a.length|0;p.length=h,h=h-1|0;var m=b.words[0]|0,y=a.words[0]|0,w=m*y,S=w&67108863,g=w/67108864|0;p.words[0]=S;for(var l=1;l<h;l++){for(var x=g>>>26,R=g&67108863,P=Math.min(l,a.length-1),B=Math.max(0,l-b.length+1);B<=P;B++){var D=l-B|0;m=b.words[D]|0,y=a.words[B]|0,w=m*y+R,x+=w/67108864|0,R=w&67108863}p.words[l]=R|0,g=x|0}return g!==0?p.words[l]=g|0:p.length--,p.strip()}var C=function(a,p,h){var m=a.words,y=p.words,w=h.words,S=0,g,l,x,R=m[0]|0,P=R&8191,B=R>>>13,D=m[1]|0,F=D&8191,V=D>>>13,ui=m[2]|0,K=ui&8191,Y=ui>>>13,Mu=m[3]|0,ne=Mu&8191,se=Mu>>>13,Ou=m[4]|0,oe=Ou&8191,ae=Ou>>>13,Au=m[5]|0,ce=Au&8191,le=Au>>>13,Ru=m[6]|0,ue=Ru&8191,pe=Ru>>>13,Pu=m[7]|0,de=Pu&8191,fe=Pu>>>13,Bu=m[8]|0,he=Bu&8191,me=Bu>>>13,Nu=m[9]|0,ve=Nu&8191,ge=Nu>>>13,Iu=y[0]|0,xe=Iu&8191,ye=Iu>>>13,Du=y[1]|0,be=Du&8191,we=Du>>>13,ju=y[2]|0,_e=ju&8191,Se=ju>>>13,Lu=y[3]|0,Ee=Lu&8191,Ce=Lu>>>13,qu=y[4]|0,Te=qu&8191,ke=qu>>>13,Fu=y[5]|0,Me=Fu&8191,Oe=Fu>>>13,Uu=y[6]|0,Ae=Uu&8191,Re=Uu>>>13,Hu=y[7]|0,Pe=Hu&8191,Be=Hu>>>13,zu=y[8]|0,Ne=zu&8191,Ie=zu>>>13,Wu=y[9]|0,De=Wu&8191,je=Wu>>>13;h.negative=a.negative^p.negative,h.length=19,g=Math.imul(P,xe),l=Math.imul(P,ye),l=l+Math.imul(B,xe)|0,x=Math.imul(B,ye);var Wo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Wo>>>26)|0,Wo&=67108863,g=Math.imul(F,xe),l=Math.imul(F,ye),l=l+Math.imul(V,xe)|0,x=Math.imul(V,ye),g=g+Math.imul(P,be)|0,l=l+Math.imul(P,we)|0,l=l+Math.imul(B,be)|0,x=x+Math.imul(B,we)|0;var $o=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+($o>>>26)|0,$o&=67108863,g=Math.imul(K,xe),l=Math.imul(K,ye),l=l+Math.imul(Y,xe)|0,x=Math.imul(Y,ye),g=g+Math.imul(F,be)|0,l=l+Math.imul(F,we)|0,l=l+Math.imul(V,be)|0,x=x+Math.imul(V,we)|0,g=g+Math.imul(P,_e)|0,l=l+Math.imul(P,Se)|0,l=l+Math.imul(B,_e)|0,x=x+Math.imul(B,Se)|0;var Vo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Vo>>>26)|0,Vo&=67108863,g=Math.imul(ne,xe),l=Math.imul(ne,ye),l=l+Math.imul(se,xe)|0,x=Math.imul(se,ye),g=g+Math.imul(K,be)|0,l=l+Math.imul(K,we)|0,l=l+Math.imul(Y,be)|0,x=x+Math.imul(Y,we)|0,g=g+Math.imul(F,_e)|0,l=l+Math.imul(F,Se)|0,l=l+Math.imul(V,_e)|0,x=x+Math.imul(V,Se)|0,g=g+Math.imul(P,Ee)|0,l=l+Math.imul(P,Ce)|0,l=l+Math.imul(B,Ee)|0,x=x+Math.imul(B,Ce)|0;var Ko=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Ko>>>26)|0,Ko&=67108863,g=Math.imul(oe,xe),l=Math.imul(oe,ye),l=l+Math.imul(ae,xe)|0,x=Math.imul(ae,ye),g=g+Math.imul(ne,be)|0,l=l+Math.imul(ne,we)|0,l=l+Math.imul(se,be)|0,x=x+Math.imul(se,we)|0,g=g+Math.imul(K,_e)|0,l=l+Math.imul(K,Se)|0,l=l+Math.imul(Y,_e)|0,x=x+Math.imul(Y,Se)|0,g=g+Math.imul(F,Ee)|0,l=l+Math.imul(F,Ce)|0,l=l+Math.imul(V,Ee)|0,x=x+Math.imul(V,Ce)|0,g=g+Math.imul(P,Te)|0,l=l+Math.imul(P,ke)|0,l=l+Math.imul(B,Te)|0,x=x+Math.imul(B,ke)|0;var Go=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Go>>>26)|0,Go&=67108863,g=Math.imul(ce,xe),l=Math.imul(ce,ye),l=l+Math.imul(le,xe)|0,x=Math.imul(le,ye),g=g+Math.imul(oe,be)|0,l=l+Math.imul(oe,we)|0,l=l+Math.imul(ae,be)|0,x=x+Math.imul(ae,we)|0,g=g+Math.imul(ne,_e)|0,l=l+Math.imul(ne,Se)|0,l=l+Math.imul(se,_e)|0,x=x+Math.imul(se,Se)|0,g=g+Math.imul(K,Ee)|0,l=l+Math.imul(K,Ce)|0,l=l+Math.imul(Y,Ee)|0,x=x+Math.imul(Y,Ce)|0,g=g+Math.imul(F,Te)|0,l=l+Math.imul(F,ke)|0,l=l+Math.imul(V,Te)|0,x=x+Math.imul(V,ke)|0,g=g+Math.imul(P,Me)|0,l=l+Math.imul(P,Oe)|0,l=l+Math.imul(B,Me)|0,x=x+Math.imul(B,Oe)|0;var Yo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,g=Math.imul(ue,xe),l=Math.imul(ue,ye),l=l+Math.imul(pe,xe)|0,x=Math.imul(pe,ye),g=g+Math.imul(ce,be)|0,l=l+Math.imul(ce,we)|0,l=l+Math.imul(le,be)|0,x=x+Math.imul(le,we)|0,g=g+Math.imul(oe,_e)|0,l=l+Math.imul(oe,Se)|0,l=l+Math.imul(ae,_e)|0,x=x+Math.imul(ae,Se)|0,g=g+Math.imul(ne,Ee)|0,l=l+Math.imul(ne,Ce)|0,l=l+Math.imul(se,Ee)|0,x=x+Math.imul(se,Ce)|0,g=g+Math.imul(K,Te)|0,l=l+Math.imul(K,ke)|0,l=l+Math.imul(Y,Te)|0,x=x+Math.imul(Y,ke)|0,g=g+Math.imul(F,Me)|0,l=l+Math.imul(F,Oe)|0,l=l+Math.imul(V,Me)|0,x=x+Math.imul(V,Oe)|0,g=g+Math.imul(P,Ae)|0,l=l+Math.imul(P,Re)|0,l=l+Math.imul(B,Ae)|0,x=x+Math.imul(B,Re)|0;var Jo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,g=Math.imul(de,xe),l=Math.imul(de,ye),l=l+Math.imul(fe,xe)|0,x=Math.imul(fe,ye),g=g+Math.imul(ue,be)|0,l=l+Math.imul(ue,we)|0,l=l+Math.imul(pe,be)|0,x=x+Math.imul(pe,we)|0,g=g+Math.imul(ce,_e)|0,l=l+Math.imul(ce,Se)|0,l=l+Math.imul(le,_e)|0,x=x+Math.imul(le,Se)|0,g=g+Math.imul(oe,Ee)|0,l=l+Math.imul(oe,Ce)|0,l=l+Math.imul(ae,Ee)|0,x=x+Math.imul(ae,Ce)|0,g=g+Math.imul(ne,Te)|0,l=l+Math.imul(ne,ke)|0,l=l+Math.imul(se,Te)|0,x=x+Math.imul(se,ke)|0,g=g+Math.imul(K,Me)|0,l=l+Math.imul(K,Oe)|0,l=l+Math.imul(Y,Me)|0,x=x+Math.imul(Y,Oe)|0,g=g+Math.imul(F,Ae)|0,l=l+Math.imul(F,Re)|0,l=l+Math.imul(V,Ae)|0,x=x+Math.imul(V,Re)|0,g=g+Math.imul(P,Pe)|0,l=l+Math.imul(P,Be)|0,l=l+Math.imul(B,Pe)|0,x=x+Math.imul(B,Be)|0;var Xo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Xo>>>26)|0,Xo&=67108863,g=Math.imul(he,xe),l=Math.imul(he,ye),l=l+Math.imul(me,xe)|0,x=Math.imul(me,ye),g=g+Math.imul(de,be)|0,l=l+Math.imul(de,we)|0,l=l+Math.imul(fe,be)|0,x=x+Math.imul(fe,we)|0,g=g+Math.imul(ue,_e)|0,l=l+Math.imul(ue,Se)|0,l=l+Math.imul(pe,_e)|0,x=x+Math.imul(pe,Se)|0,g=g+Math.imul(ce,Ee)|0,l=l+Math.imul(ce,Ce)|0,l=l+Math.imul(le,Ee)|0,x=x+Math.imul(le,Ce)|0,g=g+Math.imul(oe,Te)|0,l=l+Math.imul(oe,ke)|0,l=l+Math.imul(ae,Te)|0,x=x+Math.imul(ae,ke)|0,g=g+Math.imul(ne,Me)|0,l=l+Math.imul(ne,Oe)|0,l=l+Math.imul(se,Me)|0,x=x+Math.imul(se,Oe)|0,g=g+Math.imul(K,Ae)|0,l=l+Math.imul(K,Re)|0,l=l+Math.imul(Y,Ae)|0,x=x+Math.imul(Y,Re)|0,g=g+Math.imul(F,Pe)|0,l=l+Math.imul(F,Be)|0,l=l+Math.imul(V,Pe)|0,x=x+Math.imul(V,Be)|0,g=g+Math.imul(P,Ne)|0,l=l+Math.imul(P,Ie)|0,l=l+Math.imul(B,Ne)|0,x=x+Math.imul(B,Ie)|0;var Zo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,g=Math.imul(ve,xe),l=Math.imul(ve,ye),l=l+Math.imul(ge,xe)|0,x=Math.imul(ge,ye),g=g+Math.imul(he,be)|0,l=l+Math.imul(he,we)|0,l=l+Math.imul(me,be)|0,x=x+Math.imul(me,we)|0,g=g+Math.imul(de,_e)|0,l=l+Math.imul(de,Se)|0,l=l+Math.imul(fe,_e)|0,x=x+Math.imul(fe,Se)|0,g=g+Math.imul(ue,Ee)|0,l=l+Math.imul(ue,Ce)|0,l=l+Math.imul(pe,Ee)|0,x=x+Math.imul(pe,Ce)|0,g=g+Math.imul(ce,Te)|0,l=l+Math.imul(ce,ke)|0,l=l+Math.imul(le,Te)|0,x=x+Math.imul(le,ke)|0,g=g+Math.imul(oe,Me)|0,l=l+Math.imul(oe,Oe)|0,l=l+Math.imul(ae,Me)|0,x=x+Math.imul(ae,Oe)|0,g=g+Math.imul(ne,Ae)|0,l=l+Math.imul(ne,Re)|0,l=l+Math.imul(se,Ae)|0,x=x+Math.imul(se,Re)|0,g=g+Math.imul(K,Pe)|0,l=l+Math.imul(K,Be)|0,l=l+Math.imul(Y,Pe)|0,x=x+Math.imul(Y,Be)|0,g=g+Math.imul(F,Ne)|0,l=l+Math.imul(F,Ie)|0,l=l+Math.imul(V,Ne)|0,x=x+Math.imul(V,Ie)|0,g=g+Math.imul(P,De)|0,l=l+Math.imul(P,je)|0,l=l+Math.imul(B,De)|0,x=x+Math.imul(B,je)|0;var Qo=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(Qo>>>26)|0,Qo&=67108863,g=Math.imul(ve,be),l=Math.imul(ve,we),l=l+Math.imul(ge,be)|0,x=Math.imul(ge,we),g=g+Math.imul(he,_e)|0,l=l+Math.imul(he,Se)|0,l=l+Math.imul(me,_e)|0,x=x+Math.imul(me,Se)|0,g=g+Math.imul(de,Ee)|0,l=l+Math.imul(de,Ce)|0,l=l+Math.imul(fe,Ee)|0,x=x+Math.imul(fe,Ce)|0,g=g+Math.imul(ue,Te)|0,l=l+Math.imul(ue,ke)|0,l=l+Math.imul(pe,Te)|0,x=x+Math.imul(pe,ke)|0,g=g+Math.imul(ce,Me)|0,l=l+Math.imul(ce,Oe)|0,l=l+Math.imul(le,Me)|0,x=x+Math.imul(le,Oe)|0,g=g+Math.imul(oe,Ae)|0,l=l+Math.imul(oe,Re)|0,l=l+Math.imul(ae,Ae)|0,x=x+Math.imul(ae,Re)|0,g=g+Math.imul(ne,Pe)|0,l=l+Math.imul(ne,Be)|0,l=l+Math.imul(se,Pe)|0,x=x+Math.imul(se,Be)|0,g=g+Math.imul(K,Ne)|0,l=l+Math.imul(K,Ie)|0,l=l+Math.imul(Y,Ne)|0,x=x+Math.imul(Y,Ie)|0,g=g+Math.imul(F,De)|0,l=l+Math.imul(F,je)|0,l=l+Math.imul(V,De)|0,x=x+Math.imul(V,je)|0;var ea=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(ea>>>26)|0,ea&=67108863,g=Math.imul(ve,_e),l=Math.imul(ve,Se),l=l+Math.imul(ge,_e)|0,x=Math.imul(ge,Se),g=g+Math.imul(he,Ee)|0,l=l+Math.imul(he,Ce)|0,l=l+Math.imul(me,Ee)|0,x=x+Math.imul(me,Ce)|0,g=g+Math.imul(de,Te)|0,l=l+Math.imul(de,ke)|0,l=l+Math.imul(fe,Te)|0,x=x+Math.imul(fe,ke)|0,g=g+Math.imul(ue,Me)|0,l=l+Math.imul(ue,Oe)|0,l=l+Math.imul(pe,Me)|0,x=x+Math.imul(pe,Oe)|0,g=g+Math.imul(ce,Ae)|0,l=l+Math.imul(ce,Re)|0,l=l+Math.imul(le,Ae)|0,x=x+Math.imul(le,Re)|0,g=g+Math.imul(oe,Pe)|0,l=l+Math.imul(oe,Be)|0,l=l+Math.imul(ae,Pe)|0,x=x+Math.imul(ae,Be)|0,g=g+Math.imul(ne,Ne)|0,l=l+Math.imul(ne,Ie)|0,l=l+Math.imul(se,Ne)|0,x=x+Math.imul(se,Ie)|0,g=g+Math.imul(K,De)|0,l=l+Math.imul(K,je)|0,l=l+Math.imul(Y,De)|0,x=x+Math.imul(Y,je)|0;var ta=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(ta>>>26)|0,ta&=67108863,g=Math.imul(ve,Ee),l=Math.imul(ve,Ce),l=l+Math.imul(ge,Ee)|0,x=Math.imul(ge,Ce),g=g+Math.imul(he,Te)|0,l=l+Math.imul(he,ke)|0,l=l+Math.imul(me,Te)|0,x=x+Math.imul(me,ke)|0,g=g+Math.imul(de,Me)|0,l=l+Math.imul(de,Oe)|0,l=l+Math.imul(fe,Me)|0,x=x+Math.imul(fe,Oe)|0,g=g+Math.imul(ue,Ae)|0,l=l+Math.imul(ue,Re)|0,l=l+Math.imul(pe,Ae)|0,x=x+Math.imul(pe,Re)|0,g=g+Math.imul(ce,Pe)|0,l=l+Math.imul(ce,Be)|0,l=l+Math.imul(le,Pe)|0,x=x+Math.imul(le,Be)|0,g=g+Math.imul(oe,Ne)|0,l=l+Math.imul(oe,Ie)|0,l=l+Math.imul(ae,Ne)|0,x=x+Math.imul(ae,Ie)|0,g=g+Math.imul(ne,De)|0,l=l+Math.imul(ne,je)|0,l=l+Math.imul(se,De)|0,x=x+Math.imul(se,je)|0;var ia=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(ia>>>26)|0,ia&=67108863,g=Math.imul(ve,Te),l=Math.imul(ve,ke),l=l+Math.imul(ge,Te)|0,x=Math.imul(ge,ke),g=g+Math.imul(he,Me)|0,l=l+Math.imul(he,Oe)|0,l=l+Math.imul(me,Me)|0,x=x+Math.imul(me,Oe)|0,g=g+Math.imul(de,Ae)|0,l=l+Math.imul(de,Re)|0,l=l+Math.imul(fe,Ae)|0,x=x+Math.imul(fe,Re)|0,g=g+Math.imul(ue,Pe)|0,l=l+Math.imul(ue,Be)|0,l=l+Math.imul(pe,Pe)|0,x=x+Math.imul(pe,Be)|0,g=g+Math.imul(ce,Ne)|0,l=l+Math.imul(ce,Ie)|0,l=l+Math.imul(le,Ne)|0,x=x+Math.imul(le,Ie)|0,g=g+Math.imul(oe,De)|0,l=l+Math.imul(oe,je)|0,l=l+Math.imul(ae,De)|0,x=x+Math.imul(ae,je)|0;var ra=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(ra>>>26)|0,ra&=67108863,g=Math.imul(ve,Me),l=Math.imul(ve,Oe),l=l+Math.imul(ge,Me)|0,x=Math.imul(ge,Oe),g=g+Math.imul(he,Ae)|0,l=l+Math.imul(he,Re)|0,l=l+Math.imul(me,Ae)|0,x=x+Math.imul(me,Re)|0,g=g+Math.imul(de,Pe)|0,l=l+Math.imul(de,Be)|0,l=l+Math.imul(fe,Pe)|0,x=x+Math.imul(fe,Be)|0,g=g+Math.imul(ue,Ne)|0,l=l+Math.imul(ue,Ie)|0,l=l+Math.imul(pe,Ne)|0,x=x+Math.imul(pe,Ie)|0,g=g+Math.imul(ce,De)|0,l=l+Math.imul(ce,je)|0,l=l+Math.imul(le,De)|0,x=x+Math.imul(le,je)|0;var na=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(na>>>26)|0,na&=67108863,g=Math.imul(ve,Ae),l=Math.imul(ve,Re),l=l+Math.imul(ge,Ae)|0,x=Math.imul(ge,Re),g=g+Math.imul(he,Pe)|0,l=l+Math.imul(he,Be)|0,l=l+Math.imul(me,Pe)|0,x=x+Math.imul(me,Be)|0,g=g+Math.imul(de,Ne)|0,l=l+Math.imul(de,Ie)|0,l=l+Math.imul(fe,Ne)|0,x=x+Math.imul(fe,Ie)|0,g=g+Math.imul(ue,De)|0,l=l+Math.imul(ue,je)|0,l=l+Math.imul(pe,De)|0,x=x+Math.imul(pe,je)|0;var sa=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(sa>>>26)|0,sa&=67108863,g=Math.imul(ve,Pe),l=Math.imul(ve,Be),l=l+Math.imul(ge,Pe)|0,x=Math.imul(ge,Be),g=g+Math.imul(he,Ne)|0,l=l+Math.imul(he,Ie)|0,l=l+Math.imul(me,Ne)|0,x=x+Math.imul(me,Ie)|0,g=g+Math.imul(de,De)|0,l=l+Math.imul(de,je)|0,l=l+Math.imul(fe,De)|0,x=x+Math.imul(fe,je)|0;var oa=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(oa>>>26)|0,oa&=67108863,g=Math.imul(ve,Ne),l=Math.imul(ve,Ie),l=l+Math.imul(ge,Ne)|0,x=Math.imul(ge,Ie),g=g+Math.imul(he,De)|0,l=l+Math.imul(he,je)|0,l=l+Math.imul(me,De)|0,x=x+Math.imul(me,je)|0;var aa=(S+g|0)+((l&8191)<<13)|0;S=(x+(l>>>13)|0)+(aa>>>26)|0,aa&=67108863,g=Math.imul(ve,De),l=Math.imul(ve,je),l=l+Math.imul(ge,De)|0,x=Math.imul(ge,je);var ca=(S+g|0)+((l&8191)<<13)|0;return S=(x+(l>>>13)|0)+(ca>>>26)|0,ca&=67108863,w[0]=Wo,w[1]=$o,w[2]=Vo,w[3]=Ko,w[4]=Go,w[5]=Yo,w[6]=Jo,w[7]=Xo,w[8]=Zo,w[9]=Qo,w[10]=ea,w[11]=ta,w[12]=ia,w[13]=ra,w[14]=na,w[15]=sa,w[16]=oa,w[17]=aa,w[18]=ca,S!==0&&(w[19]=S,h.length++),h};Math.imul||(C=E);function k(b,a,p){p.negative=a.negative^b.negative,p.length=b.length+a.length;for(var h=0,m=0,y=0;y<p.length-1;y++){var w=m;m=0;for(var S=h&67108863,g=Math.min(y,a.length-1),l=Math.max(0,y-b.length+1);l<=g;l++){var x=y-l,R=b.words[x]|0,P=a.words[l]|0,B=R*P,D=B&67108863;w=w+(B/67108864|0)|0,D=D+S|0,S=D&67108863,w=w+(D>>>26)|0,m+=w>>>26,w&=67108863}p.words[y]=S,h=w,w=m}return h!==0?p.words[y]=h:p.length--,p.strip()}function M(b,a,p){var h=new O;return h.mulp(b,a,p)}n.prototype.mulTo=function(a,p){var h,m=this.length+a.length;return this.length===10&&a.length===10?h=C(this,a,p):m<63?h=E(this,a,p):m<1024?h=k(this,a,p):h=M(this,a,p),h};function O(b,a){this.x=b,this.y=a}O.prototype.makeRBT=function(a){for(var p=new Array(a),h=n.prototype._countBits(a)-1,m=0;m<a;m++)p[m]=this.revBin(m,h,a);return p},O.prototype.revBin=function(a,p,h){if(a===0||a===h-1)return a;for(var m=0,y=0;y<p;y++)m|=(a&1)<<p-y-1,a>>=1;return m},O.prototype.permute=function(a,p,h,m,y,w){for(var S=0;S<w;S++)m[S]=p[a[S]],y[S]=h[a[S]]},O.prototype.transform=function(a,p,h,m,y,w){this.permute(w,a,p,h,m,y);for(var S=1;S<y;S<<=1)for(var g=S<<1,l=Math.cos(2*Math.PI/g),x=Math.sin(2*Math.PI/g),R=0;R<y;R+=g)for(var P=l,B=x,D=0;D<S;D++){var F=h[R+D],V=m[R+D],ui=h[R+D+S],K=m[R+D+S],Y=P*ui-B*K;K=P*K+B*ui,ui=Y,h[R+D]=F+ui,m[R+D]=V+K,h[R+D+S]=F-ui,m[R+D+S]=V-K,D!==g&&(Y=l*P-x*B,B=l*B+x*P,P=Y)}},O.prototype.guessLen13b=function(a,p){var h=Math.max(p,a)|1,m=h&1,y=0;for(h=h/2|0;h;h=h>>>1)y++;return 1<<y+1+m},O.prototype.conjugate=function(a,p,h){if(!(h<=1))for(var m=0;m<h/2;m++){var y=a[m];a[m]=a[h-m-1],a[h-m-1]=y,y=p[m],p[m]=-p[h-m-1],p[h-m-1]=-y}},O.prototype.normalize13b=function(a,p){for(var h=0,m=0;m<p/2;m++){var y=Math.round(a[2*m+1]/p)*8192+Math.round(a[2*m]/p)+h;a[m]=y&67108863,y<67108864?h=0:h=y/67108864|0}return a},O.prototype.convert13b=function(a,p,h,m){for(var y=0,w=0;w<p;w++)y=y+(a[w]|0),h[2*w]=y&8191,y=y>>>13,h[2*w+1]=y&8191,y=y>>>13;for(w=2*p;w<m;++w)h[w]=0;t(y===0),t((y&-8192)===0)},O.prototype.stub=function(a){for(var p=new Array(a),h=0;h<a;h++)p[h]=0;return p},O.prototype.mulp=function(a,p,h){var m=2*this.guessLen13b(a.length,p.length),y=this.makeRBT(m),w=this.stub(m),S=new Array(m),g=new Array(m),l=new Array(m),x=new Array(m),R=new Array(m),P=new Array(m),B=h.words;B.length=m,this.convert13b(a.words,a.length,S,m),this.convert13b(p.words,p.length,x,m),this.transform(S,w,g,l,m,y),this.transform(x,w,R,P,m,y);for(var D=0;D<m;D++){var F=g[D]*R[D]-l[D]*P[D];l[D]=g[D]*P[D]+l[D]*R[D],g[D]=F}return this.conjugate(g,l,m),this.transform(g,l,B,w,m,y),this.conjugate(B,w,m),this.normalize13b(B,m),h.negative=a.negative^p.negative,h.length=a.length+p.length,h.strip()},n.prototype.mul=function(a){var p=new n(null);return p.words=new Array(this.length+a.length),this.mulTo(a,p)},n.prototype.mulf=function(a){var p=new n(null);return p.words=new Array(this.length+a.length),M(this,a,p)},n.prototype.imul=function(a){return this.clone().mulTo(a,this)},n.prototype.imuln=function(a){t(typeof a=="number"),t(a<67108864);for(var p=0,h=0;h<this.length;h++){var m=(this.words[h]|0)*a,y=(m&67108863)+(p&67108863);p>>=26,p+=m/67108864|0,p+=y>>>26,this.words[h]=y&67108863}return p!==0&&(this.words[h]=p,this.length++),this.length=a===0?1:this.length,this},n.prototype.muln=function(a){return this.clone().imuln(a)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(a){var p=_(a);if(p.length===0)return new n(1);for(var h=this,m=0;m<p.length&&p[m]===0;m++,h=h.sqr());if(++m<p.length)for(var y=h.sqr();m<p.length;m++,y=y.sqr())p[m]!==0&&(h=h.mul(y));return h},n.prototype.iushln=function(a){t(typeof a=="number"&&a>=0);var p=a%26,h=(a-p)/26,m=67108863>>>26-p<<26-p,y;if(p!==0){var w=0;for(y=0;y<this.length;y++){var S=this.words[y]&m,g=(this.words[y]|0)-S<<p;this.words[y]=g|w,w=S>>>26-p}w&&(this.words[y]=w,this.length++)}if(h!==0){for(y=this.length-1;y>=0;y--)this.words[y+h]=this.words[y];for(y=0;y<h;y++)this.words[y]=0;this.length+=h}return this.strip()},n.prototype.ishln=function(a){return t(this.negative===0),this.iushln(a)},n.prototype.iushrn=function(a,p,h){t(typeof a=="number"&&a>=0);var m;p?m=(p-p%26)/26:m=0;var y=a%26,w=Math.min((a-y)/26,this.length),S=67108863^67108863>>>y<<y,g=h;if(m-=w,m=Math.max(0,m),g){for(var l=0;l<w;l++)g.words[l]=this.words[l];g.length=w}if(w!==0)if(this.length>w)for(this.length-=w,l=0;l<this.length;l++)this.words[l]=this.words[l+w];else this.words[0]=0,this.length=1;var x=0;for(l=this.length-1;l>=0&&(x!==0||l>=m);l--){var R=this.words[l]|0;this.words[l]=x<<26-y|R>>>y,x=R&S}return g&&x!==0&&(g.words[g.length++]=x),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(a,p,h){return t(this.negative===0),this.iushrn(a,p,h)},n.prototype.shln=function(a){return this.clone().ishln(a)},n.prototype.ushln=function(a){return this.clone().iushln(a)},n.prototype.shrn=function(a){return this.clone().ishrn(a)},n.prototype.ushrn=function(a){return this.clone().iushrn(a)},n.prototype.testn=function(a){t(typeof a=="number"&&a>=0);var p=a%26,h=(a-p)/26,m=1<<p;if(this.length<=h)return!1;var y=this.words[h];return!!(y&m)},n.prototype.imaskn=function(a){t(typeof a=="number"&&a>=0);var p=a%26,h=(a-p)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(p!==0&&h++,this.length=Math.min(h,this.length),p!==0){var m=67108863^67108863>>>p<<p;this.words[this.length-1]&=m}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.maskn=function(a){return this.clone().imaskn(a)},n.prototype.iaddn=function(a){return t(typeof a=="number"),t(a<67108864),a<0?this.isubn(-a):this.negative!==0?this.length===1&&(this.words[0]|0)<a?(this.words[0]=a-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},n.prototype._iaddn=function(a){this.words[0]+=a;for(var p=0;p<this.length&&this.words[p]>=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},n.prototype.isubn=function(a){if(t(typeof a=="number"),t(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p<this.length&&this.words[p]<0;p++)this.words[p]+=67108864,this.words[p+1]-=1;return this.strip()},n.prototype.addn=function(a){return this.clone().iaddn(a)},n.prototype.subn=function(a){return this.clone().isubn(a)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(a,p,h){var m=a.length+h,y;this._expand(m);var w,S=0;for(y=0;y<a.length;y++){w=(this.words[y+h]|0)+S;var g=(a.words[y]|0)*p;w-=g&67108863,S=(w>>26)-(g/67108864|0),this.words[y+h]=w&67108863}for(;y<this.length-h;y++)w=(this.words[y+h]|0)+S,S=w>>26,this.words[y+h]=w&67108863;if(S===0)return this.strip();for(t(S===-1),S=0,y=0;y<this.length;y++)w=-(this.words[y]|0)+S,S=w>>26,this.words[y]=w&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(a,p){var h=this.length-a.length,m=this.clone(),y=a,w=y.words[y.length-1]|0,S=this._countBits(w);h=26-S,h!==0&&(y=y.ushln(h),m.iushln(h),w=y.words[y.length-1]|0);var g=m.length-y.length,l;if(p!=="mod"){l=new n(null),l.length=g+1,l.words=new Array(l.length);for(var x=0;x<l.length;x++)l.words[x]=0}var R=m.clone()._ishlnsubmul(y,1,g);R.negative===0&&(m=R,l&&(l.words[g]=1));for(var P=g-1;P>=0;P--){var B=(m.words[y.length+P]|0)*67108864+(m.words[y.length+P-1]|0);for(B=Math.min(B/w|0,67108863),m._ishlnsubmul(y,B,P);m.negative!==0;)B--,m.negative=0,m._ishlnsubmul(y,1,P),m.isZero()||(m.negative^=1);l&&(l.words[P]=B)}return l&&l.strip(),m.strip(),p!=="div"&&h!==0&&m.iushrn(h),{div:l||null,mod:m}},n.prototype.divmod=function(a,p,h){if(t(!a.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var m,y,w;return this.negative!==0&&a.negative===0?(w=this.neg().divmod(a,p),p!=="mod"&&(m=w.div.neg()),p!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.iadd(a)),{div:m,mod:y}):this.negative===0&&a.negative!==0?(w=this.divmod(a.neg(),p),p!=="mod"&&(m=w.div.neg()),{div:m,mod:w.mod}):(this.negative&a.negative)!==0?(w=this.neg().divmod(a.neg(),p),p!=="div"&&(y=w.mod.neg(),h&&y.negative!==0&&y.isub(a)),{div:w.div,mod:y}):a.length>this.length||this.cmp(a)<0?{div:new n(0),mod:this}:a.length===1?p==="div"?{div:this.divn(a.words[0]),mod:null}:p==="mod"?{div:null,mod:new n(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new n(this.modn(a.words[0]))}:this._wordDiv(a,p)},n.prototype.div=function(a){return this.divmod(a,"div",!1).div},n.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},n.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},n.prototype.divRound=function(a){var p=this.divmod(a);if(p.mod.isZero())return p.div;var h=p.div.negative!==0?p.mod.isub(a):p.mod,m=a.ushrn(1),y=a.andln(1),w=h.cmp(m);return w<0||y===1&&w===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},n.prototype.modn=function(a){t(a<=67108863);for(var p=(1<<26)%a,h=0,m=this.length-1;m>=0;m--)h=(p*h+(this.words[m]|0))%a;return h},n.prototype.idivn=function(a){t(a<=67108863);for(var p=0,h=this.length-1;h>=0;h--){var m=(this.words[h]|0)+p*67108864;this.words[h]=m/a|0,p=m%a}return this.strip()},n.prototype.divn=function(a){return this.clone().idivn(a)},n.prototype.egcd=function(a){t(a.negative===0),t(!a.isZero());var p=this,h=a.clone();p.negative!==0?p=p.umod(a):p=p.clone();for(var m=new n(1),y=new n(0),w=new n(0),S=new n(1),g=0;p.isEven()&&h.isEven();)p.iushrn(1),h.iushrn(1),++g;for(var l=h.clone(),x=p.clone();!p.isZero();){for(var R=0,P=1;(p.words[0]&P)===0&&R<26;++R,P<<=1);if(R>0)for(p.iushrn(R);R-- >0;)(m.isOdd()||y.isOdd())&&(m.iadd(l),y.isub(x)),m.iushrn(1),y.iushrn(1);for(var B=0,D=1;(h.words[0]&D)===0&&B<26;++B,D<<=1);if(B>0)for(h.iushrn(B);B-- >0;)(w.isOdd()||S.isOdd())&&(w.iadd(l),S.isub(x)),w.iushrn(1),S.iushrn(1);p.cmp(h)>=0?(p.isub(h),m.isub(w),y.isub(S)):(h.isub(p),w.isub(m),S.isub(y))}return{a:w,b:S,gcd:h.iushln(g)}},n.prototype._invmp=function(a){t(a.negative===0),t(!a.isZero());var p=this,h=a.clone();p.negative!==0?p=p.umod(a):p=p.clone();for(var m=new n(1),y=new n(0),w=h.clone();p.cmpn(1)>0&&h.cmpn(1)>0;){for(var S=0,g=1;(p.words[0]&g)===0&&S<26;++S,g<<=1);if(S>0)for(p.iushrn(S);S-- >0;)m.isOdd()&&m.iadd(w),m.iushrn(1);for(var l=0,x=1;(h.words[0]&x)===0&&l<26;++l,x<<=1);if(l>0)for(h.iushrn(l);l-- >0;)y.isOdd()&&y.iadd(w),y.iushrn(1);p.cmp(h)>=0?(p.isub(h),m.isub(y)):(h.isub(p),y.isub(m))}var R;return p.cmpn(1)===0?R=m:R=y,R.cmpn(0)<0&&R.iadd(a),R},n.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var p=this.clone(),h=a.clone();p.negative=0,h.negative=0;for(var m=0;p.isEven()&&h.isEven();m++)p.iushrn(1),h.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;h.isEven();)h.iushrn(1);var y=p.cmp(h);if(y<0){var w=p;p=h,h=w}else if(y===0||h.cmpn(1)===0)break;p.isub(h)}while(!0);return h.iushln(m)},n.prototype.invm=function(a){return this.egcd(a).a.umod(a)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(a){return this.words[0]&a},n.prototype.bincn=function(a){t(typeof a=="number");var p=a%26,h=(a-p)/26,m=1<<p;if(this.length<=h)return this._expand(h+1),this.words[h]|=m,this;for(var y=m,w=h;y!==0&&w<this.length;w++){var S=this.words[w]|0;S+=y,y=S>>>26,S&=67108863,this.words[w]=S}return y!==0&&(this.words[w]=y,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(a){var p=a<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this.strip();var h;if(this.length>1)h=1;else{p&&(a=-a),t(a<=67108863,"Number is too big");var m=this.words[0]|0;h=m===a?0:m<a?-1:1}return this.negative!==0?-h|0:h},n.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var p=this.ucmp(a);return this.negative!==0?-p|0:p},n.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var p=0,h=this.length-1;h>=0;h--){var m=this.words[h]|0,y=a.words[h]|0;if(m!==y){m<y?p=-1:m>y&&(p=1);break}}return p},n.prototype.gtn=function(a){return this.cmpn(a)===1},n.prototype.gt=function(a){return this.cmp(a)===1},n.prototype.gten=function(a){return this.cmpn(a)>=0},n.prototype.gte=function(a){return this.cmp(a)>=0},n.prototype.ltn=function(a){return this.cmpn(a)===-1},n.prototype.lt=function(a){return this.cmp(a)===-1},n.prototype.lten=function(a){return this.cmpn(a)<=0},n.prototype.lte=function(a){return this.cmp(a)<=0},n.prototype.eqn=function(a){return this.cmpn(a)===0},n.prototype.eq=function(a){return this.cmp(a)===0},n.red=function(a){return new q(a)},n.prototype.toRed=function(a){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},n.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(a){return this.red=a,this},n.prototype.forceRed=function(a){return t(!this.red,"Already a number in reduction context"),this._forceRed(a)},n.prototype.redAdd=function(a){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},n.prototype.redIAdd=function(a){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},n.prototype.redSub=function(a){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},n.prototype.redISub=function(a){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},n.prototype.redShl=function(a){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},n.prototype.redMul=function(a){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},n.prototype.redIMul=function(a){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},n.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(a){return t(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var A={k256:null,p224:null,p192:null,p25519:null};function I(b,a){this.name=b,this.p=new n(a,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}I.prototype._tmp=function(){var a=new n(null);return a.words=new Array(Math.ceil(this.n/13)),a},I.prototype.ireduce=function(a){var p=a,h;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),h=p.bitLength();while(h>this.n);var m=h<this.n?-1:p.ucmp(this.p);return m===0?(p.words[0]=0,p.length=1):m>0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},I.prototype.split=function(a,p){a.iushrn(this.n,0,p)},I.prototype.imulK=function(a){return a.imul(this.k)};function U(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}r(U,I),U.prototype.split=function(a,p){for(var h=4194303,m=Math.min(a.length,9),y=0;y<m;y++)p.words[y]=a.words[y];if(p.length=m,a.length<=9){a.words[0]=0,a.length=1;return}var w=a.words[9];for(p.words[p.length++]=w&h,y=10;y<a.length;y++){var S=a.words[y]|0;a.words[y-10]=(S&h)<<4|w>>>22,w=S}w>>>=22,a.words[y-10]=w,w===0&&a.length>10?a.length-=10:a.length-=9},U.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var p=0,h=0;h<a.length;h++){var m=a.words[h]|0;p+=m*977,a.words[h]=p&67108863,p=m*64+(p/67108864|0)}return a.words[a.length-1]===0&&(a.length--,a.words[a.length-1]===0&&a.length--),a};function Xe(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}r(Xe,I);function te(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}r(te,I);function Le(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}r(Le,I),Le.prototype.imulK=function(a){for(var p=0,h=0;h<a.length;h++){var m=(a.words[h]|0)*19+p,y=m&67108863;m>>>=26,a.words[h]=y,p=m}return p!==0&&(a.words[a.length++]=p),a},n._prime=function(a){if(A[a])return A[a];var p;if(a==="k256")p=new U;else if(a==="p224")p=new Xe;else if(a==="p192")p=new te;else if(a==="p25519")p=new Le;else throw new Error("Unknown prime "+a);return A[a]=p,p};function q(b){if(typeof b=="string"){var a=n._prime(b);this.m=a.p,this.prime=a}else t(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}q.prototype._verify1=function(a){t(a.negative===0,"red works only with positives"),t(a.red,"red works only with red numbers")},q.prototype._verify2=function(a,p){t((a.negative|p.negative)===0,"red works only with positives"),t(a.red&&a.red===p.red,"red works only with red numbers")},q.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},q.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},q.prototype.add=function(a,p){this._verify2(a,p);var h=a.add(p);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},q.prototype.iadd=function(a,p){this._verify2(a,p);var h=a.iadd(p);return h.cmp(this.m)>=0&&h.isub(this.m),h},q.prototype.sub=function(a,p){this._verify2(a,p);var h=a.sub(p);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},q.prototype.isub=function(a,p){this._verify2(a,p);var h=a.isub(p);return h.cmpn(0)<0&&h.iadd(this.m),h},q.prototype.shl=function(a,p){return this._verify1(a),this.imod(a.ushln(p))},q.prototype.imul=function(a,p){return this._verify2(a,p),this.imod(a.imul(p))},q.prototype.mul=function(a,p){return this._verify2(a,p),this.imod(a.mul(p))},q.prototype.isqr=function(a){return this.imul(a,a.clone())},q.prototype.sqr=function(a){return this.mul(a,a)},q.prototype.sqrt=function(a){if(a.isZero())return a.clone();var p=this.m.andln(3);if(t(p%2===1),p===3){var h=this.m.add(new n(1)).iushrn(2);return this.pow(a,h)}for(var m=this.m.subn(1),y=0;!m.isZero()&&m.andln(1)===0;)y++,m.iushrn(1);t(!m.isZero());var w=new n(1).toRed(this),S=w.redNeg(),g=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new n(2*l*l).toRed(this);this.pow(l,g).cmp(S)!==0;)l.redIAdd(S);for(var x=this.pow(l,m),R=this.pow(a,m.addn(1).iushrn(1)),P=this.pow(a,m),B=y;P.cmp(w)!==0;){for(var D=P,F=0;D.cmp(w)!==0;F++)D=D.redSqr();t(F<B);var V=this.pow(x,new n(1).iushln(B-F-1));R=R.redMul(V),x=V.redSqr(),P=P.redMul(x),B=F}return R},q.prototype.invm=function(a){var p=a._invmp(this.m);return p.negative!==0?(p.negative=0,this.imod(p).redNeg()):this.imod(p)},q.prototype.pow=function(a,p){if(p.isZero())return new n(1).toRed(this);if(p.cmpn(1)===0)return a.clone();var h=4,m=new Array(1<<h);m[0]=new n(1).toRed(this),m[1]=a;for(var y=2;y<m.length;y++)m[y]=this.mul(m[y-1],a);var w=m[0],S=0,g=0,l=p.bitLength()%26;for(l===0&&(l=26),y=p.length-1;y>=0;y--){for(var x=p.words[y],R=l-1;R>=0;R--){var P=x>>R&1;if(w!==m[0]&&(w=this.sqr(w)),P===0&&S===0){g=0;continue}S<<=1,S|=P,g++,!(g!==h&&(y!==0||R!==0))&&(w=this.mul(w,m[S]),g=0,S=0)}l=26}return w},q.prototype.convertTo=function(a){var p=a.umod(this.m);return p===a?p.clone():p},q.prototype.convertFrom=function(a){var p=a.clone();return p.red=null,p},n.mont=function(a){return new qe(a)};function qe(b){q.call(this,b),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(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)}r(qe,q),qe.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},qe.prototype.convertFrom=function(a){var p=this.imod(a.mul(this.rinv));return p.red=null,p},qe.prototype.imul=function(a,p){if(a.isZero()||p.isZero())return a.words[0]=0,a.length=1,a;var h=a.imul(p),m=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=h.isub(m).iushrn(this.shift),w=y;return y.cmp(this.m)>=0?w=y.isub(this.m):y.cmpn(0)<0&&(w=y.iadd(this.m)),w._forceRed(this)},qe.prototype.mul=function(a,p){if(a.isZero()||p.isZero())return new n(0)._forceRed(this);var h=a.mul(p),m=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=h.isub(m).iushrn(this.shift),w=y;return y.cmp(this.m)>=0?w=y.isub(this.m):y.cmpn(0)<0&&(w=y.iadd(this.m)),w._forceRed(this)},qe.prototype.invm=function(a){var p=this.imod(a._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(typeof Sl>"u"||Sl,iv)});var rv=T((FO,Cl)=>{typeof Object.create=="function"?Cl.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Cl.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}});var wi=T((UO,kl)=>{try{if(Tl=require("util"),typeof Tl.inherits!="function")throw"";kl.exports=Tl.inherits}catch{kl.exports=rv()}var Tl});var io=T((HO,nv)=>{"use strict";var to=require("buffer"),Rr=to.Buffer,Et={},Ct;for(Ct in to)to.hasOwnProperty(Ct)&&(Ct==="SlowBuffer"||Ct==="Buffer"||(Et[Ct]=to[Ct]));var Pr=Et.Buffer={};for(Ct in Rr)Rr.hasOwnProperty(Ct)&&(Ct==="allocUnsafe"||Ct==="allocUnsafeSlow"||(Pr[Ct]=Rr[Ct]));Et.Buffer.prototype=Rr.prototype;(!Pr.from||Pr.from===Uint8Array.from)&&(Pr.from=function(i,e,t){if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof i);if(i&&typeof i.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);return Rr(i,e,t)});Pr.alloc||(Pr.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof i);if(i<0||i>=2*(1<<30))throw new RangeError('The value "'+i+'" is invalid for option "size"');var r=Rr(i);return!e||e.length===0?r.fill(0):typeof t=="string"?r.fill(e,t):r.fill(e),r});if(!Et.kStringMaxLength)try{Et.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}Et.constants||(Et.constants={MAX_LENGTH:Et.kMaxLength},Et.kStringMaxLength&&(Et.constants.MAX_STRING_LENGTH=Et.kStringMaxLength));nv.exports=Et});var ro=T(sv=>{"use strict";var uE=wi();function Tt(i){this._reporterState={obj:null,path:[],options:i||{},errors:[]}}sv.Reporter=Tt;Tt.prototype.isError=function(e){return e instanceof Br};Tt.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Tt.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};Tt.prototype.enterKey=function(e){return this._reporterState.path.push(e)};Tt.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};Tt.prototype.leaveKey=function(e,t,r){let n=this._reporterState;this.exitKey(e),n.obj!==null&&(n.obj[t]=r)};Tt.prototype.path=function(){return this._reporterState.path.join("/")};Tt.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};Tt.prototype.leaveObject=function(e){let t=this._reporterState,r=t.obj;return t.obj=e,r};Tt.prototype.error=function(e){let t,r=this._reporterState,n=e instanceof Br;if(n?t=e:t=new Br(r.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t};Tt.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Br(i,e){this.path=i,this.rethrow(e)}uE(Br,Error);Br.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Br),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Dr=T(Ml=>{"use strict";var pE=wi(),no=ro().Reporter,Nr=io().Buffer;function kt(i,e){if(no.call(this,e),!Nr.isBuffer(i)){this.error("Input not Buffer");return}this.base=i,this.offset=0,this.length=i.length}pE(kt,no);Ml.DecoderBuffer=kt;kt.isDecoderBuffer=function(e){return e instanceof kt?!0:typeof e=="object"&&Nr.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"};kt.prototype.save=function(){return{offset:this.offset,reporter:no.prototype.save.call(this)}};kt.prototype.restore=function(e){let t=new kt(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,no.prototype.restore.call(this,e.reporter),t};kt.prototype.isEmpty=function(){return this.offset===this.length};kt.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};kt.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let r=new kt(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r};kt.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Ir(i,e){if(Array.isArray(i))this.length=0,this.value=i.map(function(t){return Ir.isEncoderBuffer(t)||(t=new Ir(t,e)),this.length+=t.length,t},this);else if(typeof i=="number"){if(!(0<=i&&i<=255))return e.error("non-byte EncoderBuffer value");this.value=i,this.length=1}else if(typeof i=="string")this.value=i,this.length=Nr.byteLength(i);else if(Nr.isBuffer(i))this.value=i,this.length=i.length;else return e.error("Unsupported type: "+typeof i)}Ml.EncoderBuffer=Ir;Ir.isEncoderBuffer=function(e){return e instanceof Ir?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Ir.prototype.join=function(e,t){return e||(e=Nr.alloc(this.length)),t||(t=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):(typeof this.value=="number"?e[t]=this.value:typeof this.value=="string"?e.write(this.value,t):Nr.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var cv=T(($O,av)=>{av.exports=ov;function ov(i,e){if(!i)throw new Error(e||"Assertion failed")}ov.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}});var so=T((VO,uv)=>{"use strict";var dE=ro().Reporter,fE=Dr().EncoderBuffer,hE=Dr().DecoderBuffer,et=cv(),lv=["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"],mE=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(lv),vE=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function W(i,e,t){let r={};this._baseState=r,r.name=t,r.enc=i,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}uv.exports=W;var gE=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];W.prototype.clone=function(){let e=this._baseState,t={};gE.forEach(function(n){t[n]=e[n]});let r=new this.constructor(t.parent);return r._baseState=t,r};W.prototype._wrap=function(){let e=this._baseState;mE.forEach(function(t){this[t]=function(){let n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}},this)};W.prototype._init=function(e){let t=this._baseState;et(t.parent===null),e.call(this),t.children=t.children.filter(function(r){return r._baseState.parent===this},this),et.equal(t.children.length,1,"Root node can have only one child")};W.prototype._useArgs=function(e){let t=this._baseState,r=e.filter(function(n){return n instanceof this.constructor},this);e=e.filter(function(n){return!(n instanceof this.constructor)},this),r.length!==0&&(et(t.children===null),t.children=r,r.forEach(function(n){n._baseState.parent=this},this)),e.length!==0&&(et(t.args===null),t.args=e,t.reverseArgs=e.map(function(n){if(typeof n!="object"||n.constructor!==Object)return n;let s={};return Object.keys(n).forEach(function(o){o==(o|0)&&(o|=0);let c=n[o];s[c]=o}),s}))};vE.forEach(function(i){W.prototype[i]=function(){let t=this._baseState;throw new Error(i+" not implemented for encoding: "+t.enc)}});lv.forEach(function(i){W.prototype[i]=function(){let t=this._baseState,r=Array.prototype.slice.call(arguments);return et(t.tag===null),t.tag=i,this._useArgs(r),this}});W.prototype.use=function(e){et(e);let t=this._baseState;return et(t.use===null),t.use=e,this};W.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};W.prototype.def=function(e){let t=this._baseState;return et(t.default===null),t.default=e,t.optional=!0,this};W.prototype.explicit=function(e){let t=this._baseState;return et(t.explicit===null&&t.implicit===null),t.explicit=e,this};W.prototype.implicit=function(e){let t=this._baseState;return et(t.explicit===null&&t.implicit===null),t.implicit=e,this};W.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};W.prototype.key=function(e){let t=this._baseState;return et(t.key===null),t.key=e,this};W.prototype.any=function(){let e=this._baseState;return e.any=!0,this};W.prototype.choice=function(e){let t=this._baseState;return et(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(r){return e[r]})),this};W.prototype.contains=function(e){let t=this._baseState;return et(t.use===null),t.contains=e,this};W.prototype._decode=function(e,t){let r=this._baseState;if(r.parent===null)return e.wrapResult(r.children[0]._decode(e,t));let n=r.default,s=!0,o=null;if(r.key!==null&&(o=e.enterKey(r.key)),r.optional){let u=null;if(r.explicit!==null?u=r.explicit:r.implicit!==null?u=r.implicit:r.tag!==null&&(u=r.tag),u===null&&!r.any){let d=e.save();try{r.choice===null?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(d)}else if(s=this._peekTag(e,u,r.any),e.isError(s))return s}let c;if(r.obj&&s&&(c=e.enterObject()),s){if(r.explicit!==null){let d=this._decodeTag(e,r.explicit);if(e.isError(d))return d;e=d}let u=e.offset;if(r.use===null&&r.choice===null){let d;r.any&&(d=e.save());let f=this._decodeTag(e,r.implicit!==null?r.implicit:r.tag,r.any);if(e.isError(f))return f;r.any?n=e.raw(d):e=f}if(t&&t.track&&r.tag!==null&&t.track(e.path(),u,e.length,"tagged"),t&&t.track&&r.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),r.any||(r.choice===null?n=this._decodeGeneric(r.tag,e,t):n=this._decodeChoice(e,t)),e.isError(n))return n;if(!r.any&&r.choice===null&&r.children!==null&&r.children.forEach(function(f){f._decode(e,t)}),r.contains&&(r.tag==="octstr"||r.tag==="bitstr")){let d=new hE(n);n=this._getUse(r.contains,e._reporterState.obj)._decode(d,t)}}return r.obj&&s&&(n=e.leaveObject(c)),r.key!==null&&(n!==null||s===!0)?e.leaveKey(o,r.key,n):o!==null&&e.exitKey(o),n};W.prototype._decodeGeneric=function(e,t,r){let n=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):e==="objid"&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):e==="objid"?this._decodeObjid(t,null,null,r):e==="gentime"||e==="utctime"?this._decodeTime(t,e,r):e==="null_"?this._decodeNull(t,r):e==="bool"?this._decodeBool(t,r):e==="objDesc"?this._decodeStr(t,e,r):e==="int"||e==="enum"?this._decodeInt(t,n.args&&n.args[0],r):n.use!==null?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)};W.prototype._getUse=function(e,t){let r=this._baseState;return r.useDecoder=this._use(e,t),et(r.useDecoder._baseState.parent===null),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder};W.prototype._decodeChoice=function(e,t){let r=this._baseState,n=null,s=!1;return Object.keys(r.choice).some(function(o){let c=e.save(),u=r.choice[o];try{let d=u._decode(e,t);if(e.isError(d))return!1;n={type:o,value:d},s=!0}catch{return e.restore(c),!1}return!0},this),s?n:e.error("Choice not matched")};W.prototype._createEncoderBuffer=function(e){return new fE(e,this.reporter)};W.prototype._encode=function(e,t,r){let n=this._baseState;if(n.default!==null&&n.default===e)return;let s=this._encodeValue(e,t,r);if(s!==void 0&&!this._skipDefault(s,t,r))return s};W.prototype._encodeValue=function(e,t,r){let n=this._baseState;if(n.parent===null)return n.children[0]._encode(e,t||new dE);let s=null;if(this.reporter=t,n.optional&&e===void 0)if(n.default!==null)e=n.default;else return;let o=null,c=!1;if(n.any)s=this._createEncoderBuffer(e);else if(n.choice)s=this._encodeChoice(e,t);else if(n.contains)o=this._getUse(n.contains,r)._encode(e,t),c=!0;else if(n.children)o=n.children.map(function(u){if(u._baseState.tag==="null_")return u._encode(null,t,e);if(u._baseState.key===null)return t.error("Child should have a key");let d=t.enterKey(u._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let f=u._encode(e[u._baseState.key],t,e);return t.leaveKey(d),f},this).filter(function(u){return u}),o=this._createEncoderBuffer(o);else if(n.tag==="seqof"||n.tag==="setof"){if(!(n.args&&n.args.length===1))return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let u=this.clone();u._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(d){let f=this._baseState;return this._getUse(f.args[0],e)._encode(d,t)},u))}else n.use!==null?s=this._getUse(n.use,r)._encode(e,t):(o=this._encodePrimitive(n.tag,e),c=!0);if(!n.any&&n.choice===null){let u=n.implicit!==null?n.implicit:n.tag,d=n.implicit===null?"universal":"context";u===null?n.use===null&&t.error("Tag could be omitted only for .use()"):n.use===null&&(s=this._encodeComposite(u,c,d,o))}return n.explicit!==null&&(s=this._encodeComposite(n.explicit,!1,"context",s)),s};W.prototype._encodeChoice=function(e,t){let r=this._baseState,n=r.choice[e.type];return n||et(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)};W.prototype._encodePrimitive=function(e,t){let r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if(e==="objid"&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.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,r.args&&r.reverseArgs[0]);if(e==="bool")return this._encodeBool(t);if(e==="objDesc")return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)};W.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};W.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var oo=T(Fi=>{"use strict";function pv(i){let e={};return Object.keys(i).forEach(function(t){(t|0)==t&&(t=t|0);let r=i[t];e[r]=t}),e}Fi.tagClass={0:"universal",1:"application",2:"context",3:"private"};Fi.tagClassByName=pv(Fi.tagClass);Fi.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"};Fi.tagByName=pv(Fi.tag)});var Al=T((GO,hv)=>{"use strict";var xE=wi(),ai=io().Buffer,dv=so(),Ol=oo();function fv(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new jt,this.tree._init(i.body)}hv.exports=fv;fv.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function jt(i){dv.call(this,"der",i)}xE(jt,dv);jt.prototype._encodeComposite=function(e,t,r,n){let s=yE(e,t,r,this.reporter);if(n.length<128){let u=ai.alloc(2);return u[0]=s,u[1]=n.length,this._createEncoderBuffer([u,n])}let o=1;for(let u=n.length;u>=256;u>>=8)o++;let c=ai.alloc(2+o);c[0]=s,c[1]=128|o;for(let u=1+o,d=n.length;d>0;u--,d>>=8)c[u]=d&255;return this._createEncoderBuffer([c,n])};jt.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let r=ai.alloc(e.length*2);for(let n=0;n<e.length;n++)r.writeUInt16BE(e.charCodeAt(n),n*2);return this._createEncoderBuffer(r)}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")};jt.prototype._encodeObjid=function(e,t,r){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 c=0;c<e.length;c++)e[c]|=0}else if(Array.isArray(e)){e=e.slice();for(let c=0;c<e.length;c++)e[c]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let n=0;for(let c=0;c<e.length;c++){let u=e[c];for(n++;u>=128;u>>=7)n++}let s=ai.alloc(n),o=s.length-1;for(let c=e.length-1;c>=0;c--){let u=e[c];for(s[o--]=u&127;(u>>=7)>0;)s[o--]=128|u&127}return this._createEncoderBuffer(s)};function Mt(i){return i<10?"0"+i:i}jt.prototype._encodeTime=function(e,t){let r,n=new Date(e);return t==="gentime"?r=[Mt(n.getUTCFullYear()),Mt(n.getUTCMonth()+1),Mt(n.getUTCDate()),Mt(n.getUTCHours()),Mt(n.getUTCMinutes()),Mt(n.getUTCSeconds()),"Z"].join(""):t==="utctime"?r=[Mt(n.getUTCFullYear()%100),Mt(n.getUTCMonth()+1),Mt(n.getUTCDate()),Mt(n.getUTCHours()),Mt(n.getUTCMinutes()),Mt(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")};jt.prototype._encodeNull=function(){return this._createEncoderBuffer("")};jt.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"&&!ai.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=ai.from(s)}if(ai.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=ai.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 r=1;for(let s=e;s>=256;s>>=8)r++;let n=new Array(r);for(let s=n.length-1;s>=0;s--)n[s]=e&255,e>>=8;return n[0]&128&&n.unshift(0),this._createEncoderBuffer(ai.from(n))};jt.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};jt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};jt.prototype._skipDefault=function(e,t,r){let n=this._baseState,s;if(n.default===null)return!1;let o=e.join();if(n.defaultBuffer===void 0&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==n.defaultBuffer[s])return!1;return!0};function yE(i,e,t,r){let n;if(i==="seqof"?i="seq":i==="setof"&&(i="set"),Ol.tagByName.hasOwnProperty(i))n=Ol.tagByName[i];else if(typeof i=="number"&&(i|0)===i)n=i;else return r.error("Unknown tag: "+i);return n>=31?r.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|=Ol.tagClassByName[t||"universal"]<<6,n)}});var vv=T((YO,mv)=>{"use strict";var bE=wi(),Rl=Al();function Pl(i){Rl.call(this,i),this.enc="pem"}bE(Pl,Rl);mv.exports=Pl;Pl.prototype.encode=function(e,t){let n=Rl.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"];for(let o=0;o<n.length;o+=64)s.push(n.slice(o,o+64));return s.push("-----END "+t.label+"-----"),s.join(`
21
- `)}});var Bl=T(xv=>{"use strict";var gv=xv;gv.der=Al();gv.pem=vv()});var Il=T((XO,Ev)=>{"use strict";var wE=wi(),_E=El(),yv=Dr().DecoderBuffer,wv=so(),bv=oo();function _v(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new ft,this.tree._init(i.body)}Ev.exports=_v;_v.prototype.decode=function(e,t){return yv.isDecoderBuffer(e)||(e=new yv(e,t)),this.tree._decode(e,t)};function ft(i){wv.call(this,"der",i)}wE(ft,wv);ft.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;let n=e.save(),s=Nl(e,'Failed to peek tag: "'+t+'"');return e.isError(s)?s:(e.restore(n),s.tag===t||s.tagStr===t||s.tagStr+"of"===t||r)};ft.prototype._decodeTag=function(e,t,r){let n=Nl(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;let s=Sv(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(s))return s;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||s!==null)return e.skip(s,'Failed to match body of: "'+t+'"');let o=e.save(),c=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(c)?c:(s=e.offset-o.offset,e.restore(o),e.skip(s,'Failed to match body of: "'+t+'"'))};ft.prototype._skipUntilEnd=function(e,t){for(;;){let r=Nl(e,t);if(e.isError(r))return r;let n=Sv(e,r.primitive,t);if(e.isError(n))return n;let s;if(r.primitive||n!==null?s=e.skip(n):s=this._skipUntilEnd(e,t),e.isError(s))return s;if(r.tagStr==="end")break}};ft.prototype._decodeList=function(e,t,r,n){let s=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let c=r.decode(e,"der",n);if(e.isError(c)&&o)break;s.push(c)}return s};ft.prototype._decodeStr=function(e,t){if(t==="bitstr"){let r=e.readUInt8();return e.isError(r)?r:{unused:r,data:e.raw()}}else if(t==="bmpstr"){let r=e.raw();if(r.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let n="";for(let s=0;s<r.length/2;s++)n+=String.fromCharCode(r.readUInt16BE(s*2));return n}else if(t==="numstr"){let r=e.raw().toString("ascii");return this._isNumstr(r)?r: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 r=e.raw().toString("ascii");return this._isPrintstr(r)?r: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")}};ft.prototype._decodeObjid=function(e,t,r){let n,s=[],o=0,c=0;for(;!e.isEmpty();)c=e.readUInt8(),o<<=7,o|=c&127,(c&128)===0&&(s.push(o),o=0);c&128&&s.push(o);let u=s[0]/40|0,d=s[0]%40;if(r?n=s:n=[u,d].concat(s.slice(1)),t){let f=t[n.join(" ")];f===void 0&&(f=t[n.join(".")]),f!==void 0&&(n=f)}return n};ft.prototype._decodeTime=function(e,t){let r=e.raw().toString(),n,s,o,c,u,d;if(t==="gentime")n=r.slice(0,4)|0,s=r.slice(4,6)|0,o=r.slice(6,8)|0,c=r.slice(8,10)|0,u=r.slice(10,12)|0,d=r.slice(12,14)|0;else if(t==="utctime")n=r.slice(0,2)|0,s=r.slice(2,4)|0,o=r.slice(4,6)|0,c=r.slice(6,8)|0,u=r.slice(8,10)|0,d=r.slice(10,12)|0,n<70?n=2e3+n:n=1900+n;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(n,s-1,o,c,u,d,0)};ft.prototype._decodeNull=function(){return null};ft.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};ft.prototype._decodeInt=function(e,t){let r=e.raw(),n=new _E(r);return t&&(n=t[n.toString(10)]||n),n};ft.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function Nl(i,e){let t=i.readUInt8(e);if(i.isError(t))return t;let r=bv.tagClass[t>>6],n=(t&32)===0;if((t&31)===31){let o=t;for(t=0;(o&128)===128;){if(o=i.readUInt8(e),i.isError(o))return o;t<<=7,t|=o&127}}else t&=31;let s=bv.tag[t];return{cls:r,primitive:n,tag:t,tagStr:s}}function Sv(i,e,t){let r=i.readUInt8(t);if(i.isError(r))return r;if(!e&&r===128)return null;if((r&128)===0)return r;let n=r&127;if(n>4)return i.error("length octect is too long");r=0;for(let s=0;s<n;s++){r<<=8;let o=i.readUInt8(t);if(i.isError(o))return o;r|=o}return r}});var Tv=T((ZO,Cv)=>{"use strict";var SE=wi(),EE=io().Buffer,Dl=Il();function jl(i){Dl.call(this,i),this.enc="pem"}SE(jl,Dl);Cv.exports=jl;jl.prototype.decode=function(e,t){let r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,c=-1;for(let f=0;f<r.length;f++){let v=r[f].match(s);if(v!==null&&v[2]===n)if(o===-1){if(v[1]!=="BEGIN")break;o=f}else{if(v[1]!=="END")break;c=f;break}}if(o===-1||c===-1)throw new Error("PEM section not found for: "+n);let u=r.slice(o+1,c).join("");u.replace(/[^a-z0-9+/=]+/gi,"");let d=EE.from(u,"base64");return Dl.prototype.decode.call(this,d,t)}});var Ll=T(Mv=>{"use strict";var kv=Mv;kv.der=Il();kv.pem=Tv()});var Av=T(Ov=>{"use strict";var CE=Bl(),TE=Ll(),kE=wi(),ME=Ov;ME.define=function(e,t){return new jr(e,t)};function jr(i,e){this.name=i,this.body=e,this.decoders={},this.encoders={}}jr.prototype._createNamed=function(e){let t=this.name;function r(n){this._initNamed(n,t)}return kE(r,e),r.prototype._initNamed=function(s,o){e.call(this,s,o)},new r(this)};jr.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(TE[e])),this.decoders[e]};jr.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)};jr.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(CE[e])),this.encoders[e]};jr.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}});var Pv=T(Rv=>{"use strict";var ao=Rv;ao.Reporter=ro().Reporter;ao.DecoderBuffer=Dr().DecoderBuffer;ao.EncoderBuffer=Dr().EncoderBuffer;ao.Node=so()});var Iv=T(Nv=>{"use strict";var Bv=Nv;Bv._reverse=function(e){let t={};return Object.keys(e).forEach(function(r){(r|0)==r&&(r=r|0);let n=e[r];t[n]=r}),t};Bv.der=oo()});var jv=T(Dv=>{"use strict";var Lr=Dv;Lr.bignum=El();Lr.define=Av().define;Lr.base=Pv();Lr.constants=Iv();Lr.decoders=Ll();Lr.encoders=Bl()});var qr=T((ql,qv)=>{var co=require("buffer"),Kt=co.Buffer;function Lv(i,e){for(var t in i)e[t]=i[t]}Kt.from&&Kt.alloc&&Kt.allocUnsafe&&Kt.allocUnsafeSlow?qv.exports=co:(Lv(co,ql),ql.Buffer=Ui);function Ui(i,e,t){return Kt(i,e,t)}Ui.prototype=Object.create(Kt.prototype);Lv(Kt,Ui);Ui.from=function(i,e,t){if(typeof i=="number")throw new TypeError("Argument must not be a number");return Kt(i,e,t)};Ui.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError("Argument must be a number");var r=Kt(i);return e!==void 0?typeof t=="string"?r.fill(e,t):r.fill(e):r.fill(0),r};Ui.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return Kt(i)};Ui.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return co.SlowBuffer(i)}});var Fl=T((nA,Fv)=>{var lo=qr().Buffer,OE=require("stream"),AE=require("util");function uo(i){if(this.buffer=null,this.writable=!0,this.readable=!0,!i)return this.buffer=lo.alloc(0),this;if(typeof i.pipe=="function")return this.buffer=lo.alloc(0),i.pipe(this),this;if(i.length||typeof i=="object")return this.buffer=i,this.writable=!1,process.nextTick(function(){this.emit("end",i),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof i+")")}AE.inherits(uo,OE);uo.prototype.write=function(e){this.buffer=lo.concat([this.buffer,lo.from(e)]),this.emit("data",e)};uo.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};Fv.exports=uo});var Hv=T((sA,Uv)=>{"use strict";function Ul(i){var e=(i/8|0)+(i%8===0?0:1);return e}var RE={ES256:Ul(256),ES384:Ul(384),ES512:Ul(521)};function PE(i){var e=RE[i];if(e)return e;throw new Error('Unknown algorithm "'+i+'"')}Uv.exports=PE});var Yv=T((oA,Gv)=>{"use strict";var po=qr().Buffer,Wv=Hv(),fo=128,$v=0,BE=32,NE=16,IE=2,Vv=NE|BE|$v<<6,ho=IE|$v<<6;function DE(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Kv(i){if(po.isBuffer(i))return i;if(typeof i=="string")return po.from(i,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function jE(i,e){i=Kv(i);var t=Wv(e),r=t+1,n=i.length,s=0;if(i[s++]!==Vv)throw new Error('Could not find expected "seq"');var o=i[s++];if(o===(fo|1)&&(o=i[s++]),n-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(n-s)+'" remaining');if(i[s++]!==ho)throw new Error('Could not find expected "int" for "r"');var c=i[s++];if(n-s-2<c)throw new Error('"r" specified length of "'+c+'", only "'+(n-s-2)+'" available');if(r<c)throw new Error('"r" specified length of "'+c+'", max of "'+r+'" is acceptable');var u=s;if(s+=c,i[s++]!==ho)throw new Error('Could not find expected "int" for "s"');var d=i[s++];if(n-s!==d)throw new Error('"s" specified length of "'+d+'", expected "'+(n-s)+'"');if(r<d)throw new Error('"s" specified length of "'+d+'", max of "'+r+'" is acceptable');var f=s;if(s+=d,s!==n)throw new Error('Expected to consume entire buffer, but "'+(n-s)+'" bytes remain');var v=t-c,_=t-d,E=po.allocUnsafe(v+c+_+d);for(s=0;s<v;++s)E[s]=0;i.copy(E,s,u+Math.max(-v,0),u+c),s=t;for(var C=s;s<C+_;++s)E[s]=0;return i.copy(E,s,f+Math.max(-_,0),f+d),E=E.toString("base64"),E=DE(E),E}function zv(i,e,t){for(var r=0;e+r<t&&i[e+r]===0;)++r;var n=i[e+r]>=fo;return n&&--r,r}function LE(i,e){i=Kv(i);var t=Wv(e),r=i.length;if(r!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+r+'"');var n=zv(i,0,t),s=zv(i,t,i.length),o=t-n,c=t-s,u=2+o+1+1+c,d=u<fo,f=po.allocUnsafe((d?2:3)+u),v=0;return f[v++]=Vv,d?f[v++]=u:(f[v++]=fo|1,f[v++]=u&255),f[v++]=ho,f[v++]=o,n<0?(f[v++]=0,v+=i.copy(f,v,0,t)):v+=i.copy(f,v,n,t),f[v++]=ho,f[v++]=c,s<0?(f[v++]=0,i.copy(f,v,t)):i.copy(f,v,t+s),f}Gv.exports={derToJose:jE,joseToDer:LE}});var Xv=T((aA,Jv)=>{"use strict";var mn=require("buffer").Buffer,Hl=require("buffer").SlowBuffer;Jv.exports=mo;function mo(i,e){if(!mn.isBuffer(i)||!mn.isBuffer(e)||i.length!==e.length)return!1;for(var t=0,r=0;r<i.length;r++)t|=i[r]^e[r];return t===0}mo.install=function(){mn.prototype.equal=Hl.prototype.equal=function(e){return mo(this,e)}};var qE=mn.prototype.equal,FE=Hl.prototype.equal;mo.restore=function(){mn.prototype.equal=qE,Hl.prototype.equal=FE}});var Vl=T((cA,og)=>{var Ur=qr().Buffer,Ot=require("crypto"),Qv=Yv(),Zv=require("util"),UE=`"%s" is not a valid algorithm.
20
+ `+n)}i.destroy()}var mr=[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 PS(i){if(i+="",i.length<1)return!1;if(!mr[i.charCodeAt(0)])return W('invalid header, index 0, char "%s"',i.charCodeAt(0)),!0;if(i.length<2)return!1;if(!mr[i.charCodeAt(1)])return W('invalid header, index 1, char "%s"',i.charCodeAt(1)),!0;if(i.length<3)return!1;if(!mr[i.charCodeAt(2)])return W('invalid header, index 2, char "%s"',i.charCodeAt(2)),!0;if(i.length<4)return!1;if(!mr[i.charCodeAt(3)])return W('invalid header, index 3, char "%s"',i.charCodeAt(3)),!0;for(let e=4;e<i.length;++e)if(!mr[i.charCodeAt(e)])return W('invalid header, index "%i", char "%s"',e,i.charCodeAt(e)),!0;return!1}});var xh=O(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.Polling=void 0;var IS=Pi(),gh=require("zlib"),NS=Jr(),BS=ue(),Et=(0,BS.default)("engine:polling"),jS={gzip:gh.createGzip,deflate:gh.createDeflate},Dc=class extends IS.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){Et("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}Et("setting request"),this.req=e,this.res=t;let n=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},r=()=>{this.req=this.res=null};e.cleanup=r,t.onAborted(n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(Et("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 p in a)t.writeHeader(p,String(a[p]));let l=p=>{this.onData(p.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((p,d)=>{let h=o+p.byteLength;if(h>n){this.onError("content-length mismatch"),t.close();return}if(!s){if(d){l(Buffer.from(p));return}s=Buffer.allocUnsafe(n)}if(Buffer.from(p).copy(s,o),d){if(h!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}l(s);return}o=h})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){Et('received "%s"',e);let t=n=>{if(n.type==="close")return Et("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&&(Et("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let r=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:r})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){Et('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let r=typeof e=="string",o={"Content-Type":r?"text/plain; charset=UTF-8":"application/octet-stream"},a=d=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(h=>{this.res.writeHeader(h,String(o[h]))}),this.res.end(d)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((r?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let p=NS(this.req).encodings(["gzip","deflate"]);if(!p){a(e);return}this.compress(e,p,(d,h)=>{if(d){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(d);return}o["Content-Encoding"]=p,a(h)})}compress(e,t,n){Et("compressing");let r=[],s=0;jS[t](this.httpCompression).on("error",n).on("data",function(o){r.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(r,s))}).end(e)}doClose(e){Et("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(Et("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(Et("transport discarded - closing right away"),n()):(Et("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}};Os.Polling=Dc});var bh=O(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.WebSocket=void 0;var DS=Pi(),LS=ue(),yh=(0,LS.default)("engine:ws"),Lc=class extends DS.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],r=t+1===e.length,s=o=>{let a=typeof o!="string",l=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;yh('writing "%s"',o),this.socket.send(o,a,l),r&&(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){yh("closing"),e&&e(),this.socket.end()}};Ms.WebSocket=Lc});var wh=O(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});var qS=xh(),FS=bh();qc.default={polling:qS.Polling,websocket:FS.WebSocket}});var _h=O(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.uServer=void 0;var US=ue(),Li=jc(),HS=wh(),_i=(0,US.default)("engine:uws"),Fc=class extends Li.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((r,s)=>{e.headers[r]=s}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{_i("response has been aborted")})}createTransport(e,t){return new HS.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:r=>{let s=r.getUserData().transport;s.socket=r,s.writable=!0,s.emit("ready")},message:(r,s,o)=>{r.getUserData().transport.onData(o?s:Buffer.from(s).toString())},close:(r,s,o)=>{r.getUserData().transport.onClose(s,o)}})}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return n();e.res=new Uc(t),super._applyMiddlewares(e,e.res,r=>{e.res.writeHead(),n(r)})}handleRequest(e,t){_i('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let n=(r,s)=>{if(r!==void 0){this.emit("connection_error",{req:t,code:r,message:Li.Server.errorMessages[r],context:s}),this.abortRequest(t.res,r,s);return}if(t._query.sid)_i("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(a,l)=>this.abortRequest(e,a,l);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,r=>{r?n(Li.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){_i("on upgrade"),this.prepare(t,e),t.res=e;let r=async(s,o)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:Li.Server.errorMessages[s],context:o}),this.abortRequest(e,s,o);return}let a=t._query.sid,l;if(a){let p=this.clients[a];if(p){if(p.upgrading)return _i("transport has already been trying to upgrade"),e.close();if(p.upgraded)return _i("transport had already been upgraded"),e.close();_i("upgrading existing transport"),l=this.createTransport(t._query.transport,t),p._maybeUpgrade(l)}else return _i("upgrade attempt for closed client"),e.close()}else if(l=await this.handshake(t._query.transport,t,(p,d)=>this.abortRequest(e,p,d)),!l)return;t.res.writeStatus("101 Switching Protocols"),e.upgrade({transport:l},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,s=>{s?r(Li.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,r)})}abortRequest(e,t,n){let r=t===Li.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=n&&n.message?n.message:Li.Server.errorMessages[t];e.writeStatus(r),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};As.uServer=Fc;var Uc=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 Th=O(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.protocol=Ke.Transport=Ke.Socket=Ke.uServer=Ke.parser=Ke.transports=Ke.Server=void 0;Ke.listen=GS;Ke.attach=Ch;var zS=require("http"),Sh=jc();Object.defineProperty(Ke,"Server",{enumerable:!0,get:function(){return Sh.Server}});var WS=Xa();Ke.transports=WS.default;var Eh=or();Ke.parser=Eh;var $S=_h();Object.defineProperty(Ke,"uServer",{enumerable:!0,get:function(){return $S.uServer}});var KS=Qa();Object.defineProperty(Ke,"Socket",{enumerable:!0,get:function(){return KS.Socket}});var VS=Pi();Object.defineProperty(Ke,"Transport",{enumerable:!0,get:function(){return VS.Transport}});Ke.protocol=Eh.protocol;function GS(i,e,t){typeof e=="function"&&(t=e,e={});let n=(0,zS.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),r=Ch(n,e);return r.httpServer=n,n.listen(i,t),r}function Ch(i,e){let t=new Sh.Server(e);return t.attach(i,e),t}});var Oh=O(kh=>{kh.Emitter=tt;function tt(i){if(i)return JS(i)}function JS(i){for(var e in tt.prototype)i[e]=tt.prototype[e];return i}tt.prototype.on=tt.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this};tt.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return t.fn=e,this.on(i,t),this};tt.prototype.off=tt.prototype.removeListener=tt.prototype.removeAllListeners=tt.prototype.removeEventListener=function(i,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+i];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var n,r=0;r<t.length;r++)if(n=t[r],n===e||n.fn===e){t.splice(r,1);break}return t.length===0&&delete this._callbacks["$"+i],this};tt.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,r=t.length;n<r;++n)t[n].apply(this,e)}return this};tt.prototype.emitReserved=tt.prototype.emit;tt.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};tt.prototype.hasListeners=function(i){return!!this.listeners(i).length}});var Hc=O(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.isBinary=Ah;Ps.hasBinary=Rs;var YS=typeof ArrayBuffer=="function",XS=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,Mh=Object.prototype.toString,ZS=typeof Blob=="function"||typeof Blob<"u"&&Mh.call(Blob)==="[object BlobConstructor]",QS=typeof File=="function"||typeof File<"u"&&Mh.call(File)==="[object FileConstructor]";function Ah(i){return YS&&(i instanceof ArrayBuffer||XS(i))||ZS&&i instanceof Blob||QS&&i instanceof File}function Rs(i,e){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let t=0,n=i.length;t<n;t++)if(Rs(i[t]))return!0;return!1}if(Ah(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return Rs(i.toJSON(),!0);for(let t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&Rs(i[t]))return!0;return!1}});var Rh=O(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.deconstructPacket=t1;Is.reconstructPacket=i1;var e1=Hc();function t1(i){let e=[],t=i.data,n=i;return n.data=zc(t,e),n.attachments=e.length,{packet:n,buffers:e}}function zc(i,e){if(!i)return i;if((0,e1.isBinary)(i)){let t={_placeholder:!0,num:e.length};return e.push(i),t}else if(Array.isArray(i)){let t=new Array(i.length);for(let n=0;n<i.length;n++)t[n]=zc(i[n],e);return t}else if(typeof i=="object"&&!(i instanceof Date)){let t={};for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=zc(i[n],e));return t}return i}function i1(i,e){return i.data=Wc(i.data,e),delete i.attachments,i}function Wc(i,e){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<e.length)return e[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let t=0;t<i.length;t++)i[t]=Wc(i[t],e);else if(typeof i=="object")for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[t]=Wc(i[t],e));return i}});var vr=O(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.Decoder=qt.Encoder=qt.PacketType=qt.protocol=void 0;qt.isPacketValid=l1;var n1=Oh(),Ph=Rh(),Ih=Hc(),r1=ue(),$c=(0,r1.default)("socket.io-parser"),Nh=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];qt.protocol=5;var Y;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(Y||(qt.PacketType=Y={}));var Kc=class{constructor(e){this.replacer=e}encode(e){return $c("encoding packet %j",e),(e.type===Y.EVENT||e.type===Y.ACK)&&(0,Ih.hasBinary)(e)?this.encodeAsBinary({type:e.type===Y.EVENT?Y.BINARY_EVENT:Y.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===Y.BINARY_EVENT||e.type===Y.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)),$c("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,Ph.deconstructPacket)(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}};qt.Encoder=Kc;var Vc=class i extends n1.Emitter{constructor(e){super(),this.reviver=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===Y.BINARY_EVENT;n||t.type===Y.BINARY_ACK?(t.type=n?Y.EVENT:Y.ACK,this.reconstructor=new Gc(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,Ih.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(Y[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===Y.BINARY_EVENT||n.type===Y.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");n.attachments=Number(o)}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 r=e.charAt(t+1);if(r!==""&&Number(r)==r){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(i.isPayloadValid(n.type,s))n.data=s;else throw new Error("invalid payload")}return $c("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case Y.CONNECT:return Ns(t);case Y.DISCONNECT:return t===void 0;case Y.CONNECT_ERROR:return typeof t=="string"||Ns(t);case Y.EVENT:case Y.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Nh.indexOf(t[0])===-1);case Y.ACK:case Y.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};qt.Decoder=Vc;var Gc=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,Ph.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function s1(i){return typeof i=="string"}var o1=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function a1(i){return i===void 0||o1(i)}function Ns(i){return Object.prototype.toString.call(i)==="[object Object]"}function c1(i,e){switch(i){case Y.CONNECT:return e===void 0||Ns(e);case Y.DISCONNECT:return e===void 0;case Y.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&Nh.indexOf(e[0])===-1);case Y.ACK:return Array.isArray(e);case Y.CONNECT_ERROR:return typeof e=="string"||Ns(e);default:return!1}}function l1(i){return s1(i.nsp)&&a1(i.id)&&c1(i.type,i.data)}});var Bh=O(yn=>{"use strict";var u1=yn&&yn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(yn,"__esModule",{value:!0});yn.Client=void 0;var Bs=vr(),p1=u1(ue()),Ft=(0,p1.default)("socket.io:client"),Jc=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?(Ft("no namespace joined yet, close the client"),this.close()):Ft("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Ft("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(Ft("creation of namespace %s was denied",e),this._packet({type:Bs.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))})}doConnect(e,t){let n=this.server.of(e);n._add(this,t,r=>{this.sockets.set(r.id,r),this.nsps.set(n.name,r),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 Ft("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Ft("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Ft("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){Ft("volatile packet is discarded since the transport is not currently writable");return}let n=Array.isArray(e)?e:[e];for(let r of n)this.conn.write(r,t)}ondata(e){try{this.decoder.add(e)}catch(t){Ft("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),r=this.nsps.get(t);!r&&e.type===Bs.PacketType.CONNECT?this.connect(t,n):r&&e.type!==Bs.PacketType.CONNECT&&e.type!==Bs.PacketType.CONNECT_ERROR?process.nextTick(function(){r._onpacket(e)}):(Ft("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){Ft("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)}};yn.Client=Jc});var Ds=O(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.StrictEventEmitter=void 0;var f1=require("events"),Yc=class extends f1.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)}};js.StrictEventEmitter=Yc});var Xc=O(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.RESERVED_EVENTS=void 0;Ls.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var Zc=O(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.RemoteSocket=bn.BroadcastOperator=void 0;var d1=Xc(),h1=vr(),qs=class i{constructor(e,t=new Set,n=new Set,r={}){this.adapter=e,this.rooms=t,this.exceptRooms=n,this.flags=r}to(e){let t=new Set(this.rooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new i(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 i(this.adapter,this.rooms,t,this.flags)}compress(e){let t=Object.assign({},this.flags,{compress:e});return new i(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){let e=Object.assign({},this.flags,{volatile:!0});return new i(this.adapter,this.rooms,this.exceptRooms,e)}get local(){let e=Object.assign({},this.flags,{local:!0});return new i(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){let t=Object.assign({},this.flags,{timeout:e});return new i(this.adapter,this.rooms,this.exceptRooms,t)}emit(e,...t){if(d1.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],r={type:h1.PacketType.EVENT,data:n};if(!(typeof n[n.length-1]=="function"))return this.adapter.broadcast(r,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=n.pop(),a=!1,l=[],p=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:l])},this.flags.timeout),d=-1,h=0,g=0,_=()=>{!a&&d===h&&l.length===g&&(clearTimeout(p),o.apply(this,[null,this.flags.expectSingleResponse?l[0]:l]))};return this.adapter.broadcastWithAck(r,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},S=>{g+=S,h++,_()},S=>{l.push(S),_()}),this.adapter.serverCount().then(S=>{d=S,_()}),!0}emitWithAck(e,...t){return new Promise((n,r)=>{t.push((s,o)=>s?(s.responses=o,r(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 Fs(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)}};bn.BroadcastOperator=qs;var Fs=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 qs(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}};bn.RemoteSocket=Fs});var el=O(wn=>{"use strict";var Lh=wn&&wn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(wn,"__esModule",{value:!0});wn.Socket=void 0;var Ct=vr(),m1=Lh(ue()),v1=Ds(),jh=Lh(Ra()),g1=Zc(),x1=Xc(),Xe=(0,m1.default)("socket.io:socket"),y1=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function Dh(){}var Qc=class extends v1.StrictEventEmitter{constructor(e,t,n,r){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,r?(this.id=r.sid,this.pid=r.pid,r.rooms.forEach(s=>this.join(s)),this.data=r.data,r.missedPackets.forEach(s=>{this.packet({type:Ct.PacketType.EVENT,data:s})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=jh.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=jh.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",Dh)}buildHandshake(e){var t,n,r,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:(r=this.request)===null||r===void 0?void 0:r.url,query:((s=this.request)===null||s===void 0?void 0:s._query)||{},auth:e}}emit(e,...t){if(x1.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],r={type:Ct.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;Xe("emitting packet with ack id %d",o),this.registerAckCallback(o,n.pop()),r.id=o}let s=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(r,{rooms:new Set([this.id]),except:new Set,flags:s}):(this.notifyOutgoingListeners(r),this.packet(r,s)),!0}emitWithAck(e,...t){let n=this.flags.timeout!==void 0;return new Promise((r,s)=>{t.push((o,a)=>n?o?s(o):r(a):r(o)),this.emit(e,...t)})}registerAckCallback(e,t){let n=this.flags.timeout;if(n===void 0){this.acks.set(e,t);return}let r=setTimeout(()=>{Xe("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(r),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 Xe("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return Xe("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){Xe("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:Ct.PacketType.CONNECT}):this.packet({type:Ct.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(Xe("got packet %j",e),e.type){case Ct.PacketType.EVENT:this.onevent(e);break;case Ct.PacketType.BINARY_EVENT:this.onevent(e);break;case Ct.PacketType.ACK:this.onack(e);break;case Ct.PacketType.BINARY_ACK:this.onack(e);break;case Ct.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(Xe("emitting event %j",t),e.id!=null&&(Xe("attaching ack callback to event"),t.push(this.ack(e.id))),this._anyListeners&&this._anyListeners.length){let n=this._anyListeners.slice();for(let r of n)r.apply(this,t)}this.dispatch(t)}ack(e){let t=this,n=!1;return function(){if(n)return;let r=Array.prototype.slice.call(arguments);Xe("sending ack %j",r),t.packet({id:e,type:Ct.PacketType.ACK,data:r}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(Xe("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):Xe("bad ack %s",e.id)}ondisconnect(){Xe("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;Xe("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&y1.has(e)&&(Xe("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=Dh}_error(e){this.packet({type:Ct.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:Ct.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){Xe("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):Xe("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 r(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();r(s+1)})}r(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 g1.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};wn.Socket=Qc});var il=O(ci=>{"use strict";var b1=ci&&ci.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ci,"__esModule",{value:!0});ci.Namespace=ci.RESERVED_EVENTS=void 0;var qh=el(),w1=Ds(),_1=b1(ue()),gt=Zc(),_n=(0,_1.default)("socket.io:namespace");ci.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var tl=class extends w1.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=>{_n("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 r(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();r(s+1)})}r(0)}to(e){return new gt.BroadcastOperator(this.adapter).to(e)}in(e){return new gt.BroadcastOperator(this.adapter).in(e)}except(e){return new gt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var r;_n("adding socket to nsp %s",this.name);let s=await this._createSocket(e,t);if(this._preConnectSockets.set(s.id,s),!((r=this.server.opts.connectionStateRecovery)===null||r===void 0)&&r.skipMiddlewares&&s.recovered&&e.conn.readyState==="open")return this._doConnect(s,n);this.run(s,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){_n("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return _n("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,r=t.offset;if(this.server.opts.connectionStateRecovery&&typeof n=="string"&&typeof r=="string"){let s;try{s=await this.adapter.restoreSession(n,r)}catch(o){_n("error while restoring session: %s",o)}if(s)return _n("connection state recovered for sid %s",s.sid),new qh.Socket(this,e,t,s)}return new qh.Socket(this,e,t)}_doConnect(e,t){this._preConnectSockets.delete(e.id),this.sockets.set(e.id,e),e._onconnect(),t&&t(e),this.emitReserved("connect",e),this.emitReserved("connection",e)}_remove(e){this.sockets.delete(e.id)||this._preConnectSockets.delete(e.id)}emit(e,...t){return new gt.BroadcastOperator(this.adapter).emit(e,...t)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}serverSideEmit(e,...t){if(ci.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,r)=>{t.push((s,o)=>s?(s.responses=o,r(s)):n(o)),this.serverSideEmit(e,...t)})}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new gt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new gt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new gt.BroadcastOperator(this.adapter).volatile}get local(){return new gt.BroadcastOperator(this.adapter).local}timeout(e){return new gt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new gt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new gt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new gt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new gt.BroadcastOperator(this.adapter).disconnectSockets(e)}};ci.Namespace=tl});var Wh=O(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.encode=nl;gr.decode=S1;gr.yeast=E1;var Hh="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Us=64,zh={},Fh=0,Si=0,Uh;function nl(i){let e="";do e=Hh[i%Us]+e,i=Math.floor(i/Us);while(i>0);return e}function S1(i){let e=0;for(Si=0;Si<i.length;Si++)e=e*Us+zh[i.charAt(Si)];return e}function E1(){let i=nl(+new Date);return i!==Uh?(Fh=0,Uh=i):i+"."+nl(Fh++)}for(;Si<Us;Si++)zh[Hh[Si]]=Si});var ol=O(Sn=>{"use strict";var rl;Object.defineProperty(Sn,"__esModule",{value:!0});Sn.SessionAwareAdapter=Sn.Adapter=void 0;var C1=require("events"),T1=Wh(),Hs=Pc(),k1=typeof((rl=Hs?.Sender)===null||rl===void 0?void 0:rl.frame)=="function",zs=class extends C1.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||{},r={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let s=this._encode(e,r);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(s,r)})}broadcastWithAck(e,t,n,r){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),l=0;this.apply(t,p=>{l++,p.acks.set(e.id,r),typeof p.notifyOutgoingListeners=="function"&&p.notifyOutgoingListeners(e),p.client.writeToEngine(a,o)}),n(l)}_encode(e,t){let n=this.encoder.encode(e);if(k1&&n.length===1&&typeof n[0]=="string"){let r=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=Hs.Sender.frame(r,{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(r=>n.leave(r))})}disconnectSockets(e,t){this.apply(e,n=>{n.disconnect(t)})}apply(e,t){let n=e.rooms,r=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)||r.has(a))continue;let l=this.nsp.sockets.get(a);l&&(t(l),s.add(a))}}else for(let[s]of this.sids){if(r.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(r=>t.add(r));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}};Sn.Adapter=zs;var sl=class extends zs{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((r,s)=>{r.disconnectedAt<n&&this.sessions.delete(s)});for(let r=this.packets.length-1;r>=0;r--)if(this.packets[r].emittedAt<n){this.packets.splice(0,r+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 l=this.packets[a];O1(n.rooms,l.opts)&&o.push(l.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:o}))}broadcast(e,t){var n;let r=e.type===2,s=e.id===void 0,o=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;if(r&&s&&o){let a=(0,T1.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};Sn.SessionAwareAdapter=sl;function O1(i,e){let t=e.rooms.size===0||i.some(r=>e.rooms.has(r)),n=i.every(r=>!e.except.has(r));return t&&n}});var $h=O(Jt=>{"use strict";var M1=Jt&&Jt.__rest||function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(i,n[r])&&(t[n[r]]=i[n[r]]);return t};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.ClusterAdapterWithHeartbeat=Jt.ClusterAdapter=Jt.MessageType=void 0;var A1=ol(),R1=ue(),P1=require("crypto"),ce=(0,R1.debug)("socket.io-adapter"),I1="emitter",Ws=5e3;function Cn(){return(0,P1.randomBytes)(8).toString("hex")}var F;(function(i){i[i.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",i[i.HEARTBEAT=2]="HEARTBEAT",i[i.BROADCAST=3]="BROADCAST",i[i.SOCKETS_JOIN=4]="SOCKETS_JOIN",i[i.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",i[i.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",i[i.FETCH_SOCKETS=7]="FETCH_SOCKETS",i[i.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",i[i.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",i[i.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",i[i.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",i[i.BROADCAST_ACK=12]="BROADCAST_ACK",i[i.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(F||(Jt.MessageType=F={}));function qi(i){return{rooms:[...i.rooms],except:[...i.except],flags:i.flags}}function En(i){return{rooms:new Set(i.rooms),except:new Set(i.except),flags:i.flags}}var $s=class extends A1.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=Cn()}onMessage(e,t){if(e.uid===this.uid)return ce("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return ce("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(ce("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case F.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,En(e.data.opts),r=>{ce("[%s] waiting for %d client acknowledgements",this.uid,r),this.publishResponse(e.uid,{type:F.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:r}})},r=>{ce("[%s] received acknowledgement with value %j",this.uid,r),this.publishResponse(e.uid,{type:F.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:r}})});else{let r=e.data.packet,s=En(e.data.opts);this.addOffsetIfNecessary(r,s,t),super.broadcast(r,s)}break}case F.SOCKETS_JOIN:super.addSockets(En(e.data.opts),e.data.rooms);break;case F.SOCKETS_LEAVE:super.delSockets(En(e.data.opts),e.data.rooms);break;case F.DISCONNECT_SOCKETS:super.disconnectSockets(En(e.data.opts),e.data.close);break;case F.FETCH_SOCKETS:{ce("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(En(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:F.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(r=>{let s=r.handshake,{sessionStore:o}=s,a=M1(s,["sessionStore"]);return{id:r.id,handshake:a,rooms:[...r.rooms],data:r.data}})}})});break}case F.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,ce("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:F.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case F.BROADCAST_CLIENT_COUNT:case F.BROADCAST_ACK:case F.FETCH_SOCKETS_RESPONSE:case F.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:ce("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let r=e.data.requestId;switch(ce("[%s] received response %s to request %s",this.uid,e.type,r),e.type){case F.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(r))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case F.BROADCAST_ACK:{(n=this.ackRequests.get(r))===null||n===void 0||n.ack(e.data.packet);break}case F.FETCH_SOCKETS_RESPONSE:{let s=this.requests.get(r);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(r));break}case F.SERVER_SIDE_EMIT_RESPONSE:{let s=this.requests.get(r);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(r));break}default:ce("[%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:F.BROADCAST,data:{packet:e,opts:qi(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return ce("[%s] error while broadcasting message: %s",this.uid,s.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var r;if(!this.nsp.server.opts.connectionStateRecovery)return;let s=e.type===2,o=e.id===void 0,a=((r=t.flags)===null||r===void 0?void 0:r.volatile)===void 0;s&&o&&a&&e.data.push(n)}broadcastWithAck(e,t,n,r){var s;if(!((s=t?.flags)===null||s===void 0?void 0:s.local)){let a=Cn();this.ackRequests.set(a,{clientCountCallback:n,ack:r}),this.publish({type:F.BROADCAST,data:{packet:e,requestId:a,opts:qi(t)}}),setTimeout(()=>{this.ackRequests.delete(a)},t.flags.timeout)}super.broadcastWithAck(e,t,n,r)}async addSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:F.SOCKETS_JOIN,data:{opts:qi(e),rooms:t}})}catch(s){ce("[%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:F.SOCKETS_LEAVE,data:{opts:qi(e),rooms:t}})}catch(s){ce("[%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:F.DISCONNECT_SOCKETS,data:{opts:qi(e),close:t}})}catch(s){ce("[%s] error while publishing message: %s",this.uid,s.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[n,r]=await Promise.all([super.fetchSockets(e),this.serverCount()]),s=r-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=Cn();return new Promise((a,l)=>{let p=setTimeout(()=>{let h=this.requests.get(o);h&&(l(new Error(`timeout reached: only ${h.current} responses received out of ${h.expected}`)),this.requests.delete(o))},e.flags.timeout||Ws),d={type:F.FETCH_SOCKETS,resolve:a,timeout:p,current:0,expected:s,responses:n};this.requests.set(o,d),this.publish({type:F.FETCH_SOCKETS,data:{opts:qi(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:F.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),r=await this.serverCount()-1;if(ce('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,r),r<=0)return n(null,[]);let s=Cn(),o=setTimeout(()=>{let l=this.requests.get(s);l&&(n(new Error(`timeout reached: only ${l.current} responses received out of ${l.expected}`),l.responses),this.requests.delete(s))},Ws),a={type:F.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:r,responses:[]};this.requests.set(s,a),this.publish({type:F.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}publish(e){ce("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{ce("[%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,ce("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{ce("[%s] error while publishing response: %s",this.uid,n)})}};Jt.ClusterAdapter=$s;var al=class extends $s{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((r,s)=>{n-r>this._opts.heartbeatTimeout&&(ce("[%s] node %s seems down",this.uid,s),this.removeNode(s))})},1e3)}init(){this.publish({type:F.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:F.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:F.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return ce("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==I1&&this.nodesMap.set(e.uid,Date.now()),e.type){case F.INITIAL_HEARTBEAT:this.publish({type:F.HEARTBEAT});break;case F.HEARTBEAT:break;case F.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:F.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),r=this.nodesMap.size;if(ce('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,r),r<=0)return n(null,[]);let s=Cn(),o=setTimeout(()=>{let l=this.customRequests.get(s);l&&(n(new Error(`timeout reached: missing ${l.missingUids.size} responses`),l.responses),this.customRequests.delete(s))},Ws),a={type:F.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(s,a),this.publish({type:F.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}async fetchSockets(e){var t;let[n,r]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),s=r-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=Cn();return new Promise((a,l)=>{let p=setTimeout(()=>{let h=this.customRequests.get(o);h&&(l(new Error(`timeout reached: missing ${h.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||Ws),d={type:F.FETCH_SOCKETS,resolve:a,timeout:p,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,d),this.publish({type:F.FETCH_SOCKETS,data:{opts:qi(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(ce("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case F.FETCH_SOCKETS_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;e.data.sockets.forEach(r=>n.responses.push(r)),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(n.responses),this.customRequests.delete(t));break}case F.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===F.FETCH_SOCKETS?t.resolve(t.responses):t.type===F.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};Jt.ClusterAdapterWithHeartbeat=al});var Ks=O(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.MessageType=Tt.ClusterAdapterWithHeartbeat=Tt.ClusterAdapter=Tt.SessionAwareAdapter=Tt.Adapter=void 0;var Kh=ol();Object.defineProperty(Tt,"Adapter",{enumerable:!0,get:function(){return Kh.Adapter}});Object.defineProperty(Tt,"SessionAwareAdapter",{enumerable:!0,get:function(){return Kh.SessionAwareAdapter}});var cl=$h();Object.defineProperty(Tt,"ClusterAdapter",{enumerable:!0,get:function(){return cl.ClusterAdapter}});Object.defineProperty(Tt,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return cl.ClusterAdapterWithHeartbeat}});Object.defineProperty(Tt,"MessageType",{enumerable:!0,get:function(){return cl.MessageType}})});var Jh=O(Tn=>{"use strict";var N1=Tn&&Tn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.ParentNamespace=void 0;var Vh=il(),B1=Ks(),j1=N1(ue()),Gh=(0,j1.default)("socket.io:parent-namespace"),Vs=class i extends Vh.Namespace{constructor(e){super(e,"/_"+i.count++),this.children=new Set}_initAdapter(){this.adapter=new ll(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){Gh("creating child namespace %s",e);let t=new Vh.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=r=>{n.call(t,r),t.sockets.size===0&&(Gh("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")}};Tn.ParentNamespace=Vs;Vs.count=0;var ll=class extends B1.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var tm=O(Ui=>{"use strict";var D1=Ui&&Ui.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ui,"__esModule",{value:!0});Ui.patchAdapter=q1;Ui.restoreAdapter=F1;Ui.serveFile=H1;var Fi=Ks(),Yh=require("fs"),L1=D1(ue()),Gs=(0,L1.default)("socket.io:adapter-uws"),ul="",{addAll:Zh,del:Qh,broadcast:em}=Fi.Adapter.prototype;function q1(i){Fi.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);Zh.call(this,e,t);let r=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(r){if(r.conn.transport.name==="websocket"){Xh(this.nsp.name,r,n,t);return}n&&r.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&Xh(this.nsp.name,r,n,s)})}},Fi.Adapter.prototype.del=function(e,t){Qh.call(this,e,t);let n=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(n&&n.conn.transport.name==="websocket"){let r=n.conn.id,s=n.conn.transport.socket,o=`${this.nsp.name}${ul}${t}`;Gs("unsubscribe connection %s from topic %s",r,o),s.unsubscribe(o)}},Fi.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){em.call(this,e,t);return}let r=t.flags||{},s={preEncoded:!0,volatile:r.volatile,compress:r.compress};e.nsp=this.nsp.name;let o=this.encoder.encode(e),a=t.rooms.size===0?this.nsp.name:`${this.nsp.name}${ul}${t.rooms.keys().next().value}`;Gs("fast publish to %s",a),o.forEach(l=>{let p=typeof l!="string";i.publish(a,p?l:"4"+l,p)}),this.apply(t,l=>{l.conn.transport.name!=="websocket"&&l.client.writeToEngine(o,s)})}}function Xh(i,e,t,n){let r=e.conn.id,s=e.conn.transport.socket;t&&(Gs("subscribe connection %s to topic %s",r,i),s.subscribe(i)),n.forEach(o=>{let a=`${i}${ul}${o}`;Gs("subscribe connection %s to topic %s",r,a),s.subscribe(a)})}function F1(){Fi.Adapter.prototype.addAll=Zh,Fi.Adapter.prototype.del=Qh,Fi.Adapter.prototype.broadcast=em}var U1=i=>{let{buffer:e,byteOffset:t,byteLength:n}=i;return e.slice(t,t+n)};function H1(i,e){let{size:t}=(0,Yh.statSync)(e),n=(0,Yh.createReadStream)(e),r=()=>!n.destroyed&&n.destroy(),s=a=>{throw r(),a},o=a=>{let l=U1(a);i.cork(()=>{let p=i.getWriteOffset(),[d,h]=i.tryEnd(l,t);!h&&!d&&(n.pause(),i.onWritable(g=>{let[_,S]=i.tryEnd(l.slice(g-p),t);return!S&&_&&n.resume(),_}))})};i.onAborted(r),n.on("data",o).on("error",s).on("end",r)}});var im=O((zM,z1)=>{z1.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 um=O((Ze,xr)=>{"use strict";var W1=Ze&&Ze.__createBinding||(Object.create?(function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),$1=Ze&&Ze.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),K1=Ze&&Ze.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&W1(e,i,t);return $1(e,i),e},dl=Ze&&Ze.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.Namespace=Ze.Socket=Ze.Server=void 0;var V1=dl(require("http")),G1=require("fs"),pl=require("zlib"),J1=Jr(),Js=require("stream"),nm=require("path"),rm=Th(),Y1=Bh(),sm=require("events"),hl=il();Object.defineProperty(Ze,"Namespace",{enumerable:!0,get:function(){return hl.Namespace}});var X1=Jh(),om=Ks(),Z1=K1(vr()),Q1=dl(ue()),lm=el();Object.defineProperty(Ze,"Socket",{enumerable:!0,get:function(){return lm.Socket}});var eE=Ds(),fl=tm(),tE=dl(Nc()),it=(0,Q1.default)("socket.io:server"),am=im().version,cm=/\.map/,kn=class i extends eE.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||Z1,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||om.SessionAwareAdapter)):this.adapter(t.adapter||om.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,tE.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 r=this.parentNsps.keys(),s=()=>{let o=r.next();if(o.done)return n(!1);o.value(e,t,(a,l)=>{if(a||!l)return s();if(this._nsps.has(e))return it("dynamic namespace %s already exists",e),n(this._nsps.get(e));let p=this.parentNsps.get(o.value).createChild(e);it("dynamic namespace %s was created",e),n(p)})};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"){it("creating http server and binding to %d",e);let n=e;e=V1.default.createServer((r,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,it("creating uWebSockets.js-based engine with opts %j",t);let n=new rm.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,(r,s)=>{if(!this.clientPathRegex.test(s.getUrl())){s.setYield(!0);return}let o=s.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),a=cm.test(o),l=a?"map":"source",p='"'+am+'"',d="W/"+p,h=s.getHeader("if-none-match");if(h&&(p===h||d===h)){it("serve client %s 304",l),r.writeStatus("304 Not Modified"),r.end();return}it("serve client %s",l),r.writeHeader("cache-control","public, max-age=0"),r.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),r.writeHeader("etag",p);let g=nm.join(__dirname,"../client-dist/",o);(0,fl.serveFile)(r,g)}),(0,fl.patchAdapter)(e)}initEngine(e,t){it("creating engine.io instance with opts %j",t),this.eio=(0,rm.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){it("attaching client serving req handler");let t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",(n,r)=>{if(this.clientPathRegex.test(n.url))this._corsMiddleware?this._corsMiddleware(n,r,()=>{this.serve(n,r)}):this.serve(n,r);else for(let s=0;s<t.length;s++)t[s].call(e,n,r)})}serve(e,t){let n=e.url.replace(this._path,"").replace(/\?.*$/,""),r=cm.test(n),s=r?"map":"source",o='"'+am+'"',a="W/"+o,l=e.headers["if-none-match"];if(l&&(o===l||a===l)){it("serve client %s 304",s),t.writeHead(304),t.end();return}it("serve client %s",s),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(r?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),i.sendFile(n,e,t)}static sendFile(e,t,n){let r=(0,G1.createReadStream)(nm.join(__dirname,"../client-dist/",e)),s=J1(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(s){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,Js.pipeline)(r,(0,pl.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,Js.pipeline)(r,(0,pl.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,Js.pipeline)(r,(0,pl.createDeflate)(),n,o);break;default:n.writeHead(200),(0,Js.pipeline)(r,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){it("incoming connection with id %s",e.id);let t=new Y1.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let r=new X1.ParentNamespace(this);return it("initializing parent namespace %s",r.name),typeof e=="function"?this.parentNsps.set(e,r):(this.parentNsps.set((s,o,a)=>a(null,e.test(s)),r),this.parentNamespacesFromRegExp.set(e,r)),t&&r.on("connect",t),r}String(e)[0]!=="/"&&(e="/"+e);let n=this._nsps.get(e);if(!n){for(let[r,s]of this.parentNamespacesFromRegExp)if(r.test(e))return it("attaching namespace %s to parent namespace %s",e,r),s.createChild(e);it("initializing namespace %s",e),n=new hl.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,fl.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&it("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)}};Ze.Server=kn;var iE=Object.keys(sm.EventEmitter.prototype).filter(function(i){return typeof sm.EventEmitter.prototype[i]=="function"});iE.forEach(function(i){kn.prototype[i]=function(){return this.sockets[i].apply(this.sockets,arguments)}});xr.exports=(i,e)=>new kn(i,e);xr.exports.Server=kn;xr.exports.Namespace=hl.Namespace;xr.exports.Socket=lm.Socket});var Ve,Nn=Mi(()=>{Ve={webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:828e5,dcMaxMessageSize:65536,dcBufferThreshold:65536,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:12e4,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50},streaming:{activeInterval:60,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5}}});var Fm={};Ai(Fm,{TileManager:()=>El});var oo,Bn,co,ao,qm,CE,TE,El,Um=Mi(()=>{oo=z(require("sharp"),1),Bn=z(require("fs"),1),co=z(require("path"),1),ao=require("child_process"),qm=require("url"),CE=(0,qm.fileURLToPath)(__importMetaUrl),TE=co.default.dirname(CE),El=class{constructor(e){this.robot=e,this.tileSize=128,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=co.default.join(TE,"../../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=1,this.compressionQuality=50,Bn.default.existsSync(this.tempDir)||Bn.default.mkdirSync(this.tempDir,{recursive:!0}),this.initializeScreenDimensions()}initializeScreenDimensions(){try{let{width:e,height:t}=this.robot.getScreenSize();this.screenWidth=e,this.screenHeight=t,this.detectDpiScale(),this.scaledWidth=Math.floor(e*this.scaleFactor),this.scaledHeight=Math.floor(t*this.scaleFactor),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 r=Math.ceil(Math.sqrt(this.scaledWidth*this.scaledHeight/n));this.tileSize=Math.max(r,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){console.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(){console.log(`\u{1F50D} [DPI Detection] screenWidth from robot: ${this.screenWidth}x${this.screenHeight}`);try{let e=(0,ao.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(console.log(`\u{1F50D} [DPI Detection] Strategy 1 (Registry AppliedDPI): ${t} DPI`),t>=96){let n=t/96;return console.log(`\u2705 [DPI Detection] Using registry scale: ${n}x (${t}/96)`),n}}catch(e){console.log("\u274C [DPI Detection] Strategy 1 failed:",e.message)}try{let e=(0,ao.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(console.log(`\u{1F50D} [DPI Detection] Strategy 2 (WMI): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return console.log(`\u2705 [DPI Detection] Using WMI scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){console.log("\u274C [DPI Detection] Strategy 2 failed:",e.message)}try{let e=(0,ao.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(console.log(`\u{1F50D} [DPI Detection] Strategy 3 (EnumDisplaySettings): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return console.log(`\u2705 [DPI Detection] Using EnumDisplaySettings scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){console.log("\u274C [DPI Detection] Strategy 3 failed:",e.message)}return console.log("\u26A0\uFE0F [DPI Detection] All strategies failed, fallback to 1x"),1}async captureFullScreen(){let e=this.robot.screen.capture(0,0,this.captureWidth,this.captureHeight),t=e.byteWidth/e.bytesPerPixel,n=e.height,r=Buffer.from(e.image),s=new Uint32Array(r.buffer,r.byteOffset,r.length>>2);for(let p=0;p<s.length;p++){let d=s[p];s[p]=d&4278255360|(d&16711680)>>16|(d&255)<<16}let o=r,a=t,l=n;if(this.dpiScale>1||this.scaleFactor<1){let p=Math.floor(this.screenWidth*this.scaleFactor),d=Math.floor(this.screenHeight*this.scaleFactor);o=await(0,oo.default)(r,{raw:{width:t,height:n,channels:e.bytesPerPixel}}).resize(p,d,{kernel:oo.default.kernel.lanczos3,fit:"fill",fastShrinkOnLoad:!1}).raw().toBuffer(),a=p,l=d}return{buffer:o,width:a,height:l,channels:e.bytesPerPixel}}async getSharedScreenCapture(){let e=Date.now();return this.sharedScreenCache&&e-this.lastCaptureTime<this.CACHE_TTL?this.sharedScreenCache:(this.sharedScreenCache=await this.captureFullScreen(),this.lastCaptureTime=e,this.sharedScreenCache)}clearScreenCache(){}async detectChangedTiles(){return(await this.detectChangedTilesWithHashes()).tiles}async detectChangedTilesWithHashes(){if(this.isProcessing)return{tiles:[],currentHashes:Array.from(this.lastTileChecksums.values())};this.isProcessing=!0;try{let e=await this.getSharedScreenCapture(),t=[],n=[],r=new Map;this.frameCount++;for(let a=0;a<this.totalTiles;a++){let l=this.calculateTileChecksumDirect(e,a);r.set(a,l)}let s=Array.from(r.values());if(this.lastTileChecksums.size===0){let a=[];for(let p=0;p<this.totalTiles;p++)this.lastTileChecksums.set(p,r.get(p)),a.push(this.processTileAsync(e,p));let l=await Promise.all(a);return t.push(...l),{tiles:t,currentHashes:s}}for(let a=0;a<this.totalTiles;a++){let l=r.get(a),p=this.lastTileChecksums.get(a);l!==p&&(n.push(a),this.lastTileChecksums.set(a,l))}if(n.length/this.totalTiles>this.changeThreshold){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(e,p));let l=await Promise.all(a);t.push(...l.map(p=>({...p,fullRefresh:!0})))}else if(n.length>0){let a=n.map(p=>this.processTileAsync(e,p)),l=await Promise.all(a);t.push(...l)}return{tiles:t,currentHashes:s}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null){let r=n||this.extractTile(e,t),s=await this.compressTileImage(r.buffer,r.width,r.height),{row:o,col:a}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:a*this.tileSize,y:o*this.tileSize,width:r.width,height:r.height,imageBuffer:s,timestamp:Date.now(),frameCount:this.frameCount}}calculateTileChecksumDirect(e,t){let{row:n,col:r}=this.getTilePosition(t),s=r*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),l=Math.min(o+this.tileSize,e.height),p=a-s,d=l-o,h=e.channels,g=e.width*h,_=0,S=16;for(let T=0;T<d;T+=4){let A=(o+T)*g+s*h;for(let P=0;P<p;P+=S){let R=A+P*h;_+=e.buffer[R]||0,_^=e.buffer[R+1]||0,_+=(e.buffer[R+2]||0)<<1,_^=(e.buffer[R+3]||0)<<2}}return _>>>0}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}extractTile(e,t){let{row:n,col:r}=this.getTilePosition(t),s=r*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),l=Math.min(o+this.tileSize,e.height),p=a-s,d=l-o,h=e.channels,g=p*h,_=Buffer.alloc(p*d*h);for(let S=0;S<d;S++){let T=((o+S)*e.width+s)*h,A=S*g;e.buffer.copy(_,A,T,T+g)}return{buffer:_,width:p,height:d,channels:h,tileIndex:t,x:s,y:o}}async compressTileImage(e,t,n){return(0,oo.default)(e,{raw:{width:t,height:n,channels:4}}).jpeg({quality:this.compressionQuality}).toBuffer()}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){console.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=[],r=[];this.frameCount++;let s=new Map;for(let a=0;a<this.totalTiles;a++){let l=this.calculateTileChecksumDirect(t,a);s.set(a,l),this.lastTileChecksums.set(a,l)}if(!e||e.length===0){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(t,p));let l=await Promise.all(a);return n.push(...l),{tiles:n,currentHashes:Array.from(s.values())}}for(let a=0;a<this.totalTiles;a++)e[a]!==s.get(a)&&r.push(a);if(r.length/this.totalTiles>this.changeThreshold){let a=[];for(let p=0;p<this.totalTiles;p++)a.push(this.processTileAsync(t,p));let l=await Promise.all(a);n.push(...l.map(p=>({...p,fullRefresh:!0})))}else if(r.length>0){let a=r.map(p=>this.processTileAsync(t,p)),l=await Promise.all(a);n.push(...l)}return{tiles:n,currentHashes:Array.from(s.values()),changedIndices:r}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear()}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{Bn.default.existsSync(this.tempDir)&&Bn.default.readdirSync(this.tempDir).forEach(t=>Bn.default.unlinkSync(co.default.join(this.tempDir,t)))}catch(e){console.warn("Cleanup error:",e)}}}});var Hm={};Ai(Hm,{ResourceManager:()=>Cl});var Cl,zm=Mi(()=>{Nn();Cl=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>Ve.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},Ve.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=Ve.resourceManagement.inactiveTimeout;for(let[n,r]of this.activeClients.entries())e-r.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${n}`),this.cleanupClientResources(n,r),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 r=this.chunkTimers.get(e);r&&(r.forEach(s=>clearTimeout(s)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset())}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return Ve.streaming}getWebRTCConfig(){return Ve.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 Wm={};Ai(Wm,{ScreenUpdateHelper:()=>Tl});var Tl,$m=Mi(()=>{Nn();Tl=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,r=!1){if(!t||t.length===0)return;let s=Ve.streaming.chunkSize,o=[];for(let l=0;l<t.length;l+=s)o.push(t.slice(l,l+s));let a=this.resourceManager.getChunkTimers(e.id);for(let l=0;l<o.length;l++){let p=o[l],d=l===o.length-1,h=setTimeout(()=>{a.delete(h),e.connected&&e.emit("tiles-data",{tiles:p,timestamp:n,forceRefresh:!1,userAction:r,chunkInfo:{chunkIndex:l,totalChunks:o.length,isLastChunk:d}})},l*Ve.streaming.chunkDelay);a.add(h)}}}});var Km={};Ai(Km,{MouseHandler:()=>kl});var kl,Vm=Mi(()=>{Nn();kl=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastMouseMove=0}setupMouseHandlers(e,t){let n=this.robot;e.on("mouse-move",t(r=>{let s=Date.now();if(!(s-this.lastMouseMove<Ve.throttling.mouseThrottle)){this.lastMouseMove=s;try{let o=n.getScreenSize(),a=Math.round(r.x/100*o.width),l=Math.round(r.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),d=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,d),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async r=>{try{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=n.getScreenSize(),a=Math.round(r.x/100*o.width),l=Math.round(r.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),d=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,d),n.mouseClick(r.button||"left",r.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 r=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(r.x/100*o.width),l=Math.round(r.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),d=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,d),n.mouseToggle("down",r.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse press error:",s.message)}})),e.on("mouse-release",t(async r=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(r.x/100*o.width),l=Math.round(r.y/100*o.height),p=Math.max(0,Math.min(o.width-1,a)),d=Math.max(0,Math.min(o.height-1,l));n.moveMouse(p,d),n.mouseToggle("up",r.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse release error:",s.message)}})),e.on("scroll",t(async r=>{try{let{direction:s,amount:o=60,horizontal:a=!1}=r,l=this.resourceManager.getClient(e.id);if(!l)return;let p=0,d=0;a||s==="left"||s==="right"?p=s==="right"?o:-o:d=s==="down"?-o:o,n.scrollMouse(p,d),l.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Scroll error:",s.message)}})),e.on("mouse-drag-select",t(r=>{try{let{startX:s,startY:o,endX:a,endY:l}=r,p=n.getScreenSize(),d=Math.round(s/100*p.width),h=Math.round(o/100*p.height),g=Math.round(a/100*p.width),_=Math.round(l/100*p.height),S=Math.max(0,Math.min(p.width-1,d)),T=Math.max(0,Math.min(p.height-1,h)),A=Math.max(0,Math.min(p.width-1,g)),P=Math.max(0,Math.min(p.height-1,_));n.moveMouse(S,T),n.mouseToggle("down","left"),n.dragMouse(A,P),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var Gm={};Ai(Gm,{KeyboardHandler:()=>Ol});var Ol,Jm=Mi(()=>{Nn();Ol=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(r=>{let s=Date.now();if(!(s-this.lastKeyPress<Ve.throttling.keyThrottle)){this.lastKeyPress=s;try{if(!r.key||typeof r.key!="string")return;let o=this.resourceManager.getClient(e.id),a=r.key;if(a.length===1){n.keyTap(a,r.modifier||[]);for(let l of r.modifier||[])n.keyToggle(l,"up")}else switch(a.toLowerCase()){case"enter":case"return":n.keyTap("enter");break;case"space":n.keyTap(" ");break;case"backspace":n.keyTap("backspace");break;case"tab":n.keyTap("tab");break;case"escape":n.keyTap("escape");break;default:n.keyTap(a,r.modifier||[])}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("type-text",t(r=>{let s=Date.now();if(!(s-this.lastTypeText<Ve.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!r.text||typeof r.text!="string")return;let o=r.text;o.length>Ve.throttling.maxTextLength&&(o=o.substring(0,Ve.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),l=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),l&&(l.idleFrameCount=0,l.tileManager&&l.tileManager.clearScreenCache())}catch(p){console.error("Robot typeString error:",p.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var Ym={};Ai(Ym,{ScreenHandler:()=>Al});function kE(i){let e=Buffer.alloc(24);return e.writeUInt32LE(i.tileIndex,0),e.writeUInt32LE(i.x,4),e.writeUInt32LE(i.y,8),e.writeUInt32LE(i.width,12),e.writeUInt32LE(i.height,16),e.writeUInt32LE(i.imageBuffer.length,20),Buffer.concat([e,i.imageBuffer])}function Ml(i,e){let t=Buffer.alloc(12);return t.writeUInt32LE(i.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...i.map(kE)])}var Al,Xm=Mi(()=>{Al=class{constructor(e,t){this.resourceManager=e,this.screenUpdateHelper=t}setupScreenHandlers(e,t,n){e.on("request-screen",t(async()=>{let r=this.resourceManager.getClient(e.id);if(r)try{let s=await r.tileManager.detectChangedTiles();s.length>0&&n.sendTiles({tiles:s,timestamp:Date.now()},Ml),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Tile capture error:",s),n.emit("screen-error",{error:s.message})}})),e.on("request-screen-with-hashes",t(async r=>{let s=this.resourceManager.getClient(e.id);if(s)try{let o=r.tileHashes||[],a=await s.tileManager.compareClientTileHashes(o);a?.tiles?.length>0?n.sendTiles({tiles:a.tiles,timestamp:Date.now(),currentHashes:a.currentHashes,changedIndices:a.changedIndices},Ml):n.emit("tiles-data",{tiles:[],timestamp:Date.now(),currentHashes:a.currentHashes,changedIndices:[]}),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Tile capture with hashes error:",o),n.emit("screen-error",{error:o.message})}})),e.on("start-streaming",t(async()=>{let r=this.resourceManager.getClient(e.id);if(!r)return;r.streamingTimeout&&(clearTimeout(r.streamingTimeout),r.streamingTimeout=null),console.log("\u{1F680} Remote streaming started"),r.idleFrameCount=0,r.isStreaming=!0,r.tileManager.lastTileChecksums.clear();try{let o=await r.tileManager.getScreenDimensions();n.emit("screen-dimensions",o)}catch(o){console.error("Get dimensions error:",o.message)}let s=async()=>{if(!e.connected||!r.isStreaming){r.streamingTimeout=null;return}try{let o=performance.now(),a=await r.tileManager.detectChangedTilesWithHashes();a.tiles.length>0&&e.connected?(n.sendTiles({tiles:a.tiles,timestamp:Date.now(),currentHashes:a.currentHashes},Ml),r.idleFrameCount=0):r.idleFrameCount++;let{activeInterval:l,idleInterval:p,idleThreshold:d}=this.resourceManager.getStreamingConfig(),h=r.idleFrameCount>=d?p:l,g=Math.max(0,h-(performance.now()-o));r.streamingTimeout=setTimeout(s,g)}catch(o){console.error("Auto streaming error:",o),r.streamingTimeout=setTimeout(s,200)}};s()})),e.on("stop-streaming",()=>{let r=this.resourceManager.getClient(e.id);r&&(r.isStreaming=!1,r.streamingTimeout&&(clearTimeout(r.streamingTimeout),r.streamingTimeout=null),console.log("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let r=this.resourceManager.getClient(e.id);if(r)try{let s=await r.tileManager.getScreenDimensions();n.emit("screen-dimensions",s)}catch(s){console.error("Get dimensions error:",s),n.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let r=this.resourceManager.getClient(e.id);r&&(r.idleFrameCount=0)}))}}});var Fl=O((Tv,ql)=>{(function(i,e){"use strict";function t(w,c){if(!w)throw new Error(c||"Assertion failed")}function n(w,c){w.super_=c;var f=function(){};f.prototype=c.prototype,w.prototype=new f,w.prototype.constructor=w}function r(w,c,f){if(r.isBN(w))return w;this.negative=0,this.words=null,this.length=0,this.red=null,w!==null&&((c==="le"||c==="be")&&(f=c,c=10),this._init(w||0,c||10,f||"be"))}typeof i=="object"?i.exports=r:e.BN=r,r.BN=r,r.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}r.isBN=function(c){return c instanceof r?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===r.wordSize&&Array.isArray(c.words)},r.max=function(c,f){return c.cmp(f)>0?c:f},r.min=function(c,f){return c.cmp(f)<0?c:f},r.prototype._init=function(c,f,m){if(typeof c=="number")return this._initNumber(c,f,m);if(typeof c=="object")return this._initArray(c,f,m);f==="hex"&&(f=16),t(f===(f|0)&&f>=2&&f<=36),c=c.toString().replace(/\s+/g,"");var v=0;c[0]==="-"&&(v++,this.negative=1),v<c.length&&(f===16?this._parseHex(c,v,m):(this._parseBase(c,f,v),m==="le"&&this._initArray(this.toArray(),f,m)))},r.prototype._initNumber=function(c,f,m){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(t(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),m==="le"&&this._initArray(this.toArray(),f,m)},r.prototype._initArray=function(c,f,m){if(t(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var b,E,C=0;if(m==="be")for(v=c.length-1,b=0;v>=0;v-=3)E=c[v]|c[v-1]<<8|c[v-2]<<16,this.words[b]|=E<<C&67108863,this.words[b+1]=E>>>26-C&67108863,C+=24,C>=26&&(C-=26,b++);else if(m==="le")for(v=0,b=0;v<c.length;v+=3)E=c[v]|c[v+1]<<8|c[v+2]<<16,this.words[b]|=E<<C&67108863,this.words[b+1]=E>>>26-C&67108863,C+=24,C>=26&&(C-=26,b++);return this.strip()};function o(w,c){var f=w.charCodeAt(c);return f>=65&&f<=70?f-55:f>=97&&f<=102?f-87:f-48&15}function a(w,c,f){var m=o(w,f);return f-1>=c&&(m|=o(w,f-1)<<4),m}r.prototype._parseHex=function(c,f,m){this.length=Math.ceil((c.length-f)/6),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var b=0,E=0,C;if(m==="be")for(v=c.length-1;v>=f;v-=2)C=a(c,f,v)<<b,this.words[E]|=C&67108863,b>=18?(b-=18,E+=1,this.words[E]|=C>>>26):b+=8;else{var x=c.length-f;for(v=x%2===0?f+1:f;v<c.length;v+=2)C=a(c,f,v)<<b,this.words[E]|=C&67108863,b>=18?(b-=18,E+=1,this.words[E]|=C>>>26):b+=8}this.strip()};function l(w,c,f,m){for(var v=0,b=Math.min(w.length,f),E=c;E<b;E++){var C=w.charCodeAt(E)-48;v*=m,C>=49?v+=C-49+10:C>=17?v+=C-17+10:v+=C}return v}r.prototype._parseBase=function(c,f,m){this.words=[0],this.length=1;for(var v=0,b=1;b<=67108863;b*=f)v++;v--,b=b/f|0;for(var E=c.length-m,C=E%v,x=Math.min(E,E-C)+m,u=0,y=m;y<x;y+=v)u=l(c,y,y+v,f),this.imuln(b),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(C!==0){var j=1;for(u=l(c,y,c.length,f),y=0;y<C;y++)j*=f;this.imuln(j),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},r.prototype.copy=function(c){c.words=new Array(this.length);for(var f=0;f<this.length;f++)c.words[f]=this.words[f];c.length=this.length,c.negative=this.negative,c.red=this.red},r.prototype.clone=function(){var c=new r(null);return this.copy(c),c},r.prototype._expand=function(c){for(;this.length<c;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},r.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var p=["","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"],d=[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],h=[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];r.prototype.toString=function(c,f){c=c||10,f=f|0||1;var m;if(c===16||c==="hex"){m="";for(var v=0,b=0,E=0;E<this.length;E++){var C=this.words[E],x=((C<<v|b)&16777215).toString(16);b=C>>>24-v&16777215,v+=2,v>=26&&(v-=26,E--),b!==0||E!==this.length-1?m=p[6-x.length]+x+m:m=x+m}for(b!==0&&(m=b.toString(16)+m);m.length%f!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(c===(c|0)&&c>=2&&c<=36){var u=d[c],y=h[c];m="";var j=this.clone();for(j.negative=0;!j.isZero();){var k=j.modn(y).toString(c);j=j.idivn(y),j.isZero()?m=k+m:m=p[u-k.length]+k+m}for(this.isZero()&&(m="0"+m);m.length%f!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}t(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(c,f){return t(typeof s<"u"),this.toArrayLike(s,c,f)},r.prototype.toArray=function(c,f){return this.toArrayLike(Array,c,f)},r.prototype.toArrayLike=function(c,f,m){var v=this.byteLength(),b=m||Math.max(1,v);t(v<=b,"byte array longer than desired length"),t(b>0,"Requested array length <= 0"),this.strip();var E=f==="le",C=new c(b),x,u,y=this.clone();if(E){for(u=0;!y.isZero();u++)x=y.andln(255),y.iushrn(8),C[u]=x;for(;u<b;u++)C[u]=0}else{for(u=0;u<b-v;u++)C[u]=0;for(u=0;!y.isZero();u++)x=y.andln(255),y.iushrn(8),C[b-u-1]=x}return C},Math.clz32?r.prototype._countBits=function(c){return 32-Math.clz32(c)}:r.prototype._countBits=function(c){var f=c,m=0;return f>=4096&&(m+=13,f>>>=13),f>=64&&(m+=7,f>>>=7),f>=8&&(m+=4,f>>>=4),f>=2&&(m+=2,f>>>=2),m+f},r.prototype._zeroBits=function(c){if(c===0)return 26;var f=c,m=0;return(f&8191)===0&&(m+=13,f>>>=13),(f&127)===0&&(m+=7,f>>>=7),(f&15)===0&&(m+=4,f>>>=4),(f&3)===0&&(m+=2,f>>>=2),(f&1)===0&&m++,m},r.prototype.bitLength=function(){var c=this.words[this.length-1],f=this._countBits(c);return(this.length-1)*26+f};function g(w){for(var c=new Array(w.bitLength()),f=0;f<c.length;f++){var m=f/26|0,v=f%26;c[f]=(w.words[m]&1<<v)>>>v}return c}r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,f=0;f<this.length;f++){var m=this._zeroBits(this.words[f]);if(c+=m,m!==26)break}return c},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},r.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return this.negative!==0},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var f=0;f<c.length;f++)this.words[f]=this.words[f]|c.words[f];return this.strip()},r.prototype.ior=function(c){return t((this.negative|c.negative)===0),this.iuor(c)},r.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},r.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},r.prototype.iuand=function(c){var f;this.length>c.length?f=c:f=this;for(var m=0;m<f.length;m++)this.words[m]=this.words[m]&c.words[m];return this.length=f.length,this.strip()},r.prototype.iand=function(c){return t((this.negative|c.negative)===0),this.iuand(c)},r.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},r.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},r.prototype.iuxor=function(c){var f,m;this.length>c.length?(f=this,m=c):(f=c,m=this);for(var v=0;v<m.length;v++)this.words[v]=f.words[v]^m.words[v];if(this!==f)for(;v<f.length;v++)this.words[v]=f.words[v];return this.length=f.length,this.strip()},r.prototype.ixor=function(c){return t((this.negative|c.negative)===0),this.iuxor(c)},r.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},r.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},r.prototype.inotn=function(c){t(typeof c=="number"&&c>=0);var f=Math.ceil(c/26)|0,m=c%26;this._expand(f),m>0&&f--;for(var v=0;v<f;v++)this.words[v]=~this.words[v]&67108863;return m>0&&(this.words[v]=~this.words[v]&67108863>>26-m),this.strip()},r.prototype.notn=function(c){return this.clone().inotn(c)},r.prototype.setn=function(c,f){t(typeof c=="number"&&c>=0);var m=c/26|0,v=c%26;return this._expand(m+1),f?this.words[m]=this.words[m]|1<<v:this.words[m]=this.words[m]&~(1<<v),this.strip()},r.prototype.iadd=function(c){var f;if(this.negative!==0&&c.negative===0)return this.negative=0,f=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,f=this.isub(c),c.negative=1,f._normSign();var m,v;this.length>c.length?(m=this,v=c):(m=c,v=this);for(var b=0,E=0;E<v.length;E++)f=(m.words[E]|0)+(v.words[E]|0)+b,this.words[E]=f&67108863,b=f>>>26;for(;b!==0&&E<m.length;E++)f=(m.words[E]|0)+b,this.words[E]=f&67108863,b=f>>>26;if(this.length=m.length,b!==0)this.words[this.length]=b,this.length++;else if(m!==this)for(;E<m.length;E++)this.words[E]=m.words[E];return this},r.prototype.add=function(c){var f;return c.negative!==0&&this.negative===0?(c.negative=0,f=this.sub(c),c.negative^=1,f):c.negative===0&&this.negative!==0?(this.negative=0,f=c.sub(this),this.negative=1,f):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},r.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var f=this.iadd(c);return c.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var m=this.cmp(c);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,b;m>0?(v=this,b=c):(v=c,b=this);for(var E=0,C=0;C<b.length;C++)f=(v.words[C]|0)-(b.words[C]|0)+E,E=f>>26,this.words[C]=f&67108863;for(;E!==0&&C<v.length;C++)f=(v.words[C]|0)+E,E=f>>26,this.words[C]=f&67108863;if(E===0&&C<v.length&&v!==this)for(;C<v.length;C++)this.words[C]=v.words[C];return this.length=Math.max(this.length,C),v!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(c){return this.clone().isub(c)};function _(w,c,f){f.negative=c.negative^w.negative;var m=w.length+c.length|0;f.length=m,m=m-1|0;var v=w.words[0]|0,b=c.words[0]|0,E=v*b,C=E&67108863,x=E/67108864|0;f.words[0]=C;for(var u=1;u<m;u++){for(var y=x>>>26,j=x&67108863,k=Math.min(u,c.length-1),M=Math.max(0,u-w.length+1);M<=k;M++){var I=u-M|0;v=w.words[I]|0,b=c.words[M]|0,E=v*b+j,y+=E/67108864|0,j=E&67108863}f.words[u]=j|0,x=y|0}return x!==0?f.words[u]=x|0:f.length--,f.strip()}var S=function(c,f,m){var v=c.words,b=f.words,E=m.words,C=0,x,u,y,j=v[0]|0,k=j&8191,M=j>>>13,I=v[1]|0,q=I&8191,H=I>>>13,Ye=v[2]|0,V=Ye&8191,G=Ye>>>13,dt=v[3]|0,te=dt&8191,ee=dt>>>13,mi=v[4]|0,Q=mi&8191,ie=mi>>>13,Kr=v[5]|0,fe=Kr&8191,de=Kr>>>13,tp=v[6]|0,he=tp&8191,me=tp>>>13,ip=v[7]|0,ve=ip&8191,ge=ip>>>13,np=v[8]|0,xe=np&8191,ye=np>>>13,rp=v[9]|0,be=rp&8191,we=rp>>>13,sp=b[0]|0,_e=sp&8191,Se=sp>>>13,op=b[1]|0,Ee=op&8191,Ce=op>>>13,ap=b[2]|0,Te=ap&8191,ke=ap>>>13,cp=b[3]|0,Oe=cp&8191,Me=cp>>>13,lp=b[4]|0,Ae=lp&8191,Re=lp>>>13,up=b[5]|0,Pe=up&8191,Ie=up>>>13,pp=b[6]|0,Ne=pp&8191,Be=pp>>>13,fp=b[7]|0,je=fp&8191,De=fp>>>13,dp=b[8]|0,Le=dp&8191,qe=dp>>>13,hp=b[9]|0,Fe=hp&8191,Ue=hp>>>13;m.negative=c.negative^f.negative,m.length=19,x=Math.imul(k,_e),u=Math.imul(k,Se),u=u+Math.imul(M,_e)|0,y=Math.imul(M,Se);var oa=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(oa>>>26)|0,oa&=67108863,x=Math.imul(q,_e),u=Math.imul(q,Se),u=u+Math.imul(H,_e)|0,y=Math.imul(H,Se),x=x+Math.imul(k,Ee)|0,u=u+Math.imul(k,Ce)|0,u=u+Math.imul(M,Ee)|0,y=y+Math.imul(M,Ce)|0;var aa=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(aa>>>26)|0,aa&=67108863,x=Math.imul(V,_e),u=Math.imul(V,Se),u=u+Math.imul(G,_e)|0,y=Math.imul(G,Se),x=x+Math.imul(q,Ee)|0,u=u+Math.imul(q,Ce)|0,u=u+Math.imul(H,Ee)|0,y=y+Math.imul(H,Ce)|0,x=x+Math.imul(k,Te)|0,u=u+Math.imul(k,ke)|0,u=u+Math.imul(M,Te)|0,y=y+Math.imul(M,ke)|0;var ca=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(ca>>>26)|0,ca&=67108863,x=Math.imul(te,_e),u=Math.imul(te,Se),u=u+Math.imul(ee,_e)|0,y=Math.imul(ee,Se),x=x+Math.imul(V,Ee)|0,u=u+Math.imul(V,Ce)|0,u=u+Math.imul(G,Ee)|0,y=y+Math.imul(G,Ce)|0,x=x+Math.imul(q,Te)|0,u=u+Math.imul(q,ke)|0,u=u+Math.imul(H,Te)|0,y=y+Math.imul(H,ke)|0,x=x+Math.imul(k,Oe)|0,u=u+Math.imul(k,Me)|0,u=u+Math.imul(M,Oe)|0,y=y+Math.imul(M,Me)|0;var la=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(la>>>26)|0,la&=67108863,x=Math.imul(Q,_e),u=Math.imul(Q,Se),u=u+Math.imul(ie,_e)|0,y=Math.imul(ie,Se),x=x+Math.imul(te,Ee)|0,u=u+Math.imul(te,Ce)|0,u=u+Math.imul(ee,Ee)|0,y=y+Math.imul(ee,Ce)|0,x=x+Math.imul(V,Te)|0,u=u+Math.imul(V,ke)|0,u=u+Math.imul(G,Te)|0,y=y+Math.imul(G,ke)|0,x=x+Math.imul(q,Oe)|0,u=u+Math.imul(q,Me)|0,u=u+Math.imul(H,Oe)|0,y=y+Math.imul(H,Me)|0,x=x+Math.imul(k,Ae)|0,u=u+Math.imul(k,Re)|0,u=u+Math.imul(M,Ae)|0,y=y+Math.imul(M,Re)|0;var ua=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(ua>>>26)|0,ua&=67108863,x=Math.imul(fe,_e),u=Math.imul(fe,Se),u=u+Math.imul(de,_e)|0,y=Math.imul(de,Se),x=x+Math.imul(Q,Ee)|0,u=u+Math.imul(Q,Ce)|0,u=u+Math.imul(ie,Ee)|0,y=y+Math.imul(ie,Ce)|0,x=x+Math.imul(te,Te)|0,u=u+Math.imul(te,ke)|0,u=u+Math.imul(ee,Te)|0,y=y+Math.imul(ee,ke)|0,x=x+Math.imul(V,Oe)|0,u=u+Math.imul(V,Me)|0,u=u+Math.imul(G,Oe)|0,y=y+Math.imul(G,Me)|0,x=x+Math.imul(q,Ae)|0,u=u+Math.imul(q,Re)|0,u=u+Math.imul(H,Ae)|0,y=y+Math.imul(H,Re)|0,x=x+Math.imul(k,Pe)|0,u=u+Math.imul(k,Ie)|0,u=u+Math.imul(M,Pe)|0,y=y+Math.imul(M,Ie)|0;var pa=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(pa>>>26)|0,pa&=67108863,x=Math.imul(he,_e),u=Math.imul(he,Se),u=u+Math.imul(me,_e)|0,y=Math.imul(me,Se),x=x+Math.imul(fe,Ee)|0,u=u+Math.imul(fe,Ce)|0,u=u+Math.imul(de,Ee)|0,y=y+Math.imul(de,Ce)|0,x=x+Math.imul(Q,Te)|0,u=u+Math.imul(Q,ke)|0,u=u+Math.imul(ie,Te)|0,y=y+Math.imul(ie,ke)|0,x=x+Math.imul(te,Oe)|0,u=u+Math.imul(te,Me)|0,u=u+Math.imul(ee,Oe)|0,y=y+Math.imul(ee,Me)|0,x=x+Math.imul(V,Ae)|0,u=u+Math.imul(V,Re)|0,u=u+Math.imul(G,Ae)|0,y=y+Math.imul(G,Re)|0,x=x+Math.imul(q,Pe)|0,u=u+Math.imul(q,Ie)|0,u=u+Math.imul(H,Pe)|0,y=y+Math.imul(H,Ie)|0,x=x+Math.imul(k,Ne)|0,u=u+Math.imul(k,Be)|0,u=u+Math.imul(M,Ne)|0,y=y+Math.imul(M,Be)|0;var fa=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(fa>>>26)|0,fa&=67108863,x=Math.imul(ve,_e),u=Math.imul(ve,Se),u=u+Math.imul(ge,_e)|0,y=Math.imul(ge,Se),x=x+Math.imul(he,Ee)|0,u=u+Math.imul(he,Ce)|0,u=u+Math.imul(me,Ee)|0,y=y+Math.imul(me,Ce)|0,x=x+Math.imul(fe,Te)|0,u=u+Math.imul(fe,ke)|0,u=u+Math.imul(de,Te)|0,y=y+Math.imul(de,ke)|0,x=x+Math.imul(Q,Oe)|0,u=u+Math.imul(Q,Me)|0,u=u+Math.imul(ie,Oe)|0,y=y+Math.imul(ie,Me)|0,x=x+Math.imul(te,Ae)|0,u=u+Math.imul(te,Re)|0,u=u+Math.imul(ee,Ae)|0,y=y+Math.imul(ee,Re)|0,x=x+Math.imul(V,Pe)|0,u=u+Math.imul(V,Ie)|0,u=u+Math.imul(G,Pe)|0,y=y+Math.imul(G,Ie)|0,x=x+Math.imul(q,Ne)|0,u=u+Math.imul(q,Be)|0,u=u+Math.imul(H,Ne)|0,y=y+Math.imul(H,Be)|0,x=x+Math.imul(k,je)|0,u=u+Math.imul(k,De)|0,u=u+Math.imul(M,je)|0,y=y+Math.imul(M,De)|0;var da=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(da>>>26)|0,da&=67108863,x=Math.imul(xe,_e),u=Math.imul(xe,Se),u=u+Math.imul(ye,_e)|0,y=Math.imul(ye,Se),x=x+Math.imul(ve,Ee)|0,u=u+Math.imul(ve,Ce)|0,u=u+Math.imul(ge,Ee)|0,y=y+Math.imul(ge,Ce)|0,x=x+Math.imul(he,Te)|0,u=u+Math.imul(he,ke)|0,u=u+Math.imul(me,Te)|0,y=y+Math.imul(me,ke)|0,x=x+Math.imul(fe,Oe)|0,u=u+Math.imul(fe,Me)|0,u=u+Math.imul(de,Oe)|0,y=y+Math.imul(de,Me)|0,x=x+Math.imul(Q,Ae)|0,u=u+Math.imul(Q,Re)|0,u=u+Math.imul(ie,Ae)|0,y=y+Math.imul(ie,Re)|0,x=x+Math.imul(te,Pe)|0,u=u+Math.imul(te,Ie)|0,u=u+Math.imul(ee,Pe)|0,y=y+Math.imul(ee,Ie)|0,x=x+Math.imul(V,Ne)|0,u=u+Math.imul(V,Be)|0,u=u+Math.imul(G,Ne)|0,y=y+Math.imul(G,Be)|0,x=x+Math.imul(q,je)|0,u=u+Math.imul(q,De)|0,u=u+Math.imul(H,je)|0,y=y+Math.imul(H,De)|0,x=x+Math.imul(k,Le)|0,u=u+Math.imul(k,qe)|0,u=u+Math.imul(M,Le)|0,y=y+Math.imul(M,qe)|0;var ha=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(ha>>>26)|0,ha&=67108863,x=Math.imul(be,_e),u=Math.imul(be,Se),u=u+Math.imul(we,_e)|0,y=Math.imul(we,Se),x=x+Math.imul(xe,Ee)|0,u=u+Math.imul(xe,Ce)|0,u=u+Math.imul(ye,Ee)|0,y=y+Math.imul(ye,Ce)|0,x=x+Math.imul(ve,Te)|0,u=u+Math.imul(ve,ke)|0,u=u+Math.imul(ge,Te)|0,y=y+Math.imul(ge,ke)|0,x=x+Math.imul(he,Oe)|0,u=u+Math.imul(he,Me)|0,u=u+Math.imul(me,Oe)|0,y=y+Math.imul(me,Me)|0,x=x+Math.imul(fe,Ae)|0,u=u+Math.imul(fe,Re)|0,u=u+Math.imul(de,Ae)|0,y=y+Math.imul(de,Re)|0,x=x+Math.imul(Q,Pe)|0,u=u+Math.imul(Q,Ie)|0,u=u+Math.imul(ie,Pe)|0,y=y+Math.imul(ie,Ie)|0,x=x+Math.imul(te,Ne)|0,u=u+Math.imul(te,Be)|0,u=u+Math.imul(ee,Ne)|0,y=y+Math.imul(ee,Be)|0,x=x+Math.imul(V,je)|0,u=u+Math.imul(V,De)|0,u=u+Math.imul(G,je)|0,y=y+Math.imul(G,De)|0,x=x+Math.imul(q,Le)|0,u=u+Math.imul(q,qe)|0,u=u+Math.imul(H,Le)|0,y=y+Math.imul(H,qe)|0,x=x+Math.imul(k,Fe)|0,u=u+Math.imul(k,Ue)|0,u=u+Math.imul(M,Fe)|0,y=y+Math.imul(M,Ue)|0;var ma=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(ma>>>26)|0,ma&=67108863,x=Math.imul(be,Ee),u=Math.imul(be,Ce),u=u+Math.imul(we,Ee)|0,y=Math.imul(we,Ce),x=x+Math.imul(xe,Te)|0,u=u+Math.imul(xe,ke)|0,u=u+Math.imul(ye,Te)|0,y=y+Math.imul(ye,ke)|0,x=x+Math.imul(ve,Oe)|0,u=u+Math.imul(ve,Me)|0,u=u+Math.imul(ge,Oe)|0,y=y+Math.imul(ge,Me)|0,x=x+Math.imul(he,Ae)|0,u=u+Math.imul(he,Re)|0,u=u+Math.imul(me,Ae)|0,y=y+Math.imul(me,Re)|0,x=x+Math.imul(fe,Pe)|0,u=u+Math.imul(fe,Ie)|0,u=u+Math.imul(de,Pe)|0,y=y+Math.imul(de,Ie)|0,x=x+Math.imul(Q,Ne)|0,u=u+Math.imul(Q,Be)|0,u=u+Math.imul(ie,Ne)|0,y=y+Math.imul(ie,Be)|0,x=x+Math.imul(te,je)|0,u=u+Math.imul(te,De)|0,u=u+Math.imul(ee,je)|0,y=y+Math.imul(ee,De)|0,x=x+Math.imul(V,Le)|0,u=u+Math.imul(V,qe)|0,u=u+Math.imul(G,Le)|0,y=y+Math.imul(G,qe)|0,x=x+Math.imul(q,Fe)|0,u=u+Math.imul(q,Ue)|0,u=u+Math.imul(H,Fe)|0,y=y+Math.imul(H,Ue)|0;var va=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(va>>>26)|0,va&=67108863,x=Math.imul(be,Te),u=Math.imul(be,ke),u=u+Math.imul(we,Te)|0,y=Math.imul(we,ke),x=x+Math.imul(xe,Oe)|0,u=u+Math.imul(xe,Me)|0,u=u+Math.imul(ye,Oe)|0,y=y+Math.imul(ye,Me)|0,x=x+Math.imul(ve,Ae)|0,u=u+Math.imul(ve,Re)|0,u=u+Math.imul(ge,Ae)|0,y=y+Math.imul(ge,Re)|0,x=x+Math.imul(he,Pe)|0,u=u+Math.imul(he,Ie)|0,u=u+Math.imul(me,Pe)|0,y=y+Math.imul(me,Ie)|0,x=x+Math.imul(fe,Ne)|0,u=u+Math.imul(fe,Be)|0,u=u+Math.imul(de,Ne)|0,y=y+Math.imul(de,Be)|0,x=x+Math.imul(Q,je)|0,u=u+Math.imul(Q,De)|0,u=u+Math.imul(ie,je)|0,y=y+Math.imul(ie,De)|0,x=x+Math.imul(te,Le)|0,u=u+Math.imul(te,qe)|0,u=u+Math.imul(ee,Le)|0,y=y+Math.imul(ee,qe)|0,x=x+Math.imul(V,Fe)|0,u=u+Math.imul(V,Ue)|0,u=u+Math.imul(G,Fe)|0,y=y+Math.imul(G,Ue)|0;var ga=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(ga>>>26)|0,ga&=67108863,x=Math.imul(be,Oe),u=Math.imul(be,Me),u=u+Math.imul(we,Oe)|0,y=Math.imul(we,Me),x=x+Math.imul(xe,Ae)|0,u=u+Math.imul(xe,Re)|0,u=u+Math.imul(ye,Ae)|0,y=y+Math.imul(ye,Re)|0,x=x+Math.imul(ve,Pe)|0,u=u+Math.imul(ve,Ie)|0,u=u+Math.imul(ge,Pe)|0,y=y+Math.imul(ge,Ie)|0,x=x+Math.imul(he,Ne)|0,u=u+Math.imul(he,Be)|0,u=u+Math.imul(me,Ne)|0,y=y+Math.imul(me,Be)|0,x=x+Math.imul(fe,je)|0,u=u+Math.imul(fe,De)|0,u=u+Math.imul(de,je)|0,y=y+Math.imul(de,De)|0,x=x+Math.imul(Q,Le)|0,u=u+Math.imul(Q,qe)|0,u=u+Math.imul(ie,Le)|0,y=y+Math.imul(ie,qe)|0,x=x+Math.imul(te,Fe)|0,u=u+Math.imul(te,Ue)|0,u=u+Math.imul(ee,Fe)|0,y=y+Math.imul(ee,Ue)|0;var xa=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(xa>>>26)|0,xa&=67108863,x=Math.imul(be,Ae),u=Math.imul(be,Re),u=u+Math.imul(we,Ae)|0,y=Math.imul(we,Re),x=x+Math.imul(xe,Pe)|0,u=u+Math.imul(xe,Ie)|0,u=u+Math.imul(ye,Pe)|0,y=y+Math.imul(ye,Ie)|0,x=x+Math.imul(ve,Ne)|0,u=u+Math.imul(ve,Be)|0,u=u+Math.imul(ge,Ne)|0,y=y+Math.imul(ge,Be)|0,x=x+Math.imul(he,je)|0,u=u+Math.imul(he,De)|0,u=u+Math.imul(me,je)|0,y=y+Math.imul(me,De)|0,x=x+Math.imul(fe,Le)|0,u=u+Math.imul(fe,qe)|0,u=u+Math.imul(de,Le)|0,y=y+Math.imul(de,qe)|0,x=x+Math.imul(Q,Fe)|0,u=u+Math.imul(Q,Ue)|0,u=u+Math.imul(ie,Fe)|0,y=y+Math.imul(ie,Ue)|0;var ya=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(ya>>>26)|0,ya&=67108863,x=Math.imul(be,Pe),u=Math.imul(be,Ie),u=u+Math.imul(we,Pe)|0,y=Math.imul(we,Ie),x=x+Math.imul(xe,Ne)|0,u=u+Math.imul(xe,Be)|0,u=u+Math.imul(ye,Ne)|0,y=y+Math.imul(ye,Be)|0,x=x+Math.imul(ve,je)|0,u=u+Math.imul(ve,De)|0,u=u+Math.imul(ge,je)|0,y=y+Math.imul(ge,De)|0,x=x+Math.imul(he,Le)|0,u=u+Math.imul(he,qe)|0,u=u+Math.imul(me,Le)|0,y=y+Math.imul(me,qe)|0,x=x+Math.imul(fe,Fe)|0,u=u+Math.imul(fe,Ue)|0,u=u+Math.imul(de,Fe)|0,y=y+Math.imul(de,Ue)|0;var ba=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(ba>>>26)|0,ba&=67108863,x=Math.imul(be,Ne),u=Math.imul(be,Be),u=u+Math.imul(we,Ne)|0,y=Math.imul(we,Be),x=x+Math.imul(xe,je)|0,u=u+Math.imul(xe,De)|0,u=u+Math.imul(ye,je)|0,y=y+Math.imul(ye,De)|0,x=x+Math.imul(ve,Le)|0,u=u+Math.imul(ve,qe)|0,u=u+Math.imul(ge,Le)|0,y=y+Math.imul(ge,qe)|0,x=x+Math.imul(he,Fe)|0,u=u+Math.imul(he,Ue)|0,u=u+Math.imul(me,Fe)|0,y=y+Math.imul(me,Ue)|0;var wa=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(wa>>>26)|0,wa&=67108863,x=Math.imul(be,je),u=Math.imul(be,De),u=u+Math.imul(we,je)|0,y=Math.imul(we,De),x=x+Math.imul(xe,Le)|0,u=u+Math.imul(xe,qe)|0,u=u+Math.imul(ye,Le)|0,y=y+Math.imul(ye,qe)|0,x=x+Math.imul(ve,Fe)|0,u=u+Math.imul(ve,Ue)|0,u=u+Math.imul(ge,Fe)|0,y=y+Math.imul(ge,Ue)|0;var _a=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(_a>>>26)|0,_a&=67108863,x=Math.imul(be,Le),u=Math.imul(be,qe),u=u+Math.imul(we,Le)|0,y=Math.imul(we,qe),x=x+Math.imul(xe,Fe)|0,u=u+Math.imul(xe,Ue)|0,u=u+Math.imul(ye,Fe)|0,y=y+Math.imul(ye,Ue)|0;var Sa=(C+x|0)+((u&8191)<<13)|0;C=(y+(u>>>13)|0)+(Sa>>>26)|0,Sa&=67108863,x=Math.imul(be,Fe),u=Math.imul(be,Ue),u=u+Math.imul(we,Fe)|0,y=Math.imul(we,Ue);var Ea=(C+x|0)+((u&8191)<<13)|0;return C=(y+(u>>>13)|0)+(Ea>>>26)|0,Ea&=67108863,E[0]=oa,E[1]=aa,E[2]=ca,E[3]=la,E[4]=ua,E[5]=pa,E[6]=fa,E[7]=da,E[8]=ha,E[9]=ma,E[10]=va,E[11]=ga,E[12]=xa,E[13]=ya,E[14]=ba,E[15]=wa,E[16]=_a,E[17]=Sa,E[18]=Ea,C!==0&&(E[19]=C,m.length++),m};Math.imul||(S=_);function T(w,c,f){f.negative=c.negative^w.negative,f.length=w.length+c.length;for(var m=0,v=0,b=0;b<f.length-1;b++){var E=v;v=0;for(var C=m&67108863,x=Math.min(b,c.length-1),u=Math.max(0,b-w.length+1);u<=x;u++){var y=b-u,j=w.words[y]|0,k=c.words[u]|0,M=j*k,I=M&67108863;E=E+(M/67108864|0)|0,I=I+C|0,C=I&67108863,E=E+(I>>>26)|0,v+=E>>>26,E&=67108863}f.words[b]=C,m=E,E=v}return m!==0?f.words[b]=m:f.length--,f.strip()}function A(w,c,f){var m=new P;return m.mulp(w,c,f)}r.prototype.mulTo=function(c,f){var m,v=this.length+c.length;return this.length===10&&c.length===10?m=S(this,c,f):v<63?m=_(this,c,f):v<1024?m=T(this,c,f):m=A(this,c,f),m};function P(w,c){this.x=w,this.y=c}P.prototype.makeRBT=function(c){for(var f=new Array(c),m=r.prototype._countBits(c)-1,v=0;v<c;v++)f[v]=this.revBin(v,m,c);return f},P.prototype.revBin=function(c,f,m){if(c===0||c===m-1)return c;for(var v=0,b=0;b<f;b++)v|=(c&1)<<f-b-1,c>>=1;return v},P.prototype.permute=function(c,f,m,v,b,E){for(var C=0;C<E;C++)v[C]=f[c[C]],b[C]=m[c[C]]},P.prototype.transform=function(c,f,m,v,b,E){this.permute(E,c,f,m,v,b);for(var C=1;C<b;C<<=1)for(var x=C<<1,u=Math.cos(2*Math.PI/x),y=Math.sin(2*Math.PI/x),j=0;j<b;j+=x)for(var k=u,M=y,I=0;I<C;I++){var q=m[j+I],H=v[j+I],Ye=m[j+I+C],V=v[j+I+C],G=k*Ye-M*V;V=k*V+M*Ye,Ye=G,m[j+I]=q+Ye,v[j+I]=H+V,m[j+I+C]=q-Ye,v[j+I+C]=H-V,I!==x&&(G=u*k-y*M,M=u*M+y*k,k=G)}},P.prototype.guessLen13b=function(c,f){var m=Math.max(f,c)|1,v=m&1,b=0;for(m=m/2|0;m;m=m>>>1)b++;return 1<<b+1+v},P.prototype.conjugate=function(c,f,m){if(!(m<=1))for(var v=0;v<m/2;v++){var b=c[v];c[v]=c[m-v-1],c[m-v-1]=b,b=f[v],f[v]=-f[m-v-1],f[m-v-1]=-b}},P.prototype.normalize13b=function(c,f){for(var m=0,v=0;v<f/2;v++){var b=Math.round(c[2*v+1]/f)*8192+Math.round(c[2*v]/f)+m;c[v]=b&67108863,b<67108864?m=0:m=b/67108864|0}return c},P.prototype.convert13b=function(c,f,m,v){for(var b=0,E=0;E<f;E++)b=b+(c[E]|0),m[2*E]=b&8191,b=b>>>13,m[2*E+1]=b&8191,b=b>>>13;for(E=2*f;E<v;++E)m[E]=0;t(b===0),t((b&-8192)===0)},P.prototype.stub=function(c){for(var f=new Array(c),m=0;m<c;m++)f[m]=0;return f},P.prototype.mulp=function(c,f,m){var v=2*this.guessLen13b(c.length,f.length),b=this.makeRBT(v),E=this.stub(v),C=new Array(v),x=new Array(v),u=new Array(v),y=new Array(v),j=new Array(v),k=new Array(v),M=m.words;M.length=v,this.convert13b(c.words,c.length,C,v),this.convert13b(f.words,f.length,y,v),this.transform(C,E,x,u,v,b),this.transform(y,E,j,k,v,b);for(var I=0;I<v;I++){var q=x[I]*j[I]-u[I]*k[I];u[I]=x[I]*k[I]+u[I]*j[I],x[I]=q}return this.conjugate(x,u,v),this.transform(x,u,M,E,v,b),this.conjugate(M,E,v),this.normalize13b(M,v),m.negative=c.negative^f.negative,m.length=c.length+f.length,m.strip()},r.prototype.mul=function(c){var f=new r(null);return f.words=new Array(this.length+c.length),this.mulTo(c,f)},r.prototype.mulf=function(c){var f=new r(null);return f.words=new Array(this.length+c.length),A(this,c,f)},r.prototype.imul=function(c){return this.clone().mulTo(c,this)},r.prototype.imuln=function(c){t(typeof c=="number"),t(c<67108864);for(var f=0,m=0;m<this.length;m++){var v=(this.words[m]|0)*c,b=(v&67108863)+(f&67108863);f>>=26,f+=v/67108864|0,f+=b>>>26,this.words[m]=b&67108863}return f!==0&&(this.words[m]=f,this.length++),this.length=c===0?1:this.length,this},r.prototype.muln=function(c){return this.clone().imuln(c)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(c){var f=g(c);if(f.length===0)return new r(1);for(var m=this,v=0;v<f.length&&f[v]===0;v++,m=m.sqr());if(++v<f.length)for(var b=m.sqr();v<f.length;v++,b=b.sqr())f[v]!==0&&(m=m.mul(b));return m},r.prototype.iushln=function(c){t(typeof c=="number"&&c>=0);var f=c%26,m=(c-f)/26,v=67108863>>>26-f<<26-f,b;if(f!==0){var E=0;for(b=0;b<this.length;b++){var C=this.words[b]&v,x=(this.words[b]|0)-C<<f;this.words[b]=x|E,E=C>>>26-f}E&&(this.words[b]=E,this.length++)}if(m!==0){for(b=this.length-1;b>=0;b--)this.words[b+m]=this.words[b];for(b=0;b<m;b++)this.words[b]=0;this.length+=m}return this.strip()},r.prototype.ishln=function(c){return t(this.negative===0),this.iushln(c)},r.prototype.iushrn=function(c,f,m){t(typeof c=="number"&&c>=0);var v;f?v=(f-f%26)/26:v=0;var b=c%26,E=Math.min((c-b)/26,this.length),C=67108863^67108863>>>b<<b,x=m;if(v-=E,v=Math.max(0,v),x){for(var u=0;u<E;u++)x.words[u]=this.words[u];x.length=E}if(E!==0)if(this.length>E)for(this.length-=E,u=0;u<this.length;u++)this.words[u]=this.words[u+E];else this.words[0]=0,this.length=1;var y=0;for(u=this.length-1;u>=0&&(y!==0||u>=v);u--){var j=this.words[u]|0;this.words[u]=y<<26-b|j>>>b,y=j&C}return x&&y!==0&&(x.words[x.length++]=y),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(c,f,m){return t(this.negative===0),this.iushrn(c,f,m)},r.prototype.shln=function(c){return this.clone().ishln(c)},r.prototype.ushln=function(c){return this.clone().iushln(c)},r.prototype.shrn=function(c){return this.clone().ishrn(c)},r.prototype.ushrn=function(c){return this.clone().iushrn(c)},r.prototype.testn=function(c){t(typeof c=="number"&&c>=0);var f=c%26,m=(c-f)/26,v=1<<f;if(this.length<=m)return!1;var b=this.words[m];return!!(b&v)},r.prototype.imaskn=function(c){t(typeof c=="number"&&c>=0);var f=c%26,m=(c-f)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(f!==0&&m++,this.length=Math.min(m,this.length),f!==0){var v=67108863^67108863>>>f<<f;this.words[this.length-1]&=v}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.maskn=function(c){return this.clone().imaskn(c)},r.prototype.iaddn=function(c){return t(typeof c=="number"),t(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},r.prototype._iaddn=function(c){this.words[0]+=c;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},r.prototype.isubn=function(c){if(t(typeof c=="number"),t(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this.strip()},r.prototype.addn=function(c){return this.clone().iaddn(c)},r.prototype.subn=function(c){return this.clone().isubn(c)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(c,f,m){var v=c.length+m,b;this._expand(v);var E,C=0;for(b=0;b<c.length;b++){E=(this.words[b+m]|0)+C;var x=(c.words[b]|0)*f;E-=x&67108863,C=(E>>26)-(x/67108864|0),this.words[b+m]=E&67108863}for(;b<this.length-m;b++)E=(this.words[b+m]|0)+C,C=E>>26,this.words[b+m]=E&67108863;if(C===0)return this.strip();for(t(C===-1),C=0,b=0;b<this.length;b++)E=-(this.words[b]|0)+C,C=E>>26,this.words[b]=E&67108863;return this.negative=1,this.strip()},r.prototype._wordDiv=function(c,f){var m=this.length-c.length,v=this.clone(),b=c,E=b.words[b.length-1]|0,C=this._countBits(E);m=26-C,m!==0&&(b=b.ushln(m),v.iushln(m),E=b.words[b.length-1]|0);var x=v.length-b.length,u;if(f!=="mod"){u=new r(null),u.length=x+1,u.words=new Array(u.length);for(var y=0;y<u.length;y++)u.words[y]=0}var j=v.clone()._ishlnsubmul(b,1,x);j.negative===0&&(v=j,u&&(u.words[x]=1));for(var k=x-1;k>=0;k--){var M=(v.words[b.length+k]|0)*67108864+(v.words[b.length+k-1]|0);for(M=Math.min(M/E|0,67108863),v._ishlnsubmul(b,M,k);v.negative!==0;)M--,v.negative=0,v._ishlnsubmul(b,1,k),v.isZero()||(v.negative^=1);u&&(u.words[k]=M)}return u&&u.strip(),v.strip(),f!=="div"&&m!==0&&v.iushrn(m),{div:u||null,mod:v}},r.prototype.divmod=function(c,f,m){if(t(!c.isZero()),this.isZero())return{div:new r(0),mod:new r(0)};var v,b,E;return this.negative!==0&&c.negative===0?(E=this.neg().divmod(c,f),f!=="mod"&&(v=E.div.neg()),f!=="div"&&(b=E.mod.neg(),m&&b.negative!==0&&b.iadd(c)),{div:v,mod:b}):this.negative===0&&c.negative!==0?(E=this.divmod(c.neg(),f),f!=="mod"&&(v=E.div.neg()),{div:v,mod:E.mod}):(this.negative&c.negative)!==0?(E=this.neg().divmod(c.neg(),f),f!=="div"&&(b=E.mod.neg(),m&&b.negative!==0&&b.isub(c)),{div:E.div,mod:b}):c.length>this.length||this.cmp(c)<0?{div:new r(0),mod:this}:c.length===1?f==="div"?{div:this.divn(c.words[0]),mod:null}:f==="mod"?{div:null,mod:new r(this.modn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new r(this.modn(c.words[0]))}:this._wordDiv(c,f)},r.prototype.div=function(c){return this.divmod(c,"div",!1).div},r.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},r.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},r.prototype.divRound=function(c){var f=this.divmod(c);if(f.mod.isZero())return f.div;var m=f.div.negative!==0?f.mod.isub(c):f.mod,v=c.ushrn(1),b=c.andln(1),E=m.cmp(v);return E<0||b===1&&E===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},r.prototype.modn=function(c){t(c<=67108863);for(var f=(1<<26)%c,m=0,v=this.length-1;v>=0;v--)m=(f*m+(this.words[v]|0))%c;return m},r.prototype.idivn=function(c){t(c<=67108863);for(var f=0,m=this.length-1;m>=0;m--){var v=(this.words[m]|0)+f*67108864;this.words[m]=v/c|0,f=v%c}return this.strip()},r.prototype.divn=function(c){return this.clone().idivn(c)},r.prototype.egcd=function(c){t(c.negative===0),t(!c.isZero());var f=this,m=c.clone();f.negative!==0?f=f.umod(c):f=f.clone();for(var v=new r(1),b=new r(0),E=new r(0),C=new r(1),x=0;f.isEven()&&m.isEven();)f.iushrn(1),m.iushrn(1),++x;for(var u=m.clone(),y=f.clone();!f.isZero();){for(var j=0,k=1;(f.words[0]&k)===0&&j<26;++j,k<<=1);if(j>0)for(f.iushrn(j);j-- >0;)(v.isOdd()||b.isOdd())&&(v.iadd(u),b.isub(y)),v.iushrn(1),b.iushrn(1);for(var M=0,I=1;(m.words[0]&I)===0&&M<26;++M,I<<=1);if(M>0)for(m.iushrn(M);M-- >0;)(E.isOdd()||C.isOdd())&&(E.iadd(u),C.isub(y)),E.iushrn(1),C.iushrn(1);f.cmp(m)>=0?(f.isub(m),v.isub(E),b.isub(C)):(m.isub(f),E.isub(v),C.isub(b))}return{a:E,b:C,gcd:m.iushln(x)}},r.prototype._invmp=function(c){t(c.negative===0),t(!c.isZero());var f=this,m=c.clone();f.negative!==0?f=f.umod(c):f=f.clone();for(var v=new r(1),b=new r(0),E=m.clone();f.cmpn(1)>0&&m.cmpn(1)>0;){for(var C=0,x=1;(f.words[0]&x)===0&&C<26;++C,x<<=1);if(C>0)for(f.iushrn(C);C-- >0;)v.isOdd()&&v.iadd(E),v.iushrn(1);for(var u=0,y=1;(m.words[0]&y)===0&&u<26;++u,y<<=1);if(u>0)for(m.iushrn(u);u-- >0;)b.isOdd()&&b.iadd(E),b.iushrn(1);f.cmp(m)>=0?(f.isub(m),v.isub(b)):(m.isub(f),b.isub(v))}var j;return f.cmpn(1)===0?j=v:j=b,j.cmpn(0)<0&&j.iadd(c),j},r.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var f=this.clone(),m=c.clone();f.negative=0,m.negative=0;for(var v=0;f.isEven()&&m.isEven();v++)f.iushrn(1),m.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;m.isEven();)m.iushrn(1);var b=f.cmp(m);if(b<0){var E=f;f=m,m=E}else if(b===0||m.cmpn(1)===0)break;f.isub(m)}while(!0);return m.iushln(v)},r.prototype.invm=function(c){return this.egcd(c).a.umod(c)},r.prototype.isEven=function(){return(this.words[0]&1)===0},r.prototype.isOdd=function(){return(this.words[0]&1)===1},r.prototype.andln=function(c){return this.words[0]&c},r.prototype.bincn=function(c){t(typeof c=="number");var f=c%26,m=(c-f)/26,v=1<<f;if(this.length<=m)return this._expand(m+1),this.words[m]|=v,this;for(var b=v,E=m;b!==0&&E<this.length;E++){var C=this.words[E]|0;C+=b,b=C>>>26,C&=67108863,this.words[E]=C}return b!==0&&(this.words[E]=b,this.length++),this},r.prototype.isZero=function(){return this.length===1&&this.words[0]===0},r.prototype.cmpn=function(c){var f=c<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this.strip();var m;if(this.length>1)m=1;else{f&&(c=-c),t(c<=67108863,"Number is too big");var v=this.words[0]|0;m=v===c?0:v<c?-1:1}return this.negative!==0?-m|0:m},r.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var f=this.ucmp(c);return this.negative!==0?-f|0:f},r.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var f=0,m=this.length-1;m>=0;m--){var v=this.words[m]|0,b=c.words[m]|0;if(v!==b){v<b?f=-1:v>b&&(f=1);break}}return f},r.prototype.gtn=function(c){return this.cmpn(c)===1},r.prototype.gt=function(c){return this.cmp(c)===1},r.prototype.gten=function(c){return this.cmpn(c)>=0},r.prototype.gte=function(c){return this.cmp(c)>=0},r.prototype.ltn=function(c){return this.cmpn(c)===-1},r.prototype.lt=function(c){return this.cmp(c)===-1},r.prototype.lten=function(c){return this.cmpn(c)<=0},r.prototype.lte=function(c){return this.cmp(c)<=0},r.prototype.eqn=function(c){return this.cmpn(c)===0},r.prototype.eq=function(c){return this.cmp(c)===0},r.red=function(c){return new L(c)},r.prototype.toRed=function(c){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},r.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype._forceRed=function(c){return this.red=c,this},r.prototype.forceRed=function(c){return t(!this.red,"Already a number in reduction context"),this._forceRed(c)},r.prototype.redAdd=function(c){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},r.prototype.redIAdd=function(c){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},r.prototype.redSub=function(c){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},r.prototype.redISub=function(c){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},r.prototype.redShl=function(c){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},r.prototype.redMul=function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},r.prototype.redIMul=function(c){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},r.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(c){return t(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var R={k256:null,p224:null,p192:null,p25519:null};function N(w,c){this.name=w,this.p=new r(c,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var c=new r(null);return c.words=new Array(Math.ceil(this.n/13)),c},N.prototype.ireduce=function(c){var f=c,m;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),m=f.bitLength();while(m>this.n);var v=m<this.n?-1:f.ucmp(this.p);return v===0?(f.words[0]=0,f.length=1):v>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},N.prototype.split=function(c,f){c.iushrn(this.n,0,f)},N.prototype.imulK=function(c){return c.imul(this.k)};function D(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(D,N),D.prototype.split=function(c,f){for(var m=4194303,v=Math.min(c.length,9),b=0;b<v;b++)f.words[b]=c.words[b];if(f.length=v,c.length<=9){c.words[0]=0,c.length=1;return}var E=c.words[9];for(f.words[f.length++]=E&m,b=10;b<c.length;b++){var C=c.words[b]|0;c.words[b-10]=(C&m)<<4|E>>>22,E=C}E>>>=22,c.words[b-10]=E,E===0&&c.length>10?c.length-=10:c.length-=9},D.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var f=0,m=0;m<c.length;m++){var v=c.words[m]|0;f+=v*977,c.words[m]=f&67108863,f=v*64+(f/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function K(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(K,N);function B(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(B,N);function U(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(U,N),U.prototype.imulK=function(c){for(var f=0,m=0;m<c.length;m++){var v=(c.words[m]|0)*19+f,b=v&67108863;v>>>=26,c.words[m]=b,f=v}return f!==0&&(c.words[c.length++]=f),c},r._prime=function(c){if(R[c])return R[c];var f;if(c==="k256")f=new D;else if(c==="p224")f=new K;else if(c==="p192")f=new B;else if(c==="p25519")f=new U;else throw new Error("Unknown prime "+c);return R[c]=f,f};function L(w){if(typeof w=="string"){var c=r._prime(w);this.m=c.p,this.prime=c}else t(w.gtn(1),"modulus must be greater than 1"),this.m=w,this.prime=null}L.prototype._verify1=function(c){t(c.negative===0,"red works only with positives"),t(c.red,"red works only with red numbers")},L.prototype._verify2=function(c,f){t((c.negative|f.negative)===0,"red works only with positives"),t(c.red&&c.red===f.red,"red works only with red numbers")},L.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):c.umod(this.m)._forceRed(this)},L.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},L.prototype.add=function(c,f){this._verify2(c,f);var m=c.add(f);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},L.prototype.iadd=function(c,f){this._verify2(c,f);var m=c.iadd(f);return m.cmp(this.m)>=0&&m.isub(this.m),m},L.prototype.sub=function(c,f){this._verify2(c,f);var m=c.sub(f);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},L.prototype.isub=function(c,f){this._verify2(c,f);var m=c.isub(f);return m.cmpn(0)<0&&m.iadd(this.m),m},L.prototype.shl=function(c,f){return this._verify1(c),this.imod(c.ushln(f))},L.prototype.imul=function(c,f){return this._verify2(c,f),this.imod(c.imul(f))},L.prototype.mul=function(c,f){return this._verify2(c,f),this.imod(c.mul(f))},L.prototype.isqr=function(c){return this.imul(c,c.clone())},L.prototype.sqr=function(c){return this.mul(c,c)},L.prototype.sqrt=function(c){if(c.isZero())return c.clone();var f=this.m.andln(3);if(t(f%2===1),f===3){var m=this.m.add(new r(1)).iushrn(2);return this.pow(c,m)}for(var v=this.m.subn(1),b=0;!v.isZero()&&v.andln(1)===0;)b++,v.iushrn(1);t(!v.isZero());var E=new r(1).toRed(this),C=E.redNeg(),x=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new r(2*u*u).toRed(this);this.pow(u,x).cmp(C)!==0;)u.redIAdd(C);for(var y=this.pow(u,v),j=this.pow(c,v.addn(1).iushrn(1)),k=this.pow(c,v),M=b;k.cmp(E)!==0;){for(var I=k,q=0;I.cmp(E)!==0;q++)I=I.redSqr();t(q<M);var H=this.pow(y,new r(1).iushln(M-q-1));j=j.redMul(H),y=H.redSqr(),k=k.redMul(y),M=q}return j},L.prototype.invm=function(c){var f=c._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},L.prototype.pow=function(c,f){if(f.isZero())return new r(1).toRed(this);if(f.cmpn(1)===0)return c.clone();var m=4,v=new Array(1<<m);v[0]=new r(1).toRed(this),v[1]=c;for(var b=2;b<v.length;b++)v[b]=this.mul(v[b-1],c);var E=v[0],C=0,x=0,u=f.bitLength()%26;for(u===0&&(u=26),b=f.length-1;b>=0;b--){for(var y=f.words[b],j=u-1;j>=0;j--){var k=y>>j&1;if(E!==v[0]&&(E=this.sqr(E)),k===0&&C===0){x=0;continue}C<<=1,C|=k,x++,!(x!==m&&(b!==0||j!==0))&&(E=this.mul(E,v[C]),x=0,C=0)}u=26}return E},L.prototype.convertTo=function(c){var f=c.umod(this.m);return f===c?f.clone():f},L.prototype.convertFrom=function(c){var f=c.clone();return f.red=null,f},r.mont=function(c){return new $(c)};function $(w){L.call(this,w),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new r(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($,L),$.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},$.prototype.convertFrom=function(c){var f=this.imod(c.mul(this.rinv));return f.red=null,f},$.prototype.imul=function(c,f){if(c.isZero()||f.isZero())return c.words[0]=0,c.length=1,c;var m=c.imul(f),v=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=m.isub(v).iushrn(this.shift),E=b;return b.cmp(this.m)>=0?E=b.isub(this.m):b.cmpn(0)<0&&(E=b.iadd(this.m)),E._forceRed(this)},$.prototype.mul=function(c,f){if(c.isZero()||f.isZero())return new r(0)._forceRed(this);var m=c.mul(f),v=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=m.isub(v).iushrn(this.shift),E=b;return b.cmp(this.m)>=0?E=b.isub(this.m):b.cmpn(0)<0&&(E=b.iadd(this.m)),E._forceRed(this)},$.prototype.invm=function(c){var f=this.imod(c._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(typeof ql>"u"||ql,Tv)});var kv=O((kA,Ul)=>{typeof Object.create=="function"?Ul.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ul.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 Ti=O((OA,zl)=>{try{if(Hl=require("util"),typeof Hl.inherits!="function")throw"";zl.exports=Hl.inherits}catch{zl.exports=kv()}var Hl});var mo=O((MA,Ov)=>{"use strict";var ho=require("buffer"),Ln=ho.Buffer,Mt={},At;for(At in ho)ho.hasOwnProperty(At)&&(At==="SlowBuffer"||At==="Buffer"||(Mt[At]=ho[At]));var qn=Mt.Buffer={};for(At in Ln)Ln.hasOwnProperty(At)&&(At==="allocUnsafe"||At==="allocUnsafeSlow"||(qn[At]=Ln[At]));Mt.Buffer.prototype=Ln.prototype;(!qn.from||qn.from===Uint8Array.from)&&(qn.from=function(i,e,t){if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof i);if(i&&typeof i.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);return Ln(i,e,t)});qn.alloc||(qn.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof i);if(i<0||i>=2*(1<<30))throw new RangeError('The value "'+i+'" is invalid for option "size"');var n=Ln(i);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!Mt.kStringMaxLength)try{Mt.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}Mt.constants||(Mt.constants={MAX_LENGTH:Mt.kMaxLength},Mt.kStringMaxLength&&(Mt.constants.MAX_STRING_LENGTH=Mt.kStringMaxLength));Ov.exports=Mt});var vo=O(Mv=>{"use strict";var HE=Ti();function Rt(i){this._reporterState={obj:null,path:[],options:i||{},errors:[]}}Mv.Reporter=Rt;Rt.prototype.isError=function(e){return e instanceof Fn};Rt.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Rt.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};Rt.prototype.enterKey=function(e){return this._reporterState.path.push(e)};Rt.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};Rt.prototype.leaveKey=function(e,t,n){let r=this._reporterState;this.exitKey(e),r.obj!==null&&(r.obj[t]=n)};Rt.prototype.path=function(){return this._reporterState.path.join("/")};Rt.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};Rt.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};Rt.prototype.error=function(e){let t,n=this._reporterState,r=e instanceof Fn;if(r?t=e:t=new Fn(n.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return r||n.errors.push(t),t};Rt.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Fn(i,e){this.path=i,this.rethrow(e)}HE(Fn,Error);Fn.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Fn),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var zn=O(Wl=>{"use strict";var zE=Ti(),go=vo().Reporter,Un=mo().Buffer;function Pt(i,e){if(go.call(this,e),!Un.isBuffer(i)){this.error("Input not Buffer");return}this.base=i,this.offset=0,this.length=i.length}zE(Pt,go);Wl.DecoderBuffer=Pt;Pt.isDecoderBuffer=function(e){return e instanceof Pt?!0:typeof e=="object"&&Un.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"};Pt.prototype.save=function(){return{offset:this.offset,reporter:go.prototype.save.call(this)}};Pt.prototype.restore=function(e){let t=new Pt(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,go.prototype.restore.call(this,e.reporter),t};Pt.prototype.isEmpty=function(){return this.offset===this.length};Pt.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};Pt.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new Pt(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};Pt.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Hn(i,e){if(Array.isArray(i))this.length=0,this.value=i.map(function(t){return Hn.isEncoderBuffer(t)||(t=new Hn(t,e)),this.length+=t.length,t},this);else if(typeof i=="number"){if(!(0<=i&&i<=255))return e.error("non-byte EncoderBuffer value");this.value=i,this.length=1}else if(typeof i=="string")this.value=i,this.length=Un.byteLength(i);else if(Un.isBuffer(i))this.value=i,this.length=i.length;else return e.error("Unsupported type: "+typeof i)}Wl.EncoderBuffer=Hn;Hn.isEncoderBuffer=function(e){return e instanceof Hn?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Hn.prototype.join=function(e,t){return e||(e=Un.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):Un.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var Pv=O((PA,Rv)=>{Rv.exports=Av;function Av(i,e){if(!i)throw new Error(e||"Assertion failed")}Av.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var xo=O((IA,Nv)=>{"use strict";var WE=vo().Reporter,$E=zn().EncoderBuffer,KE=zn().DecoderBuffer,nt=Pv(),Iv=["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"],VE=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(Iv),GE=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function X(i,e,t){let n={};this._baseState=n,n.name=t,n.enc=i,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())}Nv.exports=X;var JE=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];X.prototype.clone=function(){let e=this._baseState,t={};JE.forEach(function(r){t[r]=e[r]});let n=new this.constructor(t.parent);return n._baseState=t,n};X.prototype._wrap=function(){let e=this._baseState;VE.forEach(function(t){this[t]=function(){let r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)};X.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")};X.prototype._useArgs=function(e){let t=this._baseState,n=e.filter(function(r){return r instanceof this.constructor},this);e=e.filter(function(r){return!(r instanceof this.constructor)},this),n.length!==0&&(nt(t.children===null),t.children=n,n.forEach(function(r){r._baseState.parent=this},this)),e.length!==0&&(nt(t.args===null),t.args=e,t.reverseArgs=e.map(function(r){if(typeof r!="object"||r.constructor!==Object)return r;let s={};return Object.keys(r).forEach(function(o){o==(o|0)&&(o|=0);let a=r[o];s[a]=o}),s}))};GE.forEach(function(i){X.prototype[i]=function(){let t=this._baseState;throw new Error(i+" not implemented for encoding: "+t.enc)}});Iv.forEach(function(i){X.prototype[i]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return nt(t.tag===null),t.tag=i,this._useArgs(n),this}});X.prototype.use=function(e){nt(e);let t=this._baseState;return nt(t.use===null),t.use=e,this};X.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};X.prototype.def=function(e){let t=this._baseState;return nt(t.default===null),t.default=e,t.optional=!0,this};X.prototype.explicit=function(e){let t=this._baseState;return nt(t.explicit===null&&t.implicit===null),t.explicit=e,this};X.prototype.implicit=function(e){let t=this._baseState;return nt(t.explicit===null&&t.implicit===null),t.implicit=e,this};X.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};X.prototype.key=function(e){let t=this._baseState;return nt(t.key===null),t.key=e,this};X.prototype.any=function(){let e=this._baseState;return e.any=!0,this};X.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};X.prototype.contains=function(e){let t=this._baseState;return nt(t.use===null),t.contains=e,this};X.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let r=n.default,s=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let l=null;if(n.explicit!==null?l=n.explicit:n.implicit!==null?l=n.implicit:n.tag!==null&&(l=n.tag),l===null&&!n.any){let p=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(p)}else if(s=this._peekTag(e,l,n.any),e.isError(s))return s}let a;if(n.obj&&s&&(a=e.enterObject()),s){if(n.explicit!==null){let p=this._decodeTag(e,n.explicit);if(e.isError(p))return p;e=p}let l=e.offset;if(n.use===null&&n.choice===null){let p;n.any&&(p=e.save());let d=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(d))return d;n.any?r=e.raw(p):e=d}if(t&&t.track&&n.tag!==null&&t.track(e.path(),l,e.length,"tagged"),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?r=this._decodeGeneric(n.tag,e,t):r=this._decodeChoice(e,t)),e.isError(r))return r;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(d){d._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let p=new KE(r);r=this._getUse(n.contains,e._reporterState.obj)._decode(p,t)}}return n.obj&&s&&(r=e.leaveObject(a)),n.key!==null&&(r!==null||s===!0)?e.leaveKey(o,n.key,r):o!==null&&e.exitKey(o),r};X.prototype._decodeGeneric=function(e,t,n){let r=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):e==="objid"&&r.args?this._decodeObjid(t,r.args[0],r.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,r.args&&r.args[0],n):r.use!==null?this._getUse(r.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)};X.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};X.prototype._decodeChoice=function(e,t){let n=this._baseState,r=null,s=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),l=n.choice[o];try{let p=l._decode(e,t);if(e.isError(p))return!1;r={type:o,value:p},s=!0}catch{return e.restore(a),!1}return!0},this),s?r:e.error("Choice not matched")};X.prototype._createEncoderBuffer=function(e){return new $E(e,this.reporter)};X.prototype._encode=function(e,t,n){let r=this._baseState;if(r.default!==null&&r.default===e)return;let s=this._encodeValue(e,t,n);if(s!==void 0&&!this._skipDefault(s,t,n))return s};X.prototype._encodeValue=function(e,t,n){let r=this._baseState;if(r.parent===null)return r.children[0]._encode(e,t||new WE);let s=null;if(this.reporter=t,r.optional&&e===void 0)if(r.default!==null)e=r.default;else return;let o=null,a=!1;if(r.any)s=this._createEncoderBuffer(e);else if(r.choice)s=this._encodeChoice(e,t);else if(r.contains)o=this._getUse(r.contains,n)._encode(e,t),a=!0;else if(r.children)o=r.children.map(function(l){if(l._baseState.tag==="null_")return l._encode(null,t,e);if(l._baseState.key===null)return t.error("Child should have a key");let p=t.enterKey(l._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let d=l._encode(e[l._baseState.key],t,e);return t.leaveKey(p),d},this).filter(function(l){return l}),o=this._createEncoderBuffer(o);else if(r.tag==="seqof"||r.tag==="setof"){if(!(r.args&&r.args.length===1))return t.error("Too many args for : "+r.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let l=this.clone();l._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(p){let d=this._baseState;return this._getUse(d.args[0],e)._encode(p,t)},l))}else r.use!==null?s=this._getUse(r.use,n)._encode(e,t):(o=this._encodePrimitive(r.tag,e),a=!0);if(!r.any&&r.choice===null){let l=r.implicit!==null?r.implicit:r.tag,p=r.implicit===null?"universal":"context";l===null?r.use===null&&t.error("Tag could be omitted only for .use()"):r.use===null&&(s=this._encodeComposite(l,a,p,o))}return r.explicit!==null&&(s=this._encodeComposite(r.explicit,!1,"context",s)),s};X.prototype._encodeChoice=function(e,t){let n=this._baseState,r=n.choice[e.type];return r||nt(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)};X.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)};X.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};X.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var yo=O(Ki=>{"use strict";function Bv(i){let e={};return Object.keys(i).forEach(function(t){(t|0)==t&&(t=t|0);let n=i[t];e[n]=t}),e}Ki.tagClass={0:"universal",1:"application",2:"context",3:"private"};Ki.tagClassByName=Bv(Ki.tagClass);Ki.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"};Ki.tagByName=Bv(Ki.tag)});var Kl=O((BA,Lv)=>{"use strict";var YE=Ti(),fi=mo().Buffer,jv=xo(),$l=yo();function Dv(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new zt,this.tree._init(i.body)}Lv.exports=Dv;Dv.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function zt(i){jv.call(this,"der",i)}YE(zt,jv);zt.prototype._encodeComposite=function(e,t,n,r){let s=XE(e,t,n,this.reporter);if(r.length<128){let l=fi.alloc(2);return l[0]=s,l[1]=r.length,this._createEncoderBuffer([l,r])}let o=1;for(let l=r.length;l>=256;l>>=8)o++;let a=fi.alloc(2+o);a[0]=s,a[1]=128|o;for(let l=1+o,p=r.length;p>0;l--,p>>=8)a[l]=p&255;return this._createEncoderBuffer([a,r])};zt.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=fi.alloc(e.length*2);for(let r=0;r<e.length;r++)n.writeUInt16BE(e.charCodeAt(r),r*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")};zt.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 r=0;for(let a=0;a<e.length;a++){let l=e[a];for(r++;l>=128;l>>=7)r++}let s=fi.alloc(r),o=s.length-1;for(let a=e.length-1;a>=0;a--){let l=e[a];for(s[o--]=l&127;(l>>=7)>0;)s[o--]=128|l&127}return this._createEncoderBuffer(s)};function It(i){return i<10?"0"+i:i}zt.prototype._encodeTime=function(e,t){let n,r=new Date(e);return t==="gentime"?n=[It(r.getUTCFullYear()),It(r.getUTCMonth()+1),It(r.getUTCDate()),It(r.getUTCHours()),It(r.getUTCMinutes()),It(r.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[It(r.getUTCFullYear()%100),It(r.getUTCMonth()+1),It(r.getUTCDate()),It(r.getUTCHours()),It(r.getUTCMinutes()),It(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};zt.prototype._encodeNull=function(){return this._createEncoderBuffer("")};zt.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"&&!fi.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=fi.from(s)}if(fi.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=fi.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 r=new Array(n);for(let s=r.length-1;s>=0;s--)r[s]=e&255,e>>=8;return r[0]&128&&r.unshift(0),this._createEncoderBuffer(fi.from(r))};zt.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};zt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};zt.prototype._skipDefault=function(e,t,n){let r=this._baseState,s;if(r.default===null)return!1;let o=e.join();if(r.defaultBuffer===void 0&&(r.defaultBuffer=this._encodeValue(r.default,t,n).join()),o.length!==r.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==r.defaultBuffer[s])return!1;return!0};function XE(i,e,t,n){let r;if(i==="seqof"?i="seq":i==="setof"&&(i="set"),$l.tagByName.hasOwnProperty(i))r=$l.tagByName[i];else if(typeof i=="number"&&(i|0)===i)r=i;else return n.error("Unknown tag: "+i);return r>=31?n.error("Multi-octet tag encoding unsupported"):(e||(r|=32),r|=$l.tagClassByName[t||"universal"]<<6,r)}});var Fv=O((jA,qv)=>{"use strict";var ZE=Ti(),Vl=Kl();function Gl(i){Vl.call(this,i),this.enc="pem"}ZE(Gl,Vl);qv.exports=Gl;Gl.prototype.encode=function(e,t){let r=Vl.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"];for(let o=0;o<r.length;o+=64)s.push(r.slice(o,o+64));return s.push("-----END "+t.label+"-----"),s.join(`
21
+ `)}});var Jl=O(Hv=>{"use strict";var Uv=Hv;Uv.der=Kl();Uv.pem=Fv()});var Xl=O((LA,Gv)=>{"use strict";var QE=Ti(),eC=Fl(),zv=zn().DecoderBuffer,$v=xo(),Wv=yo();function Kv(i){this.enc="der",this.name=i.name,this.entity=i,this.tree=new xt,this.tree._init(i.body)}Gv.exports=Kv;Kv.prototype.decode=function(e,t){return zv.isDecoderBuffer(e)||(e=new zv(e,t)),this.tree._decode(e,t)};function xt(i){$v.call(this,"der",i)}QE(xt,$v);xt.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let r=e.save(),s=Yl(e,'Failed to peek tag: "'+t+'"');return e.isError(s)?s:(e.restore(r),s.tag===t||s.tagStr===t||s.tagStr+"of"===t||n)};xt.prototype._decodeTag=function(e,t,n){let r=Yl(e,'Failed to decode tag of "'+t+'"');if(e.isError(r))return r;let s=Vv(e,r.primitive,'Failed to get length of "'+t+'"');if(e.isError(s))return s;if(!n&&r.tag!==t&&r.tagStr!==t&&r.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(r.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+'"'))};xt.prototype._skipUntilEnd=function(e,t){for(;;){let n=Yl(e,t);if(e.isError(n))return n;let r=Vv(e,n.primitive,t);if(e.isError(r))return r;let s;if(n.primitive||r!==null?s=e.skip(r):s=this._skipUntilEnd(e,t),e.isError(s))return s;if(n.tagStr==="end")break}};xt.prototype._decodeList=function(e,t,n,r){let s=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let a=n.decode(e,"der",r);if(e.isError(a)&&o)break;s.push(a)}return s};xt.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 r="";for(let s=0;s<n.length/2;s++)r+=String.fromCharCode(n.readUInt16BE(s*2));return r}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")}};xt.prototype._decodeObjid=function(e,t,n){let r,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 l=s[0]/40|0,p=s[0]%40;if(n?r=s:r=[l,p].concat(s.slice(1)),t){let d=t[r.join(" ")];d===void 0&&(d=t[r.join(".")]),d!==void 0&&(r=d)}return r};xt.prototype._decodeTime=function(e,t){let n=e.raw().toString(),r,s,o,a,l,p;if(t==="gentime")r=n.slice(0,4)|0,s=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,l=n.slice(10,12)|0,p=n.slice(12,14)|0;else if(t==="utctime")r=n.slice(0,2)|0,s=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,l=n.slice(8,10)|0,p=n.slice(10,12)|0,r<70?r=2e3+r:r=1900+r;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(r,s-1,o,a,l,p,0)};xt.prototype._decodeNull=function(){return null};xt.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};xt.prototype._decodeInt=function(e,t){let n=e.raw(),r=new eC(n);return t&&(r=t[r.toString(10)]||r),r};xt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function Yl(i,e){let t=i.readUInt8(e);if(i.isError(t))return t;let n=Wv.tagClass[t>>6],r=(t&32)===0;if((t&31)===31){let o=t;for(t=0;(o&128)===128;){if(o=i.readUInt8(e),i.isError(o))return o;t<<=7,t|=o&127}}else t&=31;let s=Wv.tag[t];return{cls:n,primitive:r,tag:t,tagStr:s}}function Vv(i,e,t){let n=i.readUInt8(t);if(i.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;let r=n&127;if(r>4)return i.error("length octect is too long");n=0;for(let s=0;s<r;s++){n<<=8;let o=i.readUInt8(t);if(i.isError(o))return o;n|=o}return n}});var Yv=O((qA,Jv)=>{"use strict";var tC=Ti(),iC=mo().Buffer,Zl=Xl();function Ql(i){Zl.call(this,i),this.enc="pem"}tC(Ql,Zl);Jv.exports=Ql;Ql.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),r=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let d=0;d<n.length;d++){let h=n[d].match(s);if(h!==null&&h[2]===r)if(o===-1){if(h[1]!=="BEGIN")break;o=d}else{if(h[1]!=="END")break;a=d;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+r);let l=n.slice(o+1,a).join("");l.replace(/[^a-z0-9+/=]+/gi,"");let p=iC.from(l,"base64");return Zl.prototype.decode.call(this,p,t)}});var eu=O(Zv=>{"use strict";var Xv=Zv;Xv.der=Xl();Xv.pem=Yv()});var eg=O(Qv=>{"use strict";var nC=Jl(),rC=eu(),sC=Ti(),oC=Qv;oC.define=function(e,t){return new Wn(e,t)};function Wn(i,e){this.name=i,this.body=e,this.decoders={},this.encoders={}}Wn.prototype._createNamed=function(e){let t=this.name;function n(r){this._initNamed(r,t)}return sC(n,e),n.prototype._initNamed=function(s,o){e.call(this,s,o)},new n(this)};Wn.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(rC[e])),this.decoders[e]};Wn.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};Wn.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(nC[e])),this.encoders[e]};Wn.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var ig=O(tg=>{"use strict";var bo=tg;bo.Reporter=vo().Reporter;bo.DecoderBuffer=zn().DecoderBuffer;bo.EncoderBuffer=zn().EncoderBuffer;bo.Node=xo()});var sg=O(rg=>{"use strict";var ng=rg;ng._reverse=function(e){let t={};return Object.keys(e).forEach(function(n){(n|0)==n&&(n=n|0);let r=e[n];t[r]=n}),t};ng.der=yo()});var ag=O(og=>{"use strict";var $n=og;$n.bignum=Fl();$n.define=eg().define;$n.base=ig();$n.constants=sg();$n.decoders=eu();$n.encoders=Jl()});var Kn=O((tu,lg)=>{var wo=require("buffer"),Zt=wo.Buffer;function cg(i,e){for(var t in i)e[t]=i[t]}Zt.from&&Zt.alloc&&Zt.allocUnsafe&&Zt.allocUnsafeSlow?lg.exports=wo:(cg(wo,tu),tu.Buffer=Vi);function Vi(i,e,t){return Zt(i,e,t)}Vi.prototype=Object.create(Zt.prototype);cg(Zt,Vi);Vi.from=function(i,e,t){if(typeof i=="number")throw new TypeError("Argument must not be a number");return Zt(i,e,t)};Vi.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError("Argument must be a number");var n=Zt(i);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};Vi.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return Zt(i)};Vi.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return wo.SlowBuffer(i)}});var iu=O(($A,ug)=>{var _o=Kn().Buffer,aC=require("stream"),cC=require("util");function So(i){if(this.buffer=null,this.writable=!0,this.readable=!0,!i)return this.buffer=_o.alloc(0),this;if(typeof i.pipe=="function")return this.buffer=_o.alloc(0),i.pipe(this),this;if(i.length||typeof i=="object")return this.buffer=i,this.writable=!1,process.nextTick(function(){this.emit("end",i),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof i+")")}cC.inherits(So,aC);So.prototype.write=function(e){this.buffer=_o.concat([this.buffer,_o.from(e)]),this.emit("data",e)};So.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};ug.exports=So});var fg=O((KA,pg)=>{"use strict";function nu(i){var e=(i/8|0)+(i%8===0?0:1);return e}var lC={ES256:nu(256),ES384:nu(384),ES512:nu(521)};function uC(i){var e=lC[i];if(e)return e;throw new Error('Unknown algorithm "'+i+'"')}pg.exports=uC});var yg=O((VA,xg)=>{"use strict";var Eo=Kn().Buffer,hg=fg(),Co=128,mg=0,pC=32,fC=16,dC=2,vg=fC|pC|mg<<6,To=dC|mg<<6;function hC(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function gg(i){if(Eo.isBuffer(i))return i;if(typeof i=="string")return Eo.from(i,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function mC(i,e){i=gg(i);var t=hg(e),n=t+1,r=i.length,s=0;if(i[s++]!==vg)throw new Error('Could not find expected "seq"');var o=i[s++];if(o===(Co|1)&&(o=i[s++]),r-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(r-s)+'" remaining');if(i[s++]!==To)throw new Error('Could not find expected "int" for "r"');var a=i[s++];if(r-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(r-s-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var l=s;if(s+=a,i[s++]!==To)throw new Error('Could not find expected "int" for "s"');var p=i[s++];if(r-s!==p)throw new Error('"s" specified length of "'+p+'", expected "'+(r-s)+'"');if(n<p)throw new Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var d=s;if(s+=p,s!==r)throw new Error('Expected to consume entire buffer, but "'+(r-s)+'" bytes remain');var h=t-a,g=t-p,_=Eo.allocUnsafe(h+a+g+p);for(s=0;s<h;++s)_[s]=0;i.copy(_,s,l+Math.max(-h,0),l+a),s=t;for(var S=s;s<S+g;++s)_[s]=0;return i.copy(_,s,d+Math.max(-g,0),d+p),_=_.toString("base64"),_=hC(_),_}function dg(i,e,t){for(var n=0;e+n<t&&i[e+n]===0;)++n;var r=i[e+n]>=Co;return r&&--n,n}function vC(i,e){i=gg(i);var t=hg(e),n=i.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var r=dg(i,0,t),s=dg(i,t,i.length),o=t-r,a=t-s,l=2+o+1+1+a,p=l<Co,d=Eo.allocUnsafe((p?2:3)+l),h=0;return d[h++]=vg,p?d[h++]=l:(d[h++]=Co|1,d[h++]=l&255),d[h++]=To,d[h++]=o,r<0?(d[h++]=0,h+=i.copy(d,h,0,t)):h+=i.copy(d,h,r,t),d[h++]=To,d[h++]=a,s<0?(d[h++]=0,i.copy(d,h,t)):i.copy(d,h,t+s),d}xg.exports={derToJose:mC,joseToDer:vC}});var wg=O((GA,bg)=>{"use strict";var Er=require("buffer").Buffer,ru=require("buffer").SlowBuffer;bg.exports=ko;function ko(i,e){if(!Er.isBuffer(i)||!Er.isBuffer(e)||i.length!==e.length)return!1;for(var t=0,n=0;n<i.length;n++)t|=i[n]^e[n];return t===0}ko.install=function(){Er.prototype.equal=ru.prototype.equal=function(e){return ko(this,e)}};var gC=Er.prototype.equal,xC=ru.prototype.equal;ko.restore=function(){Er.prototype.equal=gC,ru.prototype.equal=xC}});var cu=O((JA,Ag)=>{var Gn=Kn().Buffer,Nt=require("crypto"),Sg=yg(),_g=require("util"),yC=`"%s" is not a valid algorithm.
22
22
  Supported algorithms are:
23
- "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,vn="secret must be a string or buffer",Fr="key must be a string or a buffer",HE="key must be a string, a buffer or an object",Wl=typeof Ot.createPublicKey=="function";Wl&&(Fr+=" or a KeyObject",vn+="or a KeyObject");function eg(i){if(!Ur.isBuffer(i)&&typeof i!="string"&&(!Wl||typeof i!="object"||typeof i.type!="string"||typeof i.asymmetricKeyType!="string"||typeof i.export!="function"))throw Lt(Fr)}function tg(i){if(!Ur.isBuffer(i)&&typeof i!="string"&&typeof i!="object")throw Lt(HE)}function zE(i){if(!Ur.isBuffer(i)){if(typeof i=="string")return i;if(!Wl||typeof i!="object"||i.type!=="secret"||typeof i.export!="function")throw Lt(vn)}}function $l(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ig(i){i=i.toString();var e=4-i.length%4;if(e!==4)for(var t=0;t<e;++t)i+="=";return i.replace(/\-/g,"+").replace(/_/g,"/")}function Lt(i){var e=[].slice.call(arguments,1),t=Zv.format.bind(Zv,i).apply(null,e);return new TypeError(t)}function WE(i){return Ur.isBuffer(i)||typeof i=="string"}function gn(i){return WE(i)||(i=JSON.stringify(i)),i}function rg(i){return function(t,r){zE(r),t=gn(t);var n=Ot.createHmac("sha"+i,r),s=(n.update(t),n.digest("base64"));return $l(s)}}var zl,$E="timingSafeEqual"in Ot?function(e,t){return e.byteLength!==t.byteLength?!1:Ot.timingSafeEqual(e,t)}:function(e,t){return zl||(zl=Xv()),zl(e,t)};function VE(i){return function(t,r,n){var s=rg(i)(t,n);return $E(Ur.from(r),Ur.from(s))}}function ng(i){return function(t,r){tg(r),t=gn(t);var n=Ot.createSign("RSA-SHA"+i),s=(n.update(t),n.sign(r,"base64"));return $l(s)}}function sg(i){return function(t,r,n){eg(n),t=gn(t),r=ig(r);var s=Ot.createVerify("RSA-SHA"+i);return s.update(t),s.verify(n,r,"base64")}}function KE(i){return function(t,r){tg(r),t=gn(t);var n=Ot.createSign("RSA-SHA"+i),s=(n.update(t),n.sign({key:r,padding:Ot.constants.RSA_PKCS1_PSS_PADDING,saltLength:Ot.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return $l(s)}}function GE(i){return function(t,r,n){eg(n),t=gn(t),r=ig(r);var s=Ot.createVerify("RSA-SHA"+i);return s.update(t),s.verify({key:n,padding:Ot.constants.RSA_PKCS1_PSS_PADDING,saltLength:Ot.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function YE(i){var e=ng(i);return function(){var r=e.apply(null,arguments);return r=Qv.derToJose(r,"ES"+i),r}}function JE(i){var e=sg(i);return function(r,n,s){n=Qv.joseToDer(n,"ES"+i).toString("base64");var o=e(r,n,s);return o}}function XE(){return function(){return""}}function ZE(){return function(e,t){return t===""}}og.exports=function(e){var t={hs:rg,rs:ng,ps:KE,es:YE,none:XE},r={hs:VE,rs:sg,ps:GE,es:JE,none:ZE},n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!n)throw Lt(UE,e);var s=(n[1]||n[3]).toLowerCase(),o=n[2];return{sign:t[s](o),verify:r[s](o)}}});var Kl=T((lA,ag)=>{var QE=require("buffer").Buffer;ag.exports=function(e){return typeof e=="string"?e:typeof e=="number"||QE.isBuffer(e)?e.toString():JSON.stringify(e)}});var fg=T((uA,dg)=>{var eC=qr().Buffer,cg=Fl(),tC=Vl(),iC=require("stream"),lg=Kl(),Gl=require("util");function ug(i,e){return eC.from(i,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function rC(i,e,t){t=t||"utf8";var r=ug(lg(i),"binary"),n=ug(lg(e),t);return Gl.format("%s.%s",r,n)}function pg(i){var e=i.header,t=i.payload,r=i.secret||i.privateKey,n=i.encoding,s=tC(e.alg),o=rC(e,t,n),c=s.sign(o,r);return Gl.format("%s.%s",o,c)}function vo(i){var e=i.secret;if(e=e??i.privateKey,e=e??i.key,/^hs/i.test(i.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new cg(e);this.readable=!0,this.header=i.header,this.encoding=i.encoding,this.secret=this.privateKey=this.key=t,this.payload=new cg(i.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))}Gl.inherits(vo,iC);vo.prototype.sign=function(){try{var e=pg({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")}};vo.sign=pg;dg.exports=vo});var Sg=T((pA,_g)=>{var mg=qr().Buffer,hg=Fl(),nC=Vl(),sC=require("stream"),vg=Kl(),oC=require("util"),aC=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function cC(i){return Object.prototype.toString.call(i)==="[object Object]"}function lC(i){if(cC(i))return i;try{return JSON.parse(i)}catch{return}}function gg(i){var e=i.split(".",1)[0];return lC(mg.from(e,"base64").toString("binary"))}function uC(i){return i.split(".",2).join(".")}function xg(i){return i.split(".")[2]}function pC(i,e){e=e||"utf8";var t=i.split(".")[1];return mg.from(t,"base64").toString(e)}function yg(i){return aC.test(i)&&!!gg(i)}function bg(i,e,t){if(!e){var r=new Error("Missing algorithm parameter for jws.verify");throw r.code="MISSING_ALGORITHM",r}i=vg(i);var n=xg(i),s=uC(i),o=nC(e);return o.verify(s,n,t)}function wg(i,e){if(e=e||{},i=vg(i),!yg(i))return null;var t=gg(i);if(!t)return null;var r=pC(i);return(t.typ==="JWT"||e.json)&&(r=JSON.parse(r,e.encoding)),{header:t,payload:r,signature:xg(i)}}function Hr(i){i=i||{};var e=i.secret;if(e=e??i.publicKey,e=e??i.key,/^hs/i.test(i.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new hg(e);this.readable=!0,this.algorithm=i.algorithm,this.encoding=i.encoding,this.secret=this.publicKey=this.key=t,this.signature=new hg(i.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))}oC.inherits(Hr,sC);Hr.prototype.verify=function(){try{var e=bg(this.signature.buffer,this.algorithm,this.key.buffer),t=wg(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};Hr.decode=wg;Hr.isValid=yg;Hr.verify=bg;_g.exports=Hr});var Cg=T(_i=>{var Eg=fg(),go=Sg(),dC=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];_i.ALGORITHMS=dC;_i.sign=Eg.sign;_i.verify=go.verify;_i.decode=go.decode;_i.isValid=go.isValid;_i.createSign=function(e){return new Eg(e)};_i.createVerify=function(e){return new go(e)}});var xo=T((fA,Tg)=>{"use strict";var Yl={};Yl.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};Yl.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};Tg.exports=Yl});var Jl=T((hA,kg)=>{"use strict";function fC(i){return/^[A-Za-z0-9\-_]+$/.test(i)}kg.exports={validate:fC}});var Zl=T((mA,Ig)=>{"use strict";var hC=require("crypto"),mC=jv(),vC=Cg(),{URL:Og}=require("url"),Mg=xo(),Ag=Jl(),gC=720*60,xC=1440*60,yC=mC.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 bC(i){return yC.encode({version:1,privateKey:i,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function wC(){let i=hC.createECDH("prime256v1");i.generateKeys();let e=i.getPublicKey(),t=i.getPrivateKey();if(t.length<32){let r=Buffer.alloc(32-t.length);r.fill(0),t=Buffer.concat([r,t])}if(e.length<65){let r=Buffer.alloc(65-e.length);r.fill(0),e=Buffer.concat([r,e])}return{publicKey:e.toString("base64url"),privateKey:t.toString("base64url")}}function Rg(i){if(!i)throw new Error("No subject set in vapidDetails.subject.");if(typeof i!="string"||i.length===0)throw new Error("The subject value must be a string containing an https: URL or mailto: address. "+i);let e=null;try{e=new Og(i)}catch{throw new Error("Vapid subject is not a valid URL. "+i)}if(!["https:","mailto:"].includes(e.protocol))throw new Error("Vapid subject is not an https: or mailto: URL. "+i);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 Pg(i){if(!i)throw new Error("No key set vapidDetails.publicKey");if(typeof i!="string")throw new Error("Vapid public key is must be a URL safe Base 64 encoded string.");if(!Ag.validate(i))throw new Error('Vapid public key must be a URL safe Base 64 (without "=")');if(i=Buffer.from(i,"base64url"),i.length!==65)throw new Error("Vapid public key should be 65 bytes long when decoded.")}function Bg(i){if(!i)throw new Error("No key set in vapidDetails.privateKey");if(typeof i!="string")throw new Error("Vapid private key must be a URL safe Base 64 encoded string.");if(!Ag.validate(i))throw new Error('Vapid private key must be a URL safe Base 64 (without "=")');if(i=Buffer.from(i,"base64url"),i.length!==32)throw new Error("Vapid private key should be 32 bytes long when decoded.")}function Xl(i){let e=new Date;return e.setSeconds(e.getSeconds()+i),Math.floor(e.getTime()/1e3)}function Ng(i){if(!Number.isInteger(i))throw new Error("`expiration` value must be a number");if(i<0)throw new Error("`expiration` must be a positive integer");let e=Xl(xC);if(i>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function _C(i,e,t,r,n,s){if(!i)throw new Error("No audience could be generated for VAPID.");if(typeof i!="string"||i.length===0)throw new Error("The audience value must be a string containing the origin of a push service. "+i);try{new Og(i)}catch{throw new Error("VAPID audience is not a url. "+i)}Rg(e),Pg(t),Bg(r),r=Buffer.from(r,"base64url"),s?Ng(s):s=Xl(gC);let o={typ:"JWT",alg:"ES256"},c={aud:i,exp:s,sub:e},u=vC.sign({header:o,payload:c,privateKey:bC(r)});if(n===Mg.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+u+", k="+t};if(n===Mg.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+u,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}Ig.exports={generateVAPIDKeys:wC,getFutureExpirationTimestamp:Xl,getVapidHeaders:_C,validateSubject:Rg,validatePublicKey:Pg,validatePrivateKey:Bg,validateExpiration:Ng}});var Vg=T((vA,$g)=>{"use strict";var bo=require("crypto"),jg="aes-128-gcm",wo={aes128gcm:1,aesgcm:2},Hi=16,Gt=16,SC=12,Lg=32,xn="encrypt",yn="decrypt",$;process.env.ECE_KEYLOG==="1"?$=function(i,e){return console.warn(i+" ["+e.length+"]: "+e.toString("base64url")),e}:$=function(i,e){return e};function yo(i){return typeof i=="string"?Buffer.from(i,"base64url"):i}function qg(i,e){var t=bo.createHmac("sha256",i);return t.update(e),t.digest()}function Fg(i,e){return $("salt",i),$("ikm",e),$("extract",qg(i,e))}function Ql(i,e,t){$("prk",i),$("info",e);var r=Buffer.alloc(0),n=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var s=0,o=Buffer.alloc(1);r.length<t;)o.writeUIntBE(++s,0,1),n=qg(i,Buffer.concat([n,e,o])),r=Buffer.concat([r,n]);return $("expand",r.slice(0,t))}function Ug(i,e,t,r){return Ql(Fg(i,e),t,r)}function eu(i,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+i+"\0","ascii"),e]);return $("info "+i,t),t}function Dg(i){var e=Buffer.concat([Buffer.alloc(2),i]);return e.writeUIntBE(i.length,0,2),e}function EC(i,e){var t=i.privateKey,r,n;if(e===xn)r=t.getPublicKey(),n=i.dh;else if(e===yn)r=i.dh,n=t.getPublicKey();else throw new Error("Unknown mode only "+xn+" and "+yn+" supported");return{secret:t.computeSecret(i.dh),context:Buffer.concat([Buffer.from(i.keylabel,"ascii"),Buffer.from([0]),Dg(n),Dg(r)])}}function CC(i,e){var t={secret:null,context:Buffer.alloc(0)};if(i.key){if(t.secret=i.key,t.secret.length!==Gt)throw new Error("An explicit key must be "+Gt+" bytes")}else i.dh?t=EC(i,e):typeof i.keyid!==void 0&&(t.secret=i.keymap[i.keyid]);if(!t.secret)throw new Error("Unable to determine key");return $("secret",t.secret),$("context",t.context),i.authSecret&&(t.secret=Ug(i.authSecret,t.secret,eu("auth",Buffer.alloc(0)),Lg),$("authsecret",t.secret)),t}function TC(i,e){if(!i.authSecret)throw new Error("No authentication secret for webpush");$("authsecret",i.authSecret);var t,r,n;if(e===xn)r=i.privateKey.getPublicKey(),t=n=i.dh;else if(e===yn)t=r=i.keyid,n=i.privateKey.getPublicKey();else throw new Error("Unknown mode only "+xn+" and "+yn+" supported");return $("remote pubkey",t),$("sender pubkey",r),$("receiver pubkey",n),$("secret dh",Ug(i.authSecret,i.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),n,r]),Lg))}function kC(i,e,t){if(t&&!DC(t))throw new Error("Callback is not a function");if(i.key){if(i.key.length!==Gt)throw new Error("An explicit key must be "+Gt+" bytes");return $("secret key",i.key)}if(!i.privateKey){if(t)var r=t(i.keyid);else var r=i.keymap&&i.keymap[i.keyid];if(!r)throw new Error('No saved key (keyid: "'+i.keyid+'")');return r}return TC(i,e)}function Hg(i,e,t){if(!i.salt)throw new Error("must include a salt parameter for "+i.version);var r,n,s;if(i.version==="aesgcm"){var o=CC(i,e,t);r=eu("aesgcm",o.context),n=eu("nonce",o.context),s=o.secret}else if(i.version==="aes128gcm")r=Buffer.from("Content-Encoding: aes128gcm\0"),n=Buffer.from("Content-Encoding: nonce\0"),s=kC(i,e,t);else throw new Error("Unable to set context for mode "+i.version);var c=Fg(i.salt,s),u={key:Ql(c,r,Gt),nonce:Ql(c,n,SC)};return $("key",u.key),$("nonce base",u.nonce),u}function zg(i){var e={};e.version=i.version||"aes128gcm",e.rs=parseInt(i.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=wo[e.version];if(e.version==="aes128gcm"&&(t+=Hi),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(i.salt&&(e.salt=yo(i.salt),e.salt.length!==Gt))throw new Error("The salt parameter must be "+Gt+" bytes");return e.keyid=i.keyid,i.key?e.key=yo(i.key):(e.privateKey=i.privateKey,e.privateKey||(e.keymap=i.keymap),e.version!=="aes128gcm"&&(e.keylabel=i.keylabel||"P-256"),i.dh&&(e.dh=yo(i.dh))),i.authSecret&&(e.authSecret=yo(i.authSecret)),e}function Wg(i,e){var t=Buffer.from(i),r=t.readUIntBE(t.length-6,6),n=((r^e)&16777215)+((r/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(n,t.length-6,6),$("nonce"+e,t),t}function MC(i,e){var t=i.readUIntBE(20,1);return e.salt=i.slice(0,Gt),e.rs=i.readUIntBE(Gt,4),e.keyid=i.slice(21,21+t),21+t}function OC(i,e){var t=wo[e],r=i.readUIntBE(0,t);if(r+t>i.length)throw new Error("padding exceeds block size");$("padding",i.slice(0,t+r));var n=Buffer.alloc(r);if(n.fill(0),n.compare(i.slice(t,t+r))!==0)throw new Error("invalid padding");return i.slice(t+r)}function AC(i,e){for(var t=i.length-1;t>=0;){if(i[t]){if(e){if(i[t]!==2)throw new Error("last record needs to start padding with a 2")}else if(i[t]!==1)throw new Error("last record needs to start padding with a 2");return i.slice(0,t)}--t}throw new Error("all zero plaintext")}function RC(i,e,t,r,n){$("decrypt",t);var s=Wg(i.nonce,e),o=bo.createDecipheriv(jg,i.key,s);o.setAuthTag(t.slice(t.length-Hi));var c=o.update(t.slice(0,t.length-Hi));return c=Buffer.concat([c,o.final()]),$("decrypted",c),r.version!=="aes128gcm"?OC(c,r.version):AC(c,n)}function PC(i,e,t){var r=zg(e);if(r.version==="aes128gcm"){var n=MC(i,r);i=i.slice(n)}var s=Hg(r,yn,t),o=0,c=Buffer.alloc(0),u=r.rs;r.version!=="aes128gcm"&&(u+=Hi);for(var d=0;o<i.length;++d){var f=o+u;if(r.version!=="aes128gcm"&&f===i.length)throw new Error("Truncated payload");if(f=Math.min(f,i.length),f-o<=Hi)throw new Error("Invalid block: too small at "+d);var v=RC(s,d,i.slice(o,f),r,f>=i.length);c=Buffer.concat([c,v]),o=f}return c}function BC(i,e,t,r,n,s){$("encrypt",t),r=r||0;var o=Wg(i.nonce,e),c=bo.createCipheriv(jg,i.key,o),u=[],d=wo[n.version],f=Buffer.alloc(r+d);if(f.fill(0),n.version!=="aes128gcm"){if(f.writeUIntBE(r,0,d),$("padding",f),u.push(c.update(f)),u.push(c.update(t)),!s&&f.length+t.length<n.rs)throw new Error("Unable to pad to record size")}else u.push(c.update(t)),f.writeUIntBE(s?2:1,0,1),$("padding",f),u.push(c.update(f));c.final();var v=c.getAuthTag();if(v.length!==Hi)throw new Error("invalid tag generated");return u.push(v),$("encrypted",Buffer.concat(u))}function NC(i){var e=Buffer.alloc(5),t=Buffer.from(i.keyid||[]);if(t.length>255)throw new Error("keyid is too large");return e.writeUIntBE(i.rs,0,4),e.writeUIntBE(t.length,4,1),Buffer.concat([i.salt,e,t])}function IC(i,e,t){if(!Buffer.isBuffer(i))throw new Error("buffer argument must be a Buffer");var r=zg(e);r.salt||(r.salt=bo.randomBytes(Gt));var n;r.version==="aes128gcm"?(r.privateKey&&!r.keyid&&(r.keyid=r.privateKey.getPublicKey()),n=NC(r)):n=Buffer.alloc(0);var s=Hg(r,xn,t),o=0,c=wo[r.version],u=c;r.version==="aes128gcm"&&(u+=Hi);for(var d=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),f=0,v=!1;!v;){var _=Math.min(r.rs-u-1,d);r.version!=="aes128gcm"&&(_=Math.min((1<<c*8)-1,_)),d>0&&_===0&&++_,d-=_;var E=o+r.rs-u-_;r.version!=="aes128gcm"?v=E>i.length:v=E>=i.length,v=v&&d<=0;var C=BC(s,f,i.slice(o,E),_,r,v);n=Buffer.concat([n,C]),o=E,++f}return n}function DC(i){return typeof i=="function"}$g.exports={decrypt:PC,encrypt:IC}});var tu=T((gA,Gg)=>{"use strict";var Kg=require("crypto"),jC=Vg(),LC=function(i,e,t,r){if(!i)throw new Error("No user public key provided for encryption.");if(typeof i!="string")throw new Error("The subscription p256dh value must be a string.");if(Buffer.from(i,"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 n=Kg.createECDH("prime256v1"),s=n.generateKeys(),o=Kg.randomBytes(16).toString("base64url"),c=jC.encrypt(t,{version:r,dh:i,privateKey:n,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:c}};Gg.exports={encrypt:LC}});var iu=T((xA,Jg)=>{"use strict";function Yg(i,e,t,r,n){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=i,this.statusCode=e,this.headers=t,this.body=r,this.endpoint=n}require("util").inherits(Yg,Error);Jg.exports=Yg});var Qg=T(st=>{"use strict";var qC=st&&st.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),FC=st&&st.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Xg=st&&st.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&qC(e,i,t);return FC(e,i),e};Object.defineProperty(st,"__esModule",{value:!0});st.req=st.json=st.toBuffer=void 0;var UC=Xg(require("http")),HC=Xg(require("https"));async function Zg(i){let e=0,t=[];for await(let r of i)e+=r.length,t.push(r);return Buffer.concat(t,e)}st.toBuffer=Zg;async function zC(i){let t=(await Zg(i)).toString("utf8");try{return JSON.parse(t)}catch(r){let n=r;throw n.message+=` (input: ${t})`,n}}st.json=zC;function WC(i,e={}){let r=((typeof i=="string"?i:i.href).startsWith("https:")?HC:UC).request(i,e),n=new Promise((s,o)=>{r.once("response",s).once("error",o).end()});return r.then=n.then.bind(n),r}st.req=WC});var rx=T(ht=>{"use strict";var tx=ht&&ht.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),$C=ht&&ht.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),ix=ht&&ht.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&tx(e,i,t);return $C(e,i),e},VC=ht&&ht.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&tx(e,i,t)};Object.defineProperty(ht,"__esModule",{value:!0});ht.Agent=void 0;var KC=ix(require("net")),ex=ix(require("http")),GC=require("https");VC(Qg(),ht);var Yt=Symbol("AgentBaseInternalState"),ru=class extends ex.Agent{constructor(e){super(e),this[Yt]={}}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(`
24
- `).some(r=>r.indexOf("(https.js:")!==-1||r.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 KC.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let r=this.sockets[e],n=r.indexOf(t);n!==-1&&(r.splice(n,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?GC.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){let n={...t,secureEndpoint:this.isSecureEndpoint(t)},s=this.getName(n),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,n)).then(c=>{if(this.decrementSockets(s,o),c instanceof ex.Agent)try{return c.addRequest(e,n)}catch(u){return r(u)}this[Yt].currentSocket=c,super.createSocket(e,t,r)},c=>{this.decrementSockets(s,o),r(c)})}createConnection(){let e=this[Yt].currentSocket;if(this[Yt].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Yt].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Yt]&&(this[Yt].defaultPort=e)}get protocol(){return this[Yt].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Yt]&&(this[Yt].protocol=e)}};ht.Agent=ru});var nx=T(zr=>{"use strict";var YC=zr&&zr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(zr,"__esModule",{value:!0});zr.parseProxyResponse=void 0;var JC=YC(ie()),_o=(0,JC.default)("https-proxy-agent:parse-proxy-response");function XC(i){return new Promise((e,t)=>{let r=0,n=[];function s(){let f=i.read();f?d(f):i.once("readable",s)}function o(){i.removeListener("end",c),i.removeListener("error",u),i.removeListener("readable",s)}function c(){o(),_o("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function u(f){o(),_o("onerror %o",f),t(f)}function d(f){n.push(f),r+=f.length;let v=Buffer.concat(n,r),_=v.indexOf(`\r
23
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Cr="secret must be a string or buffer",Vn="key must be a string or a buffer",bC="key must be a string, a buffer or an object",ou=typeof Nt.createPublicKey=="function";ou&&(Vn+=" or a KeyObject",Cr+="or a KeyObject");function Eg(i){if(!Gn.isBuffer(i)&&typeof i!="string"&&(!ou||typeof i!="object"||typeof i.type!="string"||typeof i.asymmetricKeyType!="string"||typeof i.export!="function"))throw Wt(Vn)}function Cg(i){if(!Gn.isBuffer(i)&&typeof i!="string"&&typeof i!="object")throw Wt(bC)}function wC(i){if(!Gn.isBuffer(i)){if(typeof i=="string")return i;if(!ou||typeof i!="object"||i.type!=="secret"||typeof i.export!="function")throw Wt(Cr)}}function au(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Tg(i){i=i.toString();var e=4-i.length%4;if(e!==4)for(var t=0;t<e;++t)i+="=";return i.replace(/\-/g,"+").replace(/_/g,"/")}function Wt(i){var e=[].slice.call(arguments,1),t=_g.format.bind(_g,i).apply(null,e);return new TypeError(t)}function _C(i){return Gn.isBuffer(i)||typeof i=="string"}function Tr(i){return _C(i)||(i=JSON.stringify(i)),i}function kg(i){return function(t,n){wC(n),t=Tr(t);var r=Nt.createHmac("sha"+i,n),s=(r.update(t),r.digest("base64"));return au(s)}}var su,SC="timingSafeEqual"in Nt?function(e,t){return e.byteLength!==t.byteLength?!1:Nt.timingSafeEqual(e,t)}:function(e,t){return su||(su=wg()),su(e,t)};function EC(i){return function(t,n,r){var s=kg(i)(t,r);return SC(Gn.from(n),Gn.from(s))}}function Og(i){return function(t,n){Cg(n),t=Tr(t);var r=Nt.createSign("RSA-SHA"+i),s=(r.update(t),r.sign(n,"base64"));return au(s)}}function Mg(i){return function(t,n,r){Eg(r),t=Tr(t),n=Tg(n);var s=Nt.createVerify("RSA-SHA"+i);return s.update(t),s.verify(r,n,"base64")}}function CC(i){return function(t,n){Cg(n),t=Tr(t);var r=Nt.createSign("RSA-SHA"+i),s=(r.update(t),r.sign({key:n,padding:Nt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Nt.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return au(s)}}function TC(i){return function(t,n,r){Eg(r),t=Tr(t),n=Tg(n);var s=Nt.createVerify("RSA-SHA"+i);return s.update(t),s.verify({key:r,padding:Nt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Nt.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function kC(i){var e=Og(i);return function(){var n=e.apply(null,arguments);return n=Sg.derToJose(n,"ES"+i),n}}function OC(i){var e=Mg(i);return function(n,r,s){r=Sg.joseToDer(r,"ES"+i).toString("base64");var o=e(n,r,s);return o}}function MC(){return function(){return""}}function AC(){return function(e,t){return t===""}}Ag.exports=function(e){var t={hs:kg,rs:Og,ps:CC,es:kC,none:MC},n={hs:EC,rs:Mg,ps:TC,es:OC,none:AC},r=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!r)throw Wt(yC,e);var s=(r[1]||r[3]).toLowerCase(),o=r[2];return{sign:t[s](o),verify:n[s](o)}}});var lu=O((YA,Rg)=>{var RC=require("buffer").Buffer;Rg.exports=function(e){return typeof e=="string"?e:typeof e=="number"||RC.isBuffer(e)?e.toString():JSON.stringify(e)}});var Dg=O((XA,jg)=>{var PC=Kn().Buffer,Pg=iu(),IC=cu(),NC=require("stream"),Ig=lu(),uu=require("util");function Ng(i,e){return PC.from(i,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function BC(i,e,t){t=t||"utf8";var n=Ng(Ig(i),"binary"),r=Ng(Ig(e),t);return uu.format("%s.%s",n,r)}function Bg(i){var e=i.header,t=i.payload,n=i.secret||i.privateKey,r=i.encoding,s=IC(e.alg),o=BC(e,t,r),a=s.sign(o,n);return uu.format("%s.%s",o,a)}function Oo(i){var e=i.secret;if(e=e??i.privateKey,e=e??i.key,/^hs/i.test(i.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new Pg(e);this.readable=!0,this.header=i.header,this.encoding=i.encoding,this.secret=this.privateKey=this.key=t,this.payload=new Pg(i.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))}uu.inherits(Oo,NC);Oo.prototype.sign=function(){try{var e=Bg({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")}};Oo.sign=Bg;jg.exports=Oo});var Vg=O((ZA,Kg)=>{var qg=Kn().Buffer,Lg=iu(),jC=cu(),DC=require("stream"),Fg=lu(),LC=require("util"),qC=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function FC(i){return Object.prototype.toString.call(i)==="[object Object]"}function UC(i){if(FC(i))return i;try{return JSON.parse(i)}catch{return}}function Ug(i){var e=i.split(".",1)[0];return UC(qg.from(e,"base64").toString("binary"))}function HC(i){return i.split(".",2).join(".")}function Hg(i){return i.split(".")[2]}function zC(i,e){e=e||"utf8";var t=i.split(".")[1];return qg.from(t,"base64").toString(e)}function zg(i){return qC.test(i)&&!!Ug(i)}function Wg(i,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}i=Fg(i);var r=Hg(i),s=HC(i),o=jC(e);return o.verify(s,r,t)}function $g(i,e){if(e=e||{},i=Fg(i),!zg(i))return null;var t=Ug(i);if(!t)return null;var n=zC(i);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:Hg(i)}}function Jn(i){i=i||{};var e=i.secret;if(e=e??i.publicKey,e=e??i.key,/^hs/i.test(i.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new Lg(e);this.readable=!0,this.algorithm=i.algorithm,this.encoding=i.encoding,this.secret=this.publicKey=this.key=t,this.signature=new Lg(i.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))}LC.inherits(Jn,DC);Jn.prototype.verify=function(){try{var e=Wg(this.signature.buffer,this.algorithm,this.key.buffer),t=$g(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")}};Jn.decode=$g;Jn.isValid=zg;Jn.verify=Wg;Kg.exports=Jn});var Jg=O(ki=>{var Gg=Dg(),Mo=Vg(),WC=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];ki.ALGORITHMS=WC;ki.sign=Gg.sign;ki.verify=Mo.verify;ki.decode=Mo.decode;ki.isValid=Mo.isValid;ki.createSign=function(e){return new Gg(e)};ki.createVerify=function(e){return new Mo(e)}});var Ao=O((eR,Yg)=>{"use strict";var pu={};pu.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};pu.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};Yg.exports=pu});var fu=O((tR,Xg)=>{"use strict";function $C(i){return/^[A-Za-z0-9\-_]+$/.test(i)}Xg.exports={validate:$C}});var hu=O((iR,s0)=>{"use strict";var KC=require("crypto"),VC=ag(),GC=Jg(),{URL:Qg}=require("url"),Zg=Ao(),e0=fu(),JC=720*60,YC=1440*60,XC=VC.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 ZC(i){return XC.encode({version:1,privateKey:i,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function QC(){let i=KC.createECDH("prime256v1");i.generateKeys();let e=i.getPublicKey(),t=i.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 t0(i){if(!i)throw new Error("No subject set in vapidDetails.subject.");if(typeof i!="string"||i.length===0)throw new Error("The subject value must be a string containing an https: URL or mailto: address. "+i);let e=null;try{e=new Qg(i)}catch{throw new Error("Vapid subject is not a valid URL. "+i)}if(!["https:","mailto:"].includes(e.protocol))throw new Error("Vapid subject is not an https: or mailto: URL. "+i);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 i0(i){if(!i)throw new Error("No key set vapidDetails.publicKey");if(typeof i!="string")throw new Error("Vapid public key is must be a URL safe Base 64 encoded string.");if(!e0.validate(i))throw new Error('Vapid public key must be a URL safe Base 64 (without "=")');if(i=Buffer.from(i,"base64url"),i.length!==65)throw new Error("Vapid public key should be 65 bytes long when decoded.")}function n0(i){if(!i)throw new Error("No key set in vapidDetails.privateKey");if(typeof i!="string")throw new Error("Vapid private key must be a URL safe Base 64 encoded string.");if(!e0.validate(i))throw new Error('Vapid private key must be a URL safe Base 64 (without "=")');if(i=Buffer.from(i,"base64url"),i.length!==32)throw new Error("Vapid private key should be 32 bytes long when decoded.")}function du(i){let e=new Date;return e.setSeconds(e.getSeconds()+i),Math.floor(e.getTime()/1e3)}function r0(i){if(!Number.isInteger(i))throw new Error("`expiration` value must be a number");if(i<0)throw new Error("`expiration` must be a positive integer");let e=du(YC);if(i>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function eT(i,e,t,n,r,s){if(!i)throw new Error("No audience could be generated for VAPID.");if(typeof i!="string"||i.length===0)throw new Error("The audience value must be a string containing the origin of a push service. "+i);try{new Qg(i)}catch{throw new Error("VAPID audience is not a url. "+i)}t0(e),i0(t),n0(n),n=Buffer.from(n,"base64url"),s?r0(s):s=du(JC);let o={typ:"JWT",alg:"ES256"},a={aud:i,exp:s,sub:e},l=GC.sign({header:o,payload:a,privateKey:ZC(n)});if(r===Zg.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+l+", k="+t};if(r===Zg.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+l,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}s0.exports={generateVAPIDKeys:QC,getFutureExpirationTimestamp:du,getVapidHeaders:eT,validateSubject:t0,validatePublicKey:i0,validatePrivateKey:n0,validateExpiration:r0}});var v0=O((nR,m0)=>{"use strict";var Po=require("crypto"),a0="aes-128-gcm",Io={aes128gcm:1,aesgcm:2},Gi=16,Qt=16,tT=12,c0=32,kr="encrypt",Or="decrypt",Z;process.env.ECE_KEYLOG==="1"?Z=function(i,e){return console.warn(i+" ["+e.length+"]: "+e.toString("base64url")),e}:Z=function(i,e){return e};function Ro(i){return typeof i=="string"?Buffer.from(i,"base64url"):i}function l0(i,e){var t=Po.createHmac("sha256",i);return t.update(e),t.digest()}function u0(i,e){return Z("salt",i),Z("ikm",e),Z("extract",l0(i,e))}function mu(i,e,t){Z("prk",i),Z("info",e);var n=Buffer.alloc(0),r=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var s=0,o=Buffer.alloc(1);n.length<t;)o.writeUIntBE(++s,0,1),r=l0(i,Buffer.concat([r,e,o])),n=Buffer.concat([n,r]);return Z("expand",n.slice(0,t))}function p0(i,e,t,n){return mu(u0(i,e),t,n)}function vu(i,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+i+"\0","ascii"),e]);return Z("info "+i,t),t}function o0(i){var e=Buffer.concat([Buffer.alloc(2),i]);return e.writeUIntBE(i.length,0,2),e}function iT(i,e){var t=i.privateKey,n,r;if(e===kr)n=t.getPublicKey(),r=i.dh;else if(e===Or)n=i.dh,r=t.getPublicKey();else throw new Error("Unknown mode only "+kr+" and "+Or+" supported");return{secret:t.computeSecret(i.dh),context:Buffer.concat([Buffer.from(i.keylabel,"ascii"),Buffer.from([0]),o0(r),o0(n)])}}function nT(i,e){var t={secret:null,context:Buffer.alloc(0)};if(i.key){if(t.secret=i.key,t.secret.length!==Qt)throw new Error("An explicit key must be "+Qt+" bytes")}else i.dh?t=iT(i,e):typeof i.keyid!==void 0&&(t.secret=i.keymap[i.keyid]);if(!t.secret)throw new Error("Unable to determine key");return Z("secret",t.secret),Z("context",t.context),i.authSecret&&(t.secret=p0(i.authSecret,t.secret,vu("auth",Buffer.alloc(0)),c0),Z("authsecret",t.secret)),t}function rT(i,e){if(!i.authSecret)throw new Error("No authentication secret for webpush");Z("authsecret",i.authSecret);var t,n,r;if(e===kr)n=i.privateKey.getPublicKey(),t=r=i.dh;else if(e===Or)t=n=i.keyid,r=i.privateKey.getPublicKey();else throw new Error("Unknown mode only "+kr+" and "+Or+" supported");return Z("remote pubkey",t),Z("sender pubkey",n),Z("receiver pubkey",r),Z("secret dh",p0(i.authSecret,i.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),r,n]),c0))}function sT(i,e,t){if(t&&!hT(t))throw new Error("Callback is not a function");if(i.key){if(i.key.length!==Qt)throw new Error("An explicit key must be "+Qt+" bytes");return Z("secret key",i.key)}if(!i.privateKey){if(t)var n=t(i.keyid);else var n=i.keymap&&i.keymap[i.keyid];if(!n)throw new Error('No saved key (keyid: "'+i.keyid+'")');return n}return rT(i,e)}function f0(i,e,t){if(!i.salt)throw new Error("must include a salt parameter for "+i.version);var n,r,s;if(i.version==="aesgcm"){var o=nT(i,e,t);n=vu("aesgcm",o.context),r=vu("nonce",o.context),s=o.secret}else if(i.version==="aes128gcm")n=Buffer.from("Content-Encoding: aes128gcm\0"),r=Buffer.from("Content-Encoding: nonce\0"),s=sT(i,e,t);else throw new Error("Unable to set context for mode "+i.version);var a=u0(i.salt,s),l={key:mu(a,n,Qt),nonce:mu(a,r,tT)};return Z("key",l.key),Z("nonce base",l.nonce),l}function d0(i){var e={};e.version=i.version||"aes128gcm",e.rs=parseInt(i.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=Io[e.version];if(e.version==="aes128gcm"&&(t+=Gi),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(i.salt&&(e.salt=Ro(i.salt),e.salt.length!==Qt))throw new Error("The salt parameter must be "+Qt+" bytes");return e.keyid=i.keyid,i.key?e.key=Ro(i.key):(e.privateKey=i.privateKey,e.privateKey||(e.keymap=i.keymap),e.version!=="aes128gcm"&&(e.keylabel=i.keylabel||"P-256"),i.dh&&(e.dh=Ro(i.dh))),i.authSecret&&(e.authSecret=Ro(i.authSecret)),e}function h0(i,e){var t=Buffer.from(i),n=t.readUIntBE(t.length-6,6),r=((n^e)&16777215)+((n/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(r,t.length-6,6),Z("nonce"+e,t),t}function oT(i,e){var t=i.readUIntBE(20,1);return e.salt=i.slice(0,Qt),e.rs=i.readUIntBE(Qt,4),e.keyid=i.slice(21,21+t),21+t}function aT(i,e){var t=Io[e],n=i.readUIntBE(0,t);if(n+t>i.length)throw new Error("padding exceeds block size");Z("padding",i.slice(0,t+n));var r=Buffer.alloc(n);if(r.fill(0),r.compare(i.slice(t,t+n))!==0)throw new Error("invalid padding");return i.slice(t+n)}function cT(i,e){for(var t=i.length-1;t>=0;){if(i[t]){if(e){if(i[t]!==2)throw new Error("last record needs to start padding with a 2")}else if(i[t]!==1)throw new Error("last record needs to start padding with a 2");return i.slice(0,t)}--t}throw new Error("all zero plaintext")}function lT(i,e,t,n,r){Z("decrypt",t);var s=h0(i.nonce,e),o=Po.createDecipheriv(a0,i.key,s);o.setAuthTag(t.slice(t.length-Gi));var a=o.update(t.slice(0,t.length-Gi));return a=Buffer.concat([a,o.final()]),Z("decrypted",a),n.version!=="aes128gcm"?aT(a,n.version):cT(a,r)}function uT(i,e,t){var n=d0(e);if(n.version==="aes128gcm"){var r=oT(i,n);i=i.slice(r)}var s=f0(n,Or,t),o=0,a=Buffer.alloc(0),l=n.rs;n.version!=="aes128gcm"&&(l+=Gi);for(var p=0;o<i.length;++p){var d=o+l;if(n.version!=="aes128gcm"&&d===i.length)throw new Error("Truncated payload");if(d=Math.min(d,i.length),d-o<=Gi)throw new Error("Invalid block: too small at "+p);var h=lT(s,p,i.slice(o,d),n,d>=i.length);a=Buffer.concat([a,h]),o=d}return a}function pT(i,e,t,n,r,s){Z("encrypt",t),n=n||0;var o=h0(i.nonce,e),a=Po.createCipheriv(a0,i.key,o),l=[],p=Io[r.version],d=Buffer.alloc(n+p);if(d.fill(0),r.version!=="aes128gcm"){if(d.writeUIntBE(n,0,p),Z("padding",d),l.push(a.update(d)),l.push(a.update(t)),!s&&d.length+t.length<r.rs)throw new Error("Unable to pad to record size")}else l.push(a.update(t)),d.writeUIntBE(s?2:1,0,1),Z("padding",d),l.push(a.update(d));a.final();var h=a.getAuthTag();if(h.length!==Gi)throw new Error("invalid tag generated");return l.push(h),Z("encrypted",Buffer.concat(l))}function fT(i){var e=Buffer.alloc(5),t=Buffer.from(i.keyid||[]);if(t.length>255)throw new Error("keyid is too large");return e.writeUIntBE(i.rs,0,4),e.writeUIntBE(t.length,4,1),Buffer.concat([i.salt,e,t])}function dT(i,e,t){if(!Buffer.isBuffer(i))throw new Error("buffer argument must be a Buffer");var n=d0(e);n.salt||(n.salt=Po.randomBytes(Qt));var r;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),r=fT(n)):r=Buffer.alloc(0);var s=f0(n,kr,t),o=0,a=Io[n.version],l=a;n.version==="aes128gcm"&&(l+=Gi);for(var p=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),d=0,h=!1;!h;){var g=Math.min(n.rs-l-1,p);n.version!=="aes128gcm"&&(g=Math.min((1<<a*8)-1,g)),p>0&&g===0&&++g,p-=g;var _=o+n.rs-l-g;n.version!=="aes128gcm"?h=_>i.length:h=_>=i.length,h=h&&p<=0;var S=pT(s,d,i.slice(o,_),g,n,h);r=Buffer.concat([r,S]),o=_,++d}return r}function hT(i){return typeof i=="function"}m0.exports={decrypt:uT,encrypt:dT}});var gu=O((rR,x0)=>{"use strict";var g0=require("crypto"),mT=v0(),vT=function(i,e,t,n){if(!i)throw new Error("No user public key provided for encryption.");if(typeof i!="string")throw new Error("The subscription p256dh value must be a string.");if(Buffer.from(i,"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 r=g0.createECDH("prime256v1"),s=r.generateKeys(),o=g0.randomBytes(16).toString("base64url"),a=mT.encrypt(t,{version:n,dh:i,privateKey:r,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:a}};x0.exports={encrypt:vT}});var xu=O((sR,b0)=>{"use strict";function y0(i,e,t,n,r){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=i,this.statusCode=e,this.headers=t,this.body=n,this.endpoint=r}require("util").inherits(y0,Error);b0.exports=y0});var S0=O(lt=>{"use strict";var gT=lt&&lt.__createBinding||(Object.create?(function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),xT=lt&&lt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),w0=lt&&lt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&gT(e,i,t);return xT(e,i),e};Object.defineProperty(lt,"__esModule",{value:!0});lt.req=lt.json=lt.toBuffer=void 0;var yT=w0(require("http")),bT=w0(require("https"));async function _0(i){let e=0,t=[];for await(let n of i)e+=n.length,t.push(n);return Buffer.concat(t,e)}lt.toBuffer=_0;async function wT(i){let t=(await _0(i)).toString("utf8");try{return JSON.parse(t)}catch(n){let r=n;throw r.message+=` (input: ${t})`,r}}lt.json=wT;function _T(i,e={}){let n=((typeof i=="string"?i:i.href).startsWith("https:")?bT:yT).request(i,e),r=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=r.then.bind(r),n}lt.req=_T});var k0=O(yt=>{"use strict";var C0=yt&&yt.__createBinding||(Object.create?(function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),ST=yt&&yt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),T0=yt&&yt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&C0(e,i,t);return ST(e,i),e},ET=yt&&yt.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&C0(e,i,t)};Object.defineProperty(yt,"__esModule",{value:!0});yt.Agent=void 0;var CT=T0(require("net")),E0=T0(require("http")),TT=require("https");ET(S0(),yt);var ei=Symbol("AgentBaseInternalState"),yu=class extends E0.Agent{constructor(e){super(e),this[ei]={}}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(`
24
+ `).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 CT.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],r=n.indexOf(t);r!==-1&&(n.splice(r,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?TT.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,n){let r={...t,secureEndpoint:this.isSecureEndpoint(t)},s=this.getName(r),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,r)).then(a=>{if(this.decrementSockets(s,o),a instanceof E0.Agent)try{return a.addRequest(e,r)}catch(l){return n(l)}this[ei].currentSocket=a,super.createSocket(e,t,n)},a=>{this.decrementSockets(s,o),n(a)})}createConnection(){let e=this[ei].currentSocket;if(this[ei].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[ei].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[ei]&&(this[ei].defaultPort=e)}get protocol(){return this[ei].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[ei]&&(this[ei].protocol=e)}};yt.Agent=yu});var O0=O(Yn=>{"use strict";var kT=Yn&&Yn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.parseProxyResponse=void 0;var OT=kT(ue()),No=(0,OT.default)("https-proxy-agent:parse-proxy-response");function MT(i){return new Promise((e,t)=>{let n=0,r=[];function s(){let d=i.read();d?p(d):i.once("readable",s)}function o(){i.removeListener("end",a),i.removeListener("error",l),i.removeListener("readable",s)}function a(){o(),No("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function l(d){o(),No("onerror %o",d),t(d)}function p(d){r.push(d),n+=d.length;let h=Buffer.concat(r,n),g=h.indexOf(`\r
25
25
  \r
26
- `);if(_===-1){_o("have not received end of HTTP headers yet..."),s();return}let E=v.slice(0,_).toString("ascii").split(`\r
27
- `),C=E.shift();if(!C)return i.destroy(),t(new Error("No header received from proxy CONNECT response"));let k=C.split(" "),M=+k[1],O=k.slice(2).join(" "),A={};for(let I of E){if(!I)continue;let U=I.indexOf(":");if(U===-1)return i.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${I}"`));let Xe=I.slice(0,U).toLowerCase(),te=I.slice(U+1).trimStart(),Le=A[Xe];typeof Le=="string"?A[Xe]=[Le,te]:Array.isArray(Le)?Le.push(te):A[Xe]=te}_o("got proxy server response: %o %o",C,A),o(),e({connect:{statusCode:M,statusText:O,headers:A},buffered:v})}i.on("error",u),i.on("end",c),s()})}zr.parseProxyResponse=XC});var ux=T(At=>{"use strict";var ZC=At&&At.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,n)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),QC=At&&At.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),cx=At&&At.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&ZC(e,i,t);return QC(e,i),e},lx=At&&At.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(At,"__esModule",{value:!0});At.HttpsProxyAgent=void 0;var So=cx(require("net")),sx=cx(require("tls")),eT=lx(require("assert")),tT=lx(ie()),iT=rx(),rT=require("url"),nT=nx(),bn=(0,tT.default)("https-proxy-agent"),ox=i=>i.servername===void 0&&i.host&&!So.isIP(i.host)?{...i,servername:i.host}:i,Eo=class extends iT.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new rT.URL(e):e,this.proxyHeaders=t?.headers??{},bn("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),n=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?ax(t,"headers"):null,host:r,port:n}}async connect(e,t){let{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let n;r.protocol==="https:"?(bn("Creating `tls.Socket`: %o",this.connectOpts),n=sx.connect(ox(this.connectOpts))):(bn("Creating `net.Socket`: %o",this.connectOpts),n=So.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=So.isIPv6(t.host)?`[${t.host}]`:t.host,c=`CONNECT ${o}:${t.port} HTTP/1.1\r
28
- `;if(r.username||r.password){let _=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(_).toString("base64")}`}s.Host=`${o}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let _ of Object.keys(s))c+=`${_}: ${s[_]}\r
29
- `;let u=(0,nT.parseProxyResponse)(n);n.write(`${c}\r
30
- `);let{connect:d,buffered:f}=await u;if(e.emit("proxyConnect",d),this.emit("proxyConnect",d,e),d.statusCode===200)return e.once("socket",sT),t.secureEndpoint?(bn("Upgrading socket connection to TLS"),sx.connect({...ax(ox(t),"host","path","port"),socket:n})):n;n.destroy();let v=new So.Socket({writable:!1});return v.readable=!0,e.once("socket",_=>{bn("Replaying proxy buffer for failed request"),(0,eT.default)(_.listenerCount("data")>0),_.push(f),_.push(null)}),v}};Eo.protocols=["http","https"];At.HttpsProxyAgent=Eo;function sT(i){i.resume()}function ax(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}});var mx=T((SA,hx)=>{"use strict";var dx=require("url"),fx=require("https"),oT=iu(),Co=Zl(),aT=tu(),mt=xo(),cT=Jl(),px=2419200,nu="",su;function wn(){}wn.prototype.setGCMAPIKey=function(i){if(i===null){nu=null;return}if(typeof i>"u"||typeof i!="string"||i.length===0)throw new Error("The GCM API Key should be a non-empty string or null.");nu=i};wn.prototype.setVapidDetails=function(i,e,t){if(arguments.length===1&&arguments[0]===null){su=null;return}Co.validateSubject(i),Co.validatePublicKey(e),Co.validatePrivateKey(t),su={subject:i,publicKey:e,privateKey:t}};wn.prototype.generateRequestDetails=function(i,e,t){if(!i||!i.endpoint)throw new Error("You must pass in a subscription with at least an endpoint.");if(typeof i.endpoint!="string"||i.endpoint.length===0)throw new Error("The subscription endpoint must be a string with a valid URL.");if(e&&(typeof i!="object"||!i.keys||!i.keys.p256dh||!i.keys.auth))throw new Error("To send a message with a payload, the subscription must have 'auth' and 'p256dh' keys.");let r=nu,n=su,s=px,o={},c=mt.supportedContentEncodings.AES_128_GCM,u=mt.supportedUrgency.NORMAL,d,f,v,_;if(t){let O=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],A=Object.keys(t);for(let I=0;I<A.length;I+=1){let U=A[I];if(!O.includes(U))throw new Error("'"+U+"' is an invalid option. The valid options are ['"+O.join("', '")+"'].")}if(t.headers){o=t.headers;let I=Object.keys(o).filter(function(U){return typeof t[U]<"u"});if(I.length>0)throw new Error("Duplicated headers defined ["+I.join(",")+"]. Please either define the header in thetop level options OR in the 'headers' key.")}if(t.gcmAPIKey&&(r=t.gcmAPIKey),t.vapidDetails!==void 0&&(n=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===mt.supportedContentEncodings.AES_128_GCM||t.contentEncoding===mt.supportedContentEncodings.AES_GCM)c=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===mt.supportedUrgency.VERY_LOW||t.urgency===mt.supportedUrgency.LOW||t.urgency===mt.supportedUrgency.NORMAL||t.urgency===mt.supportedUrgency.HIGH)u=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!cT.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");d=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?f=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 fx.Agent?(f&&console.warn("Agent option will be ignored because proxy option is defined."),v=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(_=t.timeout)}typeof s>"u"&&(s=px);let E={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(O){E.headers[O]=o[O]});let C=null;if(e){let O=aT.encrypt(i.keys.p256dh,i.keys.auth,e,c);E.headers["Content-Length"]=O.cipherText.length,E.headers["Content-Type"]="application/octet-stream",c===mt.supportedContentEncodings.AES_128_GCM?E.headers["Content-Encoding"]=mt.supportedContentEncodings.AES_128_GCM:c===mt.supportedContentEncodings.AES_GCM&&(E.headers["Content-Encoding"]=mt.supportedContentEncodings.AES_GCM,E.headers.Encryption="salt="+O.salt,E.headers["Crypto-Key"]="dh="+O.localPublicKey.toString("base64url")),C=O.cipherText}else E.headers["Content-Length"]=0;let k=i.endpoint.startsWith("https://android.googleapis.com/gcm/send"),M=i.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(k)r?E.headers.Authorization="key="+r: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(n){let O=dx.parse(i.endpoint),A=O.protocol+"//"+O.host,I=Co.getVapidHeaders(A,n.subject,n.publicKey,n.privateKey,c);E.headers.Authorization=I.Authorization,c===mt.supportedContentEncodings.AES_GCM&&(E.headers["Crypto-Key"]?E.headers["Crypto-Key"]+=";"+I["Crypto-Key"]:E.headers["Crypto-Key"]=I["Crypto-Key"])}else M&&r&&(E.headers.Authorization="key="+r);return E.headers.Urgency=u,d&&(E.headers.Topic=d),E.body=C,E.endpoint=i.endpoint,f&&(E.proxy=f),v&&(E.agent=v),_&&(E.timeout=_),E};wn.prototype.sendNotification=function(i,e,t){let r;try{r=this.generateRequestDetails(i,e,t)}catch(n){return Promise.reject(n)}return new Promise(function(n,s){let o={},c=dx.parse(r.endpoint);if(o.hostname=c.hostname,o.port=c.port,o.path=c.path,o.headers=r.headers,o.method=r.method,r.timeout&&(o.timeout=r.timeout),r.agent&&(o.agent=r.agent),r.proxy){let{HttpsProxyAgent:d}=ux();o.agent=new d(r.proxy)}let u=fx.request(o,function(d){let f="";d.on("data",function(v){f+=v}),d.on("end",function(){d.statusCode<200||d.statusCode>299?s(new oT("Received unexpected response code",d.statusCode,d.headers,f,r.endpoint)):n({statusCode:d.statusCode,body:f,headers:d.headers})})});r.timeout&&u.on("timeout",function(){u.destroy(new Error("Socket timeout"))}),u.on("error",function(d){s(d)}),r.body&&u.write(r.body),u.end()})};hx.exports=wn});var xx=T((EA,gx)=>{"use strict";var vx=Zl(),lT=tu(),uT=mx(),pT=iu(),dT=xo(),_n=new uT;gx.exports={WebPushError:pT,supportedContentEncodings:dT.supportedContentEncodings,encrypt:lT.encrypt,getVapidHeaders:vx.getVapidHeaders,generateVAPIDKeys:vx.generateVAPIDKeys,setGCMAPIKey:_n.setGCMAPIKey,setVapidDetails:_n.setVapidDetails,generateRequestDetails:_n.generateRequestDetails,sendNotification:_n.sendNotification.bind(_n)}});var n0=T((pR,uu)=>{"use strict";var LT=Object.prototype.hasOwnProperty,tt="~";function Tn(){}Object.create&&(Tn.prototype=Object.create(null),new Tn().__proto__||(tt=!1));function qT(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function r0(i,e,t,r,n){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new qT(t,r||i,n),o=tt?tt+e:e;return i._events[o]?i._events[o].fn?i._events[o]=[i._events[o],s]:i._events[o].push(s):(i._events[o]=s,i._eventsCount++),i}function Lo(i,e){--i._eventsCount===0?i._events=new Tn:delete i._events[e]}function Je(){this._events=new Tn,this._eventsCount=0}Je.prototype.eventNames=function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)LT.call(t,r)&&e.push(tt?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Je.prototype.listeners=function(e){var t=tt?tt+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,s=r.length,o=new Array(s);n<s;n++)o[n]=r[n].fn;return o};Je.prototype.listenerCount=function(e){var t=tt?tt+e:e,r=this._events[t];return r?r.fn?1:r.length:0};Je.prototype.emit=function(e,t,r,n,s,o){var c=tt?tt+e:e;if(!this._events[c])return!1;var u=this._events[c],d=arguments.length,f,v;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,n),!0;case 5:return u.fn.call(u.context,t,r,n,s),!0;case 6:return u.fn.call(u.context,t,r,n,s,o),!0}for(v=1,f=new Array(d-1);v<d;v++)f[v-1]=arguments[v];u.fn.apply(u.context,f)}else{var _=u.length,E;for(v=0;v<_;v++)switch(u[v].once&&this.removeListener(e,u[v].fn,void 0,!0),d){case 1:u[v].fn.call(u[v].context);break;case 2:u[v].fn.call(u[v].context,t);break;case 3:u[v].fn.call(u[v].context,t,r);break;case 4:u[v].fn.call(u[v].context,t,r,n);break;default:if(!f)for(E=1,f=new Array(d-1);E<d;E++)f[E-1]=arguments[E];u[v].fn.apply(u[v].context,f)}}return!0};Je.prototype.on=function(e,t,r){return r0(this,e,t,r,!1)};Je.prototype.once=function(e,t,r){return r0(this,e,t,r,!0)};Je.prototype.removeListener=function(e,t,r,n){var s=tt?tt+e:e;if(!this._events[s])return this;if(!t)return Lo(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!n||o.once)&&(!r||o.context===r)&&Lo(this,s);else{for(var c=0,u=[],d=o.length;c<d;c++)(o[c].fn!==t||n&&!o[c].once||r&&o[c].context!==r)&&u.push(o[c]);u.length?this._events[s]=u.length===1?u[0]:u:Lo(this,s)}return this};Je.prototype.removeAllListeners=function(e){var t;return e?(t=tt?tt+e:e,this._events[t]&&Lo(this,t)):(this._events=new Tn,this._eventsCount=0),this};Je.prototype.off=Je.prototype.removeListener;Je.prototype.addListener=Je.prototype.on;Je.prefixed=tt;Je.EventEmitter=Je;typeof uu<"u"&&(uu.exports=Je)});var o0=T((dR,s0)=>{"use strict";s0.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 qo=T(c0=>{var li=c0,FT=require("url"),a0=require("util")._extend,UT=o0(),HT=/(^|,)\s*upgrade\s*($|,)/i,pu=/^https|wss/;li.isSSL=pu;li.setupOutgoing=function(i,e,t,r){i.port=e[r||"target"].port||(pu.test(e[r||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(c){i[c]=e[r||"target"][c]}),i.method=e.method||t.method,i.headers=a0({},t.headers),e.headers&&a0(i.headers,e.headers),e.auth&&(i.auth=e.auth),e.ca&&(i.ca=e.ca),pu.test(e[r||"target"].protocol)&&(i.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),i.agent=e.agent||!1,i.localAddress=e.localAddress,i.agent||(i.headers=i.headers||{},(typeof i.headers.connection!="string"||!HT.test(i.headers.connection))&&(i.headers.connection="close"));var n=e[r||"target"],s=n&&e.prependPath!==!1&&n.path||"",o=e.toProxy?t.url:FT.parse(t.url).path||"";return o=e.ignorePath?"":o,i.path=li.urlJoin(s,o),e.changeOrigin&&(i.headers.host=UT(i.port,e[r||"target"].protocol)&&!zT(i.host)?i.host+":"+i.port:i.host),i};li.setupSocket=function(i){return i.setTimeout(0),i.setNoDelay(!0),i.setKeepAlive(!0,0),i};li.getPort=function(i){var e=i.headers.host?i.headers.host.match(/:(\d+)/):"";return e?e[1]:li.hasEncryptedConnection(i)?"443":"80"};li.hasEncryptedConnection=function(i){return!!(i.connection.encrypted||i.connection.pair)};li.urlJoin=function(){var i=Array.prototype.slice.call(arguments),e=i.length-1,t=i[e],r=t.split("?"),n;return i[e]=r.shift(),n=[i.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],n.push.apply(n,r),n.join("?")};li.rewriteCookieProperty=function i(e,t,r){return Array.isArray(e)?e.map(function(n){return i(n,t,r)}):e.replace(new RegExp("(;\\s*"+r+"=)([^;]+)","i"),function(n,s,o){var c;if(o in t)c=t[o];else if("*"in t)c=t["*"];else return n;return c?s+c:""})};function zT(i){return!!~i.indexOf(":")}});var d0=T((hR,p0)=>{var l0=require("url"),u0=qo(),WT=/^201|30(1|2|7|8)$/;p0.exports={removeChunked:function(e,t,r){e.httpVersion==="1.0"&&delete r.headers["transfer-encoding"]},setConnection:function(e,t,r){e.httpVersion==="1.0"?r.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!r.headers.connection&&(r.headers.connection=e.headers.connection||"keep-alive")},setRedirectHostRewrite:function(e,t,r,n){if((n.hostRewrite||n.autoRewrite||n.protocolRewrite)&&r.headers.location&&WT.test(r.statusCode)){var s=l0.parse(n.target),o=l0.parse(r.headers.location);if(s.host!=o.host)return;n.hostRewrite?o.host=n.hostRewrite:n.autoRewrite&&(o.host=e.headers.host),n.protocolRewrite&&(o.protocol=n.protocolRewrite),r.headers.location=o.format()}},writeHeaders:function(e,t,r,n){var s=n.cookieDomainRewrite,o=n.cookiePathRewrite,c=n.preserveHeaderKeyCase,u,d=function(_,E){E!=null&&(s&&_.toLowerCase()==="set-cookie"&&(E=u0.rewriteCookieProperty(E,s,"domain")),o&&_.toLowerCase()==="set-cookie"&&(E=u0.rewriteCookieProperty(E,o,"path")),t.setHeader(String(_).trim(),E))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),c&&r.rawHeaders!=null){u={};for(var f=0;f<r.rawHeaders.length;f+=2){var v=r.rawHeaders[f];u[v.toLowerCase()]=v}}Object.keys(r.headers).forEach(function(_){var E=r.headers[_];c&&u&&(_=u[_]||_),d(_,E)})},writeStatusCode:function(e,t,r){r.statusMessage?(t.statusCode=r.statusCode,t.statusMessage=r.statusMessage):t.statusCode=r.statusCode}}});var h0=T((mR,f0)=>{var kn;f0.exports=function(){if(!kn){try{kn=ie()("follow-redirects")}catch{}typeof kn!="function"&&(kn=function(){})}kn.apply(null,arguments)}});var y0=T((vR,Su)=>{var On=require("url"),Mn=On.URL,$T=require("http"),VT=require("https"),vu=require("stream").Writable,gu=require("assert"),m0=h0();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",r=Vi(Error.captureStackTrace);!e&&(t||!r)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var xu=!1;try{gu(new Mn(""))}catch(i){xu=i.code==="ERR_INVALID_URL"}var KT=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],yu=["abort","aborted","connect","error","socket","timeout"],bu=Object.create(null);yu.forEach(function(i){bu[i]=function(e,t,r){this._redirectable.emit(i,e,t,r)}});var fu=An("ERR_INVALID_URL","Invalid URL",TypeError),hu=An("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),GT=An("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",hu),YT=An("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),JT=An("ERR_STREAM_WRITE_AFTER_END","write after end"),XT=vu.prototype.destroy||g0;function ct(i,e){vu.call(this),this._sanitizeOptions(i),this._options=i,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(r){try{t._processResponse(r)}catch(n){t.emit("error",n instanceof hu?n:new hu({cause:n}))}},this._performRequest()}ct.prototype=Object.create(vu.prototype);ct.prototype.abort=function(){_u(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};ct.prototype.destroy=function(i){return _u(this._currentRequest,i),XT.call(this,i),this};ct.prototype.write=function(i,e,t){if(this._ending)throw new JT;if(!$i(i)&&!ek(i))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Vi(e)&&(t=e,e=null),i.length===0){t&&t();return}this._requestBodyLength+i.length<=this._options.maxBodyLength?(this._requestBodyLength+=i.length,this._requestBodyBuffers.push({data:i,encoding:e}),this._currentRequest.write(i,e,t)):(this.emit("error",new YT),this.abort())};ct.prototype.end=function(i,e,t){if(Vi(i)?(t=i,i=e=null):Vi(e)&&(t=e,e=null),!i)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var r=this,n=this._currentRequest;this.write(i,e,function(){r._ended=!0,n.end(null,null,t)}),this._ending=!0}};ct.prototype.setHeader=function(i,e){this._options.headers[i]=e,this._currentRequest.setHeader(i,e)};ct.prototype.removeHeader=function(i){delete this._options.headers[i],this._currentRequest.removeHeader(i)};ct.prototype.setTimeout=function(i,e){var t=this;function r(o){o.setTimeout(i),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function n(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},i),r(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",n)}return e&&this.on("timeout",e),this.socket?n(this.socket):this._currentRequest.once("socket",n),this.on("socket",r),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(i){ct.prototype[i]=function(e,t){return this._currentRequest[i](e,t)}});["aborted","connection","socket"].forEach(function(i){Object.defineProperty(ct.prototype,i,{get:function(){return this._currentRequest[i]}})});ct.prototype._sanitizeOptions=function(i){if(i.headers||(i.headers={}),i.host&&(i.hostname||(i.hostname=i.host),delete i.host),!i.pathname&&i.path){var e=i.path.indexOf("?");e<0?i.pathname=i.path:(i.pathname=i.path.substring(0,e),i.search=i.path.substring(e))}};ct.prototype._performRequest=function(){var i=this._options.protocol,e=this._options.nativeProtocols[i];if(!e)throw new TypeError("Unsupported protocol "+i);if(this._options.agents){var t=i.slice(0,-1);this._options.agent=this._options.agents[t]}var r=this._currentRequest=e.request(this._options,this._onNativeResponse);r._redirectable=this;for(var n of yu)r.on(n,bu[n]);if(this._currentUrl=/^\//.test(this._options.path)?On.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,c=this._requestBodyBuffers;(function u(d){if(r===o._currentRequest)if(d)o.emit("error",d);else if(s<c.length){var f=c[s++];r.finished||r.write(f.data,f.encoding,u)}else o._ended&&r.end()})()}};ct.prototype._processResponse=function(i){var e=i.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:i.headers,statusCode:e});var t=i.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){i.responseUrl=this._currentUrl,i.redirects=this._redirects,this.emit("response",i),this._requestBodyBuffers=[];return}if(_u(this._currentRequest),i.destroy(),++this._redirectCount>this._options.maxRedirects)throw new GT;var r,n=this._options.beforeRedirect;n&&(r=Object.assign({Host:i.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=[],du(/^content-/i,this._options.headers));var o=du(/^host$/i,this._options.headers),c=wu(this._currentUrl),u=o||c.host,d=/^\w+:/.test(t)?this._currentUrl:On.format(Object.assign(c,{host:u})),f=ZT(t,d);if(m0("redirecting to",f.href),this._isRedirect=!0,mu(f,this._options),(f.protocol!==c.protocol&&f.protocol!=="https:"||f.host!==u&&!QT(f.host,u))&&du(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Vi(n)){var v={headers:i.headers,statusCode:e},_={url:d,method:s,headers:r};n(this._options,v,_),this._sanitizeOptions(this._options)}this._performRequest()};function v0(i){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(i).forEach(function(r){var n=r+":",s=t[n]=i[r],o=e[r]=Object.create(s);function c(d,f,v){return tk(d)?d=mu(d):$i(d)?d=mu(wu(d)):(v=f,f=x0(d),d={protocol:n}),Vi(f)&&(v=f,f=null),f=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},d,f),f.nativeProtocols=t,!$i(f.host)&&!$i(f.hostname)&&(f.hostname="::1"),gu.equal(f.protocol,n,"protocol mismatch"),m0("options",f),new ct(f,v)}function u(d,f,v){var _=o.request(d,f,v);return _.end(),_}Object.defineProperties(o,{request:{value:c,configurable:!0,enumerable:!0,writable:!0},get:{value:u,configurable:!0,enumerable:!0,writable:!0}})}),e}function g0(){}function wu(i){var e;if(xu)e=new Mn(i);else if(e=x0(On.parse(i)),!$i(e.protocol))throw new fu({input:i});return e}function ZT(i,e){return xu?new Mn(i,e):wu(On.resolve(e,i))}function x0(i){if(/^\[/.test(i.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(i.hostname))throw new fu({input:i.href||i});if(/^\[/.test(i.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(i.host))throw new fu({input:i.href||i});return i}function mu(i,e){var t=e||{};for(var r of KT)t[r]=i[r];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 du(i,e){var t;for(var r in e)i.test(r)&&(t=e[r],delete e[r]);return t===null||typeof t>"u"?void 0:String(t).trim()}function An(i,e,t){function r(n){Vi(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=i,this.message=this.cause?e+": "+this.cause.message:e}return r.prototype=new(t||Error),Object.defineProperties(r.prototype,{constructor:{value:r,enumerable:!1},name:{value:"Error ["+i+"]",enumerable:!1}}),r}function _u(i,e){for(var t of yu)i.removeListener(t,bu[t]);i.on("error",g0),i.destroy(e)}function QT(i,e){gu($i(i)&&$i(e));var t=i.length-e.length-1;return t>0&&i[t]==="."&&i.endsWith(e)}function $i(i){return typeof i=="string"||i instanceof String}function Vi(i){return typeof i=="function"}function ek(i){return typeof i=="object"&&"length"in i}function tk(i){return Mn&&i instanceof Mn}Su.exports=v0({http:$T,https:VT});Su.exports.wrap=v0});var w0=T((gR,b0)=>{var ik=require("http"),rk=require("https"),Rn=d0(),Fo=qo(),nk=y0();Rn=Object.keys(Rn).map(function(i){return Rn[i]});var sk={http:ik,https:rk};b0.exports={deleteLength:function(e,t,r){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])},timeout:function(e,t,r){r.timeout&&e.socket.setTimeout(r.timeout)},XHeaders:function(e,t,r){if(r.xfwd){var n=e.isSpdy||Fo.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Fo.getPort(e),proto:n?"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,r,n,s,o){s.emit("start",e,t,r.target||r.forward);var c=r.followRedirects?nk:sk,u=c.http,d=c.https;if(r.forward){var f=(r.forward.protocol==="https:"?d:u).request(Fo.setupOutgoing(r.ssl||{},r,e,"forward")),v=C(f,r.forward);if(e.on("error",v),f.on("error",v),(r.buffer||e).pipe(f),!r.target)return t.end()}var _=(r.target.protocol==="https:"?d:u).request(Fo.setupOutgoing(r.ssl||{},r,e));_.on("socket",function(k){s&&!_.getHeader("expect")&&s.emit("proxyReq",_,e,t,r)}),r.proxyTimeout&&_.setTimeout(r.proxyTimeout,function(){_.abort()}),e.on("aborted",function(){_.abort()});var E=C(_,r.target);e.on("error",E),_.on("error",E);function C(k,M){return function(A){if(e.socket.destroyed&&A.code==="ECONNRESET")return s.emit("econnreset",A,e,t,M),k.abort();o?o(A,e,t,M):s.emit("error",A,e,t,M)}}(r.buffer||e).pipe(_),_.on("response",function(k){if(s&&s.emit("proxyRes",k,e,t),!t.headersSent&&!r.selfHandleResponse)for(var M=0;M<Rn.length&&!Rn[M](e,t,k,r);M++);t.finished?s&&s.emit("end",e,t,k):(k.on("end",function(){s&&s.emit("end",e,t,k)}),r.selfHandleResponse||k.pipe(t))})}}});var S0=T((xR,_0)=>{var ok=require("http"),ak=require("https"),Kr=qo();_0.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,r){if(r.xfwd){var n={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Kr.getPort(e),proto:Kr.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]?",":"")+n[s]})}},stream:function(e,t,r,n,s,o){var c=function(f,v){return Object.keys(v).reduce(function(_,E){var C=v[E];if(!Array.isArray(C))return _.push(E+": "+C),_;for(var k=0;k<C.length;k++)_.push(E+": "+C[k]);return _},[f]).join(`\r
26
+ `);if(g===-1){No("have not received end of HTTP headers yet..."),s();return}let _=h.slice(0,g).toString("ascii").split(`\r
27
+ `),S=_.shift();if(!S)return i.destroy(),t(new Error("No header received from proxy CONNECT response"));let T=S.split(" "),A=+T[1],P=T.slice(2).join(" "),R={};for(let N of _){if(!N)continue;let D=N.indexOf(":");if(D===-1)return i.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${N}"`));let K=N.slice(0,D).toLowerCase(),B=N.slice(D+1).trimStart(),U=R[K];typeof U=="string"?R[K]=[U,B]:Array.isArray(U)?U.push(B):R[K]=B}No("got proxy server response: %o %o",S,R),o(),e({connect:{statusCode:A,statusText:P,headers:R},buffered:h})}i.on("error",l),i.on("end",a),s()})}Yn.parseProxyResponse=MT});var N0=O(Bt=>{"use strict";var AT=Bt&&Bt.__createBinding||(Object.create?(function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),RT=Bt&&Bt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),P0=Bt&&Bt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&AT(e,i,t);return RT(e,i),e},I0=Bt&&Bt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.HttpsProxyAgent=void 0;var Bo=P0(require("net")),M0=P0(require("tls")),PT=I0(require("assert")),IT=I0(ue()),NT=k0(),BT=require("url"),jT=O0(),Mr=(0,IT.default)("https-proxy-agent"),A0=i=>i.servername===void 0&&i.host&&!Bo.isIP(i.host)?{...i,servername:i.host}:i,jo=class extends NT.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new BT.URL(e):e,this.proxyHeaders=t?.headers??{},Mr("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?R0(t,"headers"):null,host:n,port:r}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw new TypeError('No "host" provided');let r;n.protocol==="https:"?(Mr("Creating `tls.Socket`: %o",this.connectOpts),r=M0.connect(A0(this.connectOpts))):(Mr("Creating `net.Socket`: %o",this.connectOpts),r=Bo.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=Bo.isIPv6(t.host)?`[${t.host}]`:t.host,a=`CONNECT ${o}:${t.port} HTTP/1.1\r
28
+ `;if(n.username||n.password){let g=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(g).toString("base64")}`}s.Host=`${o}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let g of Object.keys(s))a+=`${g}: ${s[g]}\r
29
+ `;let l=(0,jT.parseProxyResponse)(r);r.write(`${a}\r
30
+ `);let{connect:p,buffered:d}=await l;if(e.emit("proxyConnect",p),this.emit("proxyConnect",p,e),p.statusCode===200)return e.once("socket",DT),t.secureEndpoint?(Mr("Upgrading socket connection to TLS"),M0.connect({...R0(A0(t),"host","path","port"),socket:r})):r;r.destroy();let h=new Bo.Socket({writable:!1});return h.readable=!0,e.once("socket",g=>{Mr("Replaying proxy buffer for failed request"),(0,PT.default)(g.listenerCount("data")>0),g.push(d),g.push(null)}),h}};jo.protocols=["http","https"];Bt.HttpsProxyAgent=jo;function DT(i){i.resume()}function R0(i,...e){let t={},n;for(n in i)e.includes(n)||(t[n]=i[n]);return t}});var q0=O((uR,L0)=>{"use strict";var j0=require("url"),D0=require("https"),LT=xu(),Do=hu(),qT=gu(),bt=Ao(),FT=fu(),B0=2419200,bu="",wu;function Ar(){}Ar.prototype.setGCMAPIKey=function(i){if(i===null){bu=null;return}if(typeof i>"u"||typeof i!="string"||i.length===0)throw new Error("The GCM API Key should be a non-empty string or null.");bu=i};Ar.prototype.setVapidDetails=function(i,e,t){if(arguments.length===1&&arguments[0]===null){wu=null;return}Do.validateSubject(i),Do.validatePublicKey(e),Do.validatePrivateKey(t),wu={subject:i,publicKey:e,privateKey:t}};Ar.prototype.generateRequestDetails=function(i,e,t){if(!i||!i.endpoint)throw new Error("You must pass in a subscription with at least an endpoint.");if(typeof i.endpoint!="string"||i.endpoint.length===0)throw new Error("The subscription endpoint must be a string with a valid URL.");if(e&&(typeof i!="object"||!i.keys||!i.keys.p256dh||!i.keys.auth))throw new Error("To send a message with a payload, the subscription must have 'auth' and 'p256dh' keys.");let n=bu,r=wu,s=B0,o={},a=bt.supportedContentEncodings.AES_128_GCM,l=bt.supportedUrgency.NORMAL,p,d,h,g;if(t){let P=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],R=Object.keys(t);for(let N=0;N<R.length;N+=1){let D=R[N];if(!P.includes(D))throw new Error("'"+D+"' is an invalid option. The valid options are ['"+P.join("', '")+"'].")}if(t.headers){o=t.headers;let N=Object.keys(o).filter(function(D){return typeof t[D]<"u"});if(N.length>0)throw new Error("Duplicated headers defined ["+N.join(",")+"]. Please either define the header in thetop level options OR in the 'headers' key.")}if(t.gcmAPIKey&&(n=t.gcmAPIKey),t.vapidDetails!==void 0&&(r=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===bt.supportedContentEncodings.AES_128_GCM||t.contentEncoding===bt.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===bt.supportedUrgency.VERY_LOW||t.urgency===bt.supportedUrgency.LOW||t.urgency===bt.supportedUrgency.NORMAL||t.urgency===bt.supportedUrgency.HIGH)l=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!FT.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");p=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?d=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 D0.Agent?(d&&console.warn("Agent option will be ignored because proxy option is defined."),h=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(g=t.timeout)}typeof s>"u"&&(s=B0);let _={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(P){_.headers[P]=o[P]});let S=null;if(e){let P=qT.encrypt(i.keys.p256dh,i.keys.auth,e,a);_.headers["Content-Length"]=P.cipherText.length,_.headers["Content-Type"]="application/octet-stream",a===bt.supportedContentEncodings.AES_128_GCM?_.headers["Content-Encoding"]=bt.supportedContentEncodings.AES_128_GCM:a===bt.supportedContentEncodings.AES_GCM&&(_.headers["Content-Encoding"]=bt.supportedContentEncodings.AES_GCM,_.headers.Encryption="salt="+P.salt,_.headers["Crypto-Key"]="dh="+P.localPublicKey.toString("base64url")),S=P.cipherText}else _.headers["Content-Length"]=0;let T=i.endpoint.startsWith("https://android.googleapis.com/gcm/send"),A=i.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(T)n?_.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(r){let P=j0.parse(i.endpoint),R=P.protocol+"//"+P.host,N=Do.getVapidHeaders(R,r.subject,r.publicKey,r.privateKey,a);_.headers.Authorization=N.Authorization,a===bt.supportedContentEncodings.AES_GCM&&(_.headers["Crypto-Key"]?_.headers["Crypto-Key"]+=";"+N["Crypto-Key"]:_.headers["Crypto-Key"]=N["Crypto-Key"])}else A&&n&&(_.headers.Authorization="key="+n);return _.headers.Urgency=l,p&&(_.headers.Topic=p),_.body=S,_.endpoint=i.endpoint,d&&(_.proxy=d),h&&(_.agent=h),g&&(_.timeout=g),_};Ar.prototype.sendNotification=function(i,e,t){let n;try{n=this.generateRequestDetails(i,e,t)}catch(r){return Promise.reject(r)}return new Promise(function(r,s){let o={},a=j0.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:p}=N0();o.agent=new p(n.proxy)}let l=D0.request(o,function(p){let d="";p.on("data",function(h){d+=h}),p.on("end",function(){p.statusCode<200||p.statusCode>299?s(new LT("Received unexpected response code",p.statusCode,p.headers,d,n.endpoint)):r({statusCode:p.statusCode,body:d,headers:p.headers})})});n.timeout&&l.on("timeout",function(){l.destroy(new Error("Socket timeout"))}),l.on("error",function(p){s(p)}),n.body&&l.write(n.body),l.end()})};L0.exports=Ar});var H0=O((pR,U0)=>{"use strict";var F0=hu(),UT=gu(),HT=q0(),zT=xu(),WT=Ao(),Rr=new HT;U0.exports={WebPushError:zT,supportedContentEncodings:WT.supportedContentEncodings,encrypt:UT.encrypt,getVapidHeaders:F0.getVapidHeaders,generateVAPIDKeys:F0.generateVAPIDKeys,setGCMAPIKey:Rr.setGCMAPIKey,setVapidDetails:Rr.setVapidDetails,generateRequestDetails:Rr.generateRequestDetails,sendNotification:Rr.sendNotification.bind(Rr)}});var Ax=O((QR,Mu)=>{"use strict";var gk=Object.prototype.hasOwnProperty,rt="~";function Br(){}Object.create&&(Br.prototype=Object.create(null),new Br().__proto__||(rt=!1));function xk(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function Mx(i,e,t,n,r){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new xk(t,n||i,r),o=rt?rt+e:e;return i._events[o]?i._events[o].fn?i._events[o]=[i._events[o],s]:i._events[o].push(s):(i._events[o]=s,i._eventsCount++),i}function Yo(i,e){--i._eventsCount===0?i._events=new Br:delete i._events[e]}function et(){this._events=new Br,this._eventsCount=0}et.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)gk.call(t,n)&&e.push(rt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};et.prototype.listeners=function(e){var t=rt?rt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o};et.prototype.listenerCount=function(e){var t=rt?rt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};et.prototype.emit=function(e,t,n,r,s,o){var a=rt?rt+e:e;if(!this._events[a])return!1;var l=this._events[a],p=arguments.length,d,h;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),p){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,r),!0;case 5:return l.fn.call(l.context,t,n,r,s),!0;case 6:return l.fn.call(l.context,t,n,r,s,o),!0}for(h=1,d=new Array(p-1);h<p;h++)d[h-1]=arguments[h];l.fn.apply(l.context,d)}else{var g=l.length,_;for(h=0;h<g;h++)switch(l[h].once&&this.removeListener(e,l[h].fn,void 0,!0),p){case 1:l[h].fn.call(l[h].context);break;case 2:l[h].fn.call(l[h].context,t);break;case 3:l[h].fn.call(l[h].context,t,n);break;case 4:l[h].fn.call(l[h].context,t,n,r);break;default:if(!d)for(_=1,d=new Array(p-1);_<p;_++)d[_-1]=arguments[_];l[h].fn.apply(l[h].context,d)}}return!0};et.prototype.on=function(e,t,n){return Mx(this,e,t,n,!1)};et.prototype.once=function(e,t,n){return Mx(this,e,t,n,!0)};et.prototype.removeListener=function(e,t,n,r){var s=rt?rt+e:e;if(!this._events[s])return this;if(!t)return Yo(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!r||o.once)&&(!n||o.context===n)&&Yo(this,s);else{for(var a=0,l=[],p=o.length;a<p;a++)(o[a].fn!==t||r&&!o[a].once||n&&o[a].context!==n)&&l.push(o[a]);l.length?this._events[s]=l.length===1?l[0]:l:Yo(this,s)}return this};et.prototype.removeAllListeners=function(e){var t;return e?(t=rt?rt+e:e,this._events[t]&&Yo(this,t)):(this._events=new Br,this._eventsCount=0),this};et.prototype.off=et.prototype.removeListener;et.prototype.addListener=et.prototype.on;et.prefixed=rt;et.EventEmitter=et;typeof Mu<"u"&&(Mu.exports=et)});var Px=O((e2,Rx)=>{"use strict";Rx.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 Xo=O(Nx=>{var hi=Nx,yk=require("url"),Ix=require("util")._extend,bk=Px(),wk=/(^|,)\s*upgrade\s*($|,)/i,Au=/^https|wss/;hi.isSSL=Au;hi.setupOutgoing=function(i,e,t,n){i.port=e[n||"target"].port||(Au.test(e[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){i[a]=e[n||"target"][a]}),i.method=e.method||t.method,i.headers=Ix({},t.headers),e.headers&&Ix(i.headers,e.headers),e.auth&&(i.auth=e.auth),e.ca&&(i.ca=e.ca),Au.test(e[n||"target"].protocol)&&(i.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),i.agent=e.agent||!1,i.localAddress=e.localAddress,i.agent||(i.headers=i.headers||{},(typeof i.headers.connection!="string"||!wk.test(i.headers.connection))&&(i.headers.connection="close"));var r=e[n||"target"],s=r&&e.prependPath!==!1&&r.path||"",o=e.toProxy?t.url:yk.parse(t.url).path||"";return o=e.ignorePath?"":o,i.path=hi.urlJoin(s,o),e.changeOrigin&&(i.headers.host=bk(i.port,e[n||"target"].protocol)&&!_k(i.host)?i.host+":"+i.port:i.host),i};hi.setupSocket=function(i){return i.setTimeout(0),i.setNoDelay(!0),i.setKeepAlive(!0,0),i};hi.getPort=function(i){var e=i.headers.host?i.headers.host.match(/:(\d+)/):"";return e?e[1]:hi.hasEncryptedConnection(i)?"443":"80"};hi.hasEncryptedConnection=function(i){return!!(i.connection.encrypted||i.connection.pair)};hi.urlJoin=function(){var i=Array.prototype.slice.call(arguments),e=i.length-1,t=i[e],n=t.split("?"),r;return i[e]=n.shift(),r=[i.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],r.push.apply(r,n),r.join("?")};hi.rewriteCookieProperty=function i(e,t,n){return Array.isArray(e)?e.map(function(r){return i(r,t,n)}):e.replace(new RegExp("(;\\s*"+n+"=)([^;]+)","i"),function(r,s,o){var a;if(o in t)a=t[o];else if("*"in t)a=t["*"];else return r;return a?s+a:""})};function _k(i){return!!~i.indexOf(":")}});var Lx=O((i2,Dx)=>{var Bx=require("url"),jx=Xo(),Sk=/^201|30(1|2|7|8)$/;Dx.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,r){if((r.hostRewrite||r.autoRewrite||r.protocolRewrite)&&n.headers.location&&Sk.test(n.statusCode)){var s=Bx.parse(r.target),o=Bx.parse(n.headers.location);if(s.host!=o.host)return;r.hostRewrite?o.host=r.hostRewrite:r.autoRewrite&&(o.host=e.headers.host),r.protocolRewrite&&(o.protocol=r.protocolRewrite),n.headers.location=o.format()}},writeHeaders:function(e,t,n,r){var s=r.cookieDomainRewrite,o=r.cookiePathRewrite,a=r.preserveHeaderKeyCase,l,p=function(g,_){_!=null&&(s&&g.toLowerCase()==="set-cookie"&&(_=jx.rewriteCookieProperty(_,s,"domain")),o&&g.toLowerCase()==="set-cookie"&&(_=jx.rewriteCookieProperty(_,o,"path")),t.setHeader(String(g).trim(),_))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){l={};for(var d=0;d<n.rawHeaders.length;d+=2){var h=n.rawHeaders[d];l[h.toLowerCase()]=h}}Object.keys(n.headers).forEach(function(g){var _=n.headers[g];a&&l&&(g=l[g]||g),p(g,_)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var Fx=O((n2,qx)=>{var jr;qx.exports=function(){if(!jr){try{jr=ue()("follow-redirects")}catch{}typeof jr!="function"&&(jr=function(){})}jr.apply(null,arguments)}});var $x=O((r2,Hu)=>{var Lr=require("url"),Dr=Lr.URL,Ek=require("http"),Ck=require("https"),Bu=require("stream").Writable,ju=require("assert"),Ux=Fx();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=Zi(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var Du=!1;try{ju(new Dr(""))}catch(i){Du=i.code==="ERR_INVALID_URL"}var Tk=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Lu=["abort","aborted","connect","error","socket","timeout"],qu=Object.create(null);Lu.forEach(function(i){qu[i]=function(e,t,n){this._redirectable.emit(i,e,t,n)}});var Pu=qr("ERR_INVALID_URL","Invalid URL",TypeError),Iu=qr("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),kk=qr("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Iu),Ok=qr("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Mk=qr("ERR_STREAM_WRITE_AFTER_END","write after end"),Ak=Bu.prototype.destroy||zx;function ft(i,e){Bu.call(this),this._sanitizeOptions(i),this._options=i,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(r){t.emit("error",r instanceof Iu?r:new Iu({cause:r}))}},this._performRequest()}ft.prototype=Object.create(Bu.prototype);ft.prototype.abort=function(){Uu(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};ft.prototype.destroy=function(i){return Uu(this._currentRequest,i),Ak.call(this,i),this};ft.prototype.write=function(i,e,t){if(this._ending)throw new Mk;if(!Xi(i)&&!Ik(i))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Zi(e)&&(t=e,e=null),i.length===0){t&&t();return}this._requestBodyLength+i.length<=this._options.maxBodyLength?(this._requestBodyLength+=i.length,this._requestBodyBuffers.push({data:i,encoding:e}),this._currentRequest.write(i,e,t)):(this.emit("error",new Ok),this.abort())};ft.prototype.end=function(i,e,t){if(Zi(i)?(t=i,i=e=null):Zi(e)&&(t=e,e=null),!i)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,r=this._currentRequest;this.write(i,e,function(){n._ended=!0,r.end(null,null,t)}),this._ending=!0}};ft.prototype.setHeader=function(i,e){this._options.headers[i]=e,this._currentRequest.setHeader(i,e)};ft.prototype.removeHeader=function(i){delete this._options.headers[i],this._currentRequest.removeHeader(i)};ft.prototype.setTimeout=function(i,e){var t=this;function n(o){o.setTimeout(i),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function r(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},i),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",r)}return e&&this.on("timeout",e),this.socket?r(this.socket):this._currentRequest.once("socket",r),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(i){ft.prototype[i]=function(e,t){return this._currentRequest[i](e,t)}});["aborted","connection","socket"].forEach(function(i){Object.defineProperty(ft.prototype,i,{get:function(){return this._currentRequest[i]}})});ft.prototype._sanitizeOptions=function(i){if(i.headers||(i.headers={}),i.host&&(i.hostname||(i.hostname=i.host),delete i.host),!i.pathname&&i.path){var e=i.path.indexOf("?");e<0?i.pathname=i.path:(i.pathname=i.path.substring(0,e),i.search=i.path.substring(e))}};ft.prototype._performRequest=function(){var i=this._options.protocol,e=this._options.nativeProtocols[i];if(!e)throw new TypeError("Unsupported protocol "+i);if(this._options.agents){var t=i.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 r of Lu)n.on(r,qu[r]);if(this._currentUrl=/^\//.test(this._options.path)?Lr.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function l(p){if(n===o._currentRequest)if(p)o.emit("error",p);else if(s<a.length){var d=a[s++];n.finished||n.write(d.data,d.encoding,l)}else o._ended&&n.end()})()}};ft.prototype._processResponse=function(i){var e=i.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:i.headers,statusCode:e});var t=i.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){i.responseUrl=this._currentUrl,i.redirects=this._redirects,this.emit("response",i),this._requestBodyBuffers=[];return}if(Uu(this._currentRequest),i.destroy(),++this._redirectCount>this._options.maxRedirects)throw new kk;var n,r=this._options.beforeRedirect;r&&(n=Object.assign({Host:i.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=[],Ru(/^content-/i,this._options.headers));var o=Ru(/^host$/i,this._options.headers),a=Fu(this._currentUrl),l=o||a.host,p=/^\w+:/.test(t)?this._currentUrl:Lr.format(Object.assign(a,{host:l})),d=Rk(t,p);if(Ux("redirecting to",d.href),this._isRedirect=!0,Nu(d,this._options),(d.protocol!==a.protocol&&d.protocol!=="https:"||d.host!==l&&!Pk(d.host,l))&&Ru(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Zi(r)){var h={headers:i.headers,statusCode:e},g={url:p,method:s,headers:n};r(this._options,h,g),this._sanitizeOptions(this._options)}this._performRequest()};function Hx(i){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(i).forEach(function(n){var r=n+":",s=t[r]=i[n],o=e[n]=Object.create(s);function a(p,d,h){return Nk(p)?p=Nu(p):Xi(p)?p=Nu(Fu(p)):(h=d,d=Wx(p),p={protocol:r}),Zi(d)&&(h=d,d=null),d=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},p,d),d.nativeProtocols=t,!Xi(d.host)&&!Xi(d.hostname)&&(d.hostname="::1"),ju.equal(d.protocol,r,"protocol mismatch"),Ux("options",d),new ft(d,h)}function l(p,d,h){var g=o.request(p,d,h);return g.end(),g}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:l,configurable:!0,enumerable:!0,writable:!0}})}),e}function zx(){}function Fu(i){var e;if(Du)e=new Dr(i);else if(e=Wx(Lr.parse(i)),!Xi(e.protocol))throw new Pu({input:i});return e}function Rk(i,e){return Du?new Dr(i,e):Fu(Lr.resolve(e,i))}function Wx(i){if(/^\[/.test(i.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(i.hostname))throw new Pu({input:i.href||i});if(/^\[/.test(i.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(i.host))throw new Pu({input:i.href||i});return i}function Nu(i,e){var t=e||{};for(var n of Tk)t[n]=i[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 Ru(i,e){var t;for(var n in e)i.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}function qr(i,e,t){function n(r){Zi(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,r||{}),this.code=i,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 ["+i+"]",enumerable:!1}}),n}function Uu(i,e){for(var t of Lu)i.removeListener(t,qu[t]);i.on("error",zx),i.destroy(e)}function Pk(i,e){ju(Xi(i)&&Xi(e));var t=i.length-e.length-1;return t>0&&i[t]==="."&&i.endsWith(e)}function Xi(i){return typeof i=="string"||i instanceof String}function Zi(i){return typeof i=="function"}function Ik(i){return typeof i=="object"&&"length"in i}function Nk(i){return Dr&&i instanceof Dr}Hu.exports=Hx({http:Ek,https:Ck});Hu.exports.wrap=Hx});var Vx=O((s2,Kx)=>{var Bk=require("http"),jk=require("https"),Fr=Lx(),Zo=Xo(),Dk=$x();Fr=Object.keys(Fr).map(function(i){return Fr[i]});var Lk={http:Bk,https:jk};Kx.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 r=e.isSpdy||Zo.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Zo.getPort(e),proto:r?"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,r,s,o){s.emit("start",e,t,n.target||n.forward);var a=n.followRedirects?Dk:Lk,l=a.http,p=a.https;if(n.forward){var d=(n.forward.protocol==="https:"?p:l).request(Zo.setupOutgoing(n.ssl||{},n,e,"forward")),h=S(d,n.forward);if(e.on("error",h),d.on("error",h),(n.buffer||e).pipe(d),!n.target)return t.end()}var g=(n.target.protocol==="https:"?p:l).request(Zo.setupOutgoing(n.ssl||{},n,e));g.on("socket",function(T){s&&!g.getHeader("expect")&&s.emit("proxyReq",g,e,t,n)}),n.proxyTimeout&&g.setTimeout(n.proxyTimeout,function(){g.abort()}),e.on("aborted",function(){g.abort()});var _=S(g,n.target);e.on("error",_),g.on("error",_);function S(T,A){return function(R){if(e.socket.destroyed&&R.code==="ECONNRESET")return s.emit("econnreset",R,e,t,A),T.abort();o?o(R,e,t,A):s.emit("error",R,e,t,A)}}(n.buffer||e).pipe(g),g.on("response",function(T){if(s&&s.emit("proxyRes",T,e,t),!t.headersSent&&!n.selfHandleResponse)for(var A=0;A<Fr.length&&!Fr[A](e,t,T,n);A++);t.finished?s&&s.emit("end",e,t,T):(T.on("end",function(){s&&s.emit("end",e,t,T)}),n.selfHandleResponse||T.pipe(t))})}}});var Jx=O((o2,Gx)=>{var qk=require("http"),Fk=require("https"),ir=Xo();Gx.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 r={for:e.connection.remoteAddress||e.socket.remoteAddress,port:ir.getPort(e),proto:ir.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]?",":"")+r[s]})}},stream:function(e,t,n,r,s,o){var a=function(d,h){return Object.keys(h).reduce(function(g,_){var S=h[_];if(!Array.isArray(S))return g.push(_+": "+S),g;for(var T=0;T<S.length;T++)g.push(_+": "+S[T]);return g},[d]).join(`\r
31
31
  `)+`\r
32
32
  \r
33
- `};Kr.setupSocket(t),n&&n.length&&t.unshift(n);var u=(Kr.isSSL.test(r.target.protocol)?ak:ok).request(Kr.setupOutgoing(r.ssl||{},r,e));return s&&s.emit("proxyReqWs",u,e,t,r,n),u.on("error",d),u.on("response",function(f){f.upgrade||(t.write(c("HTTP/"+f.httpVersion+" "+f.statusCode+" "+f.statusMessage,f.headers)),f.pipe(t))}),u.on("upgrade",function(f,v,_){v.on("error",d),v.on("end",function(){s.emit("close",f,v,_)}),t.on("error",function(){v.end()}),Kr.setupSocket(v),_&&_.length&&v.unshift(_),t.write(c("HTTP/1.1 101 Switching Protocols",f.headers)),v.pipe(t).pipe(v),s.emit("open",v),s.emit("proxySocket",v)}),u.end();function d(f){o?o(f,e,t):s.emit("error",f,e,t),t.end()}}}});var A0=T((yR,O0)=>{var k0=O0.exports,E0=require("util")._extend,ck=require("url").parse,M0=n0(),lk=require("http"),uk=require("https"),C0=w0(),T0=S0();k0.Server=Ki;function Eu(i){return function(e){return function(t,r){var n=i==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,c,u;typeof s[o]=="function"&&(u=s[o],o--);var d=e;if(!(s[o]instanceof Buffer)&&s[o]!==r&&(d=E0({},e),E0(d,s[o]),o--),s[o]instanceof Buffer&&(c=s[o]),["target","forward"].forEach(function(v){typeof d[v]=="string"&&(d[v]=ck(d[v]))}),!d.target&&!d.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var f=0;f<n.length&&!n[f](t,r,d,c,this,u);f++);}}}k0.createRightProxy=Eu;function Ki(i){M0.call(this),i=i||{},i.prependPath=i.prependPath!==!1,this.web=this.proxyRequest=Eu("web")(i),this.ws=this.proxyWebsocketRequest=Eu("ws")(i),this.options=i,this.webPasses=Object.keys(C0).map(function(e){return C0[e]}),this.wsPasses=Object.keys(T0).map(function(e){return T0[e]}),this.on("error",this.onError,this)}require("util").inherits(Ki,M0);Ki.prototype.onError=function(i){if(this.listeners("error").length===1)throw i};Ki.prototype.listen=function(i,e){var t=this,r=function(n,s){t.web(n,s)};return this._server=this.options.ssl?uk.createServer(this.options.ssl,r):lk.createServer(r),this.options.ws&&this._server.on("upgrade",function(n,s,o){t.ws(n,s,o)}),this._server.listen(i,e),this};Ki.prototype.close=function(i){var e=this;this._server&&this._server.close(t);function t(){e._server=null,i&&i.apply(null,arguments)}};Ki.prototype.before=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var r=i==="ws"?this.wsPasses:this.webPasses,n=!1;if(r.forEach(function(s,o){s.name===e&&(n=o)}),n===!1)throw new Error("No such pass");r.splice(n,0,t)};Ki.prototype.after=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var r=i==="ws"?this.wsPasses:this.webPasses,n=!1;if(r.forEach(function(s,o){s.name===e&&(n=o)}),n===!1)throw new Error("No such pass");r.splice(n++,0,t)}});var P0=T((bR,R0)=>{var Pn=A0().Server;function Cu(i){return new Pn(i)}Pn.createProxyServer=Cu;Pn.createServer=Cu;Pn.createProxy=Cu;R0.exports=Pn});var N0=T((wR,B0)=>{B0.exports=P0()});var Ak={};Ei(Ak,{startServer:()=>X0});module.exports=ry(Ak);var zo=require("http"),K0=require("url"),G0=require("child_process"),Gi=require("fs"),Ft=require("path"),Y0=require("url");var Uh=L(Fh(),1),{Server:Hh,Namespace:rO,Socket:nO}=Uh.default;var Hx=require("fs"),zx=require("path"),Wx=require("os");var zh=(i=0)=>e=>`\x1B[${e+i}m`,Wh=(i=0)=>e=>`\x1B[${38+i};5;${e}m`,$h=(i=0)=>(e,t,r)=>`\x1B[${38+i};2;${e};${t};${r}m`,X={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]}},oO=Object.keys(X.modifier),C1=Object.keys(X.color),T1=Object.keys(X.bgColor),aO=[...C1,...T1];function k1(){let i=new Map;for(let[e,t]of Object.entries(X)){for(let[r,n]of Object.entries(t))X[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[r]=X[r],i.set(n[0],n[1]);Object.defineProperty(X,e,{value:t,enumerable:!1})}return Object.defineProperty(X,"codes",{value:i,enumerable:!1}),X.color.close="\x1B[39m",X.bgColor.close="\x1B[49m",X.color.ansi=zh(),X.color.ansi256=Wh(),X.color.ansi16m=$h(),X.bgColor.ansi=zh(10),X.bgColor.ansi256=Wh(10),X.bgColor.ansi16m=$h(10),Object.defineProperties(X,{rgbToAnsi256:{value(e,t,r){return e===t&&t===r?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(r/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[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>X.rgbToAnsi256(...X.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,n;if(e>=232)t=((e-232)*10+8)/255,r=t,n=t;else{e-=16;let c=e%36;t=Math.floor(e/36)/5,r=Math.floor(c/6)/5,n=c%6/5}let s=Math.max(t,r,n)*2;if(s===0)return 30;let o=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>X.ansi256ToAnsi(X.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>X.ansi256ToAnsi(X.hexToAnsi256(e)),enumerable:!1}}),X}var M1=k1(),It=M1;var qs=L(require("node:process"),1),Kh=L(require("node:os"),1),Qc=L(require("node:tty"),1);function _t(i,e=globalThis.Deno?globalThis.Deno.args:qs.default.argv){let t=i.startsWith("-")?"":i.length===1?"-":"--",r=e.indexOf(t+i),n=e.indexOf("--");return r!==-1&&(n===-1||r<n)}var{env:Z}=qs.default,Ls;_t("no-color")||_t("no-colors")||_t("color=false")||_t("color=never")?Ls=0:(_t("color")||_t("colors")||_t("color=true")||_t("color=always"))&&(Ls=1);function O1(){if("FORCE_COLOR"in Z)return Z.FORCE_COLOR==="true"?1:Z.FORCE_COLOR==="false"?0:Z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Z.FORCE_COLOR,10),3)}function A1(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function R1(i,{streamIsTTY:e,sniffFlags:t=!0}={}){let r=O1();r!==void 0&&(Ls=r);let n=t?Ls:r;if(n===0)return 0;if(t){if(_t("color=16m")||_t("color=full")||_t("color=truecolor"))return 3;if(_t("color=256"))return 2}if("TF_BUILD"in Z&&"AGENT_NAME"in Z)return 1;if(i&&!e&&n===void 0)return 0;let s=n||0;if(Z.TERM==="dumb")return s;if(qs.default.platform==="win32"){let o=Kh.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Z)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in Z)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Z)||Z.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Z.TEAMCITY_VERSION)?1:0;if(Z.COLORTERM==="truecolor"||Z.TERM==="xterm-kitty"||Z.TERM==="xterm-ghostty"||Z.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Z){let o=Number.parseInt((Z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Z.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Z.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Z.TERM)||"COLORTERM"in Z?1:s}function Vh(i,e={}){let t=R1(i,{streamIsTTY:i&&i.isTTY,...e});return A1(t)}var P1={stdout:Vh({isTTY:Qc.default.isatty(1)}),stderr:Vh({isTTY:Qc.default.isatty(2)})},Gh=P1;function Yh(i,e,t){let r=i.indexOf(e);if(r===-1)return i;let n=e.length,s=0,o="";do o+=i.slice(s,r)+e+t,s=r+n,r=i.indexOf(e,s);while(r!==-1);return o+=i.slice(s),o}function Jh(i,e,t,r){let n=0,s="";do{let o=i[r-1]==="\r";s+=i.slice(n,o?r-1:r)+e+(o?`\r
33
+ `};ir.setupSocket(t),r&&r.length&&t.unshift(r);var l=(ir.isSSL.test(n.target.protocol)?Fk:qk).request(ir.setupOutgoing(n.ssl||{},n,e));return s&&s.emit("proxyReqWs",l,e,t,n,r),l.on("error",p),l.on("response",function(d){d.upgrade||(t.write(a("HTTP/"+d.httpVersion+" "+d.statusCode+" "+d.statusMessage,d.headers)),d.pipe(t))}),l.on("upgrade",function(d,h,g){h.on("error",p),h.on("end",function(){s.emit("close",d,h,g)}),t.on("error",function(){h.end()}),ir.setupSocket(h),g&&g.length&&h.unshift(g),t.write(a("HTTP/1.1 101 Switching Protocols",d.headers)),h.pipe(t).pipe(h),s.emit("open",h),s.emit("proxySocket",h)}),l.end();function p(d){o?o(d,e,t):s.emit("error",d,e,t),t.end()}}}});var iy=O((a2,ty)=>{var Qx=ty.exports,Yx=require("util")._extend,Uk=require("url").parse,ey=Ax(),Hk=require("http"),zk=require("https"),Xx=Vx(),Zx=Jx();Qx.Server=Qi;function zu(i){return function(e){return function(t,n){var r=i==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,a,l;typeof s[o]=="function"&&(l=s[o],o--);var p=e;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(p=Yx({},e),Yx(p,s[o]),o--),s[o]instanceof Buffer&&(a=s[o]),["target","forward"].forEach(function(h){typeof p[h]=="string"&&(p[h]=Uk(p[h]))}),!p.target&&!p.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var d=0;d<r.length&&!r[d](t,n,p,a,this,l);d++);}}}Qx.createRightProxy=zu;function Qi(i){ey.call(this),i=i||{},i.prependPath=i.prependPath!==!1,this.web=this.proxyRequest=zu("web")(i),this.ws=this.proxyWebsocketRequest=zu("ws")(i),this.options=i,this.webPasses=Object.keys(Xx).map(function(e){return Xx[e]}),this.wsPasses=Object.keys(Zx).map(function(e){return Zx[e]}),this.on("error",this.onError,this)}require("util").inherits(Qi,ey);Qi.prototype.onError=function(i){if(this.listeners("error").length===1)throw i};Qi.prototype.listen=function(i,e){var t=this,n=function(r,s){t.web(r,s)};return this._server=this.options.ssl?zk.createServer(this.options.ssl,n):Hk.createServer(n),this.options.ws&&this._server.on("upgrade",function(r,s,o){t.ws(r,s,o)}),this._server.listen(i,e),this};Qi.prototype.close=function(i){var e=this;this._server&&this._server.close(t);function t(){e._server=null,i&&i.apply(null,arguments)}};Qi.prototype.before=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var n=i==="ws"?this.wsPasses:this.webPasses,r=!1;if(n.forEach(function(s,o){s.name===e&&(r=o)}),r===!1)throw new Error("No such pass");n.splice(r,0,t)};Qi.prototype.after=function(i,e,t){if(i!=="ws"&&i!=="web")throw new Error("type must be `web` or `ws`");var n=i==="ws"?this.wsPasses:this.webPasses,r=!1;if(n.forEach(function(s,o){s.name===e&&(r=o)}),r===!1)throw new Error("No such pass");n.splice(r++,0,t)}});var ry=O((c2,ny)=>{var Ur=iy().Server;function Wu(i){return new Ur(i)}Ur.createProxyServer=Wu;Ur.createServer=Wu;Ur.createProxy=Wu;ny.exports=Ur});var oy=O((l2,sy)=>{sy.exports=ry()});var yy=O((Wr,Yu)=>{(function(i,e){typeof Wr=="object"&&typeof Yu=="object"?Yu.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof Wr=="object"?Wr["electron-machine-id"]=e(require("child_process"),require("crypto")):i["electron-machine-id"]=e(i.child_process,i.crypto)})(Wr,function(i,e){return(function(t){function n(s){if(r[s])return r[s].exports;var o=r[s]={exports:{},id:s,loaded:!1};return t[s].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)})([function(t,n,r){t.exports=r(34)},function(t,n,r){var s=r(29)("wks"),o=r(33),a=r(2).Symbol,l=typeof a=="function",p=t.exports=function(d){return s[d]||(s[d]=l&&a[d]||(l?a:o)("Symbol."+d))};p.store=s},function(t,n){var r=t.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=r)},function(t,n,r){var s=r(9);t.exports=function(o){if(!s(o))throw TypeError(o+" is not an object!");return o}},function(t,n,r){t.exports=!r(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(t,n,r){var s=r(12),o=r(17);t.exports=r(4)?function(a,l,p){return s.f(a,l,o(1,p))}:function(a,l,p){return a[l]=p,a}},function(t,n){var r=t.exports={version:"2.4.0"};typeof __e=="number"&&(__e=r)},function(t,n,r){var s=r(14);t.exports=function(o,a,l){if(s(o),a===void 0)return o;switch(l){case 1:return function(p){return o.call(a,p)};case 2:return function(p,d){return o.call(a,p,d)};case 3:return function(p,d,h){return o.call(a,p,d,h)}}return function(){return o.apply(a,arguments)}}},function(t,n){var r={}.hasOwnProperty;t.exports=function(s,o){return r.call(s,o)}},function(t,n){t.exports=function(r){return typeof r=="object"?r!==null:typeof r=="function"}},function(t,n){t.exports={}},function(t,n){var r={}.toString;t.exports=function(s){return r.call(s).slice(8,-1)}},function(t,n,r){var s=r(3),o=r(26),a=r(32),l=Object.defineProperty;n.f=r(4)?Object.defineProperty:function(p,d,h){if(s(p),d=a(d,!0),s(h),o)try{return l(p,d,h)}catch{}if("get"in h||"set"in h)throw TypeError("Accessors not supported!");return"value"in h&&(p[d]=h.value),p}},function(t,n,r){var s=r(42),o=r(15);t.exports=function(a){return s(o(a))}},function(t,n){t.exports=function(r){if(typeof r!="function")throw TypeError(r+" is not a function!");return r}},function(t,n){t.exports=function(r){if(r==null)throw TypeError("Can't call method on "+r);return r}},function(t,n,r){var s=r(9),o=r(2).document,a=s(o)&&s(o.createElement);t.exports=function(l){return a?o.createElement(l):{}}},function(t,n){t.exports=function(r,s){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:s}}},function(t,n,r){var s=r(12).f,o=r(8),a=r(1)("toStringTag");t.exports=function(l,p,d){l&&!o(l=d?l:l.prototype,a)&&s(l,a,{configurable:!0,value:p})}},function(t,n,r){var s=r(29)("keys"),o=r(33);t.exports=function(a){return s[a]||(s[a]=o(a))}},function(t,n){var r=Math.ceil,s=Math.floor;t.exports=function(o){return isNaN(o=+o)?0:(o>0?s:r)(o)}},function(t,n,r){var s=r(11),o=r(1)("toStringTag"),a=s((function(){return arguments})())=="Arguments",l=function(p,d){try{return p[d]}catch{}};t.exports=function(p){var d,h,g;return p===void 0?"Undefined":p===null?"Null":typeof(h=l(d=Object(p),o))=="string"?h:a?s(d):(g=s(d))=="Object"&&typeof d.callee=="function"?"Arguments":g}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,r){var s=r(2),o=r(6),a=r(7),l=r(5),p="prototype",d=function(h,g,_){var S,T,A,P=h&d.F,R=h&d.G,N=h&d.S,D=h&d.P,K=h&d.B,B=h&d.W,U=R?o:o[g]||(o[g]={}),L=U[p],$=R?s:N?s[g]:(s[g]||{})[p];R&&(_=g);for(S in _)T=!P&&$&&$[S]!==void 0,T&&S in U||(A=T?$[S]:_[S],U[S]=R&&typeof $[S]!="function"?_[S]:K&&T?a(A,s):B&&$[S]==A?(function(w){var c=function(f,m,v){if(this instanceof w){switch(arguments.length){case 0:return new w;case 1:return new w(f);case 2:return new w(f,m)}return new w(f,m,v)}return w.apply(this,arguments)};return c[p]=w[p],c})(A):D&&typeof A=="function"?a(Function.call,A):A,D&&((U.virtual||(U.virtual={}))[S]=A,h&d.R&&L&&!L[S]&&l(L,S,A)))};d.F=1,d.G=2,d.S=4,d.P=8,d.B=16,d.W=32,d.U=64,d.R=128,t.exports=d},function(t,n){t.exports=function(r){try{return!!r()}catch{return!0}}},function(t,n,r){t.exports=r(2).document&&document.documentElement},function(t,n,r){t.exports=!r(4)&&!r(24)(function(){return Object.defineProperty(r(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(t,n,r){"use strict";var s=r(28),o=r(23),a=r(57),l=r(5),p=r(8),d=r(10),h=r(45),g=r(18),_=r(52),S=r(1)("iterator"),T=!([].keys&&"next"in[].keys()),A="@@iterator",P="keys",R="values",N=function(){return this};t.exports=function(D,K,B,U,L,$,w){h(B,K,U);var c,f,m,v=function(M){if(!T&&M in x)return x[M];switch(M){case P:return function(){return new B(this,M)};case R:return function(){return new B(this,M)}}return function(){return new B(this,M)}},b=K+" Iterator",E=L==R,C=!1,x=D.prototype,u=x[S]||x[A]||L&&x[L],y=u||v(L),j=L?E?v("entries"):y:void 0,k=K=="Array"&&x.entries||u;if(k&&(m=_(k.call(new D)),m!==Object.prototype&&(g(m,b,!0),s||p(m,S)||l(m,S,N))),E&&u&&u.name!==R&&(C=!0,y=function(){return u.call(this)}),s&&!w||!T&&!C&&x[S]||l(x,S,y),d[K]=y,d[b]=N,L)if(c={values:E?y:v(R),keys:$?y:v(P),entries:j},w)for(f in c)f in x||a(x,f,c[f]);else o(o.P+o.F*(T||C),K,c);return c}},function(t,n){t.exports=!0},function(t,n,r){var s=r(2),o="__core-js_shared__",a=s[o]||(s[o]={});t.exports=function(l){return a[l]||(a[l]={})}},function(t,n,r){var s,o,a,l=r(7),p=r(41),d=r(25),h=r(16),g=r(2),_=g.process,S=g.setImmediate,T=g.clearImmediate,A=g.MessageChannel,P=0,R={},N="onreadystatechange",D=function(){var B=+this;if(R.hasOwnProperty(B)){var U=R[B];delete R[B],U()}},K=function(B){D.call(B.data)};S&&T||(S=function(B){for(var U=[],L=1;arguments.length>L;)U.push(arguments[L++]);return R[++P]=function(){p(typeof B=="function"?B:Function(B),U)},s(P),P},T=function(B){delete R[B]},r(11)(_)=="process"?s=function(B){_.nextTick(l(D,B,1))}:A?(o=new A,a=o.port2,o.port1.onmessage=K,s=l(a.postMessage,a,1)):g.addEventListener&&typeof postMessage=="function"&&!g.importScripts?(s=function(B){g.postMessage(B+"","*")},g.addEventListener("message",K,!1)):s=N in h("script")?function(B){d.appendChild(h("script"))[N]=function(){d.removeChild(this),D.call(B)}}:function(B){setTimeout(l(D,B,1),0)}),t.exports={set:S,clear:T}},function(t,n,r){var s=r(20),o=Math.min;t.exports=function(a){return a>0?o(s(a),9007199254740991):0}},function(t,n,r){var s=r(9);t.exports=function(o,a){if(!s(o))return o;var l,p;if(a&&typeof(l=o.toString)=="function"&&!s(p=l.call(o))||typeof(l=o.valueOf)=="function"&&!s(p=l.call(o))||!a&&typeof(l=o.toString)=="function"&&!s(p=l.call(o)))return p;throw TypeError("Can't convert object to primitive value")}},function(t,n){var r=0,s=Math.random();t.exports=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++r+s).toString(36))}},function(t,n,r){"use strict";function s(N){return N&&N.__esModule?N:{default:N}}function o(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(N){return(0,S.createHash)("sha256").update(N).digest("hex")}function l(N){switch(A){case"darwin":return N.split("IOPlatformUUID")[1].split(`
34
+ `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return N.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return N.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return N.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function p(N){var D=l((0,_.execSync)(R[A]).toString());return N?D:a(D)}function d(N){return new g.default(function(D,K){return(0,_.exec)(R[A],{},function(B,U,L){if(B)return K(new Error("Error while obtaining machine id: "+B.stack));var $=l(U.toString());return D(N?$:a($))})})}Object.defineProperty(n,"__esModule",{value:!0});var h=r(35),g=s(h);n.machineIdSync=p,n.machineId=d;var _=r(70),S=r(71),T=process,A=T.platform,P={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},R={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:P[o()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(t,n,r){t.exports={default:r(36),__esModule:!0}},function(t,n,r){r(66),r(68),r(69),r(67),t.exports=r(6).Promise},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(r,s,o,a){if(!(r instanceof s)||a!==void 0&&a in r)throw TypeError(o+": incorrect invocation!");return r}},function(t,n,r){var s=r(13),o=r(31),a=r(62);t.exports=function(l){return function(p,d,h){var g,_=s(p),S=o(_.length),T=a(h,S);if(l&&d!=d){for(;S>T;)if(g=_[T++],g!=g)return!0}else for(;S>T;T++)if((l||T in _)&&_[T]===d)return l||T||0;return!l&&-1}}},function(t,_,r){var s=r(7),o=r(44),a=r(43),l=r(3),p=r(31),d=r(64),h={},g={},_=t.exports=function(S,T,A,P,R){var N,D,K,B,U=R?function(){return S}:d(S),L=s(A,P,T?2:1),$=0;if(typeof U!="function")throw TypeError(S+" is not iterable!");if(a(U)){for(N=p(S.length);N>$;$++)if(B=T?L(l(D=S[$])[0],D[1]):L(S[$]),B===h||B===g)return B}else for(K=U.call(S);!(D=K.next()).done;)if(B=o(K,L,D.value,T),B===h||B===g)return B};_.BREAK=h,_.RETURN=g},function(t,n){t.exports=function(r,s,o){var a=o===void 0;switch(s.length){case 0:return a?r():r.call(o);case 1:return a?r(s[0]):r.call(o,s[0]);case 2:return a?r(s[0],s[1]):r.call(o,s[0],s[1]);case 3:return a?r(s[0],s[1],s[2]):r.call(o,s[0],s[1],s[2]);case 4:return a?r(s[0],s[1],s[2],s[3]):r.call(o,s[0],s[1],s[2],s[3])}return r.apply(o,s)}},function(t,n,r){var s=r(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(o){return s(o)=="String"?o.split(""):Object(o)}},function(t,n,r){var s=r(10),o=r(1)("iterator"),a=Array.prototype;t.exports=function(l){return l!==void 0&&(s.Array===l||a[o]===l)}},function(t,n,r){var s=r(3);t.exports=function(o,a,l,p){try{return p?a(s(l)[0],l[1]):a(l)}catch(h){var d=o.return;throw d!==void 0&&s(d.call(o)),h}}},function(t,n,r){"use strict";var s=r(49),o=r(17),a=r(18),l={};r(5)(l,r(1)("iterator"),function(){return this}),t.exports=function(p,d,h){p.prototype=s(l,{next:o(1,h)}),a(p,d+" Iterator")}},function(t,n,r){var s=r(1)("iterator"),o=!1;try{var a=[7][s]();a.return=function(){o=!0},Array.from(a,function(){throw 2})}catch{}t.exports=function(l,p){if(!p&&!o)return!1;var d=!1;try{var h=[7],g=h[s]();g.next=function(){return{done:d=!0}},h[s]=function(){return g},l(h)}catch{}return d}},function(t,n){t.exports=function(r,s){return{value:s,done:!!r}}},function(t,n,r){var s=r(2),o=r(30).set,a=s.MutationObserver||s.WebKitMutationObserver,l=s.process,p=s.Promise,d=r(11)(l)=="process";t.exports=function(){var h,g,_,S=function(){var R,N;for(d&&(R=l.domain)&&R.exit();h;){N=h.fn,h=h.next;try{N()}catch(D){throw h?_():g=void 0,D}}g=void 0,R&&R.enter()};if(d)_=function(){l.nextTick(S)};else if(a){var T=!0,A=document.createTextNode("");new a(S).observe(A,{characterData:!0}),_=function(){A.data=T=!T}}else if(p&&p.resolve){var P=p.resolve();_=function(){P.then(S)}}else _=function(){o.call(s,S)};return function(R){var N={fn:R,next:void 0};g&&(g.next=N),h||(h=N,_()),g=N}}},function(t,n,r){var s=r(3),o=r(50),a=r(22),l=r(19)("IE_PROTO"),p=function(){},d="prototype",h=function(){var g,_=r(16)("iframe"),S=a.length,T=">";for(_.style.display="none",r(25).appendChild(_),_.src="javascript:",g=_.contentWindow.document,g.open(),g.write("<script>document.F=Object</script"+T),g.close(),h=g.F;S--;)delete h[d][a[S]];return h()};t.exports=Object.create||function(g,_){var S;return g!==null?(p[d]=s(g),S=new p,p[d]=null,S[l]=g):S=h(),_===void 0?S:o(S,_)}},function(t,n,r){var s=r(12),o=r(3),a=r(54);t.exports=r(4)?Object.defineProperties:function(l,p){o(l);for(var d,h=a(p),g=h.length,_=0;g>_;)s.f(l,d=h[_++],p[d]);return l}},function(t,n,r){var s=r(55),o=r(17),a=r(13),l=r(32),p=r(8),d=r(26),h=Object.getOwnPropertyDescriptor;n.f=r(4)?h:function(g,_){if(g=a(g),_=l(_,!0),d)try{return h(g,_)}catch{}if(p(g,_))return o(!s.f.call(g,_),g[_])}},function(t,n,r){var s=r(8),o=r(63),a=r(19)("IE_PROTO"),l=Object.prototype;t.exports=Object.getPrototypeOf||function(p){return p=o(p),s(p,a)?p[a]:typeof p.constructor=="function"&&p instanceof p.constructor?p.constructor.prototype:p instanceof Object?l:null}},function(t,n,r){var s=r(8),o=r(13),a=r(39)(!1),l=r(19)("IE_PROTO");t.exports=function(p,d){var h,g=o(p),_=0,S=[];for(h in g)h!=l&&s(g,h)&&S.push(h);for(;d.length>_;)s(g,h=d[_++])&&(~a(S,h)||S.push(h));return S}},function(t,n,r){var s=r(53),o=r(22);t.exports=Object.keys||function(a){return s(a,o)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,r){var s=r(5);t.exports=function(o,a,l){for(var p in a)l&&o[p]?o[p]=a[p]:s(o,p,a[p]);return o}},function(t,n,r){t.exports=r(5)},function(t,n,r){var s=r(9),o=r(3),a=function(l,p){if(o(l),!s(p)&&p!==null)throw TypeError(p+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(l,p,d){try{d=r(7)(Function.call,r(51).f(Object.prototype,"__proto__").set,2),d(l,[]),p=!(l instanceof Array)}catch{p=!0}return function(h,g){return a(h,g),p?h.__proto__=g:d(h,g),h}})({},!1):void 0),check:a}},function(t,n,r){"use strict";var s=r(2),o=r(6),a=r(12),l=r(4),p=r(1)("species");t.exports=function(d){var h=typeof o[d]=="function"?o[d]:s[d];l&&h&&!h[p]&&a.f(h,p,{configurable:!0,get:function(){return this}})}},function(t,n,r){var s=r(3),o=r(14),a=r(1)("species");t.exports=function(l,p){var d,h=s(l).constructor;return h===void 0||(d=s(h)[a])==null?p:o(d)}},function(t,n,r){var s=r(20),o=r(15);t.exports=function(a){return function(l,p){var d,h,g=String(o(l)),_=s(p),S=g.length;return _<0||_>=S?a?"":void 0:(d=g.charCodeAt(_),d<55296||d>56319||_+1===S||(h=g.charCodeAt(_+1))<56320||h>57343?a?g.charAt(_):d:a?g.slice(_,_+2):(d-55296<<10)+(h-56320)+65536)}}},function(t,n,r){var s=r(20),o=Math.max,a=Math.min;t.exports=function(l,p){return l=s(l),l<0?o(l+p,0):a(l,p)}},function(t,n,r){var s=r(15);t.exports=function(o){return Object(s(o))}},function(t,n,r){var s=r(21),o=r(1)("iterator"),a=r(10);t.exports=r(6).getIteratorMethod=function(l){if(l!=null)return l[o]||l["@@iterator"]||a[s(l)]}},function(t,n,r){"use strict";var s=r(37),o=r(47),a=r(10),l=r(13);t.exports=r(27)(Array,"Array",function(p,d){this._t=l(p),this._i=0,this._k=d},function(){var p=this._t,d=this._k,h=this._i++;return!p||h>=p.length?(this._t=void 0,o(1)):d=="keys"?o(0,h):d=="values"?o(0,p[h]):o(0,[h,p[h]])},"values"),a.Arguments=a.Array,s("keys"),s("values"),s("entries")},function(t,n){},function(t,n,r){"use strict";var s,o,a,l=r(28),p=r(2),d=r(7),h=r(21),g=r(23),_=r(9),S=(r(3),r(14)),T=r(38),A=r(40),P=(r(58).set,r(60)),R=r(30).set,N=r(48)(),D="Promise",K=p.TypeError,U=p.process,B=p[D],U=p.process,L=h(U)=="process",$=function(){},w=!!(function(){try{var k=B.resolve(1),M=(k.constructor={})[r(1)("species")]=function(I){I($,$)};return(L||typeof PromiseRejectionEvent=="function")&&k.then($)instanceof M}catch{}})(),c=function(k,M){return k===M||k===B&&M===a},f=function(k){var M;return!(!_(k)||typeof(M=k.then)!="function")&&M},m=function(k){return c(B,k)?new v(k):new o(k)},v=o=function(k){var M,I;this.promise=new k(function(q,H){if(M!==void 0||I!==void 0)throw K("Bad Promise constructor");M=q,I=H}),this.resolve=S(M),this.reject=S(I)},b=function(k){try{k()}catch(M){return{error:M}}},E=function(k,M){if(!k._n){k._n=!0;var I=k._c;N(function(){for(var q=k._v,H=k._s==1,Ye=0,V=function(G){var dt,te,ee=H?G.ok:G.fail,mi=G.resolve,Q=G.reject,ie=G.domain;try{ee?(H||(k._h==2&&u(k),k._h=1),ee===!0?dt=q:(ie&&ie.enter(),dt=ee(q),ie&&ie.exit()),dt===G.promise?Q(K("Promise-chain cycle")):(te=f(dt))?te.call(dt,mi,Q):mi(dt)):Q(q)}catch(Kr){Q(Kr)}};I.length>Ye;)V(I[Ye++]);k._c=[],k._n=!1,M&&!k._h&&C(k)})}},C=function(k){R.call(p,function(){var M,I,q,H=k._v;if(x(k)&&(M=b(function(){L?U.emit("unhandledRejection",H,k):(I=p.onunhandledrejection)?I({promise:k,reason:H}):(q=p.console)&&q.error&&q.error("Unhandled promise rejection",H)}),k._h=L||x(k)?2:1),k._a=void 0,M)throw M.error})},x=function(k){if(k._h==1)return!1;for(var M,I=k._a||k._c,q=0;I.length>q;)if(M=I[q++],M.fail||!x(M.promise))return!1;return!0},u=function(k){R.call(p,function(){var M;L?U.emit("rejectionHandled",k):(M=p.onrejectionhandled)&&M({promise:k,reason:k._v})})},y=function(k){var M=this;M._d||(M._d=!0,M=M._w||M,M._v=k,M._s=2,M._a||(M._a=M._c.slice()),E(M,!0))},j=function(k){var M,I=this;if(!I._d){I._d=!0,I=I._w||I;try{if(I===k)throw K("Promise can't be resolved itself");(M=f(k))?N(function(){var q={_w:I,_d:!1};try{M.call(k,d(j,q,1),d(y,q,1))}catch(H){y.call(q,H)}}):(I._v=k,I._s=1,E(I,!1))}catch(q){y.call({_w:I,_d:!1},q)}}};w||(B=function(k){T(this,B,D,"_h"),S(k),s.call(this);try{k(d(j,this,1),d(y,this,1))}catch(M){y.call(this,M)}},s=function(k){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},s.prototype=r(56)(B.prototype,{then:function(k,M){var I=m(P(this,B));return I.ok=typeof k!="function"||k,I.fail=typeof M=="function"&&M,I.domain=L?U.domain:void 0,this._c.push(I),this._a&&this._a.push(I),this._s&&E(this,!1),I.promise},catch:function(k){return this.then(void 0,k)}}),v=function(){var k=new s;this.promise=k,this.resolve=d(j,k,1),this.reject=d(y,k,1)}),g(g.G+g.W+g.F*!w,{Promise:B}),r(18)(B,D),r(59)(D),a=r(6)[D],g(g.S+g.F*!w,D,{reject:function(k){var M=m(this),I=M.reject;return I(k),M.promise}}),g(g.S+g.F*(l||!w),D,{resolve:function(k){if(k instanceof B&&c(k.constructor,this))return k;var M=m(this),I=M.resolve;return I(k),M.promise}}),g(g.S+g.F*!(w&&r(46)(function(k){B.all(k).catch($)})),D,{all:function(k){var M=this,I=m(M),q=I.resolve,H=I.reject,Ye=b(function(){var V=[],G=0,dt=1;A(k,!1,function(te){var ee=G++,mi=!1;V.push(void 0),dt++,M.resolve(te).then(function(Q){mi||(mi=!0,V[ee]=Q,--dt||q(V))},H)}),--dt||q(V)});return Ye&&H(Ye.error),I.promise},race:function(k){var M=this,I=m(M),q=I.reject,H=b(function(){A(k,!1,function(Ye){M.resolve(Ye).then(I.resolve,q)})});return H&&q(H.error),I.promise}})},function(t,n,r){"use strict";var s=r(61)(!0);r(27)(String,"String",function(o){this._t=String(o),this._i=0},function(){var o,a=this._t,l=this._i;return l>=a.length?{value:void 0,done:!0}:(o=s(a,l),this._i+=o.length,{value:o,done:!1})})},function(t,n,r){r(65);for(var s=r(2),o=r(5),a=r(10),l=r(1)("toStringTag"),p=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],d=0;d<5;d++){var h=p[d],g=s[h],_=g&&g.prototype;_&&!_[l]&&o(_,l,h),a[h]=a.Array}},function(t,n){t.exports=require("child_process")},function(t,n){t.exports=require("crypto")}])})});var gO={};Ai(gO,{clearOneTimeKey:()=>Tu,pushUiLog:()=>tr,startServer:()=>My,trackConnection:()=>ku,untrackConnection:()=>Ou});module.exports=By(gO);var sa=require("http"),Ty=require("url"),ky=require("child_process"),Je=require("fs"),st=require("path"),Oy=require("url");var pm=z(um(),1),{Server:fm,Namespace:WM,Socket:$M}=pm.default;var fx=require("fs"),dx=require("path"),hx=require("os");var dm=(i=0)=>e=>`\x1B[${e+i}m`,hm=(i=0)=>e=>`\x1B[${38+i};5;${e}m`,mm=(i=0)=>(e,t,n)=>`\x1B[${38+i};2;${e};${t};${n}m`,oe={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]}},VM=Object.keys(oe.modifier),nE=Object.keys(oe.color),rE=Object.keys(oe.bgColor),GM=[...nE,...rE];function sE(){let i=new Map;for(let[e,t]of Object.entries(oe)){for(let[n,r]of Object.entries(t))oe[n]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},t[n]=oe[n],i.set(r[0],r[1]);Object.defineProperty(oe,e,{value:t,enumerable:!1})}return Object.defineProperty(oe,"codes",{value:i,enumerable:!1}),oe.color.close="\x1B[39m",oe.bgColor.close="\x1B[49m",oe.color.ansi=dm(),oe.color.ansi256=hm(),oe.color.ansi16m=mm(),oe.bgColor.ansi=dm(10),oe.bgColor.ansi256=hm(10),oe.bgColor.ansi16m=mm(10),Object.defineProperties(oe,{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 r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>oe.rgbToAnsi256(...oe.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,n=Math.floor(a/6)/5,r=a%6/5}let s=Math.max(t,n,r)*2;if(s===0)return 30;let o=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>oe.ansi256ToAnsi(oe.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>oe.ansi256ToAnsi(oe.hexToAnsi256(e)),enumerable:!1}}),oe}var oE=sE(),Ut=oE;var Xs=z(require("node:process"),1),gm=z(require("node:os"),1),ml=z(require("node:tty"),1);function kt(i,e=globalThis.Deno?globalThis.Deno.args:Xs.default.argv){let t=i.startsWith("-")?"":i.length===1?"-":"--",n=e.indexOf(t+i),r=e.indexOf("--");return n!==-1&&(r===-1||n<r)}var{env:ae}=Xs.default,Ys;kt("no-color")||kt("no-colors")||kt("color=false")||kt("color=never")?Ys=0:(kt("color")||kt("colors")||kt("color=true")||kt("color=always"))&&(Ys=1);function aE(){if("FORCE_COLOR"in ae)return ae.FORCE_COLOR==="true"?1:ae.FORCE_COLOR==="false"?0:ae.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ae.FORCE_COLOR,10),3)}function cE(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function lE(i,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=aE();n!==void 0&&(Ys=n);let r=t?Ys:n;if(r===0)return 0;if(t){if(kt("color=16m")||kt("color=full")||kt("color=truecolor"))return 3;if(kt("color=256"))return 2}if("TF_BUILD"in ae&&"AGENT_NAME"in ae)return 1;if(i&&!e&&r===void 0)return 0;let s=r||0;if(ae.TERM==="dumb")return s;if(Xs.default.platform==="win32"){let o=gm.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in ae)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in ae)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in ae)||ae.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in ae)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ae.TEAMCITY_VERSION)?1:0;if(ae.COLORTERM==="truecolor"||ae.TERM==="xterm-kitty"||ae.TERM==="xterm-ghostty"||ae.TERM==="wezterm")return 3;if("TERM_PROGRAM"in ae){let o=Number.parseInt((ae.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ae.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ae.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ae.TERM)||"COLORTERM"in ae?1:s}function vm(i,e={}){let t=lE(i,{streamIsTTY:i&&i.isTTY,...e});return cE(t)}var uE={stdout:vm({isTTY:ml.default.isatty(1)}),stderr:vm({isTTY:ml.default.isatty(2)})},xm=uE;function ym(i,e,t){let n=i.indexOf(e);if(n===-1)return i;let r=e.length,s=0,o="";do o+=i.slice(s,n)+e+t,s=n+r,n=i.indexOf(e,s);while(n!==-1);return o+=i.slice(s),o}function bm(i,e,t,n){let r=0,s="";do{let o=i[n-1]==="\r";s+=i.slice(r,o?n-1:n)+e+(o?`\r
34
35
  `:`
35
- `)+t,n=r+1,r=i.indexOf(`
36
- `,n)}while(r!==-1);return s+=i.slice(n),s}var{stdout:Xh,stderr:Zh}=Gh,el=Symbol("GENERATOR"),wr=Symbol("STYLER"),un=Symbol("IS_EMPTY"),Qh=["ansi","ansi","ansi256","ansi16m"],_r=Object.create(null),B1=(i,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=Xh?Xh.level:0;i.level=e.level===void 0?t:e.level};var N1=i=>{let e=(...t)=>t.join(" ");return B1(e,i),Object.setPrototypeOf(e,pn.prototype),e};function pn(i){return N1(i)}Object.setPrototypeOf(pn.prototype,Function.prototype);for(let[i,e]of Object.entries(It))_r[i]={get(){let t=Fs(this,il(e.open,e.close,this[wr]),this[un]);return Object.defineProperty(this,i,{value:t}),t}};_r.visible={get(){let i=Fs(this,this[wr],!0);return Object.defineProperty(this,"visible",{value:i}),i}};var tl=(i,e,t,...r)=>i==="rgb"?e==="ansi16m"?It[t].ansi16m(...r):e==="ansi256"?It[t].ansi256(It.rgbToAnsi256(...r)):It[t].ansi(It.rgbToAnsi(...r)):i==="hex"?tl("rgb",e,t,...It.hexToRgb(...r)):It[t][i](...r),I1=["rgb","hex","ansi256"];for(let i of I1){_r[i]={get(){let{level:t}=this;return function(...r){let n=il(tl(i,Qh[t],"color",...r),It.color.close,this[wr]);return Fs(this,n,this[un])}}};let e="bg"+i[0].toUpperCase()+i.slice(1);_r[e]={get(){let{level:t}=this;return function(...r){let n=il(tl(i,Qh[t],"bgColor",...r),It.bgColor.close,this[wr]);return Fs(this,n,this[un])}}}}var D1=Object.defineProperties(()=>{},{..._r,level:{enumerable:!0,get(){return this[el].level},set(i){this[el].level=i}}}),il=(i,e,t)=>{let r,n;return t===void 0?(r=i,n=e):(r=t.openAll+i,n=e+t.closeAll),{open:i,close:e,openAll:r,closeAll:n,parent:t}},Fs=(i,e,t)=>{let r=(...n)=>j1(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,D1),r[el]=i,r[wr]=e,r[un]=t,r},j1=(i,e)=>{if(i.level<=0||!e)return i[un]?"":e;let t=i[wr];if(t===void 0)return e;let{openAll:r,closeAll:n}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=Yh(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
37
- `);return s!==-1&&(e=Jh(e,n,r,s)),r+e+n};Object.defineProperties(pn.prototype,_r);var L1=pn(),hO=pn({level:Zh?Zh.level:0});var $t=L1;var nl=L(require("net"),1),St=L(require("fs"),1),Di=L(require("path"),1),im=L(require("os"),1),rm=require("child_process"),nm=require("url"),zs=Di.default.dirname((0,nm.fileURLToPath)(__importMetaUrl)),Er=Di.default.join(im.default.homedir(),".9remote"),Us=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":Di.default.join(Er,"pty-daemon.sock"),em=Di.default.join(zs,"ptyDaemon.js"),tm=Di.default.join(zs,"ptyDaemon.cjs"),Vt=null,Sr=!1,yi=!1,rl="",q1=0,Cr=new Map,Hs=new Map;function F1(){return++q1}function Ws(i,e){Hs.has(i)||Hs.set(i,[]),Hs.get(i).push(e)}function dn(i,e){let t=Hs.get(i);if(t)for(let r of t)try{r(e)}catch(n){console.error(`[DaemonClient] Error in ${i} handler:`,n)}}function sl(i){if(!Vt||!Sr)return!1;try{return Vt.write(JSON.stringify(i)+`
38
- `),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function fn(i,e=5e3){return new Promise((t,r)=>{let n=F1();i.requestId=n;let s=setTimeout(()=>{Cr.delete(n),r(new Error("Request timeout"))},e);Cr.set(n,{resolve:t,reject:r,timer:s}),sl(i)||(clearTimeout(s),Cr.delete(n),r(new Error("Not connected to daemon")))})}function U1(i){let{type:e,requestId:t,...r}=i;if(t&&Cr.has(t)){let{resolve:n,timer:s}=Cr.get(t);clearTimeout(s),Cr.delete(t),n({type:e,...r});return}switch(e){case"output":dn("output",{sessionId:r.sessionId,data:Buffer.from(r.data,"base64")});break;case"sessionClosed":dn("sessionClosed",r.sessionId);break;case"sessionRenamed":dn("sessionRenamed",{sessionId:r.sessionId,name:r.name});break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function sm(){return new Promise(i=>{let e=nl.default.connect(Us),t=setTimeout(()=>{e.destroy(),i(!1)},1e3);e.on("connect",()=>{clearTimeout(t),e.destroy(),i(!0)}),e.on("error",()=>{if(clearTimeout(t),process.platform!=="win32"&&St.default.existsSync(Us))try{St.default.unlinkSync(Us)}catch{}i(!1)})})}function H1(){return St.default.existsSync(Er)||St.default.mkdirSync(Er,{recursive:!0}),St.default.existsSync(em)?{script:em,cwd:zs}:St.default.existsSync(tm)?{script:tm,cwd:zs}:(console.error("[DaemonClient] \u274C Daemon script not found"),null)}async function z1(){if(!St.default.existsSync(Er))try{St.default.mkdirSync(Er,{recursive:!0})}catch(o){return console.error("[DaemonClient] Failed to create socket directory:",o.message),!1}let i=H1();if(!i)return!1;let{script:e,cwd:t}=i,r=Di.default.join(Er,"daemon.log"),n;try{n=St.default.openSync(r,"w")}catch(o){console.error("[DaemonClient] Failed to open log file:",o.message),n="ignore"}if((0,rm.spawn)("node",[e],{detached:!0,stdio:["ignore",n,n],cwd:t}).unref(),typeof n=="number")try{St.default.closeSync(n)}catch{}for(let o=0;o<20;o++)if(await new Promise(c=>setTimeout(c,100)),await sm())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let o=St.default.readFileSync(r,"utf8");o.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(o))}catch{}return!1}async function om(){if(!(Sr||yi)){yi=!0;try{return!await sm()&&!await z1()?(console.error("[DaemonClient] \u274C Failed to start daemon"),yi=!1,!1):new Promise(i=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),Vt&&Vt.destroy(),yi=!1,i(!1)},5e3);Vt=nl.default.connect(Us),Vt.on("connect",()=>{clearTimeout(e),Sr=!0,yi=!1,dn("connected"),i(!0)}),Vt.on("data",t=>{rl+=t.toString();let r=rl.split(`
39
- `);rl=r.pop()||"";for(let n of r)if(n.trim())try{U1(JSON.parse(n))}catch{console.error("[DaemonClient] Invalid message:",n)}}),Vt.on("close",()=>{Sr=!1,Vt=null,dn("disconnected"),setTimeout(()=>{!Sr&&!yi&&om()},2e3)}),Vt.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),yi=!1,i(!1)})})}catch(i){return console.error("[DaemonClient] \u274C Connect error:",i),yi=!1,!1}}}async function am(){return om()}function Dt(){return Sr}async function cm(){return(await fn({type:"listSessions"})).sessions||[]}async function lm(i,e=80,t=24){let r=`session-${Date.now()}`;return await fn({type:"createSession",sessionId:r,name:i,cols:e,rows:t})}async function um(i){return await fn({type:"joinSession",sessionId:i})}function ol(i,e){return sl({type:"input",sessionId:i,data:e})}function pm(i,e,t){return sl({type:"resize",sessionId:i,cols:e,rows:t})}async function dm(i){return await fn({type:"deleteSession",sessionId:i})}async function fm(i,e){return await fn({type:"renameSession",sessionId:i,name:e})}var Tr=class{get type(){throw new Error("Not implemented: type")}emit(e,t){throw new Error("Not implemented: emit")}sendBinary(e){throw new Error("Not implemented: sendBinary")}isReady(){throw new Error("Not implemented: isReady")}};var $s=class extends Tr{constructor(e){super(),this._socket=e}get type(){return"ws"}isReady(){return this._socket.connected}emit(e,t){this._socket.emit(e,t)}sendBinary(e){}};var hm=L(require("node-datachannel"),1);var{PeerConnection:W1}=hm.default,$1=[{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}];async function V1(i,e){try{let t=await fetch(i,{headers:{"X-API-Key":e}});if(!t.ok)throw new Error(`HTTP ${t.status}`);let{iceServers:r}=await t.json(),n=[];for(let s of r)for(let o of s.urls)if(o.startsWith("stun:")){let c=o.replace("stun:","").split(":")[0],u=parseInt(o.split(":")[2]||"3478");n.push({hostname:c,port:u,type:"Stun"})}else if(o.startsWith("turn:")||o.startsWith("turns:")){let c=o.startsWith("turns:"),d=o.replace(/^turns?:/,"").split("?")[0],f=d.split(":")[0],v=parseInt(d.split(":")[1]||(c?"5349":"3478")),_=o.includes("transport=tcp")?"Tcp":"Udp";n.push({hostname:f,port:v,type:c?"Tls":"Turn",relayType:_,username:s.username,password:s.credential})}return n}catch(t){return console.error("[WebRtcProtocol] TURN fetch failed:",t.message),null}}var Vs=class extends Tr{constructor({socketId:e,apiKey:t,turnApiUrl:r,turnRefreshInterval:n,dcMaxMessageSize:s,answerTimeout:o}){super(),this._socketId=e,this._apiKey=t,this._turnApiUrl=r,this._turnRefreshInterval=n,this._dcMaxMessageSize=s,this._answerTimeout=o,this._pc=null,this._dc=null,this._iceServers=$1,this._refreshTimer=null}get type(){return"dc"}isReady(){return!!this._dc}emit(e,t){}sendBinary(e){if(!this._dc)return!1;for(let t of e)try{t.length<=this._dcMaxMessageSize&&this._dc.sendMessageBinary(t)}catch(r){return console.error("[WebRtcProtocol] sendBinary error:",r.message),!1}return!0}async init(){this._apiKey&&this._turnApiUrl&&await this._refreshTurn()}setupSignaling(e){e.on("webrtc:offer",async({sdp:t})=>{try{this._createPeer();let r=await this._processOffer(t,e);e.emit("webrtc:answer",{sdp:r})}catch(r){console.error("[WebRtcProtocol] offer error:",r.message),e.emit("webrtc:error",{message:r.message})}}),e.on("webrtc:ice-candidate",({candidate:t,mid:r})=>{try{this._pc?.addRemoteCandidate(t,r||"0")}catch(n){console.error("[WebRtcProtocol] addRemoteCandidate error:",n.message)}})}close(){clearTimeout(this._refreshTimer);try{this._pc?.close()}catch{}this._pc=null,this._dc=null}_createPeer(){try{this._pc?.close()}catch{}this._pc=null,this._dc=null;let e=new W1(`peer-${this._socketId}`,{iceServers:this._iceServers});e.onDataChannel(t=>{t.onOpen(()=>{this._dc=t}),t.onClosed(()=>{this._dc=null}),t.onError(r=>console.error(`[WebRtcProtocol] DC error [${this._socketId.slice(0,6)}]:`,r))}),this._pc=e}_processOffer(e,t){return new Promise((r,n)=>{this._pc.onLocalDescription((s,o)=>{o==="answer"&&r(s)}),this._pc.onLocalCandidate((s,o)=>{s&&t.emit("webrtc:ice-candidate",{candidate:s,mid:o})});try{this._pc.setRemoteDescription(e,"offer"),this._pc.setLocalDescription()}catch(s){n(s)}setTimeout(()=>n(new Error("Answer timeout")),this._answerTimeout)})}async _refreshTurn(){let e=await V1(this._turnApiUrl,this._apiKey);e?.length&&(this._iceServers=e,console.log(`[WebRtcProtocol] TURN credentials loaded (${e.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(),this._turnRefreshInterval)}};var Ks=class{constructor(e,t){this._ws=new $s(e),this._rtc=null,t.enableWebRTC&&(this._rtc=new Vs({socketId:e.id,apiKey:t.apiKey||null,turnApiUrl:t.turnApiUrl||null,turnRefreshInterval:t.turnRefreshInterval,dcMaxMessageSize:t.dcMaxMessageSize,answerTimeout:t.answerTimeout}),this._dcChunkSize=t.dcChunkSize,this._dcMaxTilesPerFrame=t.dcMaxTilesPerFrame)}get type(){return this._rtc?.isReady()?"dc":"ws"}async init(){await this._rtc?.init()}setupSignaling(e){this._rtc?.setupSignaling(e)}emit(e,t){this._ws.emit(e,t)}sendTiles(e,t){let{tiles:r}=e;if(this._rtc?.isReady()&&r?.length>0&&t){if(r.length>this._dcMaxTilesPerFrame){this._ws.emit("tiles-data",e);return}let n=e.timestamp??Date.now(),s=[];for(let o=0;o<r.length;o+=this._dcChunkSize)s.push(t(r.slice(o,o+this._dcChunkSize),n));this._rtc.sendBinary(s);return}this._ws.emit("tiles-data",e)}close(){this._rtc?.close()}};kr();var{enableWebRTC:J1,enableTurn:Mm,turnApiUrl:X1,turnRefreshInterval:Z1,dcMaxMessageSize:Q1,dcChunkSize:eE,dcMaxTilesPerFrame:tE,answerTimeout:iE}=$e.webrtc,si=null;function rE(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function Bm(){if(si!==null)return si;if(rE())return si=!1,console.log("\u2705 Remote desktop not available (headless environment)"),si;try{let i=await import("@hurdlegroup/robotjs");(i.default||i).getScreenSize(),si=!0}catch{si=!1,console.log("\u2705 Remote desktop not available (no display or robotjs not installed)")}return si}function ml(){return si===!0}var ji=null,Nm=null,Im=null,Dm=null,jm=null,Lm=null,qm=null,ni=null,Om=null,Am=null,Rm=null,Pm=null;async function nE(){if(ji)return!0;try{let i=await import("@hurdlegroup/robotjs");ji=i.default||i;let{TileManager:e}=await Promise.resolve().then(()=>(gm(),vm)),{ResourceManager:t}=await Promise.resolve().then(()=>(ym(),xm)),{ScreenUpdateHelper:r}=await Promise.resolve().then(()=>(wm(),bm)),{MouseHandler:n}=await Promise.resolve().then(()=>(Sm(),_m)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(Cm(),Em)),{ScreenHandler:o}=await Promise.resolve().then(()=>(km(),Tm));return Nm=e,Im=t,Dm=r,jm=n,Lm=s,qm=o,ji.setMouseDelay(2),ji.setKeyboardDelay(2),!0}catch(i){return console.error("\u274C Failed to load remote modules:",i.message),!1}}async function Fm(i,e){if(!si){i.emit("remote:unavailable");return}if(!await nE()){i.emit("remote:unavailable");return}ni||(ni=new Im,Om=new Dm(ni),Am=new jm(ji,ni),Rm=new Lm(ji,ni),Pm=new qm(ni,Om),ni.startResourceMonitoring());let r=i.handshake.auth?.apiKey,n=new Nm(ji);ni.addClient(i.id,{tileManager:n,screenInterval:null,authenticated:!0,apiKey:r});let s=new Ks(i,{enableWebRTC:J1,apiKey:Mm?e:null,turnApiUrl:Mm?X1:null,turnRefreshInterval:Z1,dcMaxMessageSize:Q1,dcChunkSize:eE,dcMaxTilesPerFrame:tE,answerTimeout:iE});await s.init(),s.setupSignaling(i);let o=c=>c;Am.setupMouseHandlers(i,o),Rm.setupKeyboardHandlers(i,o),Pm.setupScreenHandlers(i,o,s),i.on("disconnect",()=>{ni.removeClient(i.id),s.close()}),i.emit("remote:ready"),console.log("\u{1F5A5}\uFE0F Remote handlers attached:",i.id)}var bi=L(require("fs"),1),vl=L(require("path"),1),Xs=0,hn=null,sE=6e4,oE={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function oi(){return process.env.CODESPACES==="true"}function Um(){return oi()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function Hm(){Xs++,oi()&&Xs===1&&aE()}function zm(){Xs--,oi()&&Xs===0&&cE()}function aE(){hn||(hn=setInterval(()=>{process.memoryUsage()},sE))}function cE(){hn&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(hn),hn=null)}function Wm(i){return vl.default.join(i,".devcontainer","devcontainer.json")}function $m(i){try{let e=Wm(i);if(!bi.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(bi.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 Vm(i,e){try{let t=vl.default.join(i,".devcontainer"),r=Wm(i);bi.default.existsSync(t)||bi.default.mkdirSync(t,{recursive:!0});let n={...oE};if(bi.default.existsSync(r))try{n={...JSON.parse(bi.default.readFileSync(r,"utf8"))}}catch{}return e?(n.postAttachCommand="9remote start",n.postCreateCommand||(n.postCreateCommand="npm install -g 9remote@latest")):delete n.postAttachCommand,bi.default.writeFileSync(r,JSON.stringify(n,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var Or=L(require("os"),1),Ye=L(require("fs"),1),Li=L(require("path"),1),Ar=Li.default.join(Or.default.homedir(),".9remote","buffers"),Zs=Li.default.join(Or.default.homedir(),".9remote","sessions.json"),Qs="/tmp/9remote-uploads";Ye.default.existsSync(Qs)||Ye.default.mkdirSync(Qs,{recursive:!0});function eo(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function gl(i){return i?"/workspaces":Or.default.homedir()}function xl(){let i=Or.default.homedir(),e=Or.default.userInfo().username,t=eo(),r={...process.env};if(Object.assign(r,{HOME:i,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:i,OLDPWD:i,TMPDIR:r.TMPDIR||(process.platform==="win32"?r.TEMP||r.TMP:"/tmp"),__CF_USER_TEXT_ENCODING:r.__CF_USER_TEXT_ENCODING,XPC_FLAGS:r.XPC_FLAGS,XPC_SERVICE_NAME:r.XPC_SERVICE_NAME,SSH_AUTH_SOCK:r.SSH_AUTH_SOCK,TERM_PROGRAM:"9Remote",TERM_PROGRAM_VERSION:"1.0.0",ITERM_SESSION_ID:`9remote-${Date.now()}`,SHLVL:"1"}),t.includes("bash")){let n=r.PROMPT_COMMAND||"";r.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${n?`; ${n}`:""}`}return r}function Km(){Ye.default.existsSync(Ar)||Ye.default.mkdirSync(Ar,{recursive:!0})}function yl(i,e,t){if(t==="buffer"){Km();try{Ye.default.writeFileSync(Li.default.join(Ar,`${i}.buf`),e.join(""),"utf8")}catch(r){console.log(`\u26A0\uFE0F Failed to save buffer for ${i}:`,r.message)}}}function Gm(i,e){if(e!=="buffer")return null;let t=Li.default.join(Ar,`${i}.buf`);try{if(Ye.default.existsSync(t))return Ye.default.readFileSync(t,"utf8")}catch(r){console.log(`\u26A0\uFE0F Failed to load buffer for ${i}:`,r.message)}return null}function bl(i){let e=Li.default.join(Ar,`${i}.buf`);try{Ye.default.existsSync(e)&&Ye.default.unlinkSync(e)}catch{}}function Ym(){Km();try{return Ye.default.readdirSync(Ar).filter(i=>i.endsWith(".buf")).map(i=>i.replace(".buf",""))}catch{return[]}}function Jm(){try{if(Ye.default.existsSync(Zs))return JSON.parse(Ye.default.readFileSync(Zs,"utf8"))}catch(i){console.log("\u26A0\uFE0F Failed to load session metadata:",i.message)}return{}}function wl(i){try{let e={};for(let[r,n]of i)e[r]={name:n.name,createdAt:n.createdAt};let t=Li.default.dirname(Zs);Ye.default.existsSync(t)||Ye.default.mkdirSync(t,{recursive:!0}),Ye.default.writeFileSync(Zs,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}var _l=L(require("node-pty"),1);var lE=50*1024,qi="daemon";function Xm(i,e,t,r,n){let s=null;i.onData(o=>{t.buffer.push(o);let c=t.buffer.reduce((u,d)=>u+d.length,0);for(;c>lE&&t.buffer.length>1;)c-=t.buffer.shift().length;r.emit("output",{sessionId:e,data:Buffer.from(o,"utf-8")}),qi==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>yl(e,t.buffer,qi),2e3))}),i.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),qi==="buffer"&&t.buffer.length>0&&yl(e,t.buffer,qi),n.delete(e),bl(e),r.emit("sessionClosed",e)})}function Zm(i,e,t){i.on("getSessions",r=>{let n=[];for(let[s,o]of t)n.push({id:s,name:o.name,createdAt:o.createdAt,restored:o.restored||!1});r(n)}),i.on("createSession",async({name:r},n)=>{let s=`session-${Date.now()}`,o=xl();o.NINE_REMOTE_SESSION_ID=s;let c=gl(oi());try{if(qi==="daemon"&&Dt()){let _=await lm(r,80,24);_.success?(t.set(_.sessionId,{daemon:!0,name:r||`Terminal ${t.size+1}`,createdAt:Date.now(),cwd:_.cwd}),n({success:!0,sessionId:_.sessionId})):n({success:!1,error:_.error});return}let u=eo(),d=process.platform==="win32"?[]:["-l"],f=_l.default.spawn(u,d,{name:"xterm-256color",cols:80,rows:24,cwd:c,env:o,useConpty:!1}),v={pty:f,name:r||`Terminal ${t.size+1}`,createdAt:Date.now(),buffer:[],cwd:c};Xm(f,s,v,e,t),t.set(s,v),n({success:!0,sessionId:s})}catch(u){console.error("Failed to create session:",u),n({success:!1,error:u.message})}}),i.on("joinSession",async(r,n)=>{let s=t.get(r);if(!s)return n({success:!1,error:"Session not found"});if(s.daemon&&Dt()){try{let o=await um(r);n({success:o.success,name:o.name,cwd:o.cwd,error:o.error})}catch(o){n({success:!1,error:o.message})}return}if(s.needsRestore&&qi==="buffer")try{let o=eo(),c=process.platform==="win32"?[]:["-l"],u=gl(oi()),d=_l.default.spawn(o,c,{name:"xterm-256color",cols:80,rows:24,cwd:u,env:xl(),useConpty:!1});s.pty=d,s.needsRestore=!1,s.cwd=u;let f=Gm(r,qi);f&&(s.buffer=[f]),Xm(d,r,s,e,t),console.log(`\u2705 Restored PTY session: ${r}`)}catch(o){return console.error("Failed to restore session:",o),n({success:!1,error:"Failed to restore session"})}s.buffer?.length>0&&i.emit("output",{sessionId:r,data:Buffer.from(s.buffer.join(""),"utf-8")}),n({success:!0,name:s.name,cwd:s.cwd})}),i.on("deleteSession",async(r,n)=>{let s=t.get(r);if(!s)return n({success:!1,error:"Session not found"});if(s.daemon&&Dt()){try{await dm(r),t.delete(r),n({success:!0})}catch(o){n({success:!1,error:o.message})}return}s.pty&&s.pty.kill(),t.delete(r),bl(r),e.emit("sessionClosed",r),wl(t),n({success:!0})}),i.on("renameSession",async({sessionId:r,name:n},s)=>{let o=t.get(r);if(!o)return s({success:!1,error:"Session not found"});if(o.daemon&&Dt()){try{await fm(r,n),o.name=n,s({success:!0})}catch(c){s({success:!1,error:c.message})}return}o.name=n,e.emit("session-renamed",{sessionId:r,name:n}),wl(t),s({success:!0})})}var Qm=L(require("fs"),1),ev=L(require("path"),1);function tv(i,e){i.on("input",({sessionId:t,data:r})=>{if(!t)return;let n=e.get(t);if(n){if(n.daemon&&Dt())return ol(t,r);n.pty&&n.pty.write(Buffer.isBuffer(r)?r.toString("utf-8"):r)}}),i.on("resize",({sessionId:t,cols:r,rows:n})=>{if(!t)return;let s=e.get(t);if(s){if(s.daemon&&Dt())return pm(t,r,n);if(s.pty)try{s.pty.resize(r,n)}catch(o){console.log(`Resize failed for ${t}: ${o.message}`)}}}),i.on("upload-file",({sessionId:t,filename:r,size:n,content:s})=>{if(!t)return;let o=e.get(t);if(o)try{let c=r.replace(/[^a-zA-Z0-9._-]/g,"_"),u=ev.default.join(Qs,`${Date.now()}_${c}`);Qm.default.writeFileSync(u,Buffer.from(s,"base64")),console.log(`\u{1F4CE} File uploaded: ${u} (${n} bytes)`),o.daemon&&Dt()?ol(t,u):o.pty&&o.pty.write(u)}catch(c){console.error("File upload error:",c),i.emit("output",{sessionId:t,data:Buffer.from(`\r
40
- Error uploading file: ${c.message}\r
41
- `,"utf-8")})}})}var ou=L(require("os"),1),qt=L(require("fs"),1),Sn=L(require("path"),1),To=L(xx(),1),ko=Sn.default.join(ou.default.homedir(),".9remote","vapid.json"),Mo=Sn.default.join(ou.default.homedir(),".9remote","push-subscriptions.json"),CA=1800*1e3,ot=[];function fT(){try{if(qt.default.existsSync(ko))return JSON.parse(qt.default.readFileSync(ko,"utf8"))}catch{}return null}function hT(i){let e=Sn.default.dirname(ko);qt.default.existsSync(e)||qt.default.mkdirSync(e,{recursive:!0}),qt.default.writeFileSync(ko,JSON.stringify(i,null,2),"utf8")}function mT(){let i=fT();if(!i){let e=To.default.generateVAPIDKeys();i={publicKey:e.publicKey,privateKey:e.privateKey},hT(i)}return To.default.setVapidDetails("mailto:admin@9remote.cc",i.publicKey,i.privateKey),i}function vT(){try{qt.default.existsSync(Mo)&&(ot=JSON.parse(qt.default.readFileSync(Mo,"utf8")))}catch{ot=[]}}function En(){try{let i=Sn.default.dirname(Mo);qt.default.existsSync(i)||qt.default.mkdirSync(i,{recursive:!0}),qt.default.writeFileSync(Mo,JSON.stringify(ot,null,2),"utf8")}catch(i){console.error("Failed to save push subscriptions:",i.message)}}function yx(i,e){ot=ot.filter(t=>t.endpoint!==i.endpoint),ot.push({...i,socketId:e,lastConnectedAt:Date.now()}),En()}function bx(i){ot=ot.filter(e=>e.endpoint!==i),En()}function wx(i){for(let e of ot)e.socketId===i&&(e.disconnectedAt=Date.now());En()}function _x(i,e){for(let t of ot)t.endpoint===e&&(t.socketId=i,t.disconnectedAt=null,t.lastConnectedAt=Date.now());En()}async function Sx(i){let t={claude:"Claude",codex:"Codex",gemini:"Gemini"}[i.tool]||"AI";console.log(`\u{1F514} Sending push notification: ${i.type} ${t}`);let r=JSON.stringify({title:i.type==="stop"?`${t} \u2705`:`${t} \u{1F514}`,body:i.type==="stop"?`${t} completed the task`:`${t} needs your input`,data:{url:"/workspace",type:i.type}}),n=[],s=ot.reduce((c,u)=>(c?.lastConnectedAt??0)>=(u?.lastConnectedAt??0)?c:u,null),o=s?[s]:[];console.log(`\u{1F4E4} sendPush: total=${ot.length} target=${o.length>0?s.endpoint.slice(0,50)+"...":"none"}`);for(let c of o)try{await To.default.sendNotification({endpoint:c.endpoint,keys:c.keys},r),console.log(` \u2705 Push sent to ${c.endpoint.slice(0,50)}...`)}catch(u){console.log(` \u274C Push failed: ${u.statusCode} ${u.message}`),(u.statusCode===410||u.statusCode===404)&&n.push(c.endpoint)}n.length>0&&(ot=ot.filter(c=>!n.includes(c.endpoint)),En())}var gT=mT();vT();function Ex(){return gT.publicKey}var Oo=L(require("os"),1),Ve=L(require("fs"),1),$r=L(require("path"),1);function Ao(){return $r.default.join(Oo.default.homedir(),".claude","settings.json")}function Ro(){return $r.default.join(Oo.default.homedir(),".codex","config.toml")}function Po(){return $r.default.join(Oo.default.homedir(),".gemini","settings.json")}function Wr(i){try{if(Ve.default.existsSync(i))return JSON.parse(Ve.default.readFileSync(i,"utf8"))}catch{}return{}}function Bo(i,e){let t=$r.default.dirname(i);Ve.default.existsSync(t)||Ve.default.mkdirSync(t,{recursive:!0}),Ve.default.writeFileSync(i,JSON.stringify(e,null,2),"utf8")}function xT(){let i=Ao(),e=Wr(i),t='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=claude" > /dev/null 2>&1 & true',r='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=notification&sessionId=$NINE_REMOTE_SESSION_ID&tool=claude" > /dev/null 2>&1 & true';return e.hooks={...e.hooks,Stop:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"permission_prompt|idle_prompt",hooks:[{type:"command",command:r}]}]},Bo(i,e),{success:!0}}function yT(){let i=Ao(),e=Wr(i);return e.hooks&&(delete e.hooks.Stop,delete e.hooks.Notification,Object.keys(e.hooks).length===0&&delete e.hooks),Bo(i,e),{success:!0}}function bT(){let i=Ro(),e=$r.default.dirname(i);Ve.default.existsSync(e)||Ve.default.mkdirSync(e,{recursive:!0});let t='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=codex" > /dev/null 2>&1 & true',r="";return Ve.default.existsSync(i)&&(r=Ve.default.readFileSync(i,"utf8"),r=r.replace(/\n?# 9Remote notification\nnotify\s*=.*\n?/g,"")),r+=`
36
+ `)+t,r=n+1,n=i.indexOf(`
37
+ `,r)}while(n!==-1);return s+=i.slice(r),s}var{stdout:wm,stderr:_m}=xm,vl=Symbol("GENERATOR"),On=Symbol("STYLER"),yr=Symbol("IS_EMPTY"),Sm=["ansi","ansi","ansi256","ansi16m"],Mn=Object.create(null),pE=(i,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=wm?wm.level:0;i.level=e.level===void 0?t:e.level};var fE=i=>{let e=(...t)=>t.join(" ");return pE(e,i),Object.setPrototypeOf(e,br.prototype),e};function br(i){return fE(i)}Object.setPrototypeOf(br.prototype,Function.prototype);for(let[i,e]of Object.entries(Ut))Mn[i]={get(){let t=Zs(this,xl(e.open,e.close,this[On]),this[yr]);return Object.defineProperty(this,i,{value:t}),t}};Mn.visible={get(){let i=Zs(this,this[On],!0);return Object.defineProperty(this,"visible",{value:i}),i}};var gl=(i,e,t,...n)=>i==="rgb"?e==="ansi16m"?Ut[t].ansi16m(...n):e==="ansi256"?Ut[t].ansi256(Ut.rgbToAnsi256(...n)):Ut[t].ansi(Ut.rgbToAnsi(...n)):i==="hex"?gl("rgb",e,t,...Ut.hexToRgb(...n)):Ut[t][i](...n),dE=["rgb","hex","ansi256"];for(let i of dE){Mn[i]={get(){let{level:t}=this;return function(...n){let r=xl(gl(i,Sm[t],"color",...n),Ut.color.close,this[On]);return Zs(this,r,this[yr])}}};let e="bg"+i[0].toUpperCase()+i.slice(1);Mn[e]={get(){let{level:t}=this;return function(...n){let r=xl(gl(i,Sm[t],"bgColor",...n),Ut.bgColor.close,this[On]);return Zs(this,r,this[yr])}}}}var hE=Object.defineProperties(()=>{},{...Mn,level:{enumerable:!0,get(){return this[vl].level},set(i){this[vl].level=i}}}),xl=(i,e,t)=>{let n,r;return t===void 0?(n=i,r=e):(n=t.openAll+i,r=e+t.closeAll),{open:i,close:e,openAll:n,closeAll:r,parent:t}},Zs=(i,e,t)=>{let n=(...r)=>mE(n,r.length===1?""+r[0]:r.join(" "));return Object.setPrototypeOf(n,hE),n[vl]=i,n[On]=e,n[yr]=t,n},mE=(i,e)=>{if(i.level<=0||!e)return i[yr]?"":e;let t=i[On];if(t===void 0)return e;let{openAll:n,closeAll:r}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=ym(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
38
+ `);return s!==-1&&(e=bm(e,r,n,s)),n+e+r};Object.defineProperties(br.prototype,Mn);var vE=br(),tA=br({level:_m?_m.level:0});var Yt=vE;var bl=z(require("net"),1),Ot=z(require("fs"),1),Hi=z(require("path"),1),Tm=z(require("os"),1),km=require("child_process"),Om=require("url"),to=Hi.default.dirname((0,Om.fileURLToPath)(__importMetaUrl)),Rn=Hi.default.join(Tm.default.homedir(),".9remote"),Qs=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":Hi.default.join(Rn,"pty-daemon.sock"),Em=Hi.default.join(to,"ptyDaemon.js"),Cm=Hi.default.join(to,"ptyDaemon.cjs"),Xt=null,An=!1,Ei=!1,yl="",gE=0,Pn=new Map,eo=new Map;function xE(){return++gE}function io(i,e){eo.has(i)||eo.set(i,[]),eo.get(i).push(e)}function wr(i,e){let t=eo.get(i);if(t)for(let n of t)try{n(e)}catch(r){console.error(`[DaemonClient] Error in ${i} handler:`,r)}}function wl(i){if(!Xt||!An)return!1;try{return Xt.write(JSON.stringify(i)+`
39
+ `),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function _r(i,e=5e3){return new Promise((t,n)=>{let r=xE();i.requestId=r;let s=setTimeout(()=>{Pn.delete(r),n(new Error("Request timeout"))},e);Pn.set(r,{resolve:t,reject:n,timer:s}),wl(i)||(clearTimeout(s),Pn.delete(r),n(new Error("Not connected to daemon")))})}function yE(i){let{type:e,requestId:t,...n}=i;if(t&&Pn.has(t)){let{resolve:r,timer:s}=Pn.get(t);clearTimeout(s),Pn.delete(t),r({type:e,...n});return}switch(e){case"output":wr("output",{sessionId:n.sessionId,data:Buffer.from(n.data,"base64")});break;case"sessionClosed":wr("sessionClosed",n.sessionId);break;case"sessionRenamed":wr("sessionRenamed",{sessionId:n.sessionId,name:n.name});break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function Mm(){return new Promise(i=>{let e=bl.default.connect(Qs),t=setTimeout(()=>{e.destroy(),i(!1)},1e3);e.on("connect",()=>{clearTimeout(t),e.destroy(),i(!0)}),e.on("error",()=>{if(clearTimeout(t),process.platform!=="win32"&&Ot.default.existsSync(Qs))try{Ot.default.unlinkSync(Qs)}catch{}i(!1)})})}function bE(){return Ot.default.existsSync(Rn)||Ot.default.mkdirSync(Rn,{recursive:!0}),Ot.default.existsSync(Em)?{script:Em,cwd:to}:Ot.default.existsSync(Cm)?{script:Cm,cwd:to}:(console.error("[DaemonClient] \u274C Daemon script not found"),null)}async function wE(){if(!Ot.default.existsSync(Rn))try{Ot.default.mkdirSync(Rn,{recursive:!0})}catch(o){return console.error("[DaemonClient] Failed to create socket directory:",o.message),!1}let i=bE();if(!i)return!1;let{script:e,cwd:t}=i,n=Hi.default.join(Rn,"daemon.log"),r;try{r=Ot.default.openSync(n,"w")}catch(o){console.error("[DaemonClient] Failed to open log file:",o.message),r="ignore"}if((0,km.spawn)("node",[e],{detached:!0,stdio:["ignore",r,r],cwd:t}).unref(),typeof r=="number")try{Ot.default.closeSync(r)}catch{}for(let o=0;o<20;o++)if(await new Promise(a=>setTimeout(a,100)),await Mm())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let o=Ot.default.readFileSync(n,"utf8");o.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(o))}catch{}return!1}async function Am(){if(!(An||Ei)){Ei=!0;try{return!await Mm()&&!await wE()?(console.error("[DaemonClient] \u274C Failed to start daemon"),Ei=!1,!1):new Promise(i=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),Xt&&Xt.destroy(),Ei=!1,i(!1)},5e3);Xt=bl.default.connect(Qs),Xt.on("connect",()=>{clearTimeout(e),An=!0,Ei=!1,wr("connected"),i(!0)}),Xt.on("data",t=>{yl+=t.toString();let n=yl.split(`
40
+ `);yl=n.pop()||"";for(let r of n)if(r.trim())try{yE(JSON.parse(r))}catch{console.error("[DaemonClient] Invalid message:",r)}}),Xt.on("close",()=>{An=!1,Xt=null,wr("disconnected"),setTimeout(()=>{!An&&!Ei&&Am()},2e3)}),Xt.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),Ei=!1,i(!1)})})}catch(i){return console.error("[DaemonClient] \u274C Connect error:",i),Ei=!1,!1}}}async function Rm(){return Am()}function Ht(){return An}async function Pm(){return(await _r({type:"listSessions"})).sessions||[]}async function Im(i,e=80,t=24){let n=`session-${Date.now()}`;return await _r({type:"createSession",sessionId:n,name:i,cols:e,rows:t})}async function Nm(i){return await _r({type:"joinSession",sessionId:i})}function _l(i,e){return wl({type:"input",sessionId:i,data:e})}function Bm(i,e,t){return wl({type:"resize",sessionId:i,cols:e,rows:t})}async function jm(i){return await _r({type:"deleteSession",sessionId:i})}async function Dm(i,e){return await _r({type:"renameSession",sessionId:i,name:e})}var In=class{get type(){throw new Error("Not implemented: type")}emit(e,t){throw new Error("Not implemented: emit")}sendBinary(e){throw new Error("Not implemented: sendBinary")}isReady(){throw new Error("Not implemented: isReady")}};var no=class extends In{constructor(e){super(),this._socket=e}get type(){return"ws"}isReady(){return this._socket.connected}emit(e,t){this._socket.emit(e,t)}sendBinary(e){}};var Lm=z(require("node-datachannel"),1);var{PeerConnection:_E}=Lm.default,SE=[{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}];async function EE(i,e){try{let t=await fetch(i,{headers:{"X-API-Key":e}});if(!t.ok)throw new Error(`HTTP ${t.status}`);let{iceServers:n}=await t.json(),r=[];for(let s of n)for(let o of s.urls)if(o.startsWith("stun:")){let a=o.replace("stun:","").split(":")[0],l=parseInt(o.split(":")[2]||"3478");r.push({hostname:a,port:l,type:"Stun"})}else if(o.startsWith("turn:")||o.startsWith("turns:")){let a=o.startsWith("turns:"),p=o.replace(/^turns?:/,"").split("?")[0],d=p.split(":")[0],h=parseInt(p.split(":")[1]||(a?"5349":"3478")),g=o.includes("transport=tcp")?"Tcp":"Udp";r.push({hostname:d,port:h,type:a?"Tls":"Turn",relayType:g,username:s.username,password:s.credential})}return r}catch(t){return console.error("[WebRtcProtocol] TURN fetch failed:",t.message),null}}var ro=class extends In{constructor({socketId:e,apiKey:t,turnApiUrl:n,turnRefreshInterval:r,dcMaxMessageSize:s,answerTimeout:o}){super(),this._socketId=e,this._apiKey=t,this._turnApiUrl=n,this._turnRefreshInterval=r,this._dcMaxMessageSize=s,this._answerTimeout=o,this._pc=null,this._dc=null,this._iceServers=SE,this._refreshTimer=null}get type(){return"dc"}isReady(){return!!this._dc}emit(e,t){}sendBinary(e){if(!this._dc)return!1;for(let t of e)try{t.length<=this._dcMaxMessageSize&&this._dc.sendMessageBinary(t)}catch(n){return console.error("[WebRtcProtocol] sendBinary error:",n.message),!1}return!0}async init(){this._apiKey&&this._turnApiUrl&&await this._refreshTurn()}setupSignaling(e){e.on("webrtc:offer",async({sdp:t})=>{try{this._createPeer();let n=await this._processOffer(t,e);e.emit("webrtc:answer",{sdp:n})}catch(n){console.error("[WebRtcProtocol] offer error:",n.message),e.emit("webrtc:error",{message:n.message})}}),e.on("webrtc:ice-candidate",({candidate:t,mid:n})=>{try{this._pc?.addRemoteCandidate(t,n||"0")}catch(r){console.error("[WebRtcProtocol] addRemoteCandidate error:",r.message)}})}close(){clearTimeout(this._refreshTimer);try{this._pc?.close()}catch{}this._pc=null,this._dc=null}_createPeer(){try{this._pc?.close()}catch{}this._pc=null,this._dc=null;let e=new _E(`peer-${this._socketId}`,{iceServers:this._iceServers});e.onDataChannel(t=>{t.onOpen(()=>{this._dc=t}),t.onClosed(()=>{this._dc=null}),t.onError(n=>console.error(`[WebRtcProtocol] DC error [${this._socketId.slice(0,6)}]:`,n))}),this._pc=e}_processOffer(e,t){return new Promise((n,r)=>{this._pc.onLocalDescription((s,o)=>{o==="answer"&&n(s)}),this._pc.onLocalCandidate((s,o)=>{s&&t.emit("webrtc:ice-candidate",{candidate:s,mid:o})});try{this._pc.setRemoteDescription(e,"offer"),this._pc.setLocalDescription()}catch(s){r(s)}setTimeout(()=>r(new Error("Answer timeout")),this._answerTimeout)})}async _refreshTurn(){let e=await EE(this._turnApiUrl,this._apiKey);e?.length&&(this._iceServers=e,console.log(`[WebRtcProtocol] TURN credentials loaded (${e.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(),this._turnRefreshInterval)}};var so=class{constructor(e,t){this._ws=new no(e),this._rtc=null,t.enableWebRTC&&(this._rtc=new ro({socketId:e.id,apiKey:t.apiKey||null,turnApiUrl:t.turnApiUrl||null,turnRefreshInterval:t.turnRefreshInterval,dcMaxMessageSize:t.dcMaxMessageSize,answerTimeout:t.answerTimeout}),this._dcChunkSize=t.dcChunkSize,this._dcMaxTilesPerFrame=t.dcMaxTilesPerFrame)}get type(){return this._rtc?.isReady()?"dc":"ws"}async init(){await this._rtc?.init()}setupSignaling(e){this._rtc?.setupSignaling(e)}emit(e,t){this._ws.emit(e,t)}sendTiles(e,t){let{tiles:n}=e;if(this._rtc?.isReady()&&n?.length>0&&t){if(n.length>this._dcMaxTilesPerFrame){this._ws.emit("tiles-data",e);return}let r=e.timestamp??Date.now(),s=[];for(let o=0;o<n.length;o+=this._dcChunkSize)s.push(t(n.slice(o,o+this._dcChunkSize),r));this._rtc.sendBinary(s);return}this._ws.emit("tiles-data",e)}close(){this._rtc?.close()}};Nn();var{enableWebRTC:OE,enableTurn:Zm,turnApiUrl:ME,turnRefreshInterval:AE,dcMaxMessageSize:RE,dcChunkSize:PE,dcMaxTilesPerFrame:IE,answerTimeout:NE}=Ve.webrtc,ui=null;function BE(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function nv(){if(ui!==null)return ui;if(BE())return ui=!1,console.log("\u2705 Remote desktop not available (headless environment)"),ui;try{let i=await import("@hurdlegroup/robotjs");(i.default||i).getScreenSize(),ui=!0}catch{ui=!1,console.log("\u2705 Remote desktop not available (no display or robotjs not installed)")}return ui}function Rl(){return ui===!0}var zi=null,rv=null,sv=null,ov=null,av=null,cv=null,lv=null,li=null,Qm=null,ev=null,tv=null,iv=null;async function jE(){if(zi)return!0;try{let i=await import("@hurdlegroup/robotjs");zi=i.default||i;let{TileManager:e}=await Promise.resolve().then(()=>(Um(),Fm)),{ResourceManager:t}=await Promise.resolve().then(()=>(zm(),Hm)),{ScreenUpdateHelper:n}=await Promise.resolve().then(()=>($m(),Wm)),{MouseHandler:r}=await Promise.resolve().then(()=>(Vm(),Km)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(Jm(),Gm)),{ScreenHandler:o}=await Promise.resolve().then(()=>(Xm(),Ym));return rv=e,sv=t,ov=n,av=r,cv=s,lv=o,zi.setMouseDelay(2),zi.setKeyboardDelay(2),!0}catch(i){return console.error("\u274C Failed to load remote modules:",i.message),!1}}async function uv(i,e){if(!ui){i.emit("remote:unavailable");return}if(!await jE()){i.emit("remote:unavailable");return}li||(li=new sv,Qm=new ov(li),ev=new av(zi,li),tv=new cv(zi,li),iv=new lv(li,Qm),li.startResourceMonitoring());let n=i.handshake.auth?.apiKey,r=new rv(zi);li.addClient(i.id,{tileManager:r,screenInterval:null,authenticated:!0,apiKey:n});let s=new so(i,{enableWebRTC:OE,apiKey:Zm?e:null,turnApiUrl:Zm?ME:null,turnRefreshInterval:AE,dcMaxMessageSize:RE,dcChunkSize:PE,dcMaxTilesPerFrame:IE,answerTimeout:NE});await s.init(),s.setupSignaling(i);let o=a=>a;ev.setupMouseHandlers(i,o),tv.setupKeyboardHandlers(i,o),iv.setupScreenHandlers(i,o,s),i.on("disconnect",()=>{li.removeClient(i.id),s.close()}),i.emit("remote:ready"),console.log("\u{1F5A5}\uFE0F Remote handlers attached:",i.id)}var Ci=z(require("fs"),1),Pl=z(require("path"),1),lo=0,Sr=null,DE=6e4,LE={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function pi(){return process.env.CODESPACES==="true"}function pv(){return pi()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function fv(){lo++,pi()&&lo===1&&qE()}function dv(){lo--,pi()&&lo===0&&FE()}function qE(){Sr||(Sr=setInterval(()=>{process.memoryUsage()},DE))}function FE(){Sr&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(Sr),Sr=null)}function hv(i){return Pl.default.join(i,".devcontainer","devcontainer.json")}function mv(i){try{let e=hv(i);if(!Ci.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(Ci.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 vv(i,e){try{let t=Pl.default.join(i,".devcontainer"),n=hv(i);Ci.default.existsSync(t)||Ci.default.mkdirSync(t,{recursive:!0});let r={...LE};if(Ci.default.existsSync(n))try{r={...JSON.parse(Ci.default.readFileSync(n,"utf8"))}}catch{}return e?(r.postAttachCommand="9remote start",r.postCreateCommand||(r.postCreateCommand="npm install -g 9remote@latest")):delete r.postAttachCommand,Ci.default.writeFileSync(n,JSON.stringify(r,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var jn=z(require("os"),1),Qe=z(require("fs"),1),Wi=z(require("path"),1),Dn=Wi.default.join(jn.default.homedir(),".9remote","buffers"),uo=Wi.default.join(jn.default.homedir(),".9remote","sessions.json"),po="/tmp/9remote-uploads";Qe.default.existsSync(po)||Qe.default.mkdirSync(po,{recursive:!0});function fo(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function Il(i){return i?"/workspaces":jn.default.homedir()}function Nl(){let i=jn.default.homedir(),e=jn.default.userInfo().username,t=fo(),n={...process.env};if(Object.assign(n,{HOME:i,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:i,OLDPWD:i,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 r=n.PROMPT_COMMAND||"";n.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${r?`; ${r}`:""}`}return n}function gv(){Qe.default.existsSync(Dn)||Qe.default.mkdirSync(Dn,{recursive:!0})}function Bl(i,e,t){if(t==="buffer"){gv();try{Qe.default.writeFileSync(Wi.default.join(Dn,`${i}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${i}:`,n.message)}}}function xv(i,e){if(e!=="buffer")return null;let t=Wi.default.join(Dn,`${i}.buf`);try{if(Qe.default.existsSync(t))return Qe.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${i}:`,n.message)}return null}function jl(i){let e=Wi.default.join(Dn,`${i}.buf`);try{Qe.default.existsSync(e)&&Qe.default.unlinkSync(e)}catch{}}function yv(){gv();try{return Qe.default.readdirSync(Dn).filter(i=>i.endsWith(".buf")).map(i=>i.replace(".buf",""))}catch{return[]}}function bv(){try{if(Qe.default.existsSync(uo))return JSON.parse(Qe.default.readFileSync(uo,"utf8"))}catch(i){console.log("\u26A0\uFE0F Failed to load session metadata:",i.message)}return{}}function Dl(i){try{let e={};for(let[n,r]of i)e[n]={name:r.name,createdAt:r.createdAt};let t=Wi.default.dirname(uo);Qe.default.existsSync(t)||Qe.default.mkdirSync(t,{recursive:!0}),Qe.default.writeFileSync(uo,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}var Ll=z(require("node-pty"),1);var UE=50*1024,$i="daemon";function wv(i,e,t,n,r){let s=null;i.onData(o=>{t.buffer.push(o);let a=t.buffer.reduce((l,p)=>l+p.length,0);for(;a>UE&&t.buffer.length>1;)a-=t.buffer.shift().length;n.emit("output",{sessionId:e,data:Buffer.from(o,"utf-8")}),$i==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>Bl(e,t.buffer,$i),2e3))}),i.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),$i==="buffer"&&t.buffer.length>0&&Bl(e,t.buffer,$i),r.delete(e),jl(e),n.emit("sessionClosed",e)})}function _v(i,e,t){i.on("getSessions",n=>{let r=[];for(let[s,o]of t)r.push({id:s,name:o.name,createdAt:o.createdAt,restored:o.restored||!1});n(r)}),i.on("createSession",async({name:n},r)=>{let s=`session-${Date.now()}`,o=Nl();o.NINE_REMOTE_SESSION_ID=s;let a=Il(pi());try{if($i==="daemon"&&Ht()){let g=await Im(n,80,24);g.success?(t.set(g.sessionId,{daemon:!0,name:n||`Terminal ${t.size+1}`,createdAt:Date.now(),cwd:g.cwd}),r({success:!0,sessionId:g.sessionId})):r({success:!1,error:g.error});return}let l=fo(),p=process.platform==="win32"?[]:["-l"],d=Ll.default.spawn(l,p,{name:"xterm-256color",cols:80,rows:24,cwd:a,env:o,useConpty:!1}),h={pty:d,name:n||`Terminal ${t.size+1}`,createdAt:Date.now(),buffer:[],cwd:a};wv(d,s,h,e,t),t.set(s,h),r({success:!0,sessionId:s})}catch(l){console.error("Failed to create session:",l),r({success:!1,error:l.message})}}),i.on("joinSession",async(n,r)=>{let s=t.get(n);if(!s)return r({success:!1,error:"Session not found"});if(s.daemon&&Ht()){try{let o=await Nm(n);r({success:o.success,name:o.name,cwd:o.cwd,error:o.error})}catch(o){r({success:!1,error:o.message})}return}if(s.needsRestore&&$i==="buffer")try{let o=fo(),a=process.platform==="win32"?[]:["-l"],l=Il(pi()),p=Ll.default.spawn(o,a,{name:"xterm-256color",cols:80,rows:24,cwd:l,env:Nl(),useConpty:!1});s.pty=p,s.needsRestore=!1,s.cwd=l;let d=xv(n,$i);d&&(s.buffer=[d]),wv(p,n,s,e,t),console.log(`\u2705 Restored PTY session: ${n}`)}catch(o){return console.error("Failed to restore session:",o),r({success:!1,error:"Failed to restore session"})}s.buffer?.length>0&&i.emit("output",{sessionId:n,data:Buffer.from(s.buffer.join(""),"utf-8")}),r({success:!0,name:s.name,cwd:s.cwd})}),i.on("deleteSession",async(n,r)=>{let s=t.get(n);if(!s)return r({success:!1,error:"Session not found"});if(s.daemon&&Ht()){try{await jm(n),t.delete(n),r({success:!0})}catch(o){r({success:!1,error:o.message})}return}s.pty&&s.pty.kill(),t.delete(n),jl(n),e.emit("sessionClosed",n),Dl(t),r({success:!0})}),i.on("renameSession",async({sessionId:n,name:r},s)=>{let o=t.get(n);if(!o)return s({success:!1,error:"Session not found"});if(o.daemon&&Ht()){try{await Dm(n,r),o.name=r,s({success:!0})}catch(a){s({success:!1,error:a.message})}return}o.name=r,e.emit("session-renamed",{sessionId:n,name:r}),Dl(t),s({success:!0})})}var Sv=z(require("fs"),1),Ev=z(require("path"),1);function Cv(i,e){i.on("input",({sessionId:t,data:n})=>{if(!t)return;let r=e.get(t);if(r){if(r.daemon&&Ht())return _l(t,n);r.pty&&r.pty.write(Buffer.isBuffer(n)?n.toString("utf-8"):n)}}),i.on("resize",({sessionId:t,cols:n,rows:r})=>{if(!t)return;let s=e.get(t);if(s){if(s.daemon&&Ht())return Bm(t,n,r);if(s.pty)try{s.pty.resize(n,r)}catch(o){console.log(`Resize failed for ${t}: ${o.message}`)}}}),i.on("upload-file",({sessionId:t,filename:n,size:r,content:s})=>{if(!t)return;let o=e.get(t);if(o)try{let a=n.replace(/[^a-zA-Z0-9._-]/g,"_"),l=Ev.default.join(po,`${Date.now()}_${a}`);Sv.default.writeFileSync(l,Buffer.from(s,"base64")),console.log(`\u{1F4CE} File uploaded: ${l} (${r} bytes)`),o.daemon&&Ht()?_l(t,l):o.pty&&o.pty.write(l)}catch(a){console.error("File upload error:",a),i.emit("output",{sessionId:t,data:Buffer.from(`\r
41
+ Error uploading file: ${a.message}\r
42
+ `,"utf-8")})}})}var _u=z(require("os"),1),$t=z(require("fs"),1),Pr=z(require("path"),1),Lo=z(H0(),1),qo=Pr.default.join(_u.default.homedir(),".9remote","vapid.json"),Fo=Pr.default.join(_u.default.homedir(),".9remote","push-subscriptions.json"),fR=1800*1e3,ut=[];function $T(){try{if($t.default.existsSync(qo))return JSON.parse($t.default.readFileSync(qo,"utf8"))}catch{}return null}function KT(i){let e=Pr.default.dirname(qo);$t.default.existsSync(e)||$t.default.mkdirSync(e,{recursive:!0}),$t.default.writeFileSync(qo,JSON.stringify(i,null,2),"utf8")}function VT(){let i=$T();if(!i){let e=Lo.default.generateVAPIDKeys();i={publicKey:e.publicKey,privateKey:e.privateKey},KT(i)}return Lo.default.setVapidDetails("mailto:admin@9remote.cc",i.publicKey,i.privateKey),i}function GT(){try{$t.default.existsSync(Fo)&&(ut=JSON.parse($t.default.readFileSync(Fo,"utf8")))}catch{ut=[]}}function Ir(){try{let i=Pr.default.dirname(Fo);$t.default.existsSync(i)||$t.default.mkdirSync(i,{recursive:!0}),$t.default.writeFileSync(Fo,JSON.stringify(ut,null,2),"utf8")}catch(i){console.error("Failed to save push subscriptions:",i.message)}}function Xn(i){return i.type==="expo"?i.token:i.endpoint}function z0(i,e){let t=Xn(i);ut=ut.filter(n=>Xn(n)!==t),ut.push({...i,socketId:e,lastConnectedAt:Date.now()}),Ir()}function W0(i){ut=ut.filter(e=>Xn(e)!==i),Ir()}function $0(i){for(let e of ut)e.socketId===i&&(e.disconnectedAt=Date.now());Ir()}function K0(i,e){for(let t of ut)Xn(t)===e&&(t.socketId=i,t.disconnectedAt=null,t.lastConnectedAt=Date.now());Ir()}async function JT(i,e,t){let n={to:i.token,sound:"default",title:t.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:t.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:"/workspace",type:t.type}},s=await(await fetch("https://exp.host/--/api/v2/push/send",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)})).json();if(s.data?.status==="error")throw new Error(s.data.message);console.log(` \u2705 Expo push sent to ${i.token.slice(0,30)}...`)}async function V0(i){let t={claude:"Claude",codex:"Codex",gemini:"Gemini"}[i.tool]||"AI";console.log(`\u{1F514} Sending push notification: ${i.type} ${t}`);let n=ut.reduce((s,o)=>(s?.lastConnectedAt??0)>=(o?.lastConnectedAt??0)?s:o,null);if(!n){console.log("\u{1F4E4} sendPush: no subscriptions");return}let r=Xn(n);console.log(`\u{1F4E4} sendPush: total=${ut.length} target=${r.slice(0,50)}...`);try{if(n.type==="expo")await JT(n,t,i);else{let s=JSON.stringify({title:i.type==="stop"?`${t} \u2705`:`${t} \u{1F514}`,body:i.type==="stop"?`${t} completed the task`:`${t} needs your input`,data:{url:"/workspace",type:i.type}});await Lo.default.sendNotification({endpoint:n.endpoint,keys:n.keys},s),console.log(` \u2705 WebPush sent to ${n.endpoint.slice(0,50)}...`)}}catch(s){console.log(` \u274C Push failed: ${s.statusCode||s.message}`),(s.statusCode===410||s.statusCode===404||s.message?.includes("DeviceNotRegistered"))&&(ut=ut.filter(a=>Xn(a)!==r),Ir())}}var YT=VT();GT();function G0(){return YT.publicKey}var Uo=z(require("os"),1),Ge=z(require("fs"),1),Qn=z(require("path"),1);function Ho(){return Qn.default.join(Uo.default.homedir(),".claude","settings.json")}function zo(){return Qn.default.join(Uo.default.homedir(),".codex","config.toml")}function Wo(){return Qn.default.join(Uo.default.homedir(),".gemini","settings.json")}function Zn(i){try{if(Ge.default.existsSync(i))return JSON.parse(Ge.default.readFileSync(i,"utf8"))}catch{}return{}}function $o(i,e){let t=Qn.default.dirname(i);Ge.default.existsSync(t)||Ge.default.mkdirSync(t,{recursive:!0}),Ge.default.writeFileSync(i,JSON.stringify(e,null,2),"utf8")}function XT(){let i=Ho(),e=Zn(i),t='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=claude" > /dev/null 2>&1 & true',n='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=notification&sessionId=$NINE_REMOTE_SESSION_ID&tool=claude" > /dev/null 2>&1 & true';return e.hooks={...e.hooks,Stop:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"permission_prompt|idle_prompt",hooks:[{type:"command",command:n}]}]},$o(i,e),{success:!0}}function ZT(){let i=Ho(),e=Zn(i);return e.hooks&&(delete e.hooks.Stop,delete e.hooks.Notification,Object.keys(e.hooks).length===0&&delete e.hooks),$o(i,e),{success:!0}}function QT(){let i=zo(),e=Qn.default.dirname(i);Ge.default.existsSync(e)||Ge.default.mkdirSync(e,{recursive:!0});let t='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=codex" > /dev/null 2>&1 & true',n="";return Ge.default.existsSync(i)&&(n=Ge.default.readFileSync(i,"utf8"),n=n.replace(/\n?# 9Remote notification\nnotify\s*=.*\n?/g,"")),n+=`
42
43
  # 9Remote notification
43
44
  notify = ["bash", "-c", "${t}"]
44
- `,Ve.default.writeFileSync(i,r,"utf8"),{success:!0}}function wT(){let i=Ro();if(!Ve.default.existsSync(i))return{success:!0};let e=Ve.default.readFileSync(i,"utf8");return e=e.replace(/\n?# 9Remote notification\nnotify\s*=.*\n?/g,""),Ve.default.writeFileSync(i,e,"utf8"),{success:!0}}function _T(){let i=Po(),e=Wr(i),t='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1 & true',r='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=notification&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1 & true';return e.hooks={...e.hooks,enabled:!0,AfterAgent:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"",hooks:[{type:"command",command:r}]}]},e.tools||(e.tools={}),e.tools.enableHooks=!0,Bo(i,e),{success:!0}}function ST(){let i=Po(),e=Wr(i);return e.hooks&&(delete e.hooks.AfterAgent,delete e.hooks.Notification,delete e.hooks.enabled,Object.keys(e.hooks).length===0&&delete e.hooks),Bo(i,e),{success:!0}}function ET(i){switch(i){case"claude":{let e=Wr(Ao());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":{let e=Ro();return Ve.default.existsSync(e)?Ve.default.readFileSync(e,"utf8").includes("# 9Remote notification"):!1}case"gemini":{let e=Wr(Po());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}default:return!1}}function CT(i){let e={claude:Ao().replace("/settings.json",""),codex:Ro().replace("/config.toml",""),gemini:Po().replace("/settings.json","")};return Ve.default.existsSync(e[i])}function Cx(i){switch(i){case"claude":return xT();case"codex":return bT();case"gemini":return _T();default:return{success:!1,error:"Unknown tool"}}}function Tx(i){switch(i){case"claude":return yT();case"codex":return wT();case"gemini":return ST();default:return{success:!1,error:"Unknown tool"}}}function kx(){let i=["claude","codex","gemini"],e={};for(let t of i)e[t]={installed:CT(t),enabled:ET(t)};return e}var au={};function Mx(i,e){au[i]=e}function Ox(i){delete au[i]}function Ax(){return{...au}}function Rx(i){i.on("getNotificationState",()=>{i.emit("notificationState",Ax())}),i.on("clearNotification",e=>{e&&(Ox(e),i.broadcast.emit("notificationCleared",e))}),i.on("getVapidKey",e=>e(Ex())),i.on("pushSubscribe",e=>{e?.endpoint&&(_x(i.id,e.endpoint),yx(e,i.id))}),i.on("pushUnsubscribe",e=>{e&&bx(e)}),i.on("enableHook",async({tool:e},t)=>{try{t(await Cx(e))}catch(r){t({success:!1,error:r.message})}}),i.on("disableHook",async({tool:e},t)=>{try{t(await Tx(e))}catch(r){t({success:!1,error:r.message})}}),i.on("getHookStatus",e=>e(kx())),i.on("getAutoStartStatus",e=>{if(!oi())return e({success:!1,error:"Not in Codespaces"});let t=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();e({success:!0,...$m(t)})}),i.on("setAutoStart",({enabled:e},t)=>{if(!oi())return t({success:!1,error:"Not in Codespaces"});let r=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t(Vm(r,e))})}var TT=$t.rgb(230,138,110),cu="daemon",zi=new Map;async function Px(){if(cu==="daemon")if(!await am())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{let r=await cm();for(let s of r)zi.set(s.id,{daemon:!0,name:s.name,createdAt:s.createdAt});let n=r.length;console.log(TT(n>0?`\u2705 Connected to daemon with ${n} session(s)`:"\u2705 Connected to PTY daemon"));return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let i=Ym(),e=Jm();for(let t of i){let r=e[t]||{};zi.set(t,{pty:null,name:r.name||`Terminal ${zi.size+1}`,createdAt:r.createdAt||Date.now(),buffer:[],needsRestore:!0}),console.log(`\u{1F504} Found saved session: ${t}`)}i.length>0&&console.log(`\u2705 Found ${i.length} saved session(s)`)}function Bx(i,e){cu==="daemon"&&(Ws("output",({sessionId:t,data:r})=>i.emit("output",{sessionId:t,data:r})),Ws("sessionClosed",t=>{zi.delete(t),i.emit("sessionClosed",t)}),Ws("sessionRenamed",({sessionId:t,name:r})=>{let n=zi.get(t);n&&(n.name=r),i.emit("session-renamed",{sessionId:t,name:r})})),i.on("connection",t=>{let r=t.handshake.auth?.connectionMode||"tunnel";console.log(`\u{1F4DF} Terminal client connected: ${t.id} [${r}]`),Hm(),t.emit("serverInfo",{remoteAvailable:ml(),daemonMode:cu==="daemon"&&Dt(),platform:process.platform,...Um()}),Zm(t,i,zi),tv(t,zi),Rx(t),ml()&&Fm(t,e).catch(n=>{console.error("\u274C Failed to setup remote handlers:",n.message)}),t.on("disconnect",()=>{console.log(`\u{1F4DF} Terminal client disconnected: ${t.id}`),wx(t.id),zm()})})}var ee=L(require("fs"),1),Cn=L(require("path"),1),Vr=L(require("os"),1),Ix=require("child_process");var Nx=["node_modules",".git"],No=[".png",".jpg",".jpeg",".gif",".webp",".ico",".svg",".bmp",".pdf",".zip",".tar",".gz",".rar",".7z",".exe",".dll",".so",".dylib",".mp3",".mp4",".wav",".avi",".mov",".webm",".woff",".woff2",".ttf",".eot",".otf",".sqlite",".db"];function Dx(i){return Nx.includes(i)}function lu(i){return No.includes(Cn.default.extname(i).toLowerCase())}function kT(i,e){return i.isDirectory()?"folder":lu(e)?"binary":"file"}function Io(i){return i<1024?`${i}B`:i<1024*1024?`${(i/1024).toFixed(1)}KB`:`${(i/(1024*1024)).toFixed(1)}MB`}function jx(i,e,t,r=50){if(!(t.length>=r))try{for(let n of ee.default.readdirSync(i)){if(t.length>=r)return;if(n.startsWith(".")||Dx(n))continue;let s=Cn.default.join(i,n);try{let o=ee.default.statSync(s);o.isDirectory()?jx(s,e,t,r):n.toLowerCase().includes(e.toLowerCase())&&t.push({name:n,path:s,type:lu(n)?"binary":"file",size:o.size,sizeFormatted:Io(o.size)})}catch{}}}catch{}}function MT(){if(process.platform!=="win32")return[];try{return(0,Ix.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).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(i=>`${i}:\\`).filter(i=>ee.default.existsSync(i)).map(i=>({letter:i[0],path:i}))}}function Lx(i){i.on("getSystemInfo",e=>{let t=process.platform;e({success:!0,platform:t,isWindows:t==="win32",drives:t==="win32"?MT():[],homedir:Vr.default.homedir()})}),i.on("getFiles",({dirPath:e},t)=>{try{let r=e||Vr.default.homedir(),n=r.startsWith("~")?r.replace("~",Vr.default.homedir()):r;if(!ee.default.existsSync(n))return t({success:!1,error:"Directory not found"});let s=[];for(let o of ee.default.readdirSync(n))if(!(o.startsWith(".")&&o!==".env"&&o!==".env.example")&&!Dx(o))try{let c=Cn.default.join(n,o),u=ee.default.statSync(c);s.push({name:o,path:c,type:kT(u,o),size:u.isFile()?u.size:null,sizeFormatted:u.isFile()?Io(u.size):null,modified:u.mtime.getTime()})}catch{}s.sort((o,c)=>o.type==="folder"&&c.type!=="folder"?-1:o.type!=="folder"&&c.type==="folder"?1:o.name.localeCompare(c.name)),t({success:!0,files:s,currentPath:n,parentPath:Cn.default.dirname(n)})}catch(r){t({success:!1,error:r.message})}}),i.on("searchFiles",({workspace:e,query:t},r)=>{try{if(!t||t.length<2)return r({success:!0,files:[]});let n=(e||Vr.default.homedir()).replace(/^~/,Vr.default.homedir());if(!ee.default.existsSync(n))return r({success:!1,error:"Workspace not found"});let s=[];jx(n,t,s,50),s.sort((o,c)=>{let u=o.name.toLowerCase()===t.toLowerCase(),d=c.name.toLowerCase()===t.toLowerCase();return u&&!d?-1:!u&&d?1:o.path.length-c.path.length}),r({success:!0,files:s})}catch(n){r({success:!1,error:n.message})}}),i.on("readFile",({filePath:e},t)=>{try{if(!ee.default.existsSync(e))return t({success:!1,error:"File not found"});let r=ee.default.statSync(e);if(r.size>512e3)return t({success:!1,error:`File too large (${Io(r.size)}). Max ${Io(512e3)}`});if(lu(e))return t({success:!1,error:"Cannot open binary file"});t({success:!0,content:ee.default.readFileSync(e,"utf-8")})}catch(r){t({success:!1,error:r.message})}}),i.on("writeFile",({filePath:e,content:t},r)=>{try{ee.default.writeFileSync(e,t,"utf-8"),r({success:!0})}catch(n){r({success:!1,error:n.message})}}),i.on("createItem",({itemPath:e,type:t},r)=>{try{if(ee.default.existsSync(e))return r({success:!1,error:"Item already exists"});t==="folder"?ee.default.mkdirSync(e,{recursive:!0}):ee.default.writeFileSync(e,"","utf-8"),r({success:!0})}catch(n){r({success:!1,error:n.message})}}),i.on("deleteItem",({itemPath:e},t)=>{try{if(!ee.default.existsSync(e))return t({success:!1,error:"Item not found"});ee.default.statSync(e).isDirectory()?ee.default.rmSync(e,{recursive:!0}):ee.default.unlinkSync(e),t({success:!0})}catch(r){t({success:!1,error:r.message})}}),i.on("renameItem",({oldPath:e,newPath:t},r)=>{try{if(!ee.default.existsSync(e))return r({success:!1,error:"Item not found"});if(ee.default.existsSync(t))return r({success:!1,error:"Target already exists"});ee.default.renameSync(e,t),r({success:!0})}catch(n){r({success:!1,error:n.message})}})}var at=L(require("fs"),1),Wi=L(require("path"),1),ci=require("child_process");function qx(i){return No.includes(Wi.default.extname(i).toLowerCase())}function Fx(i){i.on("gitStatus",({repoPath:e},t)=>{try{let r=(0,ci.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),n={};try{(0,ci.execSync)("git diff HEAD --numstat",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
45
- `).filter(Boolean).forEach(c=>{let u=c.split(" ");u.length>=3&&(n[u[2]]={added:u[0]==="-"?0:parseInt(u[0],10)||0,deleted:u[1]==="-"?0:parseInt(u[1],10)||0})})}catch{}let s=[];for(let o of r.trim().split(`
46
- `).filter(Boolean)){let c=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!c)continue;let u=c[1],d=c[2];if(!d)continue;let f;u.includes("?")?f="?":u.includes("A")?f="A":u.includes("D")?f="D":u.includes("M")?f="M":u.includes("R")?f="R":f=u.trim()[0]||"?";let v=n[d]||{added:0,deleted:0};if(f==="?")try{let _=Wi.default.join(e,d);if(at.default.existsSync(_)&&!qx(d)){let E=at.default.readFileSync(_,"utf-8");v.added=E.split(`
47
- `).length,v.deleted=0}}catch{}s.push({status:f,path:d,added:v.added,deleted:v.deleted})}t({success:!0,files:s})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),i.on("gitFileStatus",({repoPath:e,filePath:t},r)=>{try{let n=Wi.default.relative(e,t),o=(0,ci.execSync)(`git status --porcelain -- "${n}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(!o)return r({success:!0,status:null});let c=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!c)return r({success:!0,status:null});let u=c[1],d;u.includes("?")?d="?":u.includes("A")?d="A":u.includes("D")?d="D":u.includes("M")?d="M":u.includes("R")?d="R":d=u.trim()[0]||"?",r({success:!0,status:d,file:n})}catch{r({success:!0,status:null})}}),i.on("gitDiff",({repoPath:e,file:t,status:r},n)=>{try{let s="";if(t&&r==="?"){let o=Wi.default.join(e,t);if(at.default.existsSync(o)){let u=at.default.readFileSync(o,"utf-8").split(`
45
+ `,Ge.default.writeFileSync(i,n,"utf8"),{success:!0}}function ek(){let i=zo();if(!Ge.default.existsSync(i))return{success:!0};let e=Ge.default.readFileSync(i,"utf8");return e=e.replace(/\n?# 9Remote notification\nnotify\s*=.*\n?/g,""),Ge.default.writeFileSync(i,e,"utf8"),{success:!0}}function tk(){let i=Wo(),e=Zn(i),t='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=stop&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1 & true',n='command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "http://localhost:2208/api/notify?type=notification&sessionId=$NINE_REMOTE_SESSION_ID&tool=gemini" > /dev/null 2>&1 & true';return e.hooks={...e.hooks,enabled:!0,AfterAgent:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"",hooks:[{type:"command",command:n}]}]},e.tools||(e.tools={}),e.tools.enableHooks=!0,$o(i,e),{success:!0}}function ik(){let i=Wo(),e=Zn(i);return e.hooks&&(delete e.hooks.AfterAgent,delete e.hooks.Notification,delete e.hooks.enabled,Object.keys(e.hooks).length===0&&delete e.hooks),$o(i,e),{success:!0}}function nk(i){switch(i){case"claude":{let e=Zn(Ho());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":{let e=zo();return Ge.default.existsSync(e)?Ge.default.readFileSync(e,"utf8").includes("# 9Remote notification"):!1}case"gemini":{let e=Zn(Wo());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}default:return!1}}function rk(i){let e={claude:Ho().replace("/settings.json",""),codex:zo().replace("/config.toml",""),gemini:Wo().replace("/settings.json","")};return Ge.default.existsSync(e[i])}function J0(i){switch(i){case"claude":return XT();case"codex":return QT();case"gemini":return tk();default:return{success:!1,error:"Unknown tool"}}}function Y0(i){switch(i){case"claude":return ZT();case"codex":return ek();case"gemini":return ik();default:return{success:!1,error:"Unknown tool"}}}function X0(){let i=["claude","codex","gemini"],e={};for(let t of i)e[t]={installed:rk(t),enabled:nk(t)};return e}var Su={};function Z0(i,e){Su[i]=e}function Q0(i){delete Su[i]}function ex(){return{...Su}}function tx(i){i.on("getNotificationState",()=>{i.emit("notificationState",ex())}),i.on("clearNotification",e=>{e&&(Q0(e),i.broadcast.emit("notificationCleared",e))}),i.on("getVapidKey",e=>e(G0())),i.on("pushSubscribe",e=>{let t=e?.type==="expo"?e.token:e?.endpoint;t&&(K0(i.id,t),z0(e,i.id))}),i.on("pushUnsubscribe",e=>{e&&W0(e)}),i.on("enableHook",async({tool:e},t)=>{try{t(await J0(e))}catch(n){t({success:!1,error:n.message})}}),i.on("disableHook",async({tool:e},t)=>{try{t(await Y0(e))}catch(n){t({success:!1,error:n.message})}}),i.on("getHookStatus",e=>e(X0())),i.on("getAutoStartStatus",e=>{if(!pi())return e({success:!1,error:"Not in Codespaces"});let t=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();e({success:!0,...mv(t)})}),i.on("setAutoStart",({enabled:e},t)=>{if(!pi())return t({success:!1,error:"Not in Codespaces"});let n=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t(vv(n,e))})}var sk=Yt.rgb(230,138,110),Eu="daemon",Ji=new Map;async function ix(){if(Eu==="daemon")if(!await Rm())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{let n=await Pm();for(let s of n)Ji.set(s.id,{daemon:!0,name:s.name,createdAt:s.createdAt});let r=n.length;console.log(sk(r>0?`\u2705 Connected to daemon with ${r} session(s)`:"\u2705 Connected to PTY daemon"));return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let i=yv(),e=bv();for(let t of i){let n=e[t]||{};Ji.set(t,{pty:null,name:n.name||`Terminal ${Ji.size+1}`,createdAt:n.createdAt||Date.now(),buffer:[],needsRestore:!0}),console.log(`\u{1F504} Found saved session: ${t}`)}i.length>0&&console.log(`\u2705 Found ${i.length} saved session(s)`)}function nx(i,e){Eu==="daemon"&&(io("output",({sessionId:t,data:n})=>i.emit("output",{sessionId:t,data:n})),io("sessionClosed",t=>{Ji.delete(t),i.emit("sessionClosed",t)}),io("sessionRenamed",({sessionId:t,name:n})=>{let r=Ji.get(t);r&&(r.name=n),i.emit("session-renamed",{sessionId:t,name:n})})),i.on("connection",t=>{fv(),t.emit("serverInfo",{remoteAvailable:Rl(),daemonMode:Eu==="daemon"&&Ht(),platform:process.platform,...pv()}),_v(t,i,Ji),Cv(t,Ji),tx(t),Rl()&&uv(t,e).catch(n=>{console.error("\u274C Failed to setup remote handlers:",n.message)}),t.on("disconnect",n=>{let r=new Date().toISOString();console.log(`\u{1F4DF} Terminal client disconnected: ${t.id}`),$0(t.id),dv()})})}var le=z(require("fs"),1),Nr=z(require("path"),1),er=z(require("os"),1),sx=require("child_process");var rx=["node_modules",".git"],Ko=[".png",".jpg",".jpeg",".gif",".webp",".ico",".svg",".bmp",".pdf",".zip",".tar",".gz",".rar",".7z",".exe",".dll",".so",".dylib",".mp3",".mp4",".wav",".avi",".mov",".webm",".woff",".woff2",".ttf",".eot",".otf",".sqlite",".db"];function ox(i){return rx.includes(i)}function Cu(i){return Ko.includes(Nr.default.extname(i).toLowerCase())}function ok(i,e){return i.isDirectory()?"folder":Cu(e)?"binary":"file"}function Vo(i){return i<1024?`${i}B`:i<1024*1024?`${(i/1024).toFixed(1)}KB`:`${(i/(1024*1024)).toFixed(1)}MB`}function ax(i,e,t,n=50){if(!(t.length>=n))try{for(let r of le.default.readdirSync(i)){if(t.length>=n)return;if(r.startsWith(".")||ox(r))continue;let s=Nr.default.join(i,r);try{let o=le.default.statSync(s);o.isDirectory()?ax(s,e,t,n):r.toLowerCase().includes(e.toLowerCase())&&t.push({name:r,path:s,type:Cu(r)?"binary":"file",size:o.size,sizeFormatted:Vo(o.size)})}catch{}}}catch{}}function ak(){if(process.platform!=="win32")return[];try{return(0,sx.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).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(i=>`${i}:\\`).filter(i=>le.default.existsSync(i)).map(i=>({letter:i[0],path:i}))}}function cx(i){i.on("getSystemInfo",e=>{let t=process.platform;e({success:!0,platform:t,isWindows:t==="win32",drives:t==="win32"?ak():[],homedir:er.default.homedir()})}),i.on("getFiles",({dirPath:e},t)=>{try{let n=e||er.default.homedir(),r=n.startsWith("~")?n.replace("~",er.default.homedir()):n;if(!le.default.existsSync(r))return t({success:!1,error:"Directory not found"});let s=[];for(let o of le.default.readdirSync(r))if(!(o.startsWith(".")&&o!==".env"&&o!==".env.example")&&!ox(o))try{let a=Nr.default.join(r,o),l=le.default.statSync(a);s.push({name:o,path:a,type:ok(l,o),size:l.isFile()?l.size:null,sizeFormatted:l.isFile()?Vo(l.size):null,modified:l.mtime.getTime()})}catch{}s.sort((o,a)=>o.type==="folder"&&a.type!=="folder"?-1:o.type!=="folder"&&a.type==="folder"?1:o.name.localeCompare(a.name)),t({success:!0,files:s,currentPath:r,parentPath:Nr.default.dirname(r)})}catch(n){t({success:!1,error:n.message})}}),i.on("searchFiles",({workspace:e,query:t},n)=>{try{if(!t||t.length<2)return n({success:!0,files:[]});let r=(e||er.default.homedir()).replace(/^~/,er.default.homedir());if(!le.default.existsSync(r))return n({success:!1,error:"Workspace not found"});let s=[];ax(r,t,s,50),s.sort((o,a)=>{let l=o.name.toLowerCase()===t.toLowerCase(),p=a.name.toLowerCase()===t.toLowerCase();return l&&!p?-1:!l&&p?1:o.path.length-a.path.length}),n({success:!0,files:s})}catch(r){n({success:!1,error:r.message})}}),i.on("readFile",({filePath:e},t)=>{try{if(!le.default.existsSync(e))return t({success:!1,error:"File not found"});let n=le.default.statSync(e);if(n.size>512e3)return t({success:!1,error:`File too large (${Vo(n.size)}). Max ${Vo(512e3)}`});if(Cu(e))return t({success:!1,error:"Cannot open binary file"});t({success:!0,content:le.default.readFileSync(e,"utf-8")})}catch(n){t({success:!1,error:n.message})}}),i.on("writeFile",({filePath:e,content:t},n)=>{try{le.default.writeFileSync(e,t,"utf-8"),n({success:!0})}catch(r){n({success:!1,error:r.message})}}),i.on("createItem",({itemPath:e,type:t},n)=>{try{if(le.default.existsSync(e))return n({success:!1,error:"Item already exists"});t==="folder"?le.default.mkdirSync(e,{recursive:!0}):le.default.writeFileSync(e,"","utf-8"),n({success:!0})}catch(r){n({success:!1,error:r.message})}}),i.on("deleteItem",({itemPath:e},t)=>{try{if(!le.default.existsSync(e))return t({success:!1,error:"Item not found"});le.default.statSync(e).isDirectory()?le.default.rmSync(e,{recursive:!0}):le.default.unlinkSync(e),t({success:!0})}catch(n){t({success:!1,error:n.message})}}),i.on("renameItem",({oldPath:e,newPath:t},n)=>{try{if(!le.default.existsSync(e))return n({success:!1,error:"Item not found"});if(le.default.existsSync(t))return n({success:!1,error:"Target already exists"});le.default.renameSync(e,t),n({success:!0})}catch(r){n({success:!1,error:r.message})}})}var pt=z(require("fs"),1),Yi=z(require("path"),1),di=require("child_process");function lx(i){return Ko.includes(Yi.default.extname(i).toLowerCase())}function ux(i){i.on("gitStatus",({repoPath:e},t)=>{try{let n=(0,di.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),r={};try{(0,di.execSync)("git diff HEAD --numstat",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
46
+ `).filter(Boolean).forEach(a=>{let l=a.split(" ");l.length>=3&&(r[l[2]]={added:l[0]==="-"?0:parseInt(l[0],10)||0,deleted:l[1]==="-"?0:parseInt(l[1],10)||0})})}catch{}let s=[];for(let o of n.trim().split(`
47
+ `).filter(Boolean)){let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)continue;let l=a[1],p=a[2];if(!p)continue;let d;l.includes("?")?d="?":l.includes("A")?d="A":l.includes("D")?d="D":l.includes("M")?d="M":l.includes("R")?d="R":d=l.trim()[0]||"?";let h=r[p]||{added:0,deleted:0};if(d==="?")try{let g=Yi.default.join(e,p);if(pt.default.existsSync(g)&&!lx(p)){let _=pt.default.readFileSync(g,"utf-8");h.added=_.split(`
48
+ `).length,h.deleted=0}}catch{}s.push({status:d,path:p,added:h.added,deleted:h.deleted})}t({success:!0,files:s})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),i.on("gitFileStatus",({repoPath:e,filePath:t},n)=>{try{let r=Yi.default.relative(e,t),o=(0,di.execSync)(`git status --porcelain -- "${r}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).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 l=a[1],p;l.includes("?")?p="?":l.includes("A")?p="A":l.includes("D")?p="D":l.includes("M")?p="M":l.includes("R")?p="R":p=l.trim()[0]||"?",n({success:!0,status:p,file:r})}catch{n({success:!0,status:null})}}),i.on("gitDiff",({repoPath:e,file:t,status:n},r)=>{try{let s="";if(t&&n==="?"){let o=Yi.default.join(e,t);if(pt.default.existsSync(o)){let l=pt.default.readFileSync(o,"utf-8").split(`
48
49
  `);s=`diff --git a/${t} b/${t}
49
50
  new file mode 100644
50
51
  --- /dev/null
51
52
  +++ b/${t}
52
- @@ -0,0 +1,${u.length} @@
53
- ${u.map(d=>`+${d}`).join(`
54
- `)}`}}else if(t)s=(0,ci.execSync)(`git diff HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]});else{s=(0,ci.execSync)("git diff HEAD",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]});let c=(0,ci.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
55
- `).filter(u=>u.startsWith("??")).map(u=>u.substring(3));for(let u of c){let d=Wi.default.join(e,u);if(at.default.existsSync(d)&&!qx(u))try{if(at.default.statSync(d).size<=512e3){let _=at.default.readFileSync(d,"utf-8").split(`
53
+ @@ -0,0 +1,${l.length} @@
54
+ ${l.map(p=>`+${p}`).join(`
55
+ `)}`}}else if(t)s=(0,di.execSync)(`git diff HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]});else{s=(0,di.execSync)("git diff HEAD",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]});let a=(0,di.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
56
+ `).filter(l=>l.startsWith("??")).map(l=>l.substring(3));for(let l of a){let p=Yi.default.join(e,l);if(pt.default.existsSync(p)&&!lx(l))try{if(pt.default.statSync(p).size<=512e3){let g=pt.default.readFileSync(p,"utf-8").split(`
56
57
  `);s+=`
57
- diff --git a/${u} b/${u}
58
+ diff --git a/${l} b/${l}
58
59
  new file mode 100644
59
60
  --- /dev/null
60
- +++ b/${u}
61
- @@ -0,0 +1,${_.length} @@
62
- ${_.map(E=>`+${E}`).join(`
63
- `)}`}}catch{}}}n({success:!0,diff:s})}catch(s){n({success:!1,error:s.message})}}),i.on("gitDiscard",({repoPath:e,file:t,status:r},n)=>{try{if(!t)return n({success:!1,error:"No file specified"});let s=Wi.default.join(e,t);r==="?"?at.default.existsSync(s)&&(at.default.statSync(s).isDirectory()?at.default.rmSync(s,{recursive:!0}):at.default.unlinkSync(s)):r==="A"?((0,ci.execSync)(`git reset HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),at.default.existsSync(s)&&at.default.unlinkSync(s)):(0,ci.execSync)(`git checkout HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),n({success:!0})}catch(s){n({success:!1,error:s.message})}})}function Ux(i){i.on("connection",e=>{Lx(e),Fx(e)})}function OT(){try{let i=(0,zx.join)((0,Wx.homedir)(),".9remote","keys.json");return JSON.parse((0,Hx.readFileSync)(i,"utf8")).key||null}catch{return null}}var $x=null;function jo(){return $x}async function Vx(i){let e=new Hh(i,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3});return await Bm(),Bx(e,OT()),Ux(e),$x=e,e}var Kx=L(require("http"),1),Gx=L(require("https"),1),Yx=require("child_process"),Jx=require("util"),AT=(0,Jx.promisify)(Yx.exec);async function RT(){let i=process.platform,e=new Set([80,443]);try{let t;if(i==="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:r}=await AT(t),n=r.split(`
64
- `);for(let s of n){let o=s.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let c of o){let u=parseInt(c.replace(/[:\*\]\s]/g,""),10);u>0&&u<=65535&&(u===80||u===443||u>=1024)&&e.add(u)}}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 PT(i,e=2e3){return new Promise(t=>{let r=Kx.default.request({host:"localhost",port:i,method:"GET",path:"/",timeout:e},n=>{n.on("data",()=>{}),n.on("end",()=>{}),t({active:!0,protocol:"http",status:n.statusCode})});r.on("error",n=>{t({active:!1,error:n.message})}),r.on("timeout",()=>{r.destroy(),t({active:!1,error:"timeout"})}),r.end()})}function BT(i,e=2e3){return new Promise(t=>{let r=Gx.default.request({host:"localhost",port:i,method:"GET",path:"/",timeout:e,rejectUnauthorized:!1},n=>{n.on("data",()=>{}),n.on("end",()=>{}),t({active:!0,protocol:"https",status:n.statusCode})});r.on("error",n=>{t({active:!1,error:n.message})}),r.on("timeout",()=>{r.destroy(),t({active:!1,error:"timeout"})}),r.end()})}async function NT(i){let[e,t]=await Promise.all([PT(i),BT(i)]);return t.active?{port:i,...t}:e.active?{port:i,...e}:{port:i,active:!1}}async function Xx(){let i=await RT();return(await Promise.all(i.map(t=>NT(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,r)=>t.port-r.port)}var Zx=L(require("crypto"),1),IT=process.env.API_KEY_SECRET||"9remote-api-key-secret";function DT(i,e){return Zx.default.createHmac("sha256",IT).update(i+e).digest("hex").slice(0,8)}function jT(i){if(!i||!i.startsWith("sk-"))return null;let e=i.split("-");if(e.length===4){let[,t,r,n]=e,s=DT(t,r);return n!==s?null:{machineId:t,keyId:r}}return null}function Qx(i){return jT(i)!==null}async function e0(i,e){let t=i.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 r=t.slice(7);if(!Qx(r)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let n=await Xx();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(n))}function t0(i){i.setHeader("Access-Control-Allow-Origin","*"),i.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),i.setHeader("Access-Control-Allow-Headers","*"),i.setHeader("Access-Control-Allow-Credentials","true")}function i0(i,e){return i.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var Gr=require("zlib"),L0=L(N0(),1);var pk=["data:","javascript:","#","mailto:","blob:"],dk=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function Uo(i,e){return!i||pk.some(t=>i.startsWith(t))||i.startsWith("/proxy/")?i:i.startsWith(`http://localhost:${e}`)?i.replace(`http://localhost:${e}`,`/proxy/${e}`):i.startsWith("/")&&!i.startsWith("//")?`/proxy/${e}${i}`:i}function I0(i,e){let t=`/proxy/${e}`,r=new RegExp(`(${dk.join("|")})=(["'])([^"']*?)\\2`,"gi");return i=i.replace(r,(n,s,o,c)=>{if(s.toLowerCase()==="srcset"){let u=c.split(",").map(d=>{let[f,...v]=d.trim().split(/\s+/),_=Uo(f,e);return v.length?`${_} ${v.join(" ")}`:_}).join(", ");return`${s}=${o}${u}${o}`}return`${s}=${o}${Uo(c,e)}${o}`}),i=i.replace(/url\(\s*(["']?)(\/_next\/[^)"']+)\1\s*\)/gi,(n,s,o)=>`url(${s}${t}${o}${s})`),i=i.replace(/"(\/_next\/[^"]+)"/g,(n,s)=>`"${t}${s}"`),i}function D0(i){let e=`/proxy/${i}`;return`
61
+ +++ b/${l}
62
+ @@ -0,0 +1,${g.length} @@
63
+ ${g.map(_=>`+${_}`).join(`
64
+ `)}`}}catch{}}}r({success:!0,diff:s})}catch(s){r({success:!1,error:s.message})}}),i.on("gitDiscard",({repoPath:e,file:t,status:n},r)=>{try{if(!t)return r({success:!1,error:"No file specified"});let s=Yi.default.join(e,t);n==="?"?pt.default.existsSync(s)&&(pt.default.statSync(s).isDirectory()?pt.default.rmSync(s,{recursive:!0}):pt.default.unlinkSync(s)):n==="A"?((0,di.execSync)(`git reset HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),pt.default.existsSync(s)&&pt.default.unlinkSync(s)):(0,di.execSync)(`git checkout HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}),r({success:!0})}catch(s){r({success:!1,error:s.message})}})}function px(i){i.on("connection",e=>{cx(e),ux(e)})}function ck(){try{let i=(0,dx.join)((0,hx.homedir)(),".9remote","keys.json");return JSON.parse((0,fx.readFileSync)(i,"utf8")).key||null}catch{return null}}var mx=null;function Jo(){return mx}async function vx(i){let e=new fm(i,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3});return await nv(),e.on("connection",t=>{let n=t.handshake.headers["x-forwarded-for"]||t.handshake.address||"unknown";ku(t.id,n),tr(`Client connected: ${n}`),tr(`Auth received: tempKey=${t.handshake.auth?.tempKey??"null"}`),t.handshake.auth?.tempKey&&(tr("One-time key used \u2014 clearing from UI"),Tu()),t.on("disconnect",r=>{Ou(t.id),tr(`Client disconnected: ${n} (${r})`)})}),nx(e,ck()),px(e),mx=e,e}var gx=z(require("http"),1),xx=z(require("https"),1),yx=require("child_process"),bx=require("util"),lk=(0,bx.promisify)(yx.exec);async function uk(){let i=process.platform,e=new Set([80,443]);try{let t;if(i==="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 lk(t),r=n.split(`
65
+ `);for(let s of r){let o=s.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let a of o){let l=parseInt(a.replace(/[:\*\]\s]/g,""),10);l>0&&l<=65535&&(l===80||l===443||l>=1024)&&e.add(l)}}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 pk(i,e=2e3){return new Promise(t=>{let n=gx.default.request({host:"localhost",port:i,method:"GET",path:"/",timeout:e},r=>{r.on("data",()=>{}),r.on("end",()=>{}),t({active:!0,protocol:"http",status:r.statusCode})});n.on("error",r=>{t({active:!1,error:r.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}function fk(i,e=2e3){return new Promise(t=>{let n=xx.default.request({host:"localhost",port:i,method:"GET",path:"/",timeout:e,rejectUnauthorized:!1},r=>{r.on("data",()=>{}),r.on("end",()=>{}),t({active:!0,protocol:"https",status:r.statusCode})});n.on("error",r=>{t({active:!1,error:r.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}async function dk(i){let[e,t]=await Promise.all([pk(i),fk(i)]);return t.active?{port:i,...t}:e.active?{port:i,...e}:{port:i,active:!1}}async function wx(){let i=await uk();return(await Promise.all(i.map(t=>dk(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 _x=z(require("crypto"),1),hk=process.env.API_KEY_SECRET||"9remote-api-key-secret";function mk(){let i="abcdefghijklmnopqrstuvwxyz0123456789",e="";for(let t=0;t<4;t++)e+=i.charAt(Math.floor(Math.random()*i.length));return e}function Sx(i,e){return _x.default.createHmac("sha256",hk).update(i+e).digest("hex").slice(0,6)}function Ex(i){let e=i.slice(0,8),t=mk(),n=Sx(e,t);return{key:`sk-${e}-${t}-${n}`,keyId:t}}function vk(i){if(!i||!i.startsWith("sk-"))return null;let e=i.split("-");if(e.length===4){let[,t,n,r]=e,s=Sx(t,n);return r!==s?null:{machineId:t,keyId:n}}return null}function Cx(i){return vk(i)!==null}async function Tx(i,e){let t=i.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(!Cx(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let r=await wx();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(r))}function kx(i){i.setHeader("Access-Control-Allow-Origin","*"),i.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),i.setHeader("Access-Control-Allow-Headers","*"),i.setHeader("Access-Control-Allow-Credentials","true")}function Ox(i,e){return i.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var nr=require("zlib"),uy=z(oy(),1);var Wk=["data:","javascript:","#","mailto:","blob:"],$k=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function Qo(i,e){return!i||Wk.some(t=>i.startsWith(t))||i.startsWith("/proxy/")?i:i.startsWith(`http://localhost:${e}`)?i.replace(`http://localhost:${e}`,`/proxy/${e}`):i.startsWith("/")&&!i.startsWith("//")?`/proxy/${e}${i}`:i}function ay(i,e){let t=`/proxy/${e}`,n=new RegExp(`(${$k.join("|")})=(["'])([^"']*?)\\2`,"gi");return i=i.replace(n,(r,s,o,a)=>{if(s.toLowerCase()==="srcset"){let l=a.split(",").map(p=>{let[d,...h]=p.trim().split(/\s+/),g=Qo(d,e);return h.length?`${g} ${h.join(" ")}`:g}).join(", ");return`${s}=${o}${l}${o}`}return`${s}=${o}${Qo(a,e)}${o}`}),i=i.replace(/url\(\s*(["']?)(\/_next\/[^)"']+)\1\s*\)/gi,(r,s,o)=>`url(${s}${t}${o}${s})`),i=i.replace(/"(\/_next\/[^"]+)"/g,(r,s)=>`"${t}${s}"`),i}function cy(i){let e=`/proxy/${i}`;return`
65
66
  // Service Worker for 9Remote Proxy - Port ${i}
66
67
  const PROXY_BASE = '${e}';
67
68
  const TARGET_PORT = ${i};
@@ -116,7 +117,7 @@ self.addEventListener('fetch', (event) => {
116
117
 
117
118
  event.respondWith(fetch(new Request(newUrl, requestInit)));
118
119
  });
119
- `}function j0(i){return`
120
+ `}function ly(i){return`
120
121
  <script data-proxy-injected="true">
121
122
  (function() {
122
123
  if (window.__proxySwRegistered) return;
@@ -158,7 +159,7 @@ self.addEventListener('fetch', (event) => {
158
159
  });
159
160
  }
160
161
  })();
161
- </script>`}var Tu=new Set;function q0(i){Tu.add(String(i))}function F0(i){Tu.delete(String(i))}function fk(i){return Tu.has(String(i))}function hk(i){switch(i){case"gzip":return(0,Gr.createGunzip)();case"deflate":return(0,Gr.createInflate)();case"br":return(0,Gr.createBrotliDecompress)();default:return null}}function mk(i,e){if(i.includes("<head>"))return i.replace("<head>","<head>"+e);if(i.includes("<HEAD>"))return i.replace("<HEAD>","<HEAD>"+e);let t=i.match(/<head[^>]*>/i);return t?i.replace(t[0],t[0]+e):e+i}function U0(){let i=L0.default.createProxyServer({selfHandleResponse:!0});return i.on("proxyRes",(e,t,r)=>{let n=t._proxyTargetPort,s=e.headers["content-type"]||"",o=e.headers["content-encoding"]||"",c=s.includes("text/html"),u={...e.headers};if(u.location&&(u.location=Uo(u.location,n)),s.includes("application/json")||s.includes("text/x-component")){r.writeHead(e.statusCode,u),e.pipe(r);return}if(s.includes("javascript")||s.includes("text/javascript")){r.writeHead(e.statusCode,u),e.pipe(r);return}if(!c){r.writeHead(e.statusCode,u),e.pipe(r);return}delete u["content-length"],delete u["content-encoding"];let v=hk(o),_=v?e.pipe(v):e,E=[];_.on("data",C=>E.push(C)),_.on("error",C=>{console.error("[Proxy] Decompress error:",C.message),r.writeHead(502),r.end("Bad Gateway: Decompression failed")}),_.on("end",()=>{let C=Buffer.concat(E).toString("utf8");C=I0(C,n);let k=j0(n);C=mk(C,k),r.writeHead(e.statusCode,u),r.end(C)})}),i}function H0(i,e,t,r,n,s){if(n==="/sw.js"){let o=D0(r);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(!fk(r)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
162
+ </script>`}var $u=new Set;function py(i){$u.add(String(i))}function fy(i){$u.delete(String(i))}function Kk(i){return $u.has(String(i))}function Vk(i){switch(i){case"gzip":return(0,nr.createGunzip)();case"deflate":return(0,nr.createInflate)();case"br":return(0,nr.createBrotliDecompress)();default:return null}}function Gk(i,e){if(i.includes("<head>"))return i.replace("<head>","<head>"+e);if(i.includes("<HEAD>"))return i.replace("<HEAD>","<HEAD>"+e);let t=i.match(/<head[^>]*>/i);return t?i.replace(t[0],t[0]+e):e+i}function dy(){let i=uy.default.createProxyServer({selfHandleResponse:!0});return i.on("proxyRes",(e,t,n)=>{let r=t._proxyTargetPort,s=e.headers["content-type"]||"",o=e.headers["content-encoding"]||"",a=s.includes("text/html"),l={...e.headers};if(l.location&&(l.location=Qo(l.location,r)),s.includes("application/json")||s.includes("text/x-component")){n.writeHead(e.statusCode,l),e.pipe(n);return}if(s.includes("javascript")||s.includes("text/javascript")){n.writeHead(e.statusCode,l),e.pipe(n);return}if(!a){n.writeHead(e.statusCode,l),e.pipe(n);return}delete l["content-length"],delete l["content-encoding"];let h=Vk(o),g=h?e.pipe(h):e,_=[];g.on("data",S=>_.push(S)),g.on("error",S=>{console.error("[Proxy] Decompress error:",S.message),n.writeHead(502),n.end("Bad Gateway: Decompression failed")}),g.on("end",()=>{let S=Buffer.concat(_).toString("utf8");S=ay(S,r);let T=ly(r);S=Gk(S,T),n.writeHead(e.statusCode,l),n.end(S)})}),i}function hy(i,e,t,n,r,s){if(r==="/sw.js"){let o=cy(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(!Kk(n)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
162
163
  <!DOCTYPE html>
163
164
  <html>
164
165
  <head><title>Unauthorized</title></head>
@@ -169,12 +170,16 @@ self.addEventListener('fetch', (event) => {
169
170
  </div>
170
171
  </body>
171
172
  </html>
172
- `);return}e._proxyTargetPort=r,e.url=n+(s||""),i.web(e,t,{target:`http://localhost:${r}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var Bn=(0,Y0.fileURLToPath)(new URL(".",__importMetaUrl)),vk=process.env.NODE_ENV==="development",gk=5173,ku=(0,Gi.existsSync)((0,Ft.join)(Bn,"ui","dist"))?(0,Ft.join)(Bn,"ui","dist"):(0,Ft.join)(Bn,"ui"),xk={".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"},yk="9remote",bk=`https://registry.npmjs.org/${yk}/latest`;function wk(i,e){let t=(0,zo.request)({hostname:"localhost",port:gk,path:i.url,method:i.method,headers:i.headers},r=>{e.writeHead(r.statusCode,r.headers),r.pipe(e)});t.on("error",()=>{e.writeHead(502),e.end("Vite dev server not ready yet, please wait...")}),i.pipe(t)}function z0(i,e){if(!(0,Gi.existsSync)(e))return!1;let t=(0,Ft.extname)(e),r=xk[t]||"application/octet-stream";return i.setHeader("Content-Type",r),i.writeHead(200),i.end((0,Gi.readFileSync)(e)),!0}async function _k(i){try{let e=await fetch(bk);if(!e.ok)return;let{version:t}=await e.json();t&&t!==i&&J0("updateAvailable",{version:t})}catch{}}var Nn={step:0,tunnelUrl:"",oneTimeKey:"",qrUrl:"",latency:null,uptime:null},Ho=new Set;function J0(i,e){let t=`data: ${JSON.stringify({type:i,...e})}
173
+ `);return}e._proxyTargetPort=n,e.url=r+(s||""),i.web(e,t,{target:`http://localhost:${n}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var en=z(require("fs"),1),zr=z(require("path"),1),my=z(require("os"),1),Hr=zr.default.join(my.default.homedir(),".9remote"),x2=zr.default.join(Hr,"state.json"),Ku=zr.default.join(Hr,"keys.json"),Jk=zr.default.join(Hr,"cmd.json");function Vu(){en.default.existsSync(Hr)||en.default.mkdirSync(Hr,{recursive:!0})}function vy(){try{return Vu(),en.default.existsSync(Ku)?JSON.parse(en.default.readFileSync(Ku,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function Gu(i){try{Vu(),en.default.writeFileSync(Jk,JSON.stringify({cmd:i,ts:Date.now()}))}catch{}}function gy(i,e,t="Default"){try{Vu();let n={machineId:i,key:e,name:t,createdAt:new Date().toISOString()};return en.default.writeFileSync(Ku,JSON.stringify(n,null,2)),n}catch(n){return console.error("Error saving key:",n),null}}var ea=require("child_process"),Yk={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"};function Ju(){return new Promise(i=>{if(process.platform!=="darwin"){i({screenRecording:!0,accessibility:!0});return}let e=!1,t=!1,n=0,r=()=>{++n===2&&i({screenRecording:e,accessibility:t})};(0,ea.exec)(`osascript -e 'tell application "System Events" to key code 0 using {}'`,{timeout:3e3},s=>{t=!s,r()}),(0,ea.exec)("screencapture -x -R 0,0,1,1 /tmp/9remote_perm_check.png && rm -f /tmp/9remote_perm_check.png",{timeout:5e3},s=>{e=!s,r()})})}function xy(i){let e=Yk[i];e&&process.platform==="darwin"&&(0,ea.exec)(`open "${e}"`,()=>{})}var by=z(yy(),1),Xu=z(require("crypto"),1),{machineIdSync:Xk}=by.default;async function wy(i=null){let e=i||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=Xk();return Xu.default.createHash("sha256").update(t+e).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),Xu.default.randomUUID().replace(/-/g,"").substring(0,16)}}var $r=(0,Oy.fileURLToPath)(new URL(".",__importMetaUrl)),Zk=process.env.NODE_ENV==="development",Qk=5173,Zu=(0,Je.existsSync)((0,st.join)($r,"ui","dist"))?(0,st.join)($r,"ui","dist"):(0,st.join)($r,"ui"),eO={".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"},tO="9remote",iO=`https://registry.npmjs.org/${tO}/latest`;function nO(i,e){let t=(0,sa.request)({hostname:"localhost",port:Qk,path:i.url,method:i.method,headers:i.headers},n=>{e.writeHead(n.statusCode,n.headers),n.pipe(e)});t.on("error",()=>{e.writeHead(502),e.end("Vite dev server not ready yet, please wait...")}),i.pipe(t)}function _y(i,e){if(!(0,Je.existsSync)(e))return!1;let t=(0,st.extname)(e),n=eO[t]||"application/octet-stream";return i.setHeader("Content-Type",n),i.writeHead(200),i.end((0,Je.readFileSync)(e)),!0}async function rO(i){try{let e=await fetch(iO);if(!e.ok)return;let{version:t}=await e.json();t&&t!==i&&jt("updateAvailable",{version:t})}catch{}}var Qu=(0,st.join)(process.env.HOME||process.env.USERPROFILE||".",".9remote","ui-state.json");function ia(){try{(0,Je.mkdirSync)((0,st.join)(process.env.HOME||process.env.USERPROFILE||".",".9remote"),{recursive:!0}),(0,Je.writeFileSync)(Qu,JSON.stringify(re))}catch{}}function sO(){try{if((0,Je.existsSync)(Qu)){let i=JSON.parse((0,Je.readFileSync)(Qu,"utf8"));i.step===4&&i.permanentKey&&(re={...re,...i})}}catch{}}var re={step:0,tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null},na=new Set,rr=new Map,Oi=!1,ep=(0,st.join)(process.env.HOME||process.env.USERPROFILE||".",".9remote","desktop.json");function oO(){try{(0,Je.existsSync)(ep)&&(Oi=!!JSON.parse((0,Je.readFileSync)(ep,"utf8")).enabled)}catch{}}function aO(){try{(0,Je.mkdirSync)((0,st.join)(process.env.HOME||process.env.USERPROFILE||".",".9remote"),{recursive:!0}),(0,Je.writeFileSync)(ep,JSON.stringify({enabled:Oi}))}catch{}}var ra={screenRecording:!1,accessibility:!1};function cO(){Ju().then(i=>{ra=i})}function ta(){return ra}function lO(i){return new Promise(e=>{if(process.platform!=="darwin"){e();return}xy(i),e();let t=0,n=setInterval(()=>{t++,Ju().then(r=>{ra=r,(r[i]||t>=30)&&(clearInterval(n),jt("permissions",{...ra,desktopEnabled:Oi}))})},2e3)})}function Tu(){re={...re,oneTimeKey:"",oneTimeKeyExpiresAt:null,qrUrl:""},jt("state",re),ia()}function ku(i,e,t="ws"){rr.set(i,{ip:e,type:t,connectedAt:Date.now()}),jt("connections",{connections:[...rr.values()]})}function Ou(i){rr.delete(i),jt("connections",{connections:[...rr.values()]})}function tr(i){jt("log",{message:`[${new Date().toLocaleTimeString()}] ${i}`})}function jt(i,e){let t=`data: ${JSON.stringify({type:i,...e})}
173
174
 
174
- `;for(let r of Ho)try{r.write(t)}catch{Ho.delete(r)}}function Sk(i,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",...Nn})}
175
+ `;for(let n of na)try{n.write(t)}catch{na.delete(n)}}function uO(i,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",...re})}
175
176
 
176
- `),Ho.add(e),i.on("close",()=>Ho.delete(e))}function Ek(i){try{let e=JSON.parse(i||"{}");Nn={...Nn,...e},J0("state",Nn)}catch{}}var Ck=$t.rgb(230,138,110);function Tk(){return process.env.CODESPACES==="true"}async function kk(i,e){if(i.method!=="POST"){e.writeHead(405),e.end(JSON.stringify({error:"Method not allowed"}));return}if(!Tk()){e.writeHead(400),e.end(JSON.stringify({error:"Not running on Codespaces"}));return}let t=process.env.CODESPACE_NAME;if(!t){e.writeHead(400),e.end(JSON.stringify({error:"Codespace name not found"}));return}let r=jo();r&&r.emit("codespace:stopping"),e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify({success:!0,message:"Stopping codespace..."})),setTimeout(()=>{(0,G0.exec)(`gh codespace stop -c ${t}`,n=>{n&&console.error("Failed to stop codespace:",n)})},500)}var Mk="localhost",W0=parseInt(process.env.PORT||"2208",10),$0={},Ok=1e4;function V0(i,e,t,r){let n=Date.now(),s,o,c;if(r)s=r.type||"stop",o=r.sessionId||"",c=r.tool||"claude";else try{let d=JSON.parse(t||"{}");s=d.type||"stop",o=d.sessionId||"",c=d.tool||"claude"}catch{e.writeHead(400),e.end(JSON.stringify({error:"Invalid JSON"}));return}let u=jo();if(u){let d={type:s,sessionId:o,tool:c,timestamp:n};if(o&&o){Mx(o,d),u.emit("chatNotification",d);let f=`${c}:${s}`;n-($0[f]||0)<Ok||($0[f]=n,u.timeout(5e3).emit("chatNotificationAck",d,(_,E)=>{let C=u.sockets.sockets.size;!(!_&&E&&E.length>0)&&C===0&&Sx(d)}))}}e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify({success:!0}))}async function X0(){await Px();let i=U0(),e=(0,zo.createServer)(async(n,s)=>{if(t0(s),!i0(n,s))try{let o=(0,K0.parse)(n.url,!0),{pathname:c,search:u}=o,d=n.socket.remoteAddress==="127.0.0.1"||n.socket.remoteAddress==="::1";if((c==="/api/ui/events"||c==="/api/ui/state"||!c.startsWith("/api/")&&!c.startsWith("/proxy/")&&!c.startsWith("/socket.io"))&&!d){s.writeHead(403),s.end(JSON.stringify({error:"forbidden"}));return}if(c==="/api/ui/events"){Sk(n,s);return}if(c==="/api/ui/state"&&n.method==="POST"){let v="";n.on("data",_=>v+=_),n.on("end",()=>{Ek(v),s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({ok:!0}))});return}if(c==="/api/ui/state"&&n.method==="GET"){s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify(Nn));return}if(c==="/api/health"){s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({status:"ok",timestamp:Date.now()}));return}if(c==="/api/version"){let v=JSON.parse((0,Gi.readFileSync)((0,Ft.join)(Bn,"..","package.json"),"utf8"));s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({version:v.version}));return}if(!c.startsWith("/api/")&&!c.startsWith("/proxy/")&&!c.startsWith("/socket.io")){if(vk){wk(n,s);return}let v=c==="/"||c===""?(0,Ft.join)(ku,"index.html"):(0,Ft.join)(ku,c);if(z0(s,v)||z0(s,(0,Ft.join)(ku,"index.html")))return}if(c==="/api/local-sites"){await e0(n,s);return}if(c==="/api/codespace/stop"){await kk(n,s);return}if(c==="/api/notify"&&n.method==="POST"){let v="";n.on("data",_=>v+=_),n.on("end",()=>{V0(n,s,v)});return}if(c==="/api/notify"&&n.method==="GET"){V0(n,s,null,o.query);return}if(c==="/api/proxy/start"&&n.method==="POST"){let v="";n.on("data",_=>v+=_),n.on("end",()=>{let{port:_}=JSON.parse(v||"{}");_?(q0(_),s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({success:!0}))):(s.writeHead(400),s.end(JSON.stringify({error:"Port required"})))});return}if(c==="/api/proxy/end"&&n.method==="POST"){let v="";n.on("data",_=>v+=_),n.on("end",()=>{let{port:_}=JSON.parse(v||"{}");_?(F0(_),s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({success:!0}))):(s.writeHead(400),s.end(JSON.stringify({error:"Port required"})))});return}if(c.startsWith("/proxy/")){let v=c.match(/^\/proxy\/(\d+)(\/.*)?$/);if(v){H0(i,n,s,v[1],v[2]||"/",u);return}}s.writeHead(404),s.end(JSON.stringify({error:"Not found"}))}catch(o){console.error("Error:",n.url,o),s.statusCode=500,s.end("Internal server error")}});await Vx(e),e.listen(W0,n=>{if(n)throw n;console.log(Ck(`\u2705 Server ready on http://${Mk}:${W0}`));let s=JSON.parse((0,Gi.readFileSync)((0,Ft.join)(Bn,"..","package.json"),"utf8"));_k(s.version)});let t=!1,r=async n=>{if(t)return;t=!0,console.log($t.yellow(`
177
- \u{1F6D1} Received ${n}, shutting down gracefully...`));let s=setTimeout(()=>{console.log($t.red("\u26A0\uFE0F Forced exit after 5s timeout")),process.exit(1)},5e3);try{e.close(()=>{console.log($t.gray("\u2713 HTTP server closed"))});let o=jo();o&&(o.emit("server:shutdown"),o.close(()=>{console.log($t.gray("\u2713 Socket.IO closed"))})),await new Promise(c=>setTimeout(c,500)),clearTimeout(s),console.log($t.green("\u2705 Server stopped cleanly")),process.exit(0)}catch(o){console.error($t.red("\u274C Error during shutdown:"),o),clearTimeout(s),process.exit(1)}};return process.on("SIGINT",()=>r("SIGINT")),process.on("SIGTERM",()=>r("SIGTERM")),process.platform==="win32"&&process.on("SIGBREAK",()=>r("SIGBREAK")),e}X0();0&&(module.exports={startServer});
177
+ `),e.write(`data: ${JSON.stringify({type:"connections",connections:[...rr.values()]})}
178
+
179
+ `),e.write(`data: ${JSON.stringify({type:"permissions",...ta(),desktopEnabled:Oi})}
180
+
181
+ `),na.add(e),i.on("close",()=>na.delete(e))}function pO(i){try{let e=JSON.parse(i||"{}");re={...re,...e},jt("state",re),ia()}catch{}}var fO=Yt.rgb(230,138,110);function dO(){return process.env.CODESPACES==="true"}async function hO(i,e){if(i.method!=="POST"){e.writeHead(405),e.end(JSON.stringify({error:"Method not allowed"}));return}if(!dO()){e.writeHead(400),e.end(JSON.stringify({error:"Not running on Codespaces"}));return}let t=process.env.CODESPACE_NAME;if(!t){e.writeHead(400),e.end(JSON.stringify({error:"Codespace name not found"}));return}let n=Jo();n&&n.emit("codespace:stopping"),e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify({success:!0,message:"Stopping codespace..."})),setTimeout(()=>{(0,ky.exec)(`gh codespace stop -c ${t}`,r=>{r&&console.error("Failed to stop codespace:",r)})},500)}var mO="localhost",Sy=parseInt(process.env.PORT||"2208",10),Ey={},vO=1e4;function Cy(i,e,t,n){let r=Date.now(),s,o,a;if(n)s=n.type||"stop",o=n.sessionId||"",a=n.tool||"claude";else try{let p=JSON.parse(t||"{}");s=p.type||"stop",o=p.sessionId||"",a=p.tool||"claude"}catch{e.writeHead(400),e.end(JSON.stringify({error:"Invalid JSON"}));return}let l=Jo();if(l){let p={type:s,sessionId:o,tool:a,timestamp:r};if(o&&o){Z0(o,p),l.emit("chatNotification",p);let d=`${a}:${s}`;r-(Ey[d]||0)<vO||(Ey[d]=r,l.timeout(5e3).emit("chatNotificationAck",p,(g,_)=>{let S=l.sockets.sockets.size;!(!g&&_&&_.length>0)&&S===0&&V0(p)}))}}e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify({success:!0}))}async function My(){await ix();let i=dy(),e=(0,sa.createServer)(async(r,s)=>{if(kx(s),!Ox(r,s))try{let o=(0,Ty.parse)(r.url,!0),{pathname:a,search:l}=o,p=r.socket.remoteAddress==="127.0.0.1"||r.socket.remoteAddress==="::1";if((a==="/api/ui/events"||a==="/api/ui/state"||!a.startsWith("/api/")&&!a.startsWith("/proxy/")&&!a.startsWith("/socket.io"))&&!p){s.writeHead(403),s.end(JSON.stringify({error:"forbidden"}));return}if(a==="/api/ui/events"){uO(r,s);return}if(a==="/api/ui/state"&&r.method==="POST"){let h="";r.on("data",g=>h+=g),r.on("end",()=>{pO(h),s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({ok:!0}))});return}if(a==="/api/ui/state"&&r.method==="GET"){s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({...re,...ta(),desktopEnabled:Oi}));return}if(a==="/api/ui/stop"&&r.method==="POST"){s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({ok:!0})),re={...re,step:0,tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null},jt("state",re),ia(),Gu("stop-tunnel");return}if(a==="/api/ui/start"&&r.method==="POST"){s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({ok:!0})),re={...re,step:1},jt("state",re),ia(),Gu("start-tunnel");return}if(a==="/api/key/one-time"&&r.method==="POST"){let h=re.workerUrl||"https://9remote.cc",g=re.permanentKey;if(!g){s.writeHead(400),s.end(JSON.stringify({error:"No permanent key set"}));return}try{let S=await(await fetch(`${h}/api/temp-key/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:g,expiryMinutes:30})})).json(),T=`${h}/login?k=${S.tempKey}`;re={...re,oneTimeKey:S.tempKey,oneTimeKeyExpiresAt:S.expiresAt,qrUrl:T},jt("state",re),s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({oneTimeKey:S.tempKey,expiresAt:S.expiresAt,qrUrl:T}))}catch(_){s.writeHead(500),s.end(JSON.stringify({error:_.message}))}return}if(a==="/api/key/regenerate"&&r.method==="POST"){s.setHeader("Content-Type","application/json");try{let h=await wy(),{key:g}=Ex(h),_=vy();gy(h,g,_?.name||"Default"),jt("state",{...re,permanentKey:g}),re={...re,permanentKey:g},s.writeHead(200),s.end(JSON.stringify({ok:!0,permanentKey:g}))}catch(h){s.writeHead(500),s.end(JSON.stringify({error:h.message}))}return}if(a==="/api/permissions"&&r.method==="GET"){s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify(ta()));return}if(a==="/api/permissions/request"&&r.method==="POST"){let h="";r.on("data",g=>h+=g),r.on("end",async()=>{try{let{type:g}=JSON.parse(h||"{}");await lO(g),s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({ok:!0}))}catch(g){s.writeHead(500),s.end(JSON.stringify({error:g.message}))}});return}if(a==="/api/desktop/toggle"&&r.method==="POST"){let h="";r.on("data",g=>h+=g),r.on("end",()=>{try{let{enabled:g}=JSON.parse(h||"{}");Oi=!!g,aO(),jt("permissions",{...ta(),desktopEnabled:Oi}),s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({ok:!0,enabled:Oi}))}catch(g){s.writeHead(500),s.end(JSON.stringify({error:g.message}))}});return}if(a==="/api/connections"&&r.method==="GET"){s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({connections:[...rr.values()]}));return}if(a==="/api/health"){s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({status:"ok",timestamp:Date.now()}));return}if(a==="/api/version"){let h=JSON.parse((0,Je.readFileSync)((0,st.join)($r,"..","package.json"),"utf8"));s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({version:h.version}));return}if(!a.startsWith("/api/")&&!a.startsWith("/proxy/")&&!a.startsWith("/socket.io")){if(Zk){nO(r,s);return}let h=a==="/"||a===""?(0,st.join)(Zu,"index.html"):(0,st.join)(Zu,a);if(_y(s,h)||_y(s,(0,st.join)(Zu,"index.html")))return}if(a==="/api/local-sites"){await Tx(r,s);return}if(a==="/api/codespace/stop"){await hO(r,s);return}if(a==="/api/notify"&&r.method==="POST"){let h="";r.on("data",g=>h+=g),r.on("end",()=>{Cy(r,s,h)});return}if(a==="/api/notify"&&r.method==="GET"){Cy(r,s,null,o.query);return}if(a==="/api/proxy/start"&&r.method==="POST"){let h="";r.on("data",g=>h+=g),r.on("end",()=>{let{port:g}=JSON.parse(h||"{}");g?(py(g),s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({success:!0}))):(s.writeHead(400),s.end(JSON.stringify({error:"Port required"})))});return}if(a==="/api/proxy/end"&&r.method==="POST"){let h="";r.on("data",g=>h+=g),r.on("end",()=>{let{port:g}=JSON.parse(h||"{}");g?(fy(g),s.setHeader("Content-Type","application/json"),s.writeHead(200),s.end(JSON.stringify({success:!0}))):(s.writeHead(400),s.end(JSON.stringify({error:"Port required"})))});return}if(a.startsWith("/proxy/")){let h=a.match(/^\/proxy\/(\d+)(\/.*)?$/);if(h){hy(i,r,s,h[1],h[2]||"/",l);return}}s.writeHead(404),s.end(JSON.stringify({error:"Not found"}))}catch(o){console.error("Error:",r.url,o),s.statusCode=500,s.end("Internal server error")}});sO(),oO(),cO(),await vx(e),e.listen(Sy,r=>{if(r)throw r;console.log(fO(`\u2705 Server ready on http://${mO}:${Sy}`));let s=JSON.parse((0,Je.readFileSync)((0,st.join)($r,"..","package.json"),"utf8"));rO(s.version)});let t=!1,n=async r=>{if(t)return;t=!0,console.log(Yt.yellow(`
182
+ \u{1F6D1} Received ${r}, shutting down gracefully...`));let s=setTimeout(()=>{console.log(Yt.red("\u26A0\uFE0F Forced exit after 5s timeout")),process.exit(1)},5e3);try{e.close(()=>{console.log(Yt.gray("\u2713 HTTP server closed"))});let o=Jo();o&&(o.emit("server:shutdown"),o.close(()=>{console.log(Yt.gray("\u2713 Socket.IO closed"))})),await new Promise(a=>setTimeout(a,500)),clearTimeout(s),console.log(Yt.green("\u2705 Server stopped cleanly")),process.exit(0)}catch(o){console.error(Yt.red("\u274C Error during shutdown:"),o),clearTimeout(s),process.exit(1)}};return process.on("SIGINT",()=>n("SIGINT")),process.on("SIGTERM",()=>n("SIGTERM")),process.platform==="win32"&&process.on("SIGBREAK",()=>n("SIGBREAK")),e}My();0&&(module.exports={clearOneTimeKey,pushUiLog,startServer,trackConnection,untrackConnection});
178
183
  /*! Bundled license information:
179
184
 
180
185
  negotiator/index.js: