@joinezco/codeblock 0.0.9 → 0.0.11

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.
Files changed (59) hide show
  1. package/dist/editor.d.ts +23 -2
  2. package/dist/editor.js +346 -41
  3. package/dist/index.d.ts +3 -2
  4. package/dist/index.js +3 -2
  5. package/dist/lsps/index.d.ts +5 -0
  6. package/dist/lsps/index.js +9 -2
  7. package/dist/panels/{footer.d.ts → settings.d.ts} +7 -1
  8. package/dist/panels/{footer.js → settings.js} +12 -3
  9. package/dist/panels/terminal.d.ts +3 -0
  10. package/dist/panels/terminal.js +76 -0
  11. package/dist/panels/toolbar.d.ts +40 -3
  12. package/dist/panels/toolbar.js +919 -160
  13. package/dist/themes/index.js +63 -17
  14. package/dist/types.d.ts +5 -0
  15. package/dist/utils/fs.d.ts +7 -0
  16. package/dist/utils/fs.js +41 -15
  17. package/dist/workers/fs.worker.d.ts +4 -8
  18. package/dist/workers/fs.worker.js +27 -53
  19. package/package.json +14 -12
  20. package/dist/assets/clike-C8IJ2oj_.js +0 -1
  21. package/dist/assets/cmake-BQqOBYOt.js +0 -1
  22. package/dist/assets/dockerfile-C_y-rIpk.js +0 -1
  23. package/dist/assets/fs.worker-DfanUHpQ.js +0 -21
  24. package/dist/assets/go-CTD25R5P.js +0 -1
  25. package/dist/assets/haskell-BWDZoCOh.js +0 -1
  26. package/dist/assets/index-BAnLzvMk.js +0 -1
  27. package/dist/assets/index-BBC9WDX6.js +0 -1
  28. package/dist/assets/index-BEXYxRro.js +0 -1
  29. package/dist/assets/index-BfYmUKH9.js +0 -13
  30. package/dist/assets/index-BhaTNAWE.js +0 -1
  31. package/dist/assets/index-CCbYDSng.js +0 -1
  32. package/dist/assets/index-CIi8tLT6.js +0 -1
  33. package/dist/assets/index-CaANcgI2.js +0 -3
  34. package/dist/assets/index-CkWzFNzm.js +0 -208
  35. package/dist/assets/index-D_XGv9QZ.js +0 -1
  36. package/dist/assets/index-DkmiPfkD.js +0 -1
  37. package/dist/assets/index-DmNlLMQ4.js +0 -6
  38. package/dist/assets/index-DmX_vI7D.js +0 -1
  39. package/dist/assets/index-DogEEevD.js +0 -1
  40. package/dist/assets/index-DsDl5qZV.js +0 -2
  41. package/dist/assets/index-gAy5mDg-.js +0 -1
  42. package/dist/assets/index-i5qJLB2h.js +0 -1
  43. package/dist/assets/javascript.worker-ClsyHOLi.js +0 -552
  44. package/dist/assets/lua-BgMRiT3U.js +0 -1
  45. package/dist/assets/perl-CdXCOZ3F.js +0 -1
  46. package/dist/assets/process-Dw9K5EnD.js +0 -1357
  47. package/dist/assets/properties-C78fOPTZ.js +0 -1
  48. package/dist/assets/ruby-B2Rjki9n.js +0 -1
  49. package/dist/assets/shell-CjFT_Tl9.js +0 -1
  50. package/dist/assets/swift-BzpIVaGY.js +0 -1
  51. package/dist/assets/toml-BXUEaScT.js +0 -1
  52. package/dist/assets/vb-CmGdzxic.js +0 -1
  53. package/dist/e2e/editor.spec.d.ts +0 -1
  54. package/dist/e2e/editor.spec.js +0 -309
  55. package/dist/e2e/example.spec.d.ts +0 -5
  56. package/dist/e2e/example.spec.js +0 -44
  57. package/dist/index.html +0 -15
  58. package/dist/resources/config.json +0 -13
  59. package/dist/styles.css +0 -7
@@ -1,21 +0,0 @@
1
- function po(t,e){return e.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(n){if(n!=="default"&&!(n in t)){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}})}),Object.freeze(t)}/**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */const mo=Symbol("Comlink.proxy"),Oc=Symbol("Comlink.endpoint"),kc=Symbol("Comlink.releaseProxy"),$n=Symbol("Comlink.finalizer"),Xr=Symbol("Comlink.thrown"),yo=t=>typeof t=="object"&&t!==null||typeof t=="function",Ic={canHandle:t=>yo(t)&&t[mo],serialize(t){const{port1:e,port2:r}=new MessageChannel;return vi(t,e),[r,[r]]},deserialize(t){return t.start(),Pc(t)}},Bc={canHandle:t=>yo(t)&&Xr in t,serialize({value:t}){let e;return t instanceof Error?e={isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:e={isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}},wr=new Map([["proxy",Ic],["throw",Bc]]);function Cc(t,e){for(const r of t)if(e===r||r==="*"||r instanceof RegExp&&r.test(e))return!0;return!1}function vi(t,e=globalThis,r=["*"]){e.addEventListener("message",function n(i){if(!i||!i.data)return;if(!Cc(r,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:s,type:o,path:a}=Object.assign({path:[]},i.data),c=(i.data.argumentList||[]).map(Ze);let l;try{const h=a.slice(0,-1).reduce((y,w)=>y[w],t),p=a.reduce((y,w)=>y[w],t);switch(o){case"GET":l=p;break;case"SET":h[a.slice(-1)[0]]=Ze(i.data.value),l=!0;break;case"APPLY":l=p.apply(h,c);break;case"CONSTRUCT":{const y=new p(...c);l=Tn(y)}break;case"ENDPOINT":{const{port1:y,port2:w}=new MessageChannel;vi(t,w),l=Dc(y,[y])}break;case"RELEASE":l=void 0;break;default:return}}catch(h){l={value:h,[Xr]:0}}Promise.resolve(l).catch(h=>({value:h,[Xr]:0})).then(h=>{const[p,y]=fn(h);e.postMessage(Object.assign(Object.assign({},p),{id:s}),y),o==="RELEASE"&&(e.removeEventListener("message",n),wo(e),$n in t&&typeof t[$n]=="function"&&t[$n]())}).catch(h=>{const[p,y]=fn({value:new TypeError("Unserializable return value"),[Xr]:0});e.postMessage(Object.assign(Object.assign({},p),{id:s}),y)})}),e.start&&e.start()}function Ac(t){return t.constructor.name==="MessagePort"}function wo(t){Ac(t)&&t.close()}function Pc(t,e){const r=new Map;return t.addEventListener("message",function(i){const{data:s}=i;if(!s||!s.id)return;const o=r.get(s.id);if(o)try{o(s)}finally{r.delete(s.id)}}),ci(t,r,[],e)}function kr(t){if(t)throw new Error("Proxy has been released and is not useable")}function go(t){return _t(t,new Map,{type:"RELEASE"}).then(()=>{wo(t)})}const un=new WeakMap,ln="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(un.get(t)||0)-1;un.set(t,e),e===0&&go(t)});function Fc(t,e){const r=(un.get(e)||0)+1;un.set(e,r),ln&&ln.register(t,e,t)}function Nc(t){ln&&ln.unregister(t)}function ci(t,e,r=[],n=function(){}){let i=!1;const s=new Proxy(n,{get(o,a){if(kr(i),a===kc)return()=>{Nc(s),go(t),e.clear(),i=!0};if(a==="then"){if(r.length===0)return{then:()=>s};const c=_t(t,e,{type:"GET",path:r.map(l=>l.toString())}).then(Ze);return c.then.bind(c)}return ci(t,e,[...r,a])},set(o,a,c){kr(i);const[l,h]=fn(c);return _t(t,e,{type:"SET",path:[...r,a].map(p=>p.toString()),value:l},h).then(Ze)},apply(o,a,c){kr(i);const l=r[r.length-1];if(l===Oc)return _t(t,e,{type:"ENDPOINT"}).then(Ze);if(l==="bind")return ci(t,e,r.slice(0,-1));const[h,p]=Zi(c);return _t(t,e,{type:"APPLY",path:r.map(y=>y.toString()),argumentList:h},p).then(Ze)},construct(o,a){kr(i);const[c,l]=Zi(a);return _t(t,e,{type:"CONSTRUCT",path:r.map(h=>h.toString()),argumentList:c},l).then(Ze)}});return Fc(s,t),s}function Lc(t){return Array.prototype.concat.apply([],t)}function Zi(t){const e=t.map(fn);return[e.map(r=>r[0]),Lc(e.map(r=>r[1]))]}const _o=new WeakMap;function Dc(t,e){return _o.set(t,e),t}function Tn(t){return Object.assign(t,{[mo]:!0})}function fn(t){for(const[e,r]of wr)if(r.canHandle(t)){const[n,i]=r.serialize(t);return[{type:"HANDLER",name:e,value:n},i]}return[{type:"RAW",value:t},_o.get(t)||[]]}function Ze(t){switch(t.type){case"HANDLER":return wr.get(t.name).deserialize(t.value);case"RAW":return t.value}}function _t(t,e,r,n){return new Promise(i=>{const s=Mc();e.set(s,i),t.start&&t.start(),t.postMessage(Object.assign({id:s},r),n)})}function Mc(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const es=wr.get("proxy"),jc={canHandle(t){return t&&typeof t=="object"&&typeof t.next=="function"&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")},serialize(t){return es.serialize(Tn(t))},async*deserialize(t){const e=es.deserialize(t);for(;;){const{value:r,done:n}=await e.next();if(n)break;yield r}}},Uc={canHandle:t=>t&&typeof t=="object"&&t.signal instanceof AbortSignal,serialize:t=>{const{signal:e,...r}=t,{port1:n,port2:i}=new MessageChannel;return e.addEventListener("abort",()=>{n.postMessage({}),n.close()},{once:!0}),[{port:i,...r},[i]]},deserialize:t=>{const{port:e,...r}=t,n=new AbortController;return e.onmessage=()=>{n.abort(),e.close()},{signal:n.signal,...r}}};var ts=Object.freeze({__proto__:null});function Si(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function $c(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var qn,rs;function qc(){if(rs)return qn;rs=1,qn=t;function t(n,i,s){n instanceof RegExp&&(n=e(n,s)),i instanceof RegExp&&(i=e(i,s));var o=r(n,i,s);return o&&{start:o[0],end:o[1],pre:s.slice(0,o[0]),body:s.slice(o[0]+n.length,o[1]),post:s.slice(o[1]+i.length)}}function e(n,i){var s=i.match(n);return s?s[0]:null}t.range=r;function r(n,i,s){var o,a,c,l,h,p=s.indexOf(n),y=s.indexOf(i,p+1),w=p;if(p>=0&&y>0){if(n===i)return[p,y];for(o=[],c=s.length;w>=0&&!h;)w==p?(o.push(w),p=s.indexOf(n,w+1)):o.length==1?h=[o.pop(),y]:(a=o.pop(),a<c&&(c=a,l=y),y=s.indexOf(i,w+1)),w=p<y&&p>=0?p:y;o.length&&(h=[c,l])}return h}return qn}var Wn,ns;function Wc(){if(ns)return Wn;ns=1;var t=qc();Wn=h;var e="\0SLASH"+Math.random()+"\0",r="\0OPEN"+Math.random()+"\0",n="\0CLOSE"+Math.random()+"\0",i="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function o(E){return parseInt(E,10)==E?parseInt(E,10):E.charCodeAt(0)}function a(E){return E.split("\\\\").join(e).split("\\{").join(r).split("\\}").join(n).split("\\,").join(i).split("\\.").join(s)}function c(E){return E.split(e).join("\\").split(r).join("{").split(n).join("}").split(i).join(",").split(s).join(".")}function l(E){if(!E)return[""];var I=[],P=t("{","}",E);if(!P)return E.split(",");var k=P.pre,R=P.body,b=P.post,T=k.split(",");T[T.length-1]+="{"+R+"}";var O=l(b);return b.length&&(T[T.length-1]+=O.shift(),T.push.apply(T,O)),I.push.apply(I,T),I}function h(E){return E?(E.substr(0,2)==="{}"&&(E="\\{\\}"+E.substr(2)),g(a(E),!0).map(c)):[]}function p(E){return"{"+E+"}"}function y(E){return/^-?0\d/.test(E)}function w(E,I){return E<=I}function v(E,I){return E>=I}function g(E,I){var P=[],k=t("{","}",E);if(!k)return[E];var R=k.pre,b=k.post.length?g(k.post,!1):[""];if(/\$$/.test(k.pre))for(var T=0;T<b.length;T++){var O=R+"{"+k.body+"}"+b[T];P.push(O)}else{var C=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(k.body),D=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(k.body),N=C||D,V=k.body.indexOf(",")>=0;if(!N&&!V)return k.post.match(/,.*\}/)?(E=k.pre+"{"+k.body+n+k.post,g(E)):[E];var $;if(N)$=k.body.split(/\.\./);else if($=l(k.body),$.length===1&&($=g($[0],!1).map(p),$.length===1))return b.map(function(Tr){return k.pre+$[0]+Tr});var G;if(N){var de=o($[0]),Lt=o($[1]),Nn=Math.max($[0].length,$[1].length),Rr=$.length==3?Math.abs(o($[2])):1,xr=w,Ln=Lt<de;Ln&&(Rr*=-1,xr=v);var Dn=$.some(y);G=[];for(var H=de;xr(H,Lt);H+=Rr){var z;if(D)z=String.fromCharCode(H),z==="\\"&&(z="");else if(z=String(H),Dn){var Dt=Nn-z.length;if(Dt>0){var Mt=new Array(Dt+1).join("0");H<0?z="-"+Mt+z.slice(1):z=Mt+z}}G.push(z)}}else{G=[];for(var we=0;we<$.length;we++)G.push.apply(G,g($[we],!1))}for(var we=0;we<G.length;we++)for(var T=0;T<b.length;T++){var O=R+G[we]+b[T];(!I||N||O)&&P.push(O)}}return P}return Wn}var zc=Wc(),Vc=Si(zc);const Hc=1024*64,hn=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>Hc)throw new TypeError("pattern is too long")},Yc={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Ut=t=>t.replace(/[[\]\\-]/g,"\\$&"),Kc=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),is=t=>t.join(""),Jc=(t,e)=>{const r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");const n=[],i=[];let s=r+1,o=!1,a=!1,c=!1,l=!1,h=r,p="";e:for(;s<t.length;){const g=t.charAt(s);if((g==="!"||g==="^")&&s===r+1){l=!0,s++;continue}if(g==="]"&&o&&!c){h=s+1;break}if(o=!0,g==="\\"&&!c){c=!0,s++;continue}if(g==="["&&!c){for(const[E,[I,P,k]]of Object.entries(Yc))if(t.startsWith(E,s)){if(p)return["$.",!1,t.length-r,!0];s+=E.length,k?i.push(I):n.push(I),a=a||P;continue e}}if(c=!1,p){g>p?n.push(Ut(p)+"-"+Ut(g)):g===p&&n.push(Ut(g)),p="",s++;continue}if(t.startsWith("-]",s+1)){n.push(Ut(g+"-")),s+=2;continue}if(t.startsWith("-",s+1)){p=g,s+=2;continue}n.push(Ut(g)),s++}if(h<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,t.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){const g=n[0].length===2?n[0].slice(-1):n[0];return[Kc(g),!1,h-r,!1]}const y="["+(l?"^":"")+is(n)+"]",w="["+(l?"":"^")+is(i)+"]";return[n.length&&i.length?"("+y+"|"+w+")":n.length?y:w,a,h-r,!0]},ir=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),Gc=new Set(["!","?","+","*","@"]),ss=t=>Gc.has(t),Qc="(?!(?:^|/)\\.\\.?(?:$|/))",Ir="(?!\\.)",Xc=new Set(["[","."]),Zc=new Set(["..","."]),eu=new Set("().*{}+?[]^$\\!"),tu=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ei="[^/]",os=Ei+"*?",as=Ei+"+?";class ne{type;#r;#n;#s=!1;#e=[];#t;#o;#c;#a=!1;#i;#u;#f=!1;constructor(e,r,n={}){this.type=e,e&&(this.#n=!0),this.#t=r,this.#r=this.#t?this.#t.#r:this,this.#i=this.#r===this?n:this.#r.#i,this.#c=this.#r===this?[]:this.#r.#c,e==="!"&&!this.#r.#a&&this.#c.push(this),this.#o=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(const e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#u=this.#e.map(e=>String(e)).join("")}#d(){if(this!==this.#r)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let r=e,n=r.#t;for(;n;){for(let i=r.#o+1;!n.type&&i<n.#e.length;i++)for(const s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#e[i])}r=n,n=r.#t}}return this}push(...e){for(const r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof ne&&r.#t===this))throw new Error("invalid part: "+r);this.#e.push(r)}}toJSON(){const e=this.type===null?this.#e.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#e.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#r||this.#r.#a&&this.#t?.type==="!")&&e.push({}),e}isStart(){if(this.#r===this)return!0;if(!this.#t?.isStart())return!1;if(this.#o===0)return!0;const e=this.#t;for(let r=0;r<this.#o;r++){const n=e.#e[r];if(!(n instanceof ne&&n.type==="!"))return!1}return!0}isEnd(){if(this.#r===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();const e=this.#t?this.#t.#e.length:0;return this.#o===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){const r=new ne(this.type,e);for(const n of this.#e)r.copyIn(n);return r}static#l(e,r,n,i){let s=!1,o=!1,a=-1,c=!1;if(r.type===null){let w=n,v="";for(;w<e.length;){const g=e.charAt(w++);if(s||g==="\\"){s=!s,v+=g;continue}if(o){w===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(w===a+2&&c)&&(o=!1),v+=g;continue}else if(g==="["){o=!0,a=w,c=!1,v+=g;continue}if(!i.noext&&ss(g)&&e.charAt(w)==="("){r.push(v),v="";const E=new ne(g,r);w=ne.#l(e,E,w,i),r.push(E);continue}v+=g}return r.push(v),w}let l=n+1,h=new ne(null,r);const p=[];let y="";for(;l<e.length;){const w=e.charAt(l++);if(s||w==="\\"){s=!s,y+=w;continue}if(o){l===a+1?(w==="^"||w==="!")&&(c=!0):w==="]"&&!(l===a+2&&c)&&(o=!1),y+=w;continue}else if(w==="["){o=!0,a=l,c=!1,y+=w;continue}if(ss(w)&&e.charAt(l)==="("){h.push(y),y="";const v=new ne(w,h);h.push(v),l=ne.#l(e,v,l,i);continue}if(w==="|"){h.push(y),y="",p.push(h),h=new ne(null,r);continue}if(w===")")return y===""&&r.#e.length===0&&(r.#f=!0),h.push(y),y="",r.push(...p,h),l;y+=w}return r.type=null,r.#n=void 0,r.#e=[e.substring(n-1)],l}static fromGlob(e,r={}){const n=new ne(null,void 0,r);return ne.#l(e,n,0,r),n}toMMPattern(){if(this!==this.#r)return this.#r.toMMPattern();const e=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#i.nocase&&!this.#i.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;const a=(this.#i.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:e})}get options(){return this.#i}toRegExpSource(e){const r=e??!!this.#i.dot;if(this.#r===this&&this.#d(),!this.type){const c=this.isStart()&&this.isEnd(),l=this.#e.map(w=>{const[v,g,E,I]=typeof w=="string"?ne.#p(w,this.#n,c):w.toRegExpSource(e);return this.#n=this.#n||E,this.#s=this.#s||I,v}).join("");let h="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&Zc.has(this.#e[0]))){const v=Xc,g=r&&v.has(l.charAt(0))||l.startsWith("\\.")&&v.has(l.charAt(2))||l.startsWith("\\.\\.")&&v.has(l.charAt(4)),E=!r&&!e&&v.has(l.charAt(0));h=g?Qc:E?Ir:""}let p="";return this.isEnd()&&this.#r.#a&&this.#t?.type==="!"&&(p="(?:$|\\/)"),[h+l+p,ir(l),this.#n=!!this.#n,this.#s]}const n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:";let s=this.#h(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){const c=this.toString();return this.#e=[c],this.type=null,this.#n=void 0,[c,ir(this.toString()),!1,!1]}let o=!n||e||r||!Ir?"":this.#h(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#f)a=(this.isStart()&&!r?Ir:"")+as;else{const c=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Ir:"")+os+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,ir(s),this.#n=!!this.#n,this.#s]}#h(e){return this.#e.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");const[n,i,s,o]=r.toRegExpSource(e);return this.#s=this.#s||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#p(e,r,n=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){const c=e.charAt(a);if(i){i=!1,s+=(eu.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(c==="["){const[l,h,p,y]=Jc(e,a);if(p){s+=l,o=o||h,a+=p-1,r=r||y;continue}}if(c==="*"){n&&e==="*"?s+=as:s+=os,r=!0;continue}if(c==="?"){s+=Ei,r=!0;continue}s+=tu(c)}return[s,ir(e),!!r,o]}}const ru=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var zn={};const se=(t,e,r={})=>(hn(e),!r.nocomment&&e.charAt(0)==="#"?!1:new On(e,r).match(t)),nu=/^\*+([^+@!?\*\[\(]*)$/,iu=t=>e=>!e.startsWith(".")&&e.endsWith(t),su=t=>e=>e.endsWith(t),ou=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),au=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),cu=/^\*+\.\*+$/,uu=t=>!t.startsWith(".")&&t.includes("."),lu=t=>t!=="."&&t!==".."&&t.includes("."),fu=/^\.\*+$/,hu=t=>t!=="."&&t!==".."&&t.startsWith("."),du=/^\*+$/,pu=t=>t.length!==0&&!t.startsWith("."),mu=t=>t.length!==0&&t!=="."&&t!=="..",yu=/^\?+([^+@!?\*\[\(]*)?$/,wu=([t,e=""])=>{const r=bo([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},gu=([t,e=""])=>{const r=vo([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},_u=([t,e=""])=>{const r=vo([t]);return e?n=>r(n)&&n.endsWith(e):r},bu=([t,e=""])=>{const r=bo([t]);return e?n=>r(n)&&n.endsWith(e):r},bo=([t])=>{const e=t.length;return r=>r.length===e&&!r.startsWith(".")},vo=([t])=>{const e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},So=typeof process=="object"&&process?typeof zn=="object"&&zn&&zn.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",cs={win32:{sep:"\\"},posix:{sep:"/"}},vu=So==="win32"?cs.win32.sep:cs.posix.sep;se.sep=vu;const ue=Symbol("globstar **");se.GLOBSTAR=ue;const Su="[^/]",Eu=Su+"*?",Ru="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",xu="(?:(?!(?:\\/|^)\\.).)*?",Tu=(t,e={})=>r=>se(r,t,e);se.filter=Tu;const ce=(t,e={})=>Object.assign({},t,e),Ou=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return se;const e=se;return Object.assign((n,i,s={})=>e(n,i,ce(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,ce(t,s))}static defaults(i){return e.defaults(ce(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,ce(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,ce(t,s))}},unescape:(n,i={})=>e.unescape(n,ce(t,i)),escape:(n,i={})=>e.escape(n,ce(t,i)),filter:(n,i={})=>e.filter(n,ce(t,i)),defaults:n=>e.defaults(ce(t,n)),makeRe:(n,i={})=>e.makeRe(n,ce(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,ce(t,i)),match:(n,i,s={})=>e.match(n,i,ce(t,s)),sep:e.sep,GLOBSTAR:ue})};se.defaults=Ou;const Eo=(t,e={})=>(hn(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Vc(t));se.braceExpand=Eo;const ku=(t,e={})=>new On(t,e).makeRe();se.makeRe=ku;const Iu=(t,e,r={})=>{const n=new On(e,r);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};se.match=Iu;const us=/[?*]|[+@!]\(.*?\)|\[|\]/,Bu=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class On{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){hn(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||So,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const e of this.set)for(const r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){const e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);const n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const c=s[0]===""&&s[1]===""&&(s[2]==="?"||!us.test(s[2]))&&!us.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(h=>this.parse(h))];if(l)return[s[0],...s.slice(1).map(h=>this.parse(h))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){const o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");const{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,i)=>{const s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){const s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(r=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){const i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,e.splice(n-1,2),n-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1];const c=n[i+2],l=n[i+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;r=!0,n.splice(i,1);const h=n.slice(0);h[i]="**",e.push(h),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){const a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){const o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;const c=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...c),n.length===0&&n.push(""),s-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let n=r+1;n<e.length;n++){const i=this.partsMatch(e[r],e[n],!this.preserveMultipleSlashes);if(i){e[r]=[],e[n]=i;break}}return e.filter(r=>r.length)}partsMatch(e,r,n=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<r.length;)if(e[i]===r[s])o.push(a==="b"?r[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&r[s]===e[i+1])o.push(e[i]),i++;else if(n&&r[s]==="**"&&e[i]===r[s+1])o.push(r[s]),s++;else if(e[i]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(r[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(r[s]),i++,s++}else return!1;return e.length===r.length&&o}parseNegate(){if(this.nonegate)return;const e=this.pattern;let r=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=e.slice(n)),this.negate=r}matchOne(e,r,n=!1){const i=this.options;if(this.isWindows){const g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),E=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),I=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),P=!I&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),k=E?3:g?0:void 0,R=P?3:I?0:void 0;if(typeof k=="number"&&typeof R=="number"){const[b,T]=[e[k],r[R]];b.toLowerCase()===T.toLowerCase()&&(r[R]=b,R>k?r=r.slice(R):k>R&&(e=e.slice(k)))}}const{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var o=0,a=0,c=e.length,l=r.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var h=r[a],p=e[o];if(this.debug(r,h,p),h===!1)return!1;if(h===ue){this.debug("GLOBSTAR",[r,h,p]);var y=o,w=a+1;if(w===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;y<c;){var v=e[y];if(this.debug(`
6
- globstar while`,e,y,r,w,v),this.matchOne(e.slice(y),r.slice(w),n))return this.debug("globstar found match!",y,c,v),!0;if(v==="."||v===".."||!i.dot&&v.charAt(0)==="."){this.debug("dot detected!",e,y,r,w);break}this.debug("globstar swallow a segment, and continue"),y++}return!!(n&&(this.debug(`
7
- >>> no match, partial?`,e,y,r,w),y===c))}let g;if(typeof h=="string"?(g=p===h,this.debug("string match",h,p,g)):(g=h.test(p),this.debug("pattern match",h,p,g)),!g)return!1}if(o===c&&a===l)return!0;if(o===c)return n;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Eo(this.pattern,this.options)}parse(e){hn(e);const r=this.options;if(e==="**")return ue;if(e==="")return"";let n,i=null;(n=e.match(du))?i=r.dot?mu:pu:(n=e.match(nu))?i=(r.nocase?r.dot?au:ou:r.dot?su:iu)(n[1]):(n=e.match(yu))?i=(r.nocase?r.dot?gu:wu:r.dot?_u:bu)(n):(n=e.match(cu))?i=r.dot?lu:uu:(n=e.match(fu))&&(i=hu);const s=ne.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const e=this.set;if(!e.length)return this.regexp=!1,this.regexp;const r=this.options,n=r.noglobstar?Eu:r.dot?Ru:xu,i=new Set(r.nocase?["i"]:[]);let s=e.map(c=>{const l=c.map(h=>{if(h instanceof RegExp)for(const p of h.flags.split(""))i.add(p);return typeof h=="string"?Bu(h):h===ue?ue:h._src});return l.forEach((h,p)=>{const y=l[p+1],w=l[p-1];h!==ue||w===ue||(w===void 0?y!==void 0&&y!==ue?l[p+1]="(?:\\/|"+n+"\\/)?"+y:l[p]=n:y===void 0?l[p-1]=w+"(?:\\/|"+n+")?":y!==ue&&(l[p-1]=w+"(?:\\/|\\/"+n+"\\/)"+y,l[p+1]=ue))}),l.filter(h=>h!==ue).join("/")}).join("|");const[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;const n=this.options;this.isWindows&&(e=e.split("\\").join("/"));const i=this.slashSplit(e);this.debug(this.pattern,"split",i);const s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){const c=s[a];let l=i;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return se.defaults(e).Minimatch}}se.AST=ne;se.Minimatch=On;se.escape=ru;se.unescape=ir;var $t={},qt={},ls;function Cu(){if(ls)return qt;ls=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.isFloat32=void 0;const t=new DataView(new ArrayBuffer(4)),e=r=>(t.setFloat32(0,r),r===t.getFloat32(0));return qt.isFloat32=e,qt}var Wt={},fs;function Ro(){if(fs)return Wt;fs=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.JsonPackExtension=void 0;let t=class{constructor(r,n){this.tag=r,this.val=n}};return Wt.JsonPackExtension=t,Wt}var zt={},Vt={},Ht={},hs;function Au(){if(hs)return Ht;hs=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.Slice=void 0;let t=class{constructor(r,n,i,s){this.uint8=r,this.view=n,this.start=i,this.end=s}subarray(){return this.uint8.subarray(this.start,this.end)}};return Ht.Slice=t,Ht}var ds;function xo(){if(ds)return Vt;ds=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.Writer=void 0;const t=Au(),e=new Uint8Array([]),r=new DataView(e.buffer),n=typeof Buffer=="function",i=n?Buffer.prototype.utf8Write:null,s=n?Buffer.from:null,o=typeof TextEncoder<"u"?new TextEncoder:null;let a=class{constructor(l=64*1024){this.allocSize=l,this.view=r,this.x0=0,this.x=0,this.uint8=new Uint8Array(l),this.size=l,this.view=new DataView(this.uint8.buffer)}grow(l){const h=this.x0,p=this.x,y=this.uint8,w=new Uint8Array(l),v=new DataView(w.buffer),g=y.subarray(h,p);w.set(g,0),this.x=p-h,this.x0=0,this.uint8=w,this.size=l,this.view=v}ensureCapacity(l){const h=this.size,p=h-this.x;if(p<l){const y=h-this.x0,w=l-p,v=y+w;this.grow(v<=this.allocSize?this.allocSize:v*2)}}move(l){this.ensureCapacity(l),this.x+=l}reset(){this.x0=this.x}newBuffer(l){const h=this.uint8=new Uint8Array(l);this.size=l,this.view=new DataView(h.buffer),this.x=this.x0=0}flush(){const l=this.uint8.subarray(this.x0,this.x);return this.x0=this.x,l}flushSlice(){const l=new t.Slice(this.uint8,this.view,this.x0,this.x);return this.x0=this.x,l}u8(l){this.ensureCapacity(1),this.uint8[this.x++]=l}u16(l){this.ensureCapacity(2),this.view.setUint16(this.x,l),this.x+=2}u32(l){this.ensureCapacity(4),this.view.setUint32(this.x,l),this.x+=4}i32(l){this.ensureCapacity(4),this.view.setInt32(this.x,l),this.x+=4}u64(l){this.ensureCapacity(8),this.view.setBigUint64(this.x,BigInt(l)),this.x+=8}f64(l){this.ensureCapacity(8),this.view.setFloat64(this.x,l),this.x+=8}u8u16(l,h){this.ensureCapacity(3);let p=this.x;this.uint8[p++]=l,this.uint8[p++]=h>>>8,this.uint8[p++]=h&255,this.x=p}u8u32(l,h){this.ensureCapacity(5);let p=this.x;this.uint8[p++]=l,this.view.setUint32(p,h),this.x=p+4}u8u64(l,h){this.ensureCapacity(9);let p=this.x;this.uint8[p++]=l,this.view.setBigUint64(p,BigInt(h)),this.x=p+8}u8f32(l,h){this.ensureCapacity(5);let p=this.x;this.uint8[p++]=l,this.view.setFloat32(p,h),this.x=p+4}u8f64(l,h){this.ensureCapacity(9);let p=this.x;this.uint8[p++]=l,this.view.setFloat64(p,h),this.x=p+8}buf(l,h){this.ensureCapacity(h);const p=this.x;this.uint8.set(l,p),this.x=p+h}utf8(l){const h=l.length*4;if(h<168)return this.utf8Native(l);if(i){const p=i.call(this.uint8,l,this.x,h);return this.x+=p,p}else if(s){const p=this.uint8,y=p.byteOffset+this.x,v=s(p.buffer).subarray(y,y+h).write(l,0,h,"utf8");return this.x+=v,v}else if(h>1024&&o){const p=o.encodeInto(l,this.uint8.subarray(this.x,this.x+h)).written;return this.x+=p,p}return this.utf8Native(l)}utf8Native(l){const h=l.length,p=this.uint8;let y=this.x,w=0;for(;w<h;){let g=l.charCodeAt(w++);if((g&4294967168)===0){p[y++]=g;continue}else if((g&4294965248)===0)p[y++]=g>>6&31|192;else{if(g>=55296&&g<=56319&&w<h){const E=l.charCodeAt(w);(E&64512)===56320&&(w++,g=((g&1023)<<10)+(E&1023)+65536)}(g&4294901760)===0?(p[y++]=g>>12&15|224,p[y++]=g>>6&63|128):(p[y++]=g>>18&7|240,p[y++]=g>>12&63|128,p[y++]=g>>6&63|128)}p[y++]=g&63|128}const v=y-this.x;return this.x=y,v}ascii(l){const h=l.length;this.ensureCapacity(h);const p=this.uint8;let y=this.x,w=0;for(;w<h;)p[y++]=l.charCodeAt(w++);this.x=y}};return Vt.Writer=a,Vt}var ps;function Pu(){if(ps)return zt;ps=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.CborEncoderFast=void 0;const t=xo(),e=Number.isSafeInteger;let r=class{constructor(i=new t.Writer){this.writer=i}encode(i){return this.writeAny(i),this.writer.flush()}encodeToSlice(i){return this.writeAny(i),this.writer.flushSlice()}writeAny(i){switch(typeof i){case"number":return this.writeNumber(i);case"string":return this.writeStr(i);case"boolean":return this.writer.u8(244+ +i);case"object":{if(!i)return this.writer.u8(246);switch(i.constructor){case Array:return this.writeArr(i);default:return this.writeObj(i)}}}}writeCbor(){this.writer.u8u16(217,55799)}writeEnd(){this.writer.u8(255)}writeNull(){this.writer.u8(246)}writeBoolean(i){i?this.writer.u8(245):this.writer.u8(244)}writeNumber(i){e(i)?this.writeInteger(i):typeof i=="bigint"?this.writeBigInt(i):this.writeFloat(i)}writeBigInt(i){i>=0?this.writeBigUint(i):this.writeBigSint(i)}writeBigUint(i){if(i<=Number.MAX_SAFE_INTEGER)return this.writeUInteger(Number(i));this.writer.u8u64(27,i)}writeBigSint(i){if(i>=Number.MIN_SAFE_INTEGER)return this.encodeNint(Number(i));const s=-BigInt(1)-i;this.writer.u8u64(59,s)}writeInteger(i){i>=0?this.writeUInteger(i):this.encodeNint(i)}writeUInteger(i){const s=this.writer;s.ensureCapacity(9);const o=s.uint8;let a=s.x;i<=23?o[a++]=0+i:i<=255?(o[a++]=24,o[a++]=i):i<=65535?(o[a++]=25,s.view.setUint16(a,i),a+=2):i<=4294967295?(o[a++]=26,s.view.setUint32(a,i),a+=4):(o[a++]=27,s.view.setBigUint64(a,BigInt(i)),a+=8),s.x=a}encodeNumber(i){this.writeNumber(i)}encodeInteger(i){this.writeInteger(i)}encodeUint(i){this.writeUInteger(i)}encodeNint(i){const s=-1-i,o=this.writer;o.ensureCapacity(9);const a=o.uint8;let c=o.x;s<24?a[c++]=32+s:s<=255?(a[c++]=56,a[c++]=s):s<=65535?(a[c++]=57,o.view.setUint16(c,s),c+=2):s<=4294967295?(a[c++]=58,o.view.setUint32(c,s),c+=4):(a[c++]=59,o.view.setBigUint64(c,BigInt(s)),c+=8),o.x=c}writeFloat(i){this.writer.u8f64(251,i)}writeBin(i){const s=i.length;this.writeBinHdr(s),this.writer.buf(i,s)}writeBinHdr(i){const s=this.writer;i<=23?s.u8(64+i):i<=255?s.u16(22528+i):i<=65535?s.u8u16(89,i):i<=4294967295?s.u8u32(90,i):s.u8u64(91,i)}writeStr(i){const s=this.writer,a=i.length*4;s.ensureCapacity(5+a);const c=s.uint8;let l=s.x;a<=23?s.x++:a<=255?(c[s.x++]=120,l=s.x,s.x++):a<=65535?(c[s.x++]=121,l=s.x,s.x+=2):(c[s.x++]=122,l=s.x,s.x+=4);const h=s.utf8(i);a<=23?c[l]=96+h:a<=255?c[l]=h:a<=65535?s.view.setUint16(l,h):s.view.setUint32(l,h)}writeStrHdr(i){const s=this.writer;i<=23?s.u8(96+i):i<=255?s.u16(30720+i):i<=65535?s.u8u16(121,i):s.u8u32(122,i)}writeAsciiStr(i){this.writeStrHdr(i.length),this.writer.ascii(i)}writeArr(i){const s=i.length;this.writeArrHdr(s);for(let o=0;o<s;o++)this.writeAny(i[o])}writeArrHdr(i){const s=this.writer;i<=23?s.u8(128+i):i<=255?s.u16(38912+i):i<=65535?s.u8u16(153,i):i<=4294967295?s.u8u32(154,i):s.u8u64(155,i)}writeObj(i){const s=Object.keys(i),o=s.length;this.writeObjHdr(o);for(let a=0;a<o;a++){const c=s[a];this.writeStr(c),this.writeAny(i[c])}}writeObjHdr(i){const s=this.writer;i<=23?s.u8(160+i):i<=255?s.u16(47104+i):i<=65535?s.u8u16(185,i):i<=4294967295?s.u8u32(186,i):s.u8u64(187,i)}writeMapHdr(i){this.writeObjHdr(i)}writeStartMap(){this.writer.u8(191)}writeTag(i,s){this.writeTagHdr(i),this.writeAny(s)}writeTagHdr(i){const s=this.writer;i<=23?s.u8(192+i):i<=255?s.u16(55296+i):i<=65535?s.u8u16(217,i):i<=4294967295?s.u8u32(218,i):s.u8u64(219,i)}writeTkn(i){const s=this.writer;i<=23?s.u8(224+i):i<=255&&s.u16(63488+i)}writeStartStr(){this.writer.u8(127)}writeStrChunk(i){throw new Error("Not implemented")}writeEndStr(){throw new Error("Not implemented")}writeStartBin(){this.writer.u8(95)}writeBinChunk(i){throw new Error("Not implemented")}writeEndBin(){throw new Error("Not implemented")}writeStartArr(){this.writer.u8(159)}writeArrChunk(i){throw new Error("Not implemented")}writeEndArr(){this.writer.u8(255)}writeStartObj(){this.writer.u8(191)}writeObjChunk(i,s){throw new Error("Not implemented")}writeEndObj(){this.writer.u8(255)}};return zt.CborEncoderFast=r,zt}var Yt={},ms;function Ri(){if(ms)return Yt;ms=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.JsonPackValue=void 0;let t=class{constructor(r){this.val=r}};return Yt.JsonPackValue=t,Yt}var ys;function Fu(){if(ys)return $t;ys=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.CborEncoder=void 0;const t=Cu(),e=Ro(),r=Pu(),n=Ri();let i=class extends r.CborEncoderFast{writeUnknown(o){this.writeNull()}writeAny(o){switch(typeof o){case"number":return this.writeNumber(o);case"string":return this.writeStr(o);case"boolean":return this.writer.u8(244+ +o);case"object":{if(!o)return this.writer.u8(246);switch(o.constructor){case Object:return this.writeObj(o);case Array:return this.writeArr(o);case Uint8Array:return this.writeBin(o);case Map:return this.writeMap(o);case e.JsonPackExtension:return this.writeTag(o.tag,o.val);case n.JsonPackValue:const c=o.val;return this.writer.buf(c,c.length);default:return o instanceof Uint8Array?this.writeBin(o):Array.isArray(o)?this.writeArr(o):o instanceof Map?this.writeMap(o):this.writeUnknown(o)}}case"undefined":return this.writeUndef();case"bigint":return this.writeBigInt(o);default:return this.writeUnknown(o)}}writeFloat(o){(0,t.isFloat32)(o)?this.writer.u8f32(250,o):this.writer.u8f64(251,o)}writeMap(o){this.writeMapHdr(o.size),o.forEach((a,c)=>{this.writeAny(c),this.writeAny(a)})}writeUndef(){this.writer.u8(247)}};return $t.CborEncoder=i,$t}var Nu=Fu(),Kt={},Jt={},ui=function(t,e){return ui=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},ui(t,e)};function To(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ui(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var dn=function(){return dn=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},dn.apply(this,arguments)};function Oo(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function ko(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function Io(t,e){return function(r,n){e(r,n,t)}}function Bo(t,e,r,n,i,s){function o(I){if(I!==void 0&&typeof I!="function")throw new TypeError("Function expected");return I}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,h=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),p,y=!1,w=r.length-1;w>=0;w--){var v={};for(var g in n)v[g]=g==="access"?{}:n[g];for(var g in n.access)v.access[g]=n.access[g];v.addInitializer=function(I){if(y)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(I||null))};var E=(0,r[w])(a==="accessor"?{get:h.get,set:h.set}:h[c],v);if(a==="accessor"){if(E===void 0)continue;if(E===null||typeof E!="object")throw new TypeError("Object expected");(p=o(E.get))&&(h.get=p),(p=o(E.set))&&(h.set=p),(p=o(E.init))&&i.unshift(p)}else(p=o(E))&&(a==="field"?i.unshift(p):h[c]=p)}l&&Object.defineProperty(l,n.name,h),y=!0}function Co(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function Ao(t){return typeof t=="symbol"?t:"".concat(t)}function Po(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function Fo(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function No(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(h){try{l(n.next(h))}catch(p){o(p)}}function c(h){try{l(n.throw(h))}catch(p){o(p)}}function l(h){h.done?s(h.value):i(h.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function Lo(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(h){return c([l,h])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(h){l=[6,h],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var kn=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};function Do(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kn(e,t,r)}function pn(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function xi(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Mo(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(xi(arguments[e]));return t}function jo(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Uo(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}function Bt(t){return this instanceof Bt?(this.v=t,this):new Bt(t)}function $o(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(w){return function(v){return Promise.resolve(v).then(w,p)}}function a(w,v){n[w]&&(i[w]=function(g){return new Promise(function(E,I){s.push([w,g,E,I])>1||c(w,g)})},v&&(i[w]=v(i[w])))}function c(w,v){try{l(n[w](v))}catch(g){y(s[0][3],g)}}function l(w){w.value instanceof Bt?Promise.resolve(w.value.v).then(h,p):y(s[0][2],w)}function h(w){c("next",w)}function p(w){c("throw",w)}function y(w,v){w(v),s.shift(),s.length&&c(s[0][0],s[0][1])}}function qo(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Bt(t[i](o)),done:!1}:s?s(o):o}:s}}function Wo(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof pn=="function"?pn(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function zo(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Lu=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},li=function(t){return li=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},li(t)};function Vo(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=li(t),n=0;n<r.length;n++)r[n]!=="default"&&kn(e,t,r[n]);return Lu(e,t),e}function Ho(t){return t&&t.__esModule?t:{default:t}}function Yo(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Ko(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function Jo(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Go(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var Du=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function Qo(t){function e(s){t.error=t.hasError?new Du(s,t.error,"An error was suppressed during disposal."):s,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(s).then(i,function(o){return e(o),i()})}else n|=1}catch(o){e(o)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}function Xo(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,s,o){return n?e?".jsx":".js":i&&(!s||!o)?r:i+s+"."+o.toLowerCase()+"js"}):t}var Mu={__extends:To,__assign:dn,__rest:Oo,__decorate:ko,__param:Io,__esDecorate:Bo,__runInitializers:Co,__propKey:Ao,__setFunctionName:Po,__metadata:Fo,__awaiter:No,__generator:Lo,__createBinding:kn,__exportStar:Do,__values:pn,__read:xi,__spread:Mo,__spreadArrays:jo,__spreadArray:Uo,__await:Bt,__asyncGenerator:$o,__asyncDelegator:qo,__asyncValues:Wo,__makeTemplateObject:zo,__importStar:Vo,__importDefault:Ho,__classPrivateFieldGet:Yo,__classPrivateFieldSet:Ko,__classPrivateFieldIn:Jo,__addDisposableResource:Go,__disposeResources:Qo,__rewriteRelativeImportExtension:Xo},ju=Object.freeze({__proto__:null,__addDisposableResource:Go,get __assign(){return dn},__asyncDelegator:qo,__asyncGenerator:$o,__asyncValues:Wo,__await:Bt,__awaiter:No,__classPrivateFieldGet:Yo,__classPrivateFieldIn:Jo,__classPrivateFieldSet:Ko,__createBinding:kn,__decorate:ko,__disposeResources:Qo,__esDecorate:Bo,__exportStar:Do,__extends:To,__generator:Lo,__importDefault:Ho,__importStar:Vo,__makeTemplateObject:zo,__metadata:Fo,__param:Io,__propKey:Ao,__read:xi,__rest:Oo,__rewriteRelativeImportExtension:Xo,__runInitializers:Co,__setFunctionName:Po,__spread:Mo,__spreadArray:Uo,__spreadArrays:jo,__values:pn,default:Mu}),gr=$c(ju),Gt={},ws;function Uu(){if(ws)return Gt;ws=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.decodeF16=void 0;const t=Math.pow,e=r=>{const n=(r&31744)>>10,i=r&1023;return(r>>15?-1:1)*(n?n===31?i?NaN:1/0:t(2,n-15)*(1+i/1024):6103515625e-14*(i/1024))};return Gt.decodeF16=e,Gt}var Qt={},Xt={},Br={},Ye={},gs;function $u(){if(gs)return Ye;gs=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.decodeAsciiMax15=Ye.decodeAscii=void 0;const t=String.fromCharCode,e=(n,i,s)=>{const o=[];for(let a=0;a<s;a++){const c=n[i++];if(c&128)return;o.push(c)}return t.apply(String,o)};Ye.decodeAscii=e;const r=(n,i,s)=>{if(s<4)if(s<2){if(s===0)return"";{const o=n[i++];if((o&128)>1){i-=1;return}return t(o)}}else{const o=n[i++],a=n[i++];if((o&128)>0||(a&128)>0){i-=2;return}if(s<3)return t(o,a);const c=n[i++];if((c&128)>0){i-=3;return}return t(o,a,c)}else{const o=n[i++],a=n[i++],c=n[i++],l=n[i++];if((o&128)>0||(a&128)>0||(c&128)>0||(l&128)>0){i-=4;return}if(s<6){if(s===4)return t(o,a,c,l);{const h=n[i++];if((h&128)>0){i-=5;return}return t(o,a,c,l,h)}}else if(s<8){const h=n[i++],p=n[i++];if((h&128)>0||(p&128)>0){i-=6;return}if(s<7)return t(o,a,c,l,h,p);const y=n[i++];if((y&128)>0){i-=7;return}return t(o,a,c,l,h,p,y)}else{const h=n[i++],p=n[i++],y=n[i++],w=n[i++];if((h&128)>0||(p&128)>0||(y&128)>0||(w&128)>0){i-=8;return}if(s<10){if(s===8)return t(o,a,c,l,h,p,y,w);{const v=n[i++];if((v&128)>0){i-=9;return}return t(o,a,c,l,h,p,y,w,v)}}else if(s<12){const v=n[i++],g=n[i++];if((v&128)>0||(g&128)>0){i-=10;return}if(s<11)return t(o,a,c,l,h,p,y,w,v,g);const E=n[i++];if((E&128)>0){i-=11;return}return t(o,a,c,l,h,p,y,w,v,g,E)}else{const v=n[i++],g=n[i++],E=n[i++],I=n[i++];if((v&128)>0||(g&128)>0||(E&128)>0||(I&128)>0){i-=12;return}if(s<14){if(s===12)return t(o,a,c,l,h,p,y,w,v,g,E,I);{const P=n[i++];if((P&128)>0){i-=13;return}return t(o,a,c,l,h,p,y,w,v,g,E,I,P)}}else{const P=n[i++],k=n[i++];if((P&128)>0||(k&128)>0){i-=14;return}if(s<15)return t(o,a,c,l,h,p,y,w,v,g,E,I,P,k);const R=n[i++];if((R&128)>0){i-=15;return}return t(o,a,c,l,h,p,y,w,v,g,E,I,P,k,R)}}}}};return Ye.decodeAsciiMax15=r,Ye}var Cr={},_s;function qu(){if(_s)return Cr;_s=1,Object.defineProperty(Cr,"__esModule",{value:!0});const t=String.fromCharCode;return Cr.default=(e,r,n)=>{let i=r;const s=i+n,o=[];for(;i<s;){let a=e[i++];if((a&128)!==0){const c=e[i++]&63;if((a&224)===192)a=(a&31)<<6|c;else{const l=e[i++]&63;if((a&240)===224)a=(a&31)<<12|c<<6|l;else if((a&248)===240){const h=e[i++]&63;let p=(a&7)<<18|c<<12|l<<6|h;if(p>65535){p-=65536;const y=p>>>10&1023|55296;a=56320|p&1023,o.push(y)}else a=p}}}o.push(a)}return t.apply(String,o)},Cr}var bs;function Wu(){if(bs)return Br;bs=1,Object.defineProperty(Br,"__esModule",{value:!0});const t=gr,e=$u(),r=t.__importDefault(qu()),n=typeof Buffer<"u",i=n?Buffer.prototype.utf8Slice:null,s=n?Buffer.from:null,o=(h,p,y)=>(0,e.decodeAsciiMax15)(h,p,y)??(0,r.default)(h,p,y),a=(h,p,y)=>(0,e.decodeAscii)(h,p,y)??(0,r.default)(h,p,y),c=i?(h,p,y)=>i.call(h,p,p+y):s?(h,p,y)=>s(h).subarray(p,p+y).toString("utf8"):r.default,l=(h,p,y)=>y<16?o(h,p,y):y<32?a(h,p,y):c(h,p,y);return Br.default=l,Br}var vs;function zu(){if(vs)return Xt;vs=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.decodeUtf8=void 0;const e=gr.__importDefault(Wu());return Xt.decodeUtf8=e.default,Xt}var Ss;function Vu(){if(Ss)return Qt;Ss=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.Reader=void 0;const t=zu();let e=class{constructor(){this.uint8=new Uint8Array([]),this.view=new DataView(this.uint8.buffer),this.x=0}reset(n){this.x=0,this.uint8=n,this.view=new DataView(n.buffer,n.byteOffset,n.length)}peak(){return this.view.getUint8(this.x)}skip(n){this.x+=n}buf(n){const i=this.x+n,s=this.uint8.subarray(this.x,i);return this.x=i,s}u8(){return this.uint8[this.x++]}i8(){return this.view.getInt8(this.x++)}u16(){let n=this.x;const i=(this.uint8[n++]<<8)+this.uint8[n++];return this.x=n,i}i16(){const n=this.view.getInt16(this.x);return this.x+=2,n}u32(){const n=this.view.getUint32(this.x);return this.x+=4,n}i32(){const n=this.view.getInt32(this.x);return this.x+=4,n}u64(){const n=this.view.getBigUint64(this.x);return this.x+=8,n}i64(){const n=this.view.getBigInt64(this.x);return this.x+=8,n}f32(){const n=this.x;return this.x+=4,this.view.getFloat32(n)}f64(){const n=this.x;return this.x+=8,this.view.getFloat64(n)}utf8(n){const i=this.x;return this.x+=n,(0,t.decodeUtf8)(this.uint8,i,n)}ascii(n){const i=this.uint8;let s="";const o=this.x+n;for(let a=this.x;a<o;a++)s+=String.fromCharCode(i[a]);return this.x=o,s}};return Qt.Reader=e,Qt}var Ar={},Zt={},Pr={},Es;function Hu(){if(Es)return Pr;Es=1,Object.defineProperty(Pr,"__esModule",{value:!0});const t=String.fromCharCode;return Pr.default=(e,r,n)=>{let i=r;const s=i+n;let o="";for(;i<s;){const a=e[i++];if((a&128)===0){o+=t(a);continue}const c=e[i++]&63;if((a&224)===192){o+=t((a&31)<<6|c);continue}const l=e[i++]&63;if((a&240)===224){o+=t((a&31)<<12|c<<6|l);continue}if((a&248)===240){const h=e[i++]&63;let p=(a&7)<<18|c<<12|l<<6|h;if(p>65535){p-=65536;const y=p>>>10&1023|55296;p=56320|p&1023,o+=t(y,p)}else o+=t(p)}else o+=t(a)}return o},Pr}var Rs;function Yu(){if(Rs)return Zt;Rs=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.CachedUtf8Decoder=void 0;const e=gr.__importDefault(Hu());let r=1+Math.round(Math.random()*((-1>>>0)-1));function n(o,a){return r^=r<<13,r^=r>>>17,r^=r<<5,(r>>>0)%(a-o+1)+o}class i{constructor(a,c){this.bytes=a,this.value=c}}let s=class{constructor(){this.caches=[];for(let a=0;a<31;a++)this.caches.push([])}get(a,c,l){const h=this.caches[l-1],p=h.length;e:for(let y=0;y<p;y++){const w=h[y],v=w.bytes;for(let g=0;g<l;g++)if(v[g]!==a[c+g])continue e;return w.value}return null}store(a,c){const l=this.caches[a.length-1],h=new i(a,c);l.length>=16?l[n(0,15)]=h:l.push(h)}decode(a,c,l){if(!l)return"";const h=this.get(a,c,l);if(h!==null)return h;const p=(0,e.default)(a,c,l),y=Uint8Array.prototype.slice.call(a,c,c+l);return this.store(y,p),p}};return Zt.CachedUtf8Decoder=s,Zt}var xs;function Ku(){if(xs)return Ar;xs=1,Object.defineProperty(Ar,"__esModule",{value:!0});const t=Yu();return Ar.default=new t.CachedUtf8Decoder,Ar}var Ts;function Ju(){if(Ts)return Jt;Ts=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.CborDecoderBase=void 0;const t=gr,e=Uu(),r=Ro(),n=Ri(),i=Vu(),s=t.__importDefault(Ku());let o=class{constructor(c=new i.Reader,l=s.default){this.reader=c,this.keyDecoder=l}read(c){return this.reader.reset(c),this.val()}decode(c){return this.reader.reset(c),this.val()}val(){const l=this.reader.u8(),h=l>>5,p=l&31;return h<4?h<2?h===0?this.readUint(p):this.readNint(p):h===2?this.readBin(p):this.readStr(p):h<6?h===4?this.readArr(p):this.readObj(p):h===6?this.readTag(p):this.readTkn(p)}readAnyRaw(c){const l=c>>5,h=c&31;return l<4?l<2?l===0?this.readUint(h):this.readNint(h):l===2?this.readBin(h):this.readStr(h):l<6?l===4?this.readArr(h):this.readObj(h):l===6?this.readTag(h):this.readTkn(h)}readMinorLen(c){if(c<24)return c;switch(c){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return-1;default:throw 1}}readUint(c){if(c<25)return c===24?this.reader.u8():c;if(c<27)return c===25?this.reader.u16():this.reader.u32();{const l=this.reader.u64();return l>9007199254740991?l:Number(l)}}readNint(c){if(c<25)return c===24?-this.reader.u8()-1:-c-1;if(c<27)return c===25?-this.reader.u16()-1:-this.reader.u32()-1;{const l=this.reader.u64();return l>9007199254740991-1?-l-BigInt(1):-Number(l)-1}}readBin(c){const l=this.reader;if(c<=23)return l.buf(c);switch(c){case 24:return l.buf(l.u8());case 25:return l.buf(l.u16());case 26:return l.buf(l.u32());case 27:return l.buf(Number(l.u64()));case 31:{let h=0;const p=[];for(;this.reader.peak()!==255;){const g=this.readBinChunk();h+=g.length,p.push(g)}this.reader.x++;const y=new Uint8Array(h);let w=0;const v=p.length;for(let g=0;g<v;g++){const E=p[g];y.set(E,w),w+=E.length}return y}default:throw 1}}readBinChunk(){const c=this.reader.u8(),l=c>>5,h=c&31;if(l!==2)throw 2;if(h>27)throw 3;return this.readBin(h)}readAsStr(){const l=this.reader.u8(),h=l>>5,p=l&31;if(h!==3)throw 11;return this.readStr(p)}readStr(c){const l=this.reader;if(c<=23)return l.utf8(c);switch(c){case 24:return l.utf8(l.u8());case 25:return l.utf8(l.u16());case 26:return l.utf8(l.u32());case 27:return l.utf8(Number(l.u64()));case 31:{let h="";for(;l.peak()!==255;)h+=this.readStrChunk();return this.reader.x++,h}default:throw 1}}readStrLen(c){if(c<=23)return c;switch(c){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());default:throw 1}}readStrChunk(){const c=this.reader.u8(),l=c>>5,h=c&31;if(l!==3)throw 4;if(h>27)throw 5;return this.readStr(h)}readArr(c){const l=this.readMinorLen(c);return l>=0?this.readArrRaw(l):this.readArrIndef()}readArrRaw(c){const l=[];for(let h=0;h<c;h++)l.push(this.val());return l}readArrIndef(){const c=[];for(;this.reader.peak()!==255;)c.push(this.val());return this.reader.x++,c}readObj(c){if(c<28){let l=c;switch(c){case 24:l=this.reader.u8();break;case 25:l=this.reader.u16();break;case 26:l=this.reader.u32();break;case 27:l=Number(this.reader.u64());break}const h={};for(let p=0;p<l;p++){const y=this.key();if(y==="__proto__")throw 6;const w=this.val();h[y]=w}return h}else{if(c===31)return this.readObjIndef();throw 1}}readObjRaw(c){const l={};for(let h=0;h<c;h++){const p=this.key(),y=this.val();l[p]=y}return l}readObjIndef(){const c={};for(;this.reader.peak()!==255;){const l=this.key();if(this.reader.peak()===255)throw 7;const h=this.val();c[l]=h}return this.reader.x++,c}key(){const c=this.reader.u8(),l=c>>5,h=c&31;if(l!==3)return String(this.readAnyRaw(c));const p=this.readStrLen(h);if(p>31)return this.reader.utf8(p);const y=this.keyDecoder.decode(this.reader.uint8,this.reader.x,p);return this.reader.skip(p),y}readTag(c){if(c<=23)return this.readTagRaw(c);switch(c){case 24:return this.readTagRaw(this.reader.u8());case 25:return this.readTagRaw(this.reader.u16());case 26:return this.readTagRaw(this.reader.u32());case 27:return this.readTagRaw(Number(this.reader.u64()));default:throw 1}}readTagRaw(c){return new r.JsonPackExtension(c,this.val())}readTkn(c){switch(c){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;case 24:return new n.JsonPackValue(this.reader.u8());case 25:return this.f16();case 26:return this.reader.f32();case 27:return this.reader.f64()}if(c<=23)return new n.JsonPackValue(c);throw 1}f16(){return(0,e.decodeF16)(this.reader.u16())}};return Jt.CborDecoderBase=o,Jt}var Os;function Gu(){if(Os)return Kt;Os=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.CborDecoder=void 0;const t=Ju(),e=Ri();let r=class extends t.CborDecoderBase{readAsMap(){const i=this.reader.u8(),s=i>>5,o=i&31;switch(s){case 5:return this.readMap(o);default:throw 0}}readMap(i){const s=this.readMinorLen(i);return s>=0?this.readMapRaw(s):this.readMapIndef()}readMapRaw(i){const s=new Map;for(let o=0;o<i;o++){const a=this.val(),c=this.val();s.set(a,c)}return s}readMapIndef(){const i=new Map;for(;this.reader.peak()!==255;){const s=this.val();if(this.reader.peak()===255)throw 7;const o=this.val();i.set(s,o)}return this.reader.x++,i}skipN(i){for(let s=0;s<i;s++)this.skipAny()}skipAny(){this.skipAnyRaw(this.reader.u8())}skipAnyRaw(i){const s=i>>5,o=i&31;switch(s){case 0:case 1:this.skipUNint(o);break;case 2:this.skipBin(o);break;case 3:this.skipStr(o);break;case 4:this.skipArr(o);break;case 5:this.skipObj(o);break;case 7:this.skipTkn(o);break;case 6:this.skipTag(o);break}}skipMinorLen(i){if(i<=23)return i;switch(i){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return-1;default:throw 1}}skipUNint(i){if(!(i<=23))switch(i){case 24:return this.reader.skip(1);case 25:return this.reader.skip(2);case 26:return this.reader.skip(4);case 27:return this.reader.skip(8);default:throw 1}}skipBin(i){const s=this.skipMinorLen(i);if(s>=0)this.reader.skip(s);else{for(;this.reader.peak()!==255;)this.skipBinChunk();this.reader.x++}}skipBinChunk(){const i=this.reader.u8(),s=i>>5,o=i&31;if(s!==2)throw 2;if(o>27)throw 3;this.skipBin(o)}skipStr(i){const s=this.skipMinorLen(i);if(s>=0)this.reader.skip(s);else{for(;this.reader.peak()!==255;)this.skipStrChunk();this.reader.x++}}skipStrChunk(){const i=this.reader.u8(),s=i>>5,o=i&31;if(s!==3)throw 4;if(o>27)throw 5;this.skipStr(o)}skipArr(i){const s=this.skipMinorLen(i);if(s>=0)this.skipN(s);else{for(;this.reader.peak()!==255;)this.skipAny();this.reader.x++}}skipObj(i){const s=this.readMinorLen(i);if(s>=0)return this.skipN(s*2);for(;this.reader.peak()!==255;){if(this.skipAny(),this.reader.peak()===255)throw 7;this.skipAny()}this.reader.x++}skipTag(i){if(this.skipMinorLen(i)<0)throw 1;this.skipAny()}skipTkn(i){switch(i){case 24:this.reader.skip(1);return;case 25:this.reader.skip(2);return;case 26:this.reader.skip(4);return;case 27:this.reader.skip(8);return}if(!(i<=23))throw 1}validate(i,s=0,o=i.length){this.reader.reset(i),this.reader.x=s;const a=s;if(this.skipAny(),this.reader.x-a!==o)throw 8}decodeLevel(i){return this.reader.reset(i),this.readLevel()}readLevel(){const i=this.reader.u8(),s=i>>5,o=i&31;switch(s){case 4:return this.readArrLevel(o);case 5:return this.readObjLevel(o);default:return super.readAnyRaw(i)}}readPrimitiveOrVal(){switch(this.reader.peak()>>5){case 4:case 5:return this.readAsValue();default:return this.val()}}readAsValue(){const i=this.reader,s=i.x;this.skipAny();const o=i.x;return new e.JsonPackValue(i.uint8.subarray(s,o))}readObjLevel(i){const s=this.readMinorLen(i);return s>=0?this.readObjRawLevel(s):this.readObjIndefLevel()}readObjRawLevel(i){const s={};for(let o=0;o<i;o++){const a=this.key(),c=this.readPrimitiveOrVal();s[a]=c}return s}readObjIndefLevel(){const i={};for(;this.reader.peak()!==255;){const s=this.key();if(this.reader.peak()===255)throw 7;const o=this.readPrimitiveOrVal();i[s]=o}return this.reader.x++,i}readArrLevel(i){const s=this.readMinorLen(i);return s>=0?this.readArrRawLevel(s):this.readArrIndefLevel()}readArrRawLevel(i){const s=[];for(let o=0;o<i;o++)s.push(this.readPrimitiveOrVal());return s}readArrIndefLevel(){const i=[];for(;this.reader.peak()!==255;)i.push(this.readPrimitiveOrVal());return this.reader.x++,i}readHdr(i){const s=this.reader.u8();if(s>>5!==i)throw 0;const a=s&31;if(a<24)return a;switch(a){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return-1}throw 1}readStrHdr(){return this.readHdr(3)}readObjHdr(){return this.readHdr(5)}readArrHdr(){return this.readHdr(4)}findKey(i){const s=this.readObjHdr();for(let o=0;o<s;o++){if(this.key()===i)return this;this.skipAny()}throw 9}findIndex(i){const s=this.readArrHdr();if(i>=s)throw 10;for(let o=0;o<i;o++)this.skipAny();return this}find(i){for(let s=0;s<i.length;s++){const o=i[s];typeof o=="string"?this.findKey(o):this.findIndex(o)}return this}};return Kt.CborDecoder=r,Kt}var Qu=Gu(),Xu=xo();const Zu=new Xu.Writer(1024*32);new Nu.CborEncoder(Zu);const el=new Qu.CborDecoder,tl=typeof process<"u"&&process.versions?.node,Zo=t=>t.length>=2&&t[0]===31&&t[1]===139,rl=async t=>{if(console.debug("decompressData: Starting decompression, data length:",t.length),console.debug("decompressData: First few bytes:",Array.from(t.slice(0,10)).map(e=>"0x"+e.toString(16).padStart(2,"0")).join(" ")),!Zo(t))return console.debug("decompressData: Data does not appear to be gzip compressed, returning as-is"),t;if(console.debug("decompressData: Data appears to be gzip compressed"),tl){console.debug("decompressData: Using Node.js zlib");const{gunzip:e}=await Promise.resolve().then(function(){return ts}),{promisify:r}=await Promise.resolve().then(function(){return ts}),n=r(e),i=new Uint8Array(await n(t));return console.debug("decompressData: Node.js decompression successful, result length:",i.length),i}else{if(console.debug("decompressData: Using browser DecompressionStream"),typeof DecompressionStream>"u")return console.warn("decompressData: DecompressionStream not available, assuming uncompressed data"),t;try{const e=new DecompressionStream("gzip"),r=e.writable.getWriter(),n=e.readable.getReader();console.debug("decompressData: Writing data to decompression stream"),r.write(new Uint8Array(t)),r.close();const i=[];let s=!1;for(console.debug("decompressData: Reading decompressed chunks");!s;){const{value:l,done:h}=await n.read();s=h,l&&(console.debug("decompressData: Received chunk of length:",l.length),i.push(l))}const o=i.reduce((l,h)=>l+h.length,0);console.debug("decompressData: Total decompressed length:",o);const a=new Uint8Array(o);let c=0;for(const l of i)a.set(l,c),c+=l.length;return console.debug("decompressData: Browser decompression successful"),a}catch(e){return console.warn("decompressData: Browser decompression failed, returning original data:",e),t}}};typeof process<"u"&&process.cwd();var mn;(t=>{t.take=async({fs:e,path:r,filter:n,separator:i="/"})=>{if(n&&!await n(r))return null;const s=await e.stat(r);if(s.isDirectory()){const o=await e.readdir(r),a={},c=r.endsWith(i)?r:r+i;for(const l of o){const h=await t.take({fs:e,path:`${c}${l}`,separator:i,filter:n});h&&(a[l]=h)}return[0,{},a]}else if(s.isFile()){const o=await e.readFile(r),a=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);return[1,s,a]}else if(s.isSymbolicLink())return[2,{target:await e.readlink(r,{encoding:"utf8"})}];return null},t.mount=async(e,{fs:r,path:n="/",separator:i="/"})=>{try{console.debug("Snapshot.mount: Starting mount process"),console.debug("Snapshot.mount: Buffer type:",typeof e),console.debug("Snapshot.mount: Buffer length:",e?.byteLength||e?.length||"unknown"),console.debug("Snapshot.mount: Buffer constructor:",e?.constructor?.name);const s=e instanceof Uint8Array?e:new Uint8Array(e);console.debug("Snapshot.mount: Converted to Uint8Array, length:",s.length);const o=Zo(s);console.debug("Snapshot.mount: Data appears compressed:",o);let a;try{a=await rl(s),console.debug("Snapshot.mount: Successfully processed buffer, decompressed length:",a.length)}catch(l){console.warn("Snapshot.mount: Decompression failed, using original buffer:",l),a=s}console.debug("Snapshot.mount: Attempting to decode CBOR data...");const c=await el.decode(a);console.debug("Snapshot.mount: Successfully decoded snapshot, type:",typeof c),console.debug("Snapshot.mount: Snapshot structure:",Array.isArray(c)?`Array[${c.length}]`:c),c?(console.debug("Snapshot.mount: Starting fromSnapshot process..."),await ea(c,{fs:r,path:n,separator:i}),console.debug("Snapshot.mount: Successfully mounted snapshot")):console.warn("Snapshot.mount: Decoded snapshot is null or undefined")}catch(s){throw console.error("Snapshot.mount: Failed to mount snapshot:",s),s}},t.loadAndMount=async(e,{fs:r,path:n="/",separator:i="/"})=>{try{console.debug("Snapshot.loadAndMount: Starting direct load from URL:",e);const s=await fetch(e);if(!s.ok)throw new Error(`Failed to fetch snapshot: ${s.status} ${s.statusText}`);console.debug("Snapshot.loadAndMount: Response received, content-length:",s.headers.get("content-length"));const o=await s.arrayBuffer(),a=new Uint8Array(o);console.debug("Snapshot.loadAndMount: Downloaded buffer length:",a.length),await t.mount(a,{fs:r,path:n,separator:i})}catch(s){throw console.error("Snapshot.loadAndMount: Failed to load and mount snapshot:",s),s}}})(mn||(mn={}));const ea=async(t,{fs:e,path:r="/",separator:n="/"})=>{if(t)switch(t[0]){case 0:{r.endsWith(n)||(r=r+n);const[,,i]=t;e.mkdirSync(r,{recursive:!0});for(const[s,o]of Object.entries(i))await ea(o,{fs:e,path:`${r}${s}`,separator:n});break}case 1:{const[,,i]=t;e.writeFileSync(r,i);break}case 2:{const[,{target:i}]=t;e.symlinkSync(i,r);break}}};var Vn={exports:{}},ks;function nl(){if(ks)return Vn.exports;ks=1;var t=Vn.exports={},e,r;function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=n}catch{e=n}try{typeof clearTimeout=="function"?r=clearTimeout:r=i}catch{r=i}})();function s(g){if(e===setTimeout)return setTimeout(g,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(g,0);try{return e(g,0)}catch{try{return e.call(null,g,0)}catch{return e.call(this,g,0)}}}function o(g){if(r===clearTimeout)return clearTimeout(g);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(g);try{return r(g)}catch{try{return r.call(null,g)}catch{return r.call(this,g)}}}var a=[],c=!1,l,h=-1;function p(){!c||!l||(c=!1,l.length?a=l.concat(a):h=-1,a.length&&y())}function y(){if(!c){var g=s(p);c=!0;for(var E=a.length;E;){for(l=a,a=[];++h<E;)l&&l[h].run();h=-1,E=a.length}l=null,c=!1,o(g)}}t.nextTick=function(g){var E=new Array(arguments.length-1);if(arguments.length>1)for(var I=1;I<arguments.length;I++)E[I-1]=arguments[I];a.push(new w(g,E)),a.length===1&&!c&&s(y)};function w(g,E){this.fun=g,this.array=E}w.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function v(){}return t.on=v,t.addListener=v,t.once=v,t.off=v,t.removeListener=v,t.removeAllListeners=v,t.emit=v,t.prependListener=v,t.prependOnceListener=v,t.listeners=function(g){return[]},t.binding=function(g){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(g){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},Vn.exports}var ta=nl(),il=Si(ta),ra=po({__proto__:null,default:il},[ta]);const ee={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_SYMLINK:2097152,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4},{S_IFMT:sl,S_IFDIR:ol,S_IFREG:al,S_IFBLK:cl,S_IFCHR:ul,S_IFLNK:ll,S_IFIFO:fl,S_IFSOCK:hl}=ee;class st{static build(e,r=!1){const n=new st,{uid:i,gid:s,atime:o,mtime:a,ctime:c}=e,l=r?p=>BigInt(p):p=>p;n.uid=l(i),n.gid=l(s),n.rdev=l(e.rdev),n.blksize=l(4096),n.ino=l(e.ino),n.size=l(e.getSize()),n.blocks=l(1),n.atime=o,n.mtime=a,n.ctime=c,n.birthtime=c,n.atimeMs=l(o.getTime()),n.mtimeMs=l(a.getTime());const h=l(c.getTime());if(n.ctimeMs=h,n.birthtimeMs=h,r){n.atimeNs=BigInt(o.getTime())*BigInt(1e6),n.mtimeNs=BigInt(a.getTime())*BigInt(1e6);const p=BigInt(c.getTime())*BigInt(1e6);n.ctimeNs=p,n.birthtimeNs=p}return n.dev=l(0),n.mode=l(e.mode),n.nlink=l(e.nlink),n}uid;gid;rdev;blksize;ino;size;blocks;atime;mtime;ctime;birthtime;atimeMs;mtimeMs;ctimeMs;birthtimeMs;atimeNs;mtimeNs;ctimeNs;birthtimeNs;dev;mode;nlink;_checkModeProperty(e){return(Number(this.mode)&sl)===e}isDirectory(){return this._checkModeProperty(ol)}isFile(){return this._checkModeProperty(al)}isBlockDevice(){return this._checkModeProperty(cl)}isCharacterDevice(){return this._checkModeProperty(ul)}isSymbolicLink(){return this._checkModeProperty(ll)}isFIFO(){return this._checkModeProperty(fl)}isSocket(){return this._checkModeProperty(hl)}}var Hn={},er={},Is;function dl(){if(Is)return er;Is=1,er.byteLength=a,er.toByteArray=l,er.fromByteArray=y;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=n.length;i<s;++i)t[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(w){var v=w.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=w.indexOf("=");g===-1&&(g=v);var E=g===v?0:4-g%4;return[g,E]}function a(w){var v=o(w),g=v[0],E=v[1];return(g+E)*3/4-E}function c(w,v,g){return(v+g)*3/4-g}function l(w){var v,g=o(w),E=g[0],I=g[1],P=new r(c(w,E,I)),k=0,R=I>0?E-4:E,b;for(b=0;b<R;b+=4)v=e[w.charCodeAt(b)]<<18|e[w.charCodeAt(b+1)]<<12|e[w.charCodeAt(b+2)]<<6|e[w.charCodeAt(b+3)],P[k++]=v>>16&255,P[k++]=v>>8&255,P[k++]=v&255;return I===2&&(v=e[w.charCodeAt(b)]<<2|e[w.charCodeAt(b+1)]>>4,P[k++]=v&255),I===1&&(v=e[w.charCodeAt(b)]<<10|e[w.charCodeAt(b+1)]<<4|e[w.charCodeAt(b+2)]>>2,P[k++]=v>>8&255,P[k++]=v&255),P}function h(w){return t[w>>18&63]+t[w>>12&63]+t[w>>6&63]+t[w&63]}function p(w,v,g){for(var E,I=[],P=v;P<g;P+=3)E=(w[P]<<16&16711680)+(w[P+1]<<8&65280)+(w[P+2]&255),I.push(h(E));return I.join("")}function y(w){for(var v,g=w.length,E=g%3,I=[],P=16383,k=0,R=g-E;k<R;k+=P)I.push(p(w,k,k+P>R?R:k+P));return E===1?(v=w[g-1],I.push(t[v>>2]+t[v<<4&63]+"==")):E===2&&(v=(w[g-2]<<8)+w[g-1],I.push(t[v>>10]+t[v>>4&63]+t[v<<2&63]+"=")),I.join("")}return er}var Fr={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Bs;function pl(){return Bs||(Bs=1,Fr.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<<a)-1,l=c>>1,h=-7,p=r?i-1:0,y=r?-1:1,w=t[e+p];for(p+=y,s=w&(1<<-h)-1,w>>=-h,h+=a;h>0;s=s*256+t[e+p],p+=y,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=o*256+t[e+p],p+=y,h-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(w?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(w?-1:1)*o*Math.pow(2,s-n)},Fr.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,h=(1<<l)-1,p=h>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=n?0:s-1,v=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+p>=1?e+=y/c:e+=y*Math.pow(2,1-p),e*c>=2&&(o++,c/=2),o+p>=h?(a=0,o=h):o+p>=1?(a=(e*c-1)*Math.pow(2,i),o=o+p):(a=e*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;t[r+w]=a&255,w+=v,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[r+w]=o&255,w+=v,o/=256,l-=8);t[r+w-v]|=g*128}),Fr}/*!
8
- * The buffer module from node.js, for the browser.
9
- *
10
- * @author Feross Aboukhadijeh <https://feross.org>
11
- * @license MIT
12
- */var Cs;function ml(){return Cs||(Cs=1,function(t){const e=dl(),r=pl(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=P,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const d=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(d,u),d.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(d){if(d>i)throw new RangeError('The value "'+d+'" is invalid for option "size"');const u=new Uint8Array(d);return Object.setPrototypeOf(u,a.prototype),u}function a(d,u,f){if(typeof d=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(d)}return c(d,u,f)}a.poolSize=8192;function c(d,u,f){if(typeof d=="string")return y(d,u);if(ArrayBuffer.isView(d))return v(d);if(d==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof d);if(ge(d,ArrayBuffer)||d&&ge(d.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ge(d,SharedArrayBuffer)||d&&ge(d.buffer,SharedArrayBuffer)))return g(d,u,f);if(typeof d=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const m=d.valueOf&&d.valueOf();if(m!=null&&m!==d)return a.from(m,u,f);const _=E(d);if(_)return _;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof d[Symbol.toPrimitive]=="function")return a.from(d[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof d)}a.from=function(d,u,f){return c(d,u,f)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(d){if(typeof d!="number")throw new TypeError('"size" argument must be of type number');if(d<0)throw new RangeError('The value "'+d+'" is invalid for option "size"')}function h(d,u,f){return l(d),d<=0?o(d):u!==void 0?typeof f=="string"?o(d).fill(u,f):o(d).fill(u):o(d)}a.alloc=function(d,u,f){return h(d,u,f)};function p(d){return l(d),o(d<0?0:I(d)|0)}a.allocUnsafe=function(d){return p(d)},a.allocUnsafeSlow=function(d){return p(d)};function y(d,u){if((typeof u!="string"||u==="")&&(u="utf8"),!a.isEncoding(u))throw new TypeError("Unknown encoding: "+u);const f=k(d,u)|0;let m=o(f);const _=m.write(d,u);return _!==f&&(m=m.slice(0,_)),m}function w(d){const u=d.length<0?0:I(d.length)|0,f=o(u);for(let m=0;m<u;m+=1)f[m]=d[m]&255;return f}function v(d){if(ge(d,Uint8Array)){const u=new Uint8Array(d);return g(u.buffer,u.byteOffset,u.byteLength)}return w(d)}function g(d,u,f){if(u<0||d.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(d.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');let m;return u===void 0&&f===void 0?m=new Uint8Array(d):f===void 0?m=new Uint8Array(d,u):m=new Uint8Array(d,u,f),Object.setPrototypeOf(m,a.prototype),m}function E(d){if(a.isBuffer(d)){const u=I(d.length)|0,f=o(u);return f.length===0||d.copy(f,0,0,u),f}if(d.length!==void 0)return typeof d.length!="number"||Un(d.length)?o(0):w(d);if(d.type==="Buffer"&&Array.isArray(d.data))return w(d.data)}function I(d){if(d>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return d|0}function P(d){return+d!=d&&(d=0),a.alloc(+d)}a.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==a.prototype},a.compare=function(u,f){if(ge(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),ge(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(u)||!a.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===f)return 0;let m=u.length,_=f.length;for(let S=0,x=Math.min(m,_);S<x;++S)if(u[S]!==f[S]){m=u[S],_=f[S];break}return m<_?-1:_<m?1:0},a.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(u,f){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return a.alloc(0);let m;if(f===void 0)for(f=0,m=0;m<u.length;++m)f+=u[m].length;const _=a.allocUnsafe(f);let S=0;for(m=0;m<u.length;++m){let x=u[m];if(ge(x,Uint8Array))S+x.length>_.length?(a.isBuffer(x)||(x=a.from(x)),x.copy(_,S)):Uint8Array.prototype.set.call(_,x,S);else if(a.isBuffer(x))x.copy(_,S);else throw new TypeError('"list" argument must be an Array of Buffers');S+=x.length}return _};function k(d,u){if(a.isBuffer(d))return d.length;if(ArrayBuffer.isView(d)||ge(d,ArrayBuffer))return d.byteLength;if(typeof d!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof d);const f=d.length,m=arguments.length>2&&arguments[2]===!0;if(!m&&f===0)return 0;let _=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return jn(d).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Xi(d).length;default:if(_)return m?-1:jn(d).length;u=(""+u).toLowerCase(),_=!0}}a.byteLength=k;function R(d,u,f){let m=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,u>>>=0,f<=u))return"";for(d||(d="utf8");;)switch(d){case"hex":return Ln(this,u,f);case"utf8":case"utf-8":return de(this,u,f);case"ascii":return Rr(this,u,f);case"latin1":case"binary":return xr(this,u,f);case"base64":return G(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Dn(this,u,f);default:if(m)throw new TypeError("Unknown encoding: "+d);d=(d+"").toLowerCase(),m=!0}}a.prototype._isBuffer=!0;function b(d,u,f){const m=d[u];d[u]=d[f],d[f]=m}a.prototype.swap16=function(){const u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<u;f+=2)b(this,f,f+1);return this},a.prototype.swap32=function(){const u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<u;f+=4)b(this,f,f+3),b(this,f+1,f+2);return this},a.prototype.swap64=function(){const u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<u;f+=8)b(this,f,f+7),b(this,f+1,f+6),b(this,f+2,f+5),b(this,f+3,f+4);return this},a.prototype.toString=function(){const u=this.length;return u===0?"":arguments.length===0?de(this,0,u):R.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(u){if(!a.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:a.compare(this,u)===0},a.prototype.inspect=function(){let u="";const f=t.INSPECT_MAX_BYTES;return u=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(u+=" ... "),"<Buffer "+u+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(u,f,m,_,S){if(ge(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),!a.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(f===void 0&&(f=0),m===void 0&&(m=u?u.length:0),_===void 0&&(_=0),S===void 0&&(S=this.length),f<0||m>u.length||_<0||S>this.length)throw new RangeError("out of range index");if(_>=S&&f>=m)return 0;if(_>=S)return-1;if(f>=m)return 1;if(f>>>=0,m>>>=0,_>>>=0,S>>>=0,this===u)return 0;let x=S-_,j=m-f;const K=Math.min(x,j),Y=this.slice(_,S),J=u.slice(f,m);for(let W=0;W<K;++W)if(Y[W]!==J[W]){x=Y[W],j=J[W];break}return x<j?-1:j<x?1:0};function T(d,u,f,m,_){if(d.length===0)return-1;if(typeof f=="string"?(m=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Un(f)&&(f=_?0:d.length-1),f<0&&(f=d.length+f),f>=d.length){if(_)return-1;f=d.length-1}else if(f<0)if(_)f=0;else return-1;if(typeof u=="string"&&(u=a.from(u,m)),a.isBuffer(u))return u.length===0?-1:O(d,u,f,m,_);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?_?Uint8Array.prototype.indexOf.call(d,u,f):Uint8Array.prototype.lastIndexOf.call(d,u,f):O(d,[u],f,m,_);throw new TypeError("val must be string, number or Buffer")}function O(d,u,f,m,_){let S=1,x=d.length,j=u.length;if(m!==void 0&&(m=String(m).toLowerCase(),m==="ucs2"||m==="ucs-2"||m==="utf16le"||m==="utf-16le")){if(d.length<2||u.length<2)return-1;S=2,x/=2,j/=2,f/=2}function K(J,W){return S===1?J[W]:J.readUInt16BE(W*S)}let Y;if(_){let J=-1;for(Y=f;Y<x;Y++)if(K(d,Y)===K(u,J===-1?0:Y-J)){if(J===-1&&(J=Y),Y-J+1===j)return J*S}else J!==-1&&(Y-=Y-J),J=-1}else for(f+j>x&&(f=x-j),Y=f;Y>=0;Y--){let J=!0;for(let W=0;W<j;W++)if(K(d,Y+W)!==K(u,W)){J=!1;break}if(J)return Y}return-1}a.prototype.includes=function(u,f,m){return this.indexOf(u,f,m)!==-1},a.prototype.indexOf=function(u,f,m){return T(this,u,f,m,!0)},a.prototype.lastIndexOf=function(u,f,m){return T(this,u,f,m,!1)};function C(d,u,f,m){f=Number(f)||0;const _=d.length-f;m?(m=Number(m),m>_&&(m=_)):m=_;const S=u.length;m>S/2&&(m=S/2);let x;for(x=0;x<m;++x){const j=parseInt(u.substr(x*2,2),16);if(Un(j))return x;d[f+x]=j}return x}function D(d,u,f,m){return Or(jn(u,d.length-f),d,f,m)}function N(d,u,f,m){return Or(Ec(u),d,f,m)}function V(d,u,f,m){return Or(Xi(u),d,f,m)}function $(d,u,f,m){return Or(Rc(u,d.length-f),d,f,m)}a.prototype.write=function(u,f,m,_){if(f===void 0)_="utf8",m=this.length,f=0;else if(m===void 0&&typeof f=="string")_=f,m=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(m)?(m=m>>>0,_===void 0&&(_="utf8")):(_=m,m=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const S=this.length-f;if((m===void 0||m>S)&&(m=S),u.length>0&&(m<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");_||(_="utf8");let x=!1;for(;;)switch(_){case"hex":return C(this,u,f,m);case"utf8":case"utf-8":return D(this,u,f,m);case"ascii":case"latin1":case"binary":return N(this,u,f,m);case"base64":return V(this,u,f,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,u,f,m);default:if(x)throw new TypeError("Unknown encoding: "+_);_=(""+_).toLowerCase(),x=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function G(d,u,f){return u===0&&f===d.length?e.fromByteArray(d):e.fromByteArray(d.slice(u,f))}function de(d,u,f){f=Math.min(d.length,f);const m=[];let _=u;for(;_<f;){const S=d[_];let x=null,j=S>239?4:S>223?3:S>191?2:1;if(_+j<=f){let K,Y,J,W;switch(j){case 1:S<128&&(x=S);break;case 2:K=d[_+1],(K&192)===128&&(W=(S&31)<<6|K&63,W>127&&(x=W));break;case 3:K=d[_+1],Y=d[_+2],(K&192)===128&&(Y&192)===128&&(W=(S&15)<<12|(K&63)<<6|Y&63,W>2047&&(W<55296||W>57343)&&(x=W));break;case 4:K=d[_+1],Y=d[_+2],J=d[_+3],(K&192)===128&&(Y&192)===128&&(J&192)===128&&(W=(S&15)<<18|(K&63)<<12|(Y&63)<<6|J&63,W>65535&&W<1114112&&(x=W))}}x===null?(x=65533,j=1):x>65535&&(x-=65536,m.push(x>>>10&1023|55296),x=56320|x&1023),m.push(x),_+=j}return Nn(m)}const Lt=4096;function Nn(d){const u=d.length;if(u<=Lt)return String.fromCharCode.apply(String,d);let f="",m=0;for(;m<u;)f+=String.fromCharCode.apply(String,d.slice(m,m+=Lt));return f}function Rr(d,u,f){let m="";f=Math.min(d.length,f);for(let _=u;_<f;++_)m+=String.fromCharCode(d[_]&127);return m}function xr(d,u,f){let m="";f=Math.min(d.length,f);for(let _=u;_<f;++_)m+=String.fromCharCode(d[_]);return m}function Ln(d,u,f){const m=d.length;(!u||u<0)&&(u=0),(!f||f<0||f>m)&&(f=m);let _="";for(let S=u;S<f;++S)_+=xc[d[S]];return _}function Dn(d,u,f){const m=d.slice(u,f);let _="";for(let S=0;S<m.length-1;S+=2)_+=String.fromCharCode(m[S]+m[S+1]*256);return _}a.prototype.slice=function(u,f){const m=this.length;u=~~u,f=f===void 0?m:~~f,u<0?(u+=m,u<0&&(u=0)):u>m&&(u=m),f<0?(f+=m,f<0&&(f=0)):f>m&&(f=m),f<u&&(f=u);const _=this.subarray(u,f);return Object.setPrototypeOf(_,a.prototype),_};function H(d,u,f){if(d%1!==0||d<0)throw new RangeError("offset is not uint");if(d+u>f)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(u,f,m){u=u>>>0,f=f>>>0,m||H(u,f,this.length);let _=this[u],S=1,x=0;for(;++x<f&&(S*=256);)_+=this[u+x]*S;return _},a.prototype.readUintBE=a.prototype.readUIntBE=function(u,f,m){u=u>>>0,f=f>>>0,m||H(u,f,this.length);let _=this[u+--f],S=1;for(;f>0&&(S*=256);)_+=this[u+--f]*S;return _},a.prototype.readUint8=a.prototype.readUInt8=function(u,f){return u=u>>>0,f||H(u,1,this.length),this[u]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(u,f){return u=u>>>0,f||H(u,2,this.length),this[u]|this[u+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(u,f){return u=u>>>0,f||H(u,2,this.length),this[u]<<8|this[u+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(u,f){return u=u>>>0,f||H(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(u,f){return u=u>>>0,f||H(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},a.prototype.readBigUInt64LE=Ie(function(u){u=u>>>0,pt(u,"offset");const f=this[u],m=this[u+7];(f===void 0||m===void 0)&&jt(u,this.length-8);const _=f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,S=this[++u]+this[++u]*2**8+this[++u]*2**16+m*2**24;return BigInt(_)+(BigInt(S)<<BigInt(32))}),a.prototype.readBigUInt64BE=Ie(function(u){u=u>>>0,pt(u,"offset");const f=this[u],m=this[u+7];(f===void 0||m===void 0)&&jt(u,this.length-8);const _=f*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],S=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+m;return(BigInt(_)<<BigInt(32))+BigInt(S)}),a.prototype.readIntLE=function(u,f,m){u=u>>>0,f=f>>>0,m||H(u,f,this.length);let _=this[u],S=1,x=0;for(;++x<f&&(S*=256);)_+=this[u+x]*S;return S*=128,_>=S&&(_-=Math.pow(2,8*f)),_},a.prototype.readIntBE=function(u,f,m){u=u>>>0,f=f>>>0,m||H(u,f,this.length);let _=f,S=1,x=this[u+--_];for(;_>0&&(S*=256);)x+=this[u+--_]*S;return S*=128,x>=S&&(x-=Math.pow(2,8*f)),x},a.prototype.readInt8=function(u,f){return u=u>>>0,f||H(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},a.prototype.readInt16LE=function(u,f){u=u>>>0,f||H(u,2,this.length);const m=this[u]|this[u+1]<<8;return m&32768?m|4294901760:m},a.prototype.readInt16BE=function(u,f){u=u>>>0,f||H(u,2,this.length);const m=this[u+1]|this[u]<<8;return m&32768?m|4294901760:m},a.prototype.readInt32LE=function(u,f){return u=u>>>0,f||H(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},a.prototype.readInt32BE=function(u,f){return u=u>>>0,f||H(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},a.prototype.readBigInt64LE=Ie(function(u){u=u>>>0,pt(u,"offset");const f=this[u],m=this[u+7];(f===void 0||m===void 0)&&jt(u,this.length-8);const _=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(m<<24);return(BigInt(_)<<BigInt(32))+BigInt(f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),a.prototype.readBigInt64BE=Ie(function(u){u=u>>>0,pt(u,"offset");const f=this[u],m=this[u+7];(f===void 0||m===void 0)&&jt(u,this.length-8);const _=(f<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(_)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+m)}),a.prototype.readFloatLE=function(u,f){return u=u>>>0,f||H(u,4,this.length),r.read(this,u,!0,23,4)},a.prototype.readFloatBE=function(u,f){return u=u>>>0,f||H(u,4,this.length),r.read(this,u,!1,23,4)},a.prototype.readDoubleLE=function(u,f){return u=u>>>0,f||H(u,8,this.length),r.read(this,u,!0,52,8)},a.prototype.readDoubleBE=function(u,f){return u=u>>>0,f||H(u,8,this.length),r.read(this,u,!1,52,8)};function z(d,u,f,m,_,S){if(!a.isBuffer(d))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>_||u<S)throw new RangeError('"value" argument is out of bounds');if(f+m>d.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(u,f,m,_){if(u=+u,f=f>>>0,m=m>>>0,!_){const j=Math.pow(2,8*m)-1;z(this,u,f,m,j,0)}let S=1,x=0;for(this[f]=u&255;++x<m&&(S*=256);)this[f+x]=u/S&255;return f+m},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(u,f,m,_){if(u=+u,f=f>>>0,m=m>>>0,!_){const j=Math.pow(2,8*m)-1;z(this,u,f,m,j,0)}let S=m-1,x=1;for(this[f+S]=u&255;--S>=0&&(x*=256);)this[f+S]=u/x&255;return f+m},a.prototype.writeUint8=a.prototype.writeUInt8=function(u,f,m){return u=+u,f=f>>>0,m||z(this,u,f,1,255,0),this[f]=u&255,f+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(u,f,m){return u=+u,f=f>>>0,m||z(this,u,f,2,65535,0),this[f]=u&255,this[f+1]=u>>>8,f+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(u,f,m){return u=+u,f=f>>>0,m||z(this,u,f,2,65535,0),this[f]=u>>>8,this[f+1]=u&255,f+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(u,f,m){return u=+u,f=f>>>0,m||z(this,u,f,4,4294967295,0),this[f+3]=u>>>24,this[f+2]=u>>>16,this[f+1]=u>>>8,this[f]=u&255,f+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(u,f,m){return u=+u,f=f>>>0,m||z(this,u,f,4,4294967295,0),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4};function Dt(d,u,f,m,_){Qi(u,m,_,d,f,7);let S=Number(u&BigInt(4294967295));d[f++]=S,S=S>>8,d[f++]=S,S=S>>8,d[f++]=S,S=S>>8,d[f++]=S;let x=Number(u>>BigInt(32)&BigInt(4294967295));return d[f++]=x,x=x>>8,d[f++]=x,x=x>>8,d[f++]=x,x=x>>8,d[f++]=x,f}function Mt(d,u,f,m,_){Qi(u,m,_,d,f,7);let S=Number(u&BigInt(4294967295));d[f+7]=S,S=S>>8,d[f+6]=S,S=S>>8,d[f+5]=S,S=S>>8,d[f+4]=S;let x=Number(u>>BigInt(32)&BigInt(4294967295));return d[f+3]=x,x=x>>8,d[f+2]=x,x=x>>8,d[f+1]=x,x=x>>8,d[f]=x,f+8}a.prototype.writeBigUInt64LE=Ie(function(u,f=0){return Dt(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Ie(function(u,f=0){return Mt(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(u,f,m,_){if(u=+u,f=f>>>0,!_){const K=Math.pow(2,8*m-1);z(this,u,f,m,K-1,-K)}let S=0,x=1,j=0;for(this[f]=u&255;++S<m&&(x*=256);)u<0&&j===0&&this[f+S-1]!==0&&(j=1),this[f+S]=(u/x>>0)-j&255;return f+m},a.prototype.writeIntBE=function(u,f,m,_){if(u=+u,f=f>>>0,!_){const K=Math.pow(2,8*m-1);z(this,u,f,m,K-1,-K)}let S=m-1,x=1,j=0;for(this[f+S]=u&255;--S>=0&&(x*=256);)u<0&&j===0&&this[f+S+1]!==0&&(j=1),this[f+S]=(u/x>>0)-j&255;return f+m},a.prototype.writeInt8=function(u,f,m){return u=+u,f=f>>>0,m||z(this,u,f,1,127,-128),u<0&&(u=255+u+1),this[f]=u&255,f+1},a.prototype.writeInt16LE=function(u,f,m){return u=+u,f=f>>>0,m||z(this,u,f,2,32767,-32768),this[f]=u&255,this[f+1]=u>>>8,f+2},a.prototype.writeInt16BE=function(u,f,m){return u=+u,f=f>>>0,m||z(this,u,f,2,32767,-32768),this[f]=u>>>8,this[f+1]=u&255,f+2},a.prototype.writeInt32LE=function(u,f,m){return u=+u,f=f>>>0,m||z(this,u,f,4,2147483647,-2147483648),this[f]=u&255,this[f+1]=u>>>8,this[f+2]=u>>>16,this[f+3]=u>>>24,f+4},a.prototype.writeInt32BE=function(u,f,m){return u=+u,f=f>>>0,m||z(this,u,f,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4},a.prototype.writeBigInt64LE=Ie(function(u,f=0){return Dt(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Ie(function(u,f=0){return Mt(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function we(d,u,f,m,_,S){if(f+m>d.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function Tr(d,u,f,m,_){return u=+u,f=f>>>0,_||we(d,u,f,4),r.write(d,u,f,m,23,4),f+4}a.prototype.writeFloatLE=function(u,f,m){return Tr(this,u,f,!0,m)},a.prototype.writeFloatBE=function(u,f,m){return Tr(this,u,f,!1,m)};function Ji(d,u,f,m,_){return u=+u,f=f>>>0,_||we(d,u,f,8),r.write(d,u,f,m,52,8),f+8}a.prototype.writeDoubleLE=function(u,f,m){return Ji(this,u,f,!0,m)},a.prototype.writeDoubleBE=function(u,f,m){return Ji(this,u,f,!1,m)},a.prototype.copy=function(u,f,m,_){if(!a.isBuffer(u))throw new TypeError("argument should be a Buffer");if(m||(m=0),!_&&_!==0&&(_=this.length),f>=u.length&&(f=u.length),f||(f=0),_>0&&_<m&&(_=m),_===m||u.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(m<0||m>=this.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("sourceEnd out of bounds");_>this.length&&(_=this.length),u.length-f<_-m&&(_=u.length-f+m);const S=_-m;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,m,_):Uint8Array.prototype.set.call(u,this.subarray(m,_),f),S},a.prototype.fill=function(u,f,m,_){if(typeof u=="string"){if(typeof f=="string"?(_=f,f=0,m=this.length):typeof m=="string"&&(_=m,m=this.length),_!==void 0&&typeof _!="string")throw new TypeError("encoding must be a string");if(typeof _=="string"&&!a.isEncoding(_))throw new TypeError("Unknown encoding: "+_);if(u.length===1){const x=u.charCodeAt(0);(_==="utf8"&&x<128||_==="latin1")&&(u=x)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(f<0||this.length<f||this.length<m)throw new RangeError("Out of range index");if(m<=f)return this;f=f>>>0,m=m===void 0?this.length:m>>>0,u||(u=0);let S;if(typeof u=="number")for(S=f;S<m;++S)this[S]=u;else{const x=a.isBuffer(u)?u:a.from(u,_),j=x.length;if(j===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(S=0;S<m-f;++S)this[S+f]=x[S%j]}return this};const dt={};function Mn(d,u,f){dt[d]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${d}]`,this.stack,delete this.name}get code(){return d}set code(_){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:_,writable:!0})}toString(){return`${this.name} [${d}]: ${this.message}`}}}Mn("ERR_BUFFER_OUT_OF_BOUNDS",function(d){return d?`${d} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Mn("ERR_INVALID_ARG_TYPE",function(d,u){return`The "${d}" argument must be of type number. Received type ${typeof u}`},TypeError),Mn("ERR_OUT_OF_RANGE",function(d,u,f){let m=`The value of "${d}" is out of range.`,_=f;return Number.isInteger(f)&&Math.abs(f)>2**32?_=Gi(String(f)):typeof f=="bigint"&&(_=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(_=Gi(_)),_+="n"),m+=` It must be ${u}. Received ${_}`,m},RangeError);function Gi(d){let u="",f=d.length;const m=d[0]==="-"?1:0;for(;f>=m+4;f-=3)u=`_${d.slice(f-3,f)}${u}`;return`${d.slice(0,f)}${u}`}function bc(d,u,f){pt(u,"offset"),(d[u]===void 0||d[u+f]===void 0)&&jt(u,d.length-(f+1))}function Qi(d,u,f,m,_,S){if(d>f||d<u){const x=typeof u=="bigint"?"n":"";let j;throw u===0||u===BigInt(0)?j=`>= 0${x} and < 2${x} ** ${(S+1)*8}${x}`:j=`>= -(2${x} ** ${(S+1)*8-1}${x}) and < 2 ** ${(S+1)*8-1}${x}`,new dt.ERR_OUT_OF_RANGE("value",j,d)}bc(m,_,S)}function pt(d,u){if(typeof d!="number")throw new dt.ERR_INVALID_ARG_TYPE(u,"number",d)}function jt(d,u,f){throw Math.floor(d)!==d?(pt(d,f),new dt.ERR_OUT_OF_RANGE("offset","an integer",d)):u<0?new dt.ERR_BUFFER_OUT_OF_BOUNDS:new dt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${u}`,d)}const vc=/[^+/0-9A-Za-z-_]/g;function Sc(d){if(d=d.split("=")[0],d=d.trim().replace(vc,""),d.length<2)return"";for(;d.length%4!==0;)d=d+"=";return d}function jn(d,u){u=u||1/0;let f;const m=d.length;let _=null;const S=[];for(let x=0;x<m;++x){if(f=d.charCodeAt(x),f>55295&&f<57344){if(!_){if(f>56319){(u-=3)>-1&&S.push(239,191,189);continue}else if(x+1===m){(u-=3)>-1&&S.push(239,191,189);continue}_=f;continue}if(f<56320){(u-=3)>-1&&S.push(239,191,189),_=f;continue}f=(_-55296<<10|f-56320)+65536}else _&&(u-=3)>-1&&S.push(239,191,189);if(_=null,f<128){if((u-=1)<0)break;S.push(f)}else if(f<2048){if((u-=2)<0)break;S.push(f>>6|192,f&63|128)}else if(f<65536){if((u-=3)<0)break;S.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((u-=4)<0)break;S.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return S}function Ec(d){const u=[];for(let f=0;f<d.length;++f)u.push(d.charCodeAt(f)&255);return u}function Rc(d,u){let f,m,_;const S=[];for(let x=0;x<d.length&&!((u-=2)<0);++x)f=d.charCodeAt(x),m=f>>8,_=f%256,S.push(_),S.push(m);return S}function Xi(d){return e.toByteArray(Sc(d))}function Or(d,u,f,m){let _;for(_=0;_<m&&!(_+f>=u.length||_>=d.length);++_)u[_+f]=d[_];return _}function ge(d,u){return d instanceof u||d!=null&&d.constructor!=null&&d.constructor.name!=null&&d.constructor.name===u.name}function Un(d){return d!==d}const xc=function(){const d="0123456789abcdef",u=new Array(256);for(let f=0;f<16;++f){const m=f*16;for(let _=0;_<16;++_)u[m+_]=d[f]+d[_]}return u}();function Ie(d){return typeof BigInt>"u"?Tc:d}function Tc(){throw new Error("BigInt not supported")}}(Hn)),Hn}var re=ml();function na(t,...e){return new re.Buffer(t,...e)}const Pe=re.Buffer.allocUnsafe||na,Et=re.Buffer.from||na;function Rt(t,e){if(!t)throw new Error(e||"Assertion failed")}function ia(t,e,r){if(t!==e)throw new Error(`Expected ${e}, got ${t}`)}function yl(t,...e){let r=0;return t.replace(/%s/g,()=>String(e[r++]??""))}function sa(t,e){if(t==null)throw new TypeError('The constructor to "inherits" must not be null or undefined');if(e==null)throw new TypeError('The super constructor to "inherits" must not be null or undefined');if(e.prototype===void 0)throw new TypeError('The super constructor to "inherits" must have a prototype');t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}const As=typeof Symbol>"u"?"_kCode":Symbol("code"),oa={};function aa(t){return class extends t{constructor(r,...n){super(wl(r,n)),this.code=r,this[As]=r,this.name=`${super.name} [${this[As]}]`}}}const ca=typeof globalThis<"u"?globalThis:global;function wl(t,e){ia(typeof t,"string");const r=oa[t];Rt(r,`An invalid error message key was used: ${t}.`);let n;if(typeof r=="function")n=r;else{if(n=yl,e===void 0||e.length===0)return r;e.unshift(r)}return String(n.apply(null,e))}function A(t,e){oa[t]=typeof e=="function"?e:String(e)}const Ke=aa(ca.Error),yn=aa(ca.TypeError);A("ERR_ARG_NOT_ITERABLE","%s must be iterable");A("ERR_ASSERTION","%s");A("ERR_BUFFER_OUT_OF_BOUNDS",bl);A("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received");A("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s");A("ERR_CPU_USAGE","Unable to obtain cpu usage %s");A("ERR_DNS_SET_SERVERS_FAILED",(t,e)=>`c-ares failed to set servers: "${t}" [${e}]`);A("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value");A("ERR_ENCODING_NOT_SUPPORTED",t=>`The "${t}" encoding is not supported`);A("ERR_ENCODING_INVALID_ENCODED_DATA",t=>`The encoded data was not valid for encoding ${t}`);A("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client");A("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s");A("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding");A("ERR_INDEX_OUT_OF_RANGE","Index out of range");A("ERR_INVALID_ARG_TYPE",gl);A("ERR_INVALID_ARRAY_LENGTH",(t,e,r)=>(ia(typeof r,"number"),`The array "${t}" (length ${r}) must be of length ${e}.`));A("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s");A("ERR_INVALID_CALLBACK","Callback must be a function");A("ERR_INVALID_CHAR","Invalid character in %s");A("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column");A("ERR_INVALID_FD",'"fd" must be a positive integer: %s');A("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s');A("ERR_INVALID_FILE_URL_PATH","File URL path %s");A("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent");A("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s");A("ERR_INVALID_OPT_VALUE",(t,e)=>`The value "${String(e)}" is invalid for option "${t}"`);A("ERR_INVALID_OPT_VALUE_ENCODING",t=>`The value "${String(t)}" is invalid for option "encoding"`);A("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL');A("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s");A("ERR_INVALID_THIS",'Value of "this" must be of type %s');A("ERR_INVALID_TUPLE","%s must be an iterable %s tuple");A("ERR_INVALID_URL","Invalid URL: %s");A("ERR_INVALID_URL_SCHEME",t=>`The URL must be ${Zr(t,"scheme")}`);A("ERR_IPC_CHANNEL_CLOSED","Channel closed");A("ERR_IPC_DISCONNECTED","IPC channel is already disconnected");A("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe");A("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks");A("ERR_MISSING_ARGS",_l);A("ERR_MULTIPLE_CALLBACK","Callback called multiple times");A("ERR_NAPI_CONS_FUNCTION","Constructor must be a function");A("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object");A("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support");A("ERR_NO_LONGER_SUPPORTED","%s is no longer supported");A("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s");A("ERR_SOCKET_ALREADY_BOUND","Socket is already bound");A("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536");A("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6");A("ERR_SOCKET_CANNOT_SEND","Unable to send data");A("ERR_SOCKET_CLOSED","Socket is closed");A("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running");A("ERR_STDERR_CLOSE","process.stderr cannot be closed");A("ERR_STDOUT_CLOSE","process.stdout cannot be closed");A("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode");A("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s");A("ERR_TLS_DH_PARAM_SIZE",t=>`DH parameter size ${t} is less than 2048`);A("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout");A("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate");A("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext');A("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected");A("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming");A("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0");A("ERR_UNKNOWN_ENCODING","Unknown encoding: %s");A("ERR_UNKNOWN_SIGNAL","Unknown signal: %s");A("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type");A("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type");A("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");A("ERR_DIR_CLOSED","Directory handle was closed");A("ERR_DIR_CONCURRENT_OPERATION","Cannot do synchronous work on directory handle with concurrent asynchronous operations");function gl(t,e,r){Rt(t,"name is required");let n;e.includes("not ")?(n="must not be",e=e.split("not ")[1]):n="must be";let i;if(Array.isArray(t))i=`The ${t.map(o=>`"${o}"`).join(", ")} arguments ${n} ${Zr(e,"type")}`;else if(t.includes(" argument"))i=`The ${t} ${n} ${Zr(e,"type")}`;else{const s=t.includes(".")?"property":"argument";i=`The "${t}" ${s} ${n} ${Zr(e,"type")}`}return arguments.length>=3&&(i+=`. Received type ${r!==null?typeof r:"null"}`),i}function _l(...t){Rt(t.length>0,"At least one arg needs to be specified");let e="The ";const r=t.length;switch(t=t.map(n=>`"${n}"`),r){case 1:e+=`${t[0]} argument`;break;case 2:e+=`${t[0]} and ${t[1]} arguments`;break;default:e+=t.slice(0,r-1).join(", "),e+=`, and ${t[r-1]} arguments`;break}return`${e} must be specified`}function Zr(t,e){if(Rt(t,"expected is required"),Rt(typeof e=="string","thing is required"),Array.isArray(t)){const r=t.length;return Rt(r>0,"At least one expected value needs to be specified"),t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function bl(t,e){return e?"Attempt to write outside buffer bounds":`"${t}" is outside of buffer bounds`}const wn="utf8";function vl(t){if(t&&!re.Buffer.isEncoding(t))throw new yn("ERR_INVALID_OPT_VALUE_ENCODING",t)}function ur(t,e){return!e||e===wn?t:e==="buffer"?new re.Buffer(t):new re.Buffer(t).toString(e)}const{S_IFMT:Sl,S_IFDIR:El,S_IFREG:Rl,S_IFBLK:xl,S_IFCHR:Tl,S_IFLNK:Ol,S_IFIFO:kl,S_IFSOCK:Il}=ee;class _r{static build(e,r){const n=new _r,{mode:i}=e.getNode();return n.name=ur(e.getName(),r),n.mode=i,n.path=e.getParentPath(),n.parentPath=n.path,n}name="";path="";parentPath="";mode=0;_checkModeProperty(e){return(this.mode&Sl)===e}isDirectory(){return this._checkModeProperty(El)}isFile(){return this._checkModeProperty(Rl)}isBlockDevice(){return this._checkModeProperty(xl)}isCharacterDevice(){return this._checkModeProperty(Tl)}isSymbolicLink(){return this._checkModeProperty(Ol)}isFIFO(){return this._checkModeProperty(kl)}isSocket(){return this._checkModeProperty(Il)}}var Yn,Ps;function Bl(){if(Ps)return Yn;Ps=1;function t(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function e(i,s){for(var o="",a=0,c=-1,l=0,h,p=0;p<=i.length;++p){if(p<i.length)h=i.charCodeAt(p);else{if(h===47)break;h=47}if(h===47){if(!(c===p-1||l===1))if(c!==p-1&&l===2){if(o.length<2||a!==2||o.charCodeAt(o.length-1)!==46||o.charCodeAt(o.length-2)!==46){if(o.length>2){var y=o.lastIndexOf("/");if(y!==o.length-1){y===-1?(o="",a=0):(o=o.slice(0,y),a=o.length-1-o.lastIndexOf("/")),c=p,l=0;continue}}else if(o.length===2||o.length===1){o="",a=0,c=p,l=0;continue}}s&&(o.length>0?o+="/..":o="..",a=2)}else o.length>0?o+="/"+i.slice(c+1,p):o=i.slice(c+1,p),a=p-c-1;c=p,l=0}else h===46&&l!==-1?++l:l=-1}return o}function r(i,s){var o=s.dir||s.root,a=s.base||(s.name||"")+(s.ext||"");return o?o===s.root?o+a:o+i+a:a}var n={resolve:function(){for(var s="",o=!1,a,c=arguments.length-1;c>=-1&&!o;c--){var l;c>=0?l=arguments[c]:(a===void 0&&(a=process.cwd()),l=a),t(l),l.length!==0&&(s=l+"/"+s,o=l.charCodeAt(0)===47)}return s=e(s,!o),o?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(t(s),s.length===0)return".";var o=s.charCodeAt(0)===47,a=s.charCodeAt(s.length-1)===47;return s=e(s,!o),s.length===0&&!o&&(s="."),s.length>0&&a&&(s+="/"),o?"/"+s:s},isAbsolute:function(s){return t(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,o=0;o<arguments.length;++o){var a=arguments[o];t(a),a.length>0&&(s===void 0?s=a:s+="/"+a)}return s===void 0?".":n.normalize(s)},relative:function(s,o){if(t(s),t(o),s===o||(s=n.resolve(s),o=n.resolve(o),s===o))return"";for(var a=1;a<s.length&&s.charCodeAt(a)===47;++a);for(var c=s.length,l=c-a,h=1;h<o.length&&o.charCodeAt(h)===47;++h);for(var p=o.length,y=p-h,w=l<y?l:y,v=-1,g=0;g<=w;++g){if(g===w){if(y>w){if(o.charCodeAt(h+g)===47)return o.slice(h+g+1);if(g===0)return o.slice(h+g)}else l>w&&(s.charCodeAt(a+g)===47?v=g:g===0&&(v=0));break}var E=s.charCodeAt(a+g),I=o.charCodeAt(h+g);if(E!==I)break;E===47&&(v=g)}var P="";for(g=a+v+1;g<=c;++g)(g===c||s.charCodeAt(g)===47)&&(P.length===0?P+="..":P+="/..");return P.length>0?P+o.slice(h+v):(h+=v,o.charCodeAt(h)===47&&++h,o.slice(h))},_makeLong:function(s){return s},dirname:function(s){if(t(s),s.length===0)return".";for(var o=s.charCodeAt(0),a=o===47,c=-1,l=!0,h=s.length-1;h>=1;--h)if(o=s.charCodeAt(h),o===47){if(!l){c=h;break}}else l=!1;return c===-1?a?"/":".":a&&c===1?"//":s.slice(0,c)},basename:function(s,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');t(s);var a=0,c=-1,l=!0,h;if(o!==void 0&&o.length>0&&o.length<=s.length){if(o.length===s.length&&o===s)return"";var p=o.length-1,y=-1;for(h=s.length-1;h>=0;--h){var w=s.charCodeAt(h);if(w===47){if(!l){a=h+1;break}}else y===-1&&(l=!1,y=h+1),p>=0&&(w===o.charCodeAt(p)?--p===-1&&(c=h):(p=-1,c=y))}return a===c?c=y:c===-1&&(c=s.length),s.slice(a,c)}else{for(h=s.length-1;h>=0;--h)if(s.charCodeAt(h)===47){if(!l){a=h+1;break}}else c===-1&&(l=!1,c=h+1);return c===-1?"":s.slice(a,c)}},extname:function(s){t(s);for(var o=-1,a=0,c=-1,l=!0,h=0,p=s.length-1;p>=0;--p){var y=s.charCodeAt(p);if(y===47){if(!l){a=p+1;break}continue}c===-1&&(l=!1,c=p+1),y===46?o===-1?o=p:h!==1&&(h=1):o!==-1&&(h=-1)}return o===-1||c===-1||h===0||h===1&&o===c-1&&o===a+1?"":s.slice(o,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return r("/",s)},parse:function(s){t(s);var o={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return o;var a=s.charCodeAt(0),c=a===47,l;c?(o.root="/",l=1):l=0;for(var h=-1,p=0,y=-1,w=!0,v=s.length-1,g=0;v>=l;--v){if(a=s.charCodeAt(v),a===47){if(!w){p=v+1;break}continue}y===-1&&(w=!1,y=v+1),a===46?h===-1?h=v:g!==1&&(g=1):h!==-1&&(g=-1)}return h===-1||y===-1||g===0||g===1&&h===y-1&&h===p+1?y!==-1&&(p===0&&c?o.base=o.name=s.slice(1,y):o.base=o.name=s.slice(p,y)):(p===0&&c?(o.name=s.slice(1,h),o.base=s.slice(1,y)):(o.name=s.slice(p,h),o.base=s.slice(p,y)),o.ext=s.slice(h,y)),p>0?o.dir=s.slice(0,p-1):c&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,Yn=n,Yn}var ie=Bl(),Cl=Si(ie),ua=po({__proto__:null,default:Cl},[ie]);function Al(){return{...{cwd:()=>"/",emitWarning:(r,n)=>{console.warn(`${n}${n?": ":""}${r}`)},env:{},getuid:()=>0,getgid:()=>0,platform:"browser"},...ra}}var In=Al(),Nr={exports:{}},Fs;function Pl(){if(Fs)return Nr.exports;Fs=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(b,T,O){return Function.prototype.apply.call(b,T,O)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(b){return Object.getOwnPropertyNames(b).concat(Object.getOwnPropertySymbols(b))}:r=function(b){return Object.getOwnPropertyNames(b)};function n(R){console&&console.warn&&console.warn(R)}var i=Number.isNaN||function(b){return b!==b};function s(){s.init.call(this)}Nr.exports=s,Nr.exports.once=I,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(R){if(typeof R!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof R)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(R){if(typeof R!="number"||R<0||i(R))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+R+".");o=R}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(b){if(typeof b!="number"||b<0||i(b))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+b+".");return this._maxListeners=b,this};function c(R){return R._maxListeners===void 0?s.defaultMaxListeners:R._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(b){for(var T=[],O=1;O<arguments.length;O++)T.push(arguments[O]);var C=b==="error",D=this._events;if(D!==void 0)C=C&&D.error===void 0;else if(!C)return!1;if(C){var N;if(T.length>0&&(N=T[0]),N instanceof Error)throw N;var V=new Error("Unhandled error."+(N?" ("+N.message+")":""));throw V.context=N,V}var $=D[b];if($===void 0)return!1;if(typeof $=="function")e($,this,T);else for(var G=$.length,de=v($,G),O=0;O<G;++O)e(de[O],this,T);return!0};function l(R,b,T,O){var C,D,N;if(a(T),D=R._events,D===void 0?(D=R._events=Object.create(null),R._eventsCount=0):(D.newListener!==void 0&&(R.emit("newListener",b,T.listener?T.listener:T),D=R._events),N=D[b]),N===void 0)N=D[b]=T,++R._eventsCount;else if(typeof N=="function"?N=D[b]=O?[T,N]:[N,T]:O?N.unshift(T):N.push(T),C=c(R),C>0&&N.length>C&&!N.warned){N.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(b)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=R,V.type=b,V.count=N.length,n(V)}return R}s.prototype.addListener=function(b,T){return l(this,b,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(b,T){return l(this,b,T,!0)};function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(R,b,T){var O={fired:!1,wrapFn:void 0,target:R,type:b,listener:T},C=h.bind(O);return C.listener=T,O.wrapFn=C,C}s.prototype.once=function(b,T){return a(T),this.on(b,p(this,b,T)),this},s.prototype.prependOnceListener=function(b,T){return a(T),this.prependListener(b,p(this,b,T)),this},s.prototype.removeListener=function(b,T){var O,C,D,N,V;if(a(T),C=this._events,C===void 0)return this;if(O=C[b],O===void 0)return this;if(O===T||O.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete C[b],C.removeListener&&this.emit("removeListener",b,O.listener||T));else if(typeof O!="function"){for(D=-1,N=O.length-1;N>=0;N--)if(O[N]===T||O[N].listener===T){V=O[N].listener,D=N;break}if(D<0)return this;D===0?O.shift():g(O,D),O.length===1&&(C[b]=O[0]),C.removeListener!==void 0&&this.emit("removeListener",b,V||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(b){var T,O,C;if(O=this._events,O===void 0)return this;if(O.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):O[b]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete O[b]),this;if(arguments.length===0){var D=Object.keys(O),N;for(C=0;C<D.length;++C)N=D[C],N!=="removeListener"&&this.removeAllListeners(N);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=O[b],typeof T=="function")this.removeListener(b,T);else if(T!==void 0)for(C=T.length-1;C>=0;C--)this.removeListener(b,T[C]);return this};function y(R,b,T){var O=R._events;if(O===void 0)return[];var C=O[b];return C===void 0?[]:typeof C=="function"?T?[C.listener||C]:[C]:T?E(C):v(C,C.length)}s.prototype.listeners=function(b){return y(this,b,!0)},s.prototype.rawListeners=function(b){return y(this,b,!1)},s.listenerCount=function(R,b){return typeof R.listenerCount=="function"?R.listenerCount(b):w.call(R,b)},s.prototype.listenerCount=w;function w(R){var b=this._events;if(b!==void 0){var T=b[R];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function v(R,b){for(var T=new Array(b),O=0;O<b;++O)T[O]=R[O];return T}function g(R,b){for(;b+1<R.length;b++)R[b]=R[b+1];R.pop()}function E(R){for(var b=new Array(R.length),T=0;T<b.length;++T)b[T]=R[T].listener||R[T];return b}function I(R,b){return new Promise(function(T,O){function C(N){R.removeListener(b,D),O(N)}function D(){typeof R.removeListener=="function"&&R.removeListener("error",C),T([].slice.call(arguments))}k(R,b,D,{once:!0}),b!=="error"&&P(R,C,{once:!0})})}function P(R,b,T){typeof R.on=="function"&&k(R,"error",b,T)}function k(R,b,T,O){if(typeof R.on=="function")O.once?R.once(b,T):R.on(b,T);else if(typeof R.addEventListener=="function")R.addEventListener(b,function C(D){O.once&&R.removeEventListener(b,C),T(D)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof R)}return Nr.exports}var br=Pl();const{S_IFMT:Ee,S_IFDIR:Fl,S_IFREG:la,S_IFLNK:Ns,S_IFCHR:Nl,O_APPEND:Ll}=ee,Lr=()=>In.getuid?.()??0,Dr=()=>In.getgid?.()??0,Ls="/";class Dl extends br.EventEmitter{ino;_uid=Lr();_gid=Dr();_atime=new Date;_mtime=new Date;_ctime=new Date;buf;rdev=0;mode;_nlink=1;symlink;constructor(e,r=438){super(),this.mode=r,this.ino=e}set ctime(e){this._ctime=e}get ctime(){return this._ctime}set uid(e){this._uid=e,this.ctime=new Date}get uid(){return this._uid}set gid(e){this._gid=e,this.ctime=new Date}get gid(){return this._gid}set atime(e){this._atime=e,this.ctime=new Date}get atime(){return this._atime}set mtime(e){this._mtime=e,this.ctime=new Date}get mtime(){return this._mtime}get perm(){return this.mode&~Ee}set perm(e){this.mode=this.mode&Ee|e&~Ee,this.ctime=new Date}set nlink(e){this._nlink=e,this.ctime=new Date}get nlink(){return this._nlink}getString(e="utf8"){return this.atime=new Date,this.getBuffer().toString(e)}setString(e){this.buf=Et(e,"utf8"),this.touch()}getBuffer(){return this.atime=new Date,this.buf||this.setBuffer(Pe(0)),Et(this.buf)}setBuffer(e){this.buf=Et(e),this.touch()}getSize(){return this.buf?this.buf.length:0}setModeProperty(e){this.mode=e}isFile(){return(this.mode&Ee)===la}isDirectory(){return(this.mode&Ee)===Fl}isSymlink(){return(this.mode&Ee)===Ns}isCharacterDevice(){return(this.mode&Ee)===Nl}makeSymlink(e){this.mode=Ns|438,this.symlink=e}write(e,r=0,n=e.length,i=0){if(this.buf||(this.buf=Pe(0)),i+n>this.buf.length){const s=Pe(i+n);this.buf.copy(s,0,0,this.buf.length),this.buf=s}return e.copy(this.buf,i,r,r+n),this.touch(),n}read(e,r=0,n=e.byteLength,i=0){if(this.atime=new Date,this.buf||(this.buf=Pe(0)),i>=this.buf.length)return 0;let s=n;s>e.byteLength&&(s=e.byteLength),s+i>this.buf.length&&(s=this.buf.length-i);const o=e instanceof re.Buffer?e:re.Buffer.from(e.buffer);return this.buf.copy(o,r,i,i+s),s}truncate(e=0){if(!e)this.buf=Pe(0);else if(this.buf||(this.buf=Pe(0)),e<=this.buf.length)this.buf=this.buf.slice(0,e);else{const r=Pe(e);this.buf.copy(r),r.fill(0,this.buf.length),this.buf=r}this.touch()}chmod(e){this.mode=this.mode&Ee|e&~Ee,this.touch()}chown(e,r){this.uid=e,this.gid=r,this.touch()}touch(){this.mtime=new Date,this.emit("change",this)}canRead(e=Lr(),r=Dr()){return!!(this.perm&4||r===this.gid&&this.perm&32||e===this.uid&&this.perm&256)}canWrite(e=Lr(),r=Dr()){return!!(this.perm&2||r===this.gid&&this.perm&16||e===this.uid&&this.perm&128)}canExecute(e=Lr(),r=Dr()){return!!(this.perm&1||r===this.gid&&this.perm&8||e===this.uid&&this.perm&64)}del(){this.emit("delete",this)}toJSON(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}}}class dr extends br.EventEmitter{vol;parent;children=new Map;_steps=[];node;ino=0;length=0;name;get steps(){return this._steps}set steps(e){this._steps=e;for(const[r,n]of this.children.entries())r==="."||r===".."||n?.syncSteps()}constructor(e,r,n){super(),this.vol=e,this.parent=r,this.name=n,this.syncSteps()}setNode(e){this.node=e,this.ino=e.ino}getNode(){return this.node}createChild(e,r=this.vol.createNode(la|438)){const n=new dr(this.vol,this,e);return n.setNode(r),r.isDirectory()&&(n.children.set(".",n),n.getNode().nlink++),this.setChild(e,n),n}setChild(e,r=new dr(this.vol,this,e)){return this.children.set(e,r),r.parent=this,this.length++,r.getNode().isDirectory()&&(r.children.set("..",this),this.getNode().nlink++),this.getNode().mtime=new Date,this.emit("child:add",r,this),r}deleteChild(e){e.getNode().isDirectory()&&(e.children.delete(".."),this.getNode().nlink--),this.children.delete(e.getName()),this.length--,this.getNode().mtime=new Date,this.emit("child:delete",e,this)}getChild(e){return this.getNode().mtime=new Date,this.children.get(e)}getPath(){return this.steps.join(Ls)}getParentPath(){return this.steps.slice(0,-1).join(Ls)}getName(){return this.steps[this.steps.length-1]}toJSON(){return{steps:this.steps,ino:this.ino,children:Array.from(this.children.keys())}}syncSteps(){this.steps=this.parent?this.parent.steps.concat([this.name]):[this.name]}}class Ml{fd;link;node;position;flags;constructor(e,r,n,i){this.link=e,this.node=r,this.flags=n,this.fd=i,this.position=0,this.flags&Ll&&(this.position=this.getSize())}getString(e="utf8"){return this.node.getString()}setString(e){this.node.setString(e)}getBuffer(){return this.node.getBuffer()}setBuffer(e){this.node.setBuffer(e)}getSize(){return this.node.getSize()}truncate(e){this.node.truncate(e)}seekTo(e){this.position=e}stats(){return st.build(this.node)}write(e,r=0,n=e.length,i){typeof i!="number"&&(i=this.position);const s=this.node.write(e,r,n,i);return this.position=i+s,s}read(e,r=0,n=e.byteLength,i){typeof i!="number"&&(i=this.position);const s=this.node.read(e,r,n,i);return this.position=i+s,s}chmod(e){this.node.chmod(e)}chown(e,r){this.node.chown(e,r)}}var Bn=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(()=>t()).catch(()=>{});function jl(t,e,r){const n=setTimeout.apply(typeof globalThis<"u"?globalThis:global,arguments);return n&&typeof n=="object"&&typeof n.unref=="function"&&n.unref(),n}/**
13
- * @license
14
- * web-streams-polyfill v4.1.0
15
- * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
16
- * This code is released under the MIT license.
17
- * SPDX-License-Identifier: MIT
18
- */function pr(){}function X(t){return typeof t=="object"&&t!==null||typeof t=="function"}const fa=pr;function U(t,e){try{Object.defineProperty(t,"name",{value:e,configurable:!0})}catch{}}const Ti=Promise,Ul=Promise.resolve.bind(Ti),$l=Promise.prototype.then,ql=Promise.reject.bind(Ti),Wl=Ul;function te(t){return new Ti(t)}function q(t){return te(e=>e(t))}function F(t){return ql(t)}function ve(t,e,r){return $l.call(t,e,r)}function me(t,e,r){ve(ve(t,e,r),void 0,fa)}function Kn(t,e){me(t,e)}function fi(t,e){me(t,void 0,e)}function ot(t,e,r){return ve(t,e,r)}function vr(t){ve(t,void 0,fa)}let at=t=>{if(typeof queueMicrotask=="function")at=queueMicrotask;else{const e=q(void 0);at=r=>ve(e,r)}return at(t)};function Ct(t,e,r){if(typeof t!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(t,e,r)}function Nt(t,e,r){try{return q(Ct(t,e,r))}catch(n){return F(n)}}class he{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){const r=this._back;let n=r;r._elements.length===16383&&(n={_elements:[],_next:void 0}),r._elements.push(e),n!==r&&(this._back=n,r._next=n),++this._size}shift(){const e=this._front;let r=e;const n=this._cursor;let i=n+1;const s=e._elements,o=s[n];return i===16384&&(r=e._next,i=0),--this._size,this._cursor=i,e!==r&&(this._front=r),s[n]=void 0,o}forEach(e){let r=this._cursor,n=this._front,i=n._elements;for(;!(r===i.length&&n._next===void 0||r===i.length&&(n=n._next,i=n._elements,r=0,i.length===0));)e(i[r]),++r}peek(){const e=this._front,r=this._cursor;return e._elements[r]}}const ha=Symbol("[[AbortSteps]]"),da=Symbol("[[ErrorSteps]]"),Oi=Symbol("[[CancelSteps]]"),ki=Symbol("[[PullSteps]]"),Ii=Symbol("[[ReleaseSteps]]");function pa(t,e){t._ownerReadableStream=e,e._reader=t,e._state==="readable"?hi(t):e._state==="closed"?function(r){hi(r),ya(r)}(t):ma(t,e._storedError)}function Bi(t,e){return pe(t._ownerReadableStream,e)}function Te(t){const e=t._ownerReadableStream;e._state==="readable"?Ci(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(r,n){ma(r,n)}(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._readableStreamController[Ii](),e._reader=void 0,t._ownerReadableStream=void 0}function gn(t){return new TypeError("Cannot "+t+" a stream using a released reader")}function hi(t){t._closedPromise=te((e,r)=>{t._closedPromise_resolve=e,t._closedPromise_reject=r})}function ma(t,e){hi(t),Ci(t,e)}function Ci(t,e){t._closedPromise_reject!==void 0&&(vr(t._closedPromise),t._closedPromise_reject(e),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0)}function ya(t){t._closedPromise_resolve!==void 0&&(t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0)}const Ds=Number.isFinite||function(t){return typeof t=="number"&&isFinite(t)},zl=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};function je(t,e){if(t!==void 0&&typeof(r=t)!="object"&&typeof r!="function")throw new TypeError(`${e} is not an object.`);var r}function ze(t,e){if(typeof t!="function")throw new TypeError(`${e} is not a function.`)}function wa(t,e){if(!function(r){return typeof r=="object"&&r!==null||typeof r=="function"}(t))throw new TypeError(`${e} is not an object.`)}function ct(t,e,r){if(t===void 0)throw new TypeError(`Parameter ${e} is required in '${r}'.`)}function Ms(t,e,r){if(t===void 0)throw new TypeError(`${e} is required in '${r}'.`)}function ga(t){return Number(t)}function js(t){return t===0?0:t}function Ai(t,e){const r=Number.MAX_SAFE_INTEGER;let n=Number(t);if(n=js(n),!Ds(n))throw new TypeError(`${e} is not a finite number`);if(n=function(i){return js(zl(i))}(n),n<0||n>r)throw new TypeError(`${e} is outside the accepted range of 0 to ${r}, inclusive`);return Ds(n)&&n!==0?n:0}function Pi(t,e){if(!Fe(t))throw new TypeError(`${e} is not a ReadableStream.`)}function xt(t){return new et(t)}function _a(t,e){t._reader._readRequests.push(e)}function Fi(t,e,r){const n=t._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(e)}function Cn(t){return t._reader._readRequests.length}function ba(t){const e=t._reader;return e!==void 0&&!!Ue(e)}class et{constructor(e){if(ct(e,1,"ReadableStreamDefaultReader"),Pi(e,"First parameter"),$e(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");pa(this,e),this._readRequests=new he}get closed(){return Ue(this)?this._closedPromise:F(Mr("closed"))}cancel(e=void 0){return Ue(this)?this._ownerReadableStream===void 0?F(gn("cancel")):Bi(this,e):F(Mr("cancel"))}read(){if(!Ue(this))return F(Mr("read"));if(this._ownerReadableStream===void 0)return F(gn("read from"));let e,r;const n=te((i,s)=>{e=i,r=s});return mr(this,{_chunkSteps:i=>e({value:i,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:i=>r(i)}),n}releaseLock(){if(!Ue(this))throw Mr("releaseLock");this._ownerReadableStream!==void 0&&function(e){Te(e);const r=new TypeError("Reader was released");va(e,r)}(this)}}function Ue(t){return!!X(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readRequests")&&t instanceof et}function mr(t,e){const r=t._ownerReadableStream;r._disturbed=!0,r._state==="closed"?e._closeSteps():r._state==="errored"?e._errorSteps(r._storedError):r._readableStreamController[ki](e)}function va(t,e){const r=t._readRequests;t._readRequests=new he,r.forEach(n=>{n._errorSteps(e)})}function Mr(t){return new TypeError(`ReadableStreamDefaultReader.prototype.${t} can only be used on a ReadableStreamDefaultReader`)}var Jn,Gn,Qn;function sr(t){return t.slice()}function Sa(t,e,r,n,i){new Uint8Array(t).set(new Uint8Array(r,n,i),e)}Object.defineProperties(et.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),U(et.prototype.cancel,"cancel"),U(et.prototype.read,"read"),U(et.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(et.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});let ut=t=>(ut=typeof t.transfer=="function"?e=>e.transfer():typeof structuredClone=="function"?e=>structuredClone(e,{transfer:[e]}):e=>e,ut(t)),lt=t=>(lt=typeof t.detached=="boolean"?e=>e.detached:e=>e.byteLength===0,lt(t));function Ea(t,e,r){if(t.slice)return t.slice(e,r);const n=r-e,i=new ArrayBuffer(n);return Sa(i,0,t,e,n),i}function or(t,e){const r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(`${String(e)} is not a function`);return r}}function Us(t){try{const e=t.done,r=t.value;return ve(Wl(r),n=>({done:e,value:n}))}catch(e){return F(e)}}const Sr=(Qn=(Jn=Symbol.asyncIterator)!==null&&Jn!==void 0?Jn:(Gn=Symbol.for)===null||Gn===void 0?void 0:Gn.call(Symbol,"Symbol.asyncIterator"))!==null&&Qn!==void 0?Qn:"@@asyncIterator";function Ra(t,e="sync",r){if(r===void 0)if(e==="async"){if((r=or(t,Sr))===void 0)return function(i){const s={next(){let o;try{o=xa(i)}catch(a){return F(a)}return Us(o)},return(o){let a;try{const c=or(i.iterator,"return");if(c===void 0)return q({done:!0,value:o});a=Ct(c,i.iterator,[o])}catch(c){return F(c)}return X(a)?Us(a):F(new TypeError("The iterator.return() method must return an object"))}};return{iterator:s,nextMethod:s.next,done:!1}}(Ra(t,"sync",or(t,Symbol.iterator)))}else r=or(t,Symbol.iterator);if(r===void 0)throw new TypeError("The object is not iterable");const n=Ct(r,t,[]);if(!X(n))throw new TypeError("The iterator method must return an object");return{iterator:n,nextMethod:n.next,done:!1}}function xa(t){const e=Ct(t.nextMethod,t.iterator,[]);if(!X(e))throw new TypeError("The iterator.next() method must return an object");return e}class Ta{constructor(e,r){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=r}next(){const e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?ot(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){const r=()=>this._returnSteps(e);return this._ongoingPromise=this._ongoingPromise?ot(this._ongoingPromise,r,r):r(),this._ongoingPromise}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});const e=this._reader;let r,n;const i=te((s,o)=>{r=s,n=o});return mr(e,{_chunkSteps:s=>{this._ongoingPromise=void 0,at(()=>r({value:s,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Te(e),r({value:void 0,done:!0})},_errorSteps:s=>{this._ongoingPromise=void 0,this._isFinished=!0,Te(e),n(s)}}),i}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;const r=this._reader;if(!this._preventCancel){const n=Bi(r,e);return Te(r),ot(n,()=>({value:e,done:!0}))}return Te(r),q({value:e,done:!0})}}const Oa={next(){return $s(this)?this._asyncIteratorImpl.next():F(qs("next"))},return(t){return $s(this)?this._asyncIteratorImpl.return(t):F(qs("return"))},[Sr](){return this}};function $s(t){if(!X(t)||!Object.prototype.hasOwnProperty.call(t,"_asyncIteratorImpl"))return!1;try{return t._asyncIteratorImpl instanceof Ta}catch{return!1}}function qs(t){return new TypeError(`ReadableStreamAsyncIterator.${t} can only be used on a ReadableSteamAsyncIterator`)}Object.defineProperty(Oa,Sr,{enumerable:!1});const ka=Number.isNaN||function(t){return t!=t};function Ws(t){const e=Ea(t.buffer,t.byteOffset,t.byteOffset+t.byteLength);return new Uint8Array(e)}function di(t){const e=t._queue.shift();return t._queueTotalSize-=e.size,t._queueTotalSize<0&&(t._queueTotalSize=0),e.value}function Ni(t,e,r){if(typeof(n=r)!="number"||ka(n)||n<0||r===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var n;t._queue.push({value:e,size:r}),t._queueTotalSize+=r}function Ve(t){t._queue=new he,t._queueTotalSize=0}function Ia(t){return t===DataView}class vt{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Xn(this))throw Zn("view");return this._view}respond(e){if(!Xn(this))throw Zn("respond");if(ct(e,1,"respond"),e=Ai(e,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(lt(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");nn(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!Xn(this))throw Zn("respondWithNewView");if(ct(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(lt(e.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");sn(this._associatedReadableByteStreamController,e)}}Object.defineProperties(vt.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),U(vt.prototype.respond,"respond"),U(vt.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(vt.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Le{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!tt(this))throw tr("byobRequest");return mi(this)}get desiredSize(){if(!tt(this))throw tr("desiredSize");return Ua(this)}close(){if(!tt(this))throw tr("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");const e=this._controlledReadableByteStream._state;if(e!=="readable")throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);ar(this)}enqueue(e){if(!tt(this))throw tr("enqueue");if(ct(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(e.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(e.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");const r=this._controlledReadableByteStream._state;if(r!=="readable")throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be enqueued to`);rn(this,e)}error(e=void 0){if(!tt(this))throw tr("error");fe(this,e)}[Oi](e){Ba(this),Ve(this);const r=this._cancelAlgorithm(e);return An(this),r}[ki](e){const r=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void ja(this,e);const n=this._autoAllocateChunkSize;if(n!==void 0){let i;try{i=new ArrayBuffer(n)}catch(o){return void e._errorSteps(o)}const s={buffer:i,bufferByteLength:n,byteOffset:0,byteLength:n,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(s)}_a(r,e),ft(this)}[Ii](){if(this._pendingPullIntos.length>0){const e=this._pendingPullIntos.peek();e.readerType="none",this._pendingPullIntos=new he,this._pendingPullIntos.push(e)}}}function tt(t){return!!X(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableByteStream")&&t instanceof Le}function Xn(t){return!!X(t)&&!!Object.prototype.hasOwnProperty.call(t,"_associatedReadableByteStreamController")&&t instanceof vt}function ft(t){if(function(r){const n=r._controlledReadableByteStream;return n._state!=="readable"||r._closeRequested||!r._started?!1:!!(ba(n)&&Cn(n)>0||Di(n)&&Wa(n)>0||Ua(r)>0)}(t)){if(t._pulling)return void(t._pullAgain=!0);t._pulling=!0,me(t._pullAlgorithm(),()=>(t._pulling=!1,t._pullAgain&&(t._pullAgain=!1,ft(t)),null),r=>(fe(t,r),null))}}function Ba(t){Li(t),t._pendingPullIntos=new he}function Ca(t,e){let r=!1;t._state==="closed"&&(r=!0);const n=Aa(e);e.readerType==="default"?Fi(t,n,r):function(i,s,o){const a=i._reader,c=a._readIntoRequests.shift();o?c._closeSteps(s):c._chunkSteps(s)}(t,n,r)}function en(t,e){for(let r=0;r<e.length;++r)Ca(t,e[r])}function Aa(t){const e=t.bytesFilled,r=t.elementSize;return new t.viewConstructor(t.buffer,t.byteOffset,e/r)}function tn(t,e,r,n){t._queue.push({buffer:e,byteOffset:r,byteLength:n}),t._queueTotalSize+=n}function Pa(t,e,r,n){let i;try{i=Ea(e,r,r+n)}catch(s){throw fe(t,s),s}tn(t,i,0,n)}function Fa(t,e){e.bytesFilled>0&&Pa(t,e.buffer,e.byteOffset,e.bytesFilled),Tt(t)}function Na(t,e){const r=Math.min(t._queueTotalSize,e.byteLength-e.bytesFilled),n=e.bytesFilled+r;let i=r,s=!1;const o=n-n%e.elementSize;o>=e.minimumFill&&(i=o-e.bytesFilled,s=!0);const a=t._queue;for(;i>0;){const c=a.peek(),l=Math.min(i,c.byteLength),h=e.byteOffset+e.bytesFilled;Sa(e.buffer,h,c.buffer,c.byteOffset,l),c.byteLength===l?a.shift():(c.byteOffset+=l,c.byteLength-=l),t._queueTotalSize-=l,La(t,l,e),i-=l}return s}function La(t,e,r){r.bytesFilled+=e}function Da(t){t._queueTotalSize===0&&t._closeRequested?(An(t),Er(t._controlledReadableByteStream)):ft(t)}function Li(t){t._byobRequest!==null&&(t._byobRequest._associatedReadableByteStreamController=void 0,t._byobRequest._view=null,t._byobRequest=null)}function pi(t){const e=[];for(;t._pendingPullIntos.length>0&&t._queueTotalSize!==0;){const r=t._pendingPullIntos.peek();Na(t,r)&&(Tt(t),e.push(r))}return e}function Vl(t,e,r,n){const i=t._controlledReadableByteStream,s=e.constructor,o=function(y){return Ia(y)?1:y.BYTES_PER_ELEMENT}(s),{byteOffset:a,byteLength:c}=e,l=r*o;let h;try{h=ut(e.buffer)}catch(y){return void n._errorSteps(y)}const p={buffer:h,bufferByteLength:h.byteLength,byteOffset:a,byteLength:c,bytesFilled:0,minimumFill:l,elementSize:o,viewConstructor:s,readerType:"byob"};if(t._pendingPullIntos.length>0)return t._pendingPullIntos.push(p),void zs(i,n);if(i._state!=="closed"){if(t._queueTotalSize>0){if(Na(t,p)){const y=Aa(p);return Da(t),void n._chunkSteps(y)}if(t._closeRequested){const y=new TypeError("Insufficient bytes to fill elements in the given buffer");return fe(t,y),void n._errorSteps(y)}}t._pendingPullIntos.push(p),zs(i,n),ft(t)}else{const y=new s(p.buffer,p.byteOffset,0);n._closeSteps(y)}}function Ma(t,e){const r=t._pendingPullIntos.peek();Li(t),t._controlledReadableByteStream._state==="closed"?function(n,i){i.readerType==="none"&&Tt(n);const s=n._controlledReadableByteStream;if(Di(s)){const o=[];for(let a=0;a<Wa(s);++a)o.push(Tt(n));en(s,o)}}(t,r):function(n,i,s){if(La(0,i,s),s.readerType==="none"){Fa(n,s);const c=pi(n);return void en(n._controlledReadableByteStream,c)}if(s.bytesFilled<s.minimumFill)return;Tt(n);const o=s.bytesFilled%s.elementSize;if(o>0){const c=s.byteOffset+s.bytesFilled;Pa(n,s.buffer,c-o,o)}s.bytesFilled-=o;const a=pi(n);Ca(n._controlledReadableByteStream,s),en(n._controlledReadableByteStream,a)}(t,e,r),ft(t)}function Tt(t){return t._pendingPullIntos.shift()}function An(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0}function ar(t){const e=t._controlledReadableByteStream;if(!t._closeRequested&&e._state==="readable")if(t._queueTotalSize>0)t._closeRequested=!0;else{if(t._pendingPullIntos.length>0){const r=t._pendingPullIntos.peek();if(r.bytesFilled%r.elementSize!=0){const n=new TypeError("Insufficient bytes to fill elements in the given buffer");throw fe(t,n),n}}An(t),Er(e)}}function rn(t,e){const r=t._controlledReadableByteStream;if(t._closeRequested||r._state!=="readable")return;const{buffer:n,byteOffset:i,byteLength:s}=e;if(lt(n))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");const o=ut(n);if(t._pendingPullIntos.length>0){const a=t._pendingPullIntos.peek();if(lt(a.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Li(t),a.buffer=ut(a.buffer),a.readerType==="none"&&Fa(t,a)}if(ba(r))(function(a){const c=a._controlledReadableByteStream._reader;for(;c._readRequests.length>0;){if(a._queueTotalSize===0)return;ja(a,c._readRequests.shift())}})(t),Cn(r)===0?tn(t,o,i,s):(t._pendingPullIntos.length>0&&Tt(t),Fi(r,new Uint8Array(o,i,s),!1));else if(Di(r)){tn(t,o,i,s);const a=pi(t);en(t._controlledReadableByteStream,a)}else tn(t,o,i,s);ft(t)}function fe(t,e){const r=t._controlledReadableByteStream;r._state==="readable"&&(Ba(t),Ve(t),An(t),uc(r,e))}function ja(t,e){const r=t._queue.shift();t._queueTotalSize-=r.byteLength,Da(t);const n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);e._chunkSteps(n)}function mi(t){if(t._byobRequest===null&&t._pendingPullIntos.length>0){const e=t._pendingPullIntos.peek(),r=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),n=Object.create(vt.prototype);(function(i,s,o){i._associatedReadableByteStreamController=s,i._view=o})(n,t,r),t._byobRequest=n}return t._byobRequest}function Ua(t){const e=t._controlledReadableByteStream._state;return e==="errored"?null:e==="closed"?0:t._strategyHWM-t._queueTotalSize}function nn(t,e){const r=t._pendingPullIntos.peek();if(t._controlledReadableByteStream._state==="closed"){if(e!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(e===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(r.bytesFilled+e>r.byteLength)throw new RangeError("bytesWritten out of range")}r.buffer=ut(r.buffer),Ma(t,e)}function sn(t,e){const r=t._pendingPullIntos.peek();if(t._controlledReadableByteStream._state==="closed"){if(e.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(e.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(r.byteOffset+r.bytesFilled!==e.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.bufferByteLength!==e.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(r.bytesFilled+e.byteLength>r.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");const n=e.byteLength;r.buffer=ut(e.buffer),Ma(t,n)}function $a(t,e,r,n,i,s,o){e._controlledReadableByteStream=t,e._pullAgain=!1,e._pulling=!1,e._byobRequest=null,e._queue=e._queueTotalSize=void 0,Ve(e),e._closeRequested=!1,e._started=!1,e._strategyHWM=s,e._pullAlgorithm=n,e._cancelAlgorithm=i,e._autoAllocateChunkSize=o,e._pendingPullIntos=new he,t._readableStreamController=e,me(q(r()),()=>(e._started=!0,ft(e),null),a=>(fe(e,a),null))}function Zn(t){return new TypeError(`ReadableStreamBYOBRequest.prototype.${t} can only be used on a ReadableStreamBYOBRequest`)}function tr(t){return new TypeError(`ReadableByteStreamController.prototype.${t} can only be used on a ReadableByteStreamController`)}function Hl(t,e){if((t=`${t}`)!="byob")throw new TypeError(`${e} '${t}' is not a valid enumeration value for ReadableStreamReaderMode`);return t}function qa(t){return new rt(t)}function zs(t,e){t._reader._readIntoRequests.push(e)}function Wa(t){return t._reader._readIntoRequests.length}function Di(t){const e=t._reader;return e!==void 0&&!!it(e)}Object.defineProperties(Le.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),U(Le.prototype.close,"close"),U(Le.prototype.enqueue,"enqueue"),U(Le.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Le.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class rt{constructor(e){if(ct(e,1,"ReadableStreamBYOBReader"),Pi(e,"First parameter"),$e(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!tt(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");pa(this,e),this._readIntoRequests=new he}get closed(){return it(this)?this._closedPromise:F(jr("closed"))}cancel(e=void 0){return it(this)?this._ownerReadableStream===void 0?F(gn("cancel")):Bi(this,e):F(jr("cancel"))}read(e,r={}){if(!it(this))return F(jr("read"));if(!ArrayBuffer.isView(e))return F(new TypeError("view must be an array buffer view"));if(e.byteLength===0)return F(new TypeError("view must have non-zero byteLength"));if(e.buffer.byteLength===0)return F(new TypeError("view's buffer must have non-zero byteLength"));if(lt(e.buffer))return F(new TypeError("view's buffer has been detached"));let n;try{n=function(c,l){var h;return je(c,l),{min:Ai((h=c?.min)!==null&&h!==void 0?h:1,`${l} has member 'min' that`)}}(r,"options")}catch(c){return F(c)}const i=n.min;if(i===0)return F(new TypeError("options.min must be greater than 0"));if(function(c){return Ia(c.constructor)}(e)){if(i>e.byteLength)return F(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(i>e.length)return F(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return F(gn("read from"));let s,o;const a=te((c,l)=>{s=c,o=l});return za(this,e,i,{_chunkSteps:c=>s({value:c,done:!1}),_closeSteps:c=>s({value:c,done:!0}),_errorSteps:c=>o(c)}),a}releaseLock(){if(!it(this))throw jr("releaseLock");this._ownerReadableStream!==void 0&&function(e){Te(e);const r=new TypeError("Reader was released");Va(e,r)}(this)}}function it(t){return!!X(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readIntoRequests")&&t instanceof rt}function za(t,e,r,n){const i=t._ownerReadableStream;i._disturbed=!0,i._state==="errored"?n._errorSteps(i._storedError):Vl(i._readableStreamController,e,r,n)}function Va(t,e){const r=t._readIntoRequests;t._readIntoRequests=new he,r.forEach(n=>{n._errorSteps(e)})}function jr(t){return new TypeError(`ReadableStreamBYOBReader.prototype.${t} can only be used on a ReadableStreamBYOBReader`)}function yi(t,e){const{highWaterMark:r}=t;if(r===void 0)return e;if(ka(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function Ha(t){const{size:e}=t;return e||(()=>1)}function Ya(t,e){je(t,e);const r=t?.highWaterMark,n=t?.size;return{highWaterMark:r===void 0?void 0:ga(r),size:n===void 0?void 0:Yl(n,`${e} has member 'size' that`)}}function Yl(t,e){return ze(t,e),r=>ga(t(r))}function Kl(t,e,r){return ze(t,r),n=>Nt(t,e,[n])}function Jl(t,e,r){return ze(t,r),()=>Nt(t,e,[])}function Gl(t,e,r){return ze(t,r),n=>Ct(t,e,[n])}function Ql(t,e,r){return ze(t,r),(n,i)=>Nt(t,e,[n,i])}function Ka(t,e){if(!St(t))throw new TypeError(`${e} is not a WritableStream.`)}Object.defineProperties(rt.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),U(rt.prototype.cancel,"cancel"),U(rt.prototype.read,"read"),U(rt.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(rt.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});class De{constructor(e={},r={}){e===void 0?e=null:wa(e,"First parameter");const n=Ya(r,"Second parameter"),i=function(o,a){je(o,a);const c=o?.abort,l=o?.close,h=o?.start,p=o?.type,y=o?.write;return{abort:c===void 0?void 0:Kl(c,o,`${a} has member 'abort' that`),close:l===void 0?void 0:Jl(l,o,`${a} has member 'close' that`),start:h===void 0?void 0:Gl(h,o,`${a} has member 'start' that`),write:y===void 0?void 0:Ql(y,o,`${a} has member 'write' that`),type:p}}(e,"First parameter");if(Xl(this),i.type!==void 0)throw new RangeError("Invalid type is specified");const s=Ha(n);(function(o,a,c,l){const h=Object.create(bn.prototype);let p,y,w,v;p=a.start!==void 0?()=>a.start(h):()=>{},y=a.write!==void 0?g=>a.write(g,h):()=>q(void 0),w=a.close!==void 0?()=>a.close():()=>q(void 0),v=a.abort!==void 0?g=>a.abort(g):()=>q(void 0),ef(o,h,p,y,w,v,c,l)})(this,i,yi(n,1),s)}get locked(){if(!St(this))throw $r("locked");return Ot(this)}abort(e=void 0){return St(this)?Ot(this)?F(new TypeError("Cannot abort a stream that already has a writer")):_n(this,e):F($r("abort"))}close(){return St(this)?Ot(this)?F(new TypeError("Cannot close a stream that already has a writer")):Se(this)?F(new TypeError("Cannot close an already-closing stream")):Ga(this):F($r("close"))}getWriter(){if(!St(this))throw $r("getWriter");return Ja(this)}}function Ja(t){return new Ne(t)}function Xl(t){t._state="writable",t._storedError=void 0,t._writer=void 0,t._writableStreamController=void 0,t._writeRequests=new he,t._inFlightWriteRequest=void 0,t._closeRequest=void 0,t._inFlightCloseRequest=void 0,t._pendingAbortRequest=void 0,t._backpressure=!1}function St(t){return!!X(t)&&!!Object.prototype.hasOwnProperty.call(t,"_writableStreamController")&&t instanceof De}function Ot(t){return t._writer!==void 0}function _n(t,e){var r;if(t._state==="closed"||t._state==="errored")return q(void 0);t._writableStreamController._abortReason=e,(r=t._writableStreamController._abortController)===null||r===void 0||r.abort(e);const n=t._state;if(n==="closed"||n==="errored")return q(void 0);if(t._pendingAbortRequest!==void 0)return t._pendingAbortRequest._promise;let i=!1;n==="erroring"&&(i=!0,e=void 0);const s=te((o,a)=>{t._pendingAbortRequest={_promise:void 0,_resolve:o,_reject:a,_reason:e,_wasAlreadyErroring:i}});return t._pendingAbortRequest._promise=s,i||Mi(t,e),s}function Ga(t){const e=t._state;if(e==="closed"||e==="errored")return F(new TypeError(`The stream (in ${e} state) is not in the writable state and cannot be closed`));const r=te((s,o)=>{const a={_resolve:s,_reject:o};t._closeRequest=a}),n=t._writer;var i;return n!==void 0&&t._backpressure&&e==="writable"&&Wi(n),Ni(i=t._writableStreamController,tc,0),Pn(i),r}function wi(t,e){t._state!=="writable"?ji(t):Mi(t,e)}function Mi(t,e){const r=t._writableStreamController;t._state="erroring",t._storedError=e;const n=t._writer;n!==void 0&&Xa(n,e),!function(i){return!(i._inFlightWriteRequest===void 0&&i._inFlightCloseRequest===void 0)}(t)&&r._started&&ji(t)}function ji(t){t._state="errored",t._writableStreamController[da]();const e=t._storedError;if(t._writeRequests.forEach(n=>{n._reject(e)}),t._writeRequests=new he,t._pendingAbortRequest===void 0)return void Ur(t);const r=t._pendingAbortRequest;if(t._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(e),void Ur(t);me(t._writableStreamController[ha](r._reason),()=>(r._resolve(),Ur(t),null),n=>(r._reject(n),Ur(t),null))}function Se(t){return t._closeRequest!==void 0||t._inFlightCloseRequest!==void 0}function Ur(t){t._closeRequest!==void 0&&(t._closeRequest._reject(t._storedError),t._closeRequest=void 0);const e=t._writer;e!==void 0&&qi(e,t._storedError)}function Ui(t,e){const r=t._writer;r!==void 0&&e!==t._backpressure&&(e?function(n){Fn(n)}(r):Wi(r)),t._backpressure=e}Object.defineProperties(De.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),U(De.prototype.abort,"abort"),U(De.prototype.close,"close"),U(De.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(De.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});class Ne{constructor(e){if(ct(e,1,"WritableStreamDefaultWriter"),Ka(e,"First parameter"),Ot(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;const r=e._state;if(r==="writable")!Se(e)&&e._backpressure?Fn(this):Vs(this),on(this);else if(r==="erroring")_i(this,e._storedError),on(this);else if(r==="closed")Vs(this),on(n=this),sc(n);else{const i=e._storedError;_i(this,i),ic(this,i)}var n}get closed(){return Je(this)?this._closedPromise:F(Ge("closed"))}get desiredSize(){if(!Je(this))throw Ge("desiredSize");if(this._ownerWritableStream===void 0)throw cr("desiredSize");return function(e){const r=e._ownerWritableStream,n=r._state;return n==="errored"||n==="erroring"?null:n==="closed"?0:rc(r._writableStreamController)}(this)}get ready(){return Je(this)?this._readyPromise:F(Ge("ready"))}abort(e=void 0){return Je(this)?this._ownerWritableStream===void 0?F(cr("abort")):function(r,n){return _n(r._ownerWritableStream,n)}(this,e):F(Ge("abort"))}close(){if(!Je(this))return F(Ge("close"));const e=this._ownerWritableStream;return e===void 0?F(cr("close")):Se(e)?F(new TypeError("Cannot close an already-closing stream")):Qa(this)}releaseLock(){if(!Je(this))throw Ge("releaseLock");this._ownerWritableStream!==void 0&&Za(this)}write(e=void 0){return Je(this)?this._ownerWritableStream===void 0?F(cr("write to")):ec(this,e):F(Ge("write"))}}function Je(t){return!!X(t)&&!!Object.prototype.hasOwnProperty.call(t,"_ownerWritableStream")&&t instanceof Ne}function Qa(t){return Ga(t._ownerWritableStream)}function Zl(t,e){t._closedPromiseState==="pending"?qi(t,e):function(r,n){ic(r,n)}(t,e)}function Xa(t,e){t._readyPromiseState==="pending"?oc(t,e):function(r,n){_i(r,n)}(t,e)}function Za(t){const e=t._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Xa(t,r),Zl(t,r),e._writer=void 0,t._ownerWritableStream=void 0}function ec(t,e){const r=t._ownerWritableStream,n=r._writableStreamController,i=function(a,c){if(a._strategySizeAlgorithm===void 0)return 1;try{return a._strategySizeAlgorithm(c)}catch(l){return gi(a,l),1}}(n,e);if(r!==t._ownerWritableStream)return F(cr("write to"));const s=r._state;if(s==="errored")return F(r._storedError);if(Se(r)||s==="closed")return F(new TypeError("The stream is closing or closed and cannot be written to"));if(s==="erroring")return F(r._storedError);const o=function(a){return te((c,l)=>{const h={_resolve:c,_reject:l};a._writeRequests.push(h)})}(r);return function(a,c,l){try{Ni(a,c,l)}catch(p){return void gi(a,p)}const h=a._controlledWritableStream;!Se(h)&&h._state==="writable"&&Ui(h,$i(a)),Pn(a)}(n,e,i),o}Object.defineProperties(Ne.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),U(Ne.prototype.abort,"abort"),U(Ne.prototype.close,"close"),U(Ne.prototype.releaseLock,"releaseLock"),U(Ne.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ne.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});const tc={};class bn{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!ei(this))throw ti("abortReason");return this._abortReason}get signal(){if(!ei(this))throw ti("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(e=void 0){if(!ei(this))throw ti("error");this._controlledWritableStream._state==="writable"&&nc(this,e)}[ha](e){const r=this._abortAlgorithm(e);return vn(this),r}[da](){Ve(this)}}function ei(t){return!!X(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledWritableStream")&&t instanceof bn}function ef(t,e,r,n,i,s,o,a){e._controlledWritableStream=t,t._writableStreamController=e,e._queue=void 0,e._queueTotalSize=void 0,Ve(e),e._abortReason=void 0,e._abortController=function(){if(typeof AbortController=="function")return new AbortController}(),e._started=!1,e._strategySizeAlgorithm=a,e._strategyHWM=o,e._writeAlgorithm=n,e._closeAlgorithm=i,e._abortAlgorithm=s;const c=$i(e);Ui(t,c),me(q(r()),()=>(e._started=!0,Pn(e),null),l=>(e._started=!0,wi(t,l),null))}function vn(t){t._writeAlgorithm=void 0,t._closeAlgorithm=void 0,t._abortAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function rc(t){return t._strategyHWM-t._queueTotalSize}function Pn(t){const e=t._controlledWritableStream;if(!t._started||e._inFlightWriteRequest!==void 0)return;if(e._state==="erroring")return void ji(e);if(t._queue.length===0)return;const r=t._queue.peek().value;r===tc?function(n){const i=n._controlledWritableStream;(function(o){o._inFlightCloseRequest=o._closeRequest,o._closeRequest=void 0})(i),di(n);const s=n._closeAlgorithm();vn(n),me(s,()=>(function(o){o._inFlightCloseRequest._resolve(void 0),o._inFlightCloseRequest=void 0,o._state==="erroring"&&(o._storedError=void 0,o._pendingAbortRequest!==void 0&&(o._pendingAbortRequest._resolve(),o._pendingAbortRequest=void 0)),o._state="closed";const a=o._writer;a!==void 0&&sc(a)}(i),null),o=>(function(a,c){a._inFlightCloseRequest._reject(c),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(c),a._pendingAbortRequest=void 0),wi(a,c)}(i,o),null))}(t):function(n,i){const s=n._controlledWritableStream;(function(a){a._inFlightWriteRequest=a._writeRequests.shift()})(s);const o=n._writeAlgorithm(i);me(o,()=>{(function(c){c._inFlightWriteRequest._resolve(void 0),c._inFlightWriteRequest=void 0})(s);const a=s._state;if(di(n),!Se(s)&&a==="writable"){const c=$i(n);Ui(s,c)}return Pn(n),null},a=>(s._state==="writable"&&vn(n),function(c,l){c._inFlightWriteRequest._reject(l),c._inFlightWriteRequest=void 0,wi(c,l)}(s,a),null))}(t,r)}function gi(t,e){t._controlledWritableStream._state==="writable"&&nc(t,e)}function $i(t){return rc(t)<=0}function nc(t,e){const r=t._controlledWritableStream;vn(t),Mi(r,e)}function $r(t){return new TypeError(`WritableStream.prototype.${t} can only be used on a WritableStream`)}function ti(t){return new TypeError(`WritableStreamDefaultController.prototype.${t} can only be used on a WritableStreamDefaultController`)}function Ge(t){return new TypeError(`WritableStreamDefaultWriter.prototype.${t} can only be used on a WritableStreamDefaultWriter`)}function cr(t){return new TypeError("Cannot "+t+" a stream using a released writer")}function on(t){t._closedPromise=te((e,r)=>{t._closedPromise_resolve=e,t._closedPromise_reject=r,t._closedPromiseState="pending"})}function ic(t,e){on(t),qi(t,e)}function qi(t,e){t._closedPromise_reject!==void 0&&(vr(t._closedPromise),t._closedPromise_reject(e),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="rejected")}function sc(t){t._closedPromise_resolve!==void 0&&(t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="resolved")}function Fn(t){t._readyPromise=te((e,r)=>{t._readyPromise_resolve=e,t._readyPromise_reject=r}),t._readyPromiseState="pending"}function _i(t,e){Fn(t),oc(t,e)}function Vs(t){Fn(t),Wi(t)}function oc(t,e){t._readyPromise_reject!==void 0&&(vr(t._readyPromise),t._readyPromise_reject(e),t._readyPromise_resolve=void 0,t._readyPromise_reject=void 0,t._readyPromiseState="rejected")}function Wi(t){t._readyPromise_resolve!==void 0&&(t._readyPromise_resolve(void 0),t._readyPromise_resolve=void 0,t._readyPromise_reject=void 0,t._readyPromiseState="fulfilled")}Object.defineProperties(bn.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bn.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});const Hs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:void 0,tf=function(){const t=Hs?.DOMException;return function(e){if(typeof e!="function"&&typeof e!="object"||e.name!=="DOMException")return!1;try{return new e,!0}catch{return!1}}(t)?t:void 0}()||function(){const t=function(e,r){this.message=e||"",this.name=r||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return U(t,"DOMException"),t.prototype=Object.create(Error.prototype),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,configurable:!0}),t}();function Ys(t,e,r,n,i,s){const o=xt(t),a=Ja(e);t._disturbed=!0;let c=!1,l=q(void 0);return te((h,p)=>{let y;if(s!==void 0){if(y=()=>{const b=s.reason!==void 0?s.reason:new tf("Aborted","AbortError"),T=[];n||T.push(()=>e._state==="writable"?_n(e,b):q(void 0)),i||T.push(()=>t._state==="readable"?pe(t,b):q(void 0)),P(()=>Promise.all(T.map(O=>O())),!0,b)},s.aborted)return void y();s.addEventListener("abort",y)}var w,v,g;if(I(t,o._closedPromise,b=>(n?k(!0,b):P(()=>_n(e,b),!0,b),null)),I(e,a._closedPromise,b=>(i?k(!0,b):P(()=>pe(t,b),!0,b),null)),w=t,v=o._closedPromise,g=()=>(r?k():P(()=>function(b){const T=b._ownerWritableStream,O=T._state;return Se(T)||O==="closed"?q(void 0):O==="errored"?F(T._storedError):Qa(b)}(a)),null),w._state==="closed"?g():Kn(v,g),Se(e)||e._state==="closed"){const b=new TypeError("the destination writable stream closed before all data could be piped to it");i?k(!0,b):P(()=>pe(t,b),!0,b)}function E(){const b=l;return ve(l,()=>b!==l?E():void 0)}function I(b,T,O){b._state==="errored"?O(b._storedError):fi(T,O)}function P(b,T,O){function C(){return me(b(),()=>R(T,O),D=>R(!0,D)),null}c||(c=!0,e._state!=="writable"||Se(e)?C():Kn(E(),C))}function k(b,T){c||(c=!0,e._state!=="writable"||Se(e)?R(b,T):Kn(E(),()=>R(b,T)))}function R(b,T){return Za(a),Te(o),s!==void 0&&s.removeEventListener("abort",y),b?p(T):h(void 0),null}vr(te((b,T)=>{(function O(C){C?b():ve(c?q(!0):ve(a._readyPromise,()=>te((D,N)=>{mr(o,{_chunkSteps:V=>{l=ve(ec(a,V),void 0,pr),D(!1)},_closeSteps:()=>D(!0),_errorSteps:N})})),O,T)})(!1)}))})}class Me{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!qr(this))throw Wr("desiredSize");return zi(this)}close(){if(!qr(this))throw Wr("close");if(!Ft(this))throw new TypeError("The stream is not in a state that permits close");At(this)}enqueue(e=void 0){if(!qr(this))throw Wr("enqueue");if(!Ft(this))throw new TypeError("The stream is not in a state that permits enqueue");return Pt(this,e)}error(e=void 0){if(!qr(this))throw Wr("error");qe(this,e)}[Oi](e){Ve(this);const r=this._cancelAlgorithm(e);return Sn(this),r}[ki](e){const r=this._controlledReadableStream;if(this._queue.length>0){const n=di(this);this._closeRequested&&this._queue.length===0?(Sn(this),Er(r)):yr(this),e._chunkSteps(n)}else _a(r,e),yr(this)}[Ii](){}}function qr(t){return!!X(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableStream")&&t instanceof Me}function yr(t){if(ac(t)){if(t._pulling)return void(t._pullAgain=!0);t._pulling=!0,me(t._pullAlgorithm(),()=>(t._pulling=!1,t._pullAgain&&(t._pullAgain=!1,yr(t)),null),e=>(qe(t,e),null))}}function ac(t){const e=t._controlledReadableStream;return!Ft(t)||!t._started?!1:$e(e)&&Cn(e)>0?!0:zi(t)>0}function Sn(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function At(t){if(!Ft(t))return;const e=t._controlledReadableStream;t._closeRequested=!0,t._queue.length===0&&(Sn(t),Er(e))}function Pt(t,e){if(!Ft(t))return;const r=t._controlledReadableStream;if($e(r)&&Cn(r)>0)Fi(r,e,!1);else{let n;try{n=t._strategySizeAlgorithm(e)}catch(i){throw qe(t,i),i}try{Ni(t,e,n)}catch(i){throw qe(t,i),i}}yr(t)}function qe(t,e){const r=t._controlledReadableStream;r._state==="readable"&&(Ve(t),Sn(t),uc(r,e))}function zi(t){const e=t._controlledReadableStream._state;return e==="errored"?null:e==="closed"?0:t._strategyHWM-t._queueTotalSize}function Ft(t){const e=t._controlledReadableStream._state;return!t._closeRequested&&e==="readable"}function cc(t,e,r,n,i,s,o){e._controlledReadableStream=t,e._queue=void 0,e._queueTotalSize=void 0,Ve(e),e._started=!1,e._closeRequested=!1,e._pullAgain=!1,e._pulling=!1,e._strategySizeAlgorithm=o,e._strategyHWM=s,e._pullAlgorithm=n,e._cancelAlgorithm=i,t._readableStreamController=e,me(q(r()),()=>(e._started=!0,yr(e),null),a=>(qe(e,a),null))}function Wr(t){return new TypeError(`ReadableStreamDefaultController.prototype.${t} can only be used on a ReadableStreamDefaultController`)}function rf(t,e){return tt(t._readableStreamController)?function(r){let n,i,s,o,a,c=xt(r),l=!1,h=!1,p=!1,y=!1,w=!1;const v=te(O=>{a=O});function g(O){fi(O._closedPromise,C=>(O!==c||(fe(s._readableStreamController,C),fe(o._readableStreamController,C),y&&w||a(void 0)),null))}function E(){it(c)&&(Te(c),c=xt(r),g(c)),mr(c,{_chunkSteps:O=>{at(()=>{h=!1,p=!1;const C=O;let D=O;if(!y&&!w)try{D=Ws(O)}catch(N){return fe(s._readableStreamController,N),fe(o._readableStreamController,N),void a(pe(r,N))}y||rn(s._readableStreamController,C),w||rn(o._readableStreamController,D),l=!1,h?P():p&&k()})},_closeSteps:()=>{l=!1,y||ar(s._readableStreamController),w||ar(o._readableStreamController),s._readableStreamController._pendingPullIntos.length>0&&nn(s._readableStreamController,0),o._readableStreamController._pendingPullIntos.length>0&&nn(o._readableStreamController,0),y&&w||a(void 0)},_errorSteps:()=>{l=!1}})}function I(O,C){Ue(c)&&(Te(c),c=qa(r),g(c));const D=C?o:s,N=C?s:o;za(c,O,1,{_chunkSteps:V=>{at(()=>{h=!1,p=!1;const $=C?w:y;if(C?y:w)$||sn(D._readableStreamController,V);else{let G;try{G=Ws(V)}catch(de){return fe(D._readableStreamController,de),fe(N._readableStreamController,de),void a(pe(r,de))}$||sn(D._readableStreamController,V),rn(N._readableStreamController,G)}l=!1,h?P():p&&k()})},_closeSteps:V=>{l=!1;const $=C?w:y,G=C?y:w;$||ar(D._readableStreamController),G||ar(N._readableStreamController),V!==void 0&&($||sn(D._readableStreamController,V),!G&&N._readableStreamController._pendingPullIntos.length>0&&nn(N._readableStreamController,0)),$&&G||a(void 0)},_errorSteps:()=>{l=!1}})}function P(){if(l)return h=!0,q(void 0);l=!0;const O=mi(s._readableStreamController);return O===null?E():I(O._view,!1),q(void 0)}function k(){if(l)return p=!0,q(void 0);l=!0;const O=mi(o._readableStreamController);return O===null?E():I(O._view,!0),q(void 0)}function R(O){if(y=!0,n=O,w){const C=sr([n,i]),D=pe(r,C);a(D)}return v}function b(O){if(w=!0,i=O,y){const C=sr([n,i]),D=pe(r,C);a(D)}return v}function T(){}return s=Js(T,P,R),o=Js(T,k,b),g(c),[s,o]}(t):function(r,n){const i=xt(r);let s,o,a,c,l,h=!1,p=!1,y=!1,w=!1;const v=te(k=>{l=k});function g(){return h?(p=!0,q(void 0)):(h=!0,mr(i,{_chunkSteps:k=>{at(()=>{p=!1;const R=k,b=k;y||Pt(a._readableStreamController,R),w||Pt(c._readableStreamController,b),h=!1,p&&g()})},_closeSteps:()=>{h=!1,y||At(a._readableStreamController),w||At(c._readableStreamController),y&&w||l(void 0)},_errorSteps:()=>{h=!1}}),q(void 0))}function E(k){if(y=!0,s=k,w){const R=sr([s,o]),b=pe(r,R);l(b)}return v}function I(k){if(w=!0,o=k,y){const R=sr([s,o]),b=pe(r,R);l(b)}return v}function P(){}return a=En(P,g,E),c=En(P,g,I),fi(i._closedPromise,k=>(qe(a._readableStreamController,k),qe(c._readableStreamController,k),y&&w||l(void 0),null)),[a,c]}(t)}function nf(t){return X(e=t)&&e.getReader!==void 0?function(r){let n;function i(){let o;try{o=r.read()}catch(a){return F(a)}return ot(o,a=>{if(!X(a))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(a.done)At(n._readableStreamController);else{const c=a.value;Pt(n._readableStreamController,c)}})}function s(o){try{return q(r.cancel(o))}catch(a){return F(a)}}return n=En(pr,i,s,0),n}(t.getReader()):function(r){let n;const i=Ra(r,"async");function s(){let a;try{a=xa(i)}catch(c){return F(c)}return ot(q(a),c=>{if(!X(c))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(c.done)At(n._readableStreamController);else{const l=c.value;Pt(n._readableStreamController,l)}})}function o(a){const c=i.iterator;let l;try{l=or(c,"return")}catch(h){return F(h)}return l===void 0?q(void 0):ot(Nt(l,c,[a]),h=>{if(!X(h))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return n=En(pr,s,o,0),n}(t);var e}function sf(t,e,r){return ze(t,r),n=>Nt(t,e,[n])}function of(t,e,r){return ze(t,r),n=>Nt(t,e,[n])}function af(t,e,r){return ze(t,r),n=>Ct(t,e,[n])}function cf(t,e){if((t=`${t}`)!="bytes")throw new TypeError(`${e} '${t}' is not a valid enumeration value for ReadableStreamType`);return t}function Ks(t,e){je(t,e);const r=t?.preventAbort,n=t?.preventCancel,i=t?.preventClose,s=t?.signal;return s!==void 0&&function(o,a){if(!function(c){if(typeof c!="object"||c===null)return!1;try{return typeof c.aborted=="boolean"}catch{return!1}}(o))throw new TypeError(`${a} is not an AbortSignal.`)}(s,`${e} has member 'signal' that`),{preventAbort:!!r,preventCancel:!!n,preventClose:!!i,signal:s}}Object.defineProperties(Me.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),U(Me.prototype.close,"close"),U(Me.prototype.enqueue,"enqueue"),U(Me.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Me.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});let Z=class{constructor(e={},r={}){e===void 0?e=null:wa(e,"First parameter");const n=Ya(r,"Second parameter"),i=function(s,o){je(s,o);const a=s,c=a?.autoAllocateChunkSize,l=a?.cancel,h=a?.pull,p=a?.start,y=a?.type;return{autoAllocateChunkSize:c===void 0?void 0:Ai(c,`${o} has member 'autoAllocateChunkSize' that`),cancel:l===void 0?void 0:sf(l,a,`${o} has member 'cancel' that`),pull:h===void 0?void 0:of(h,a,`${o} has member 'pull' that`),start:p===void 0?void 0:af(p,a,`${o} has member 'start' that`),type:y===void 0?void 0:cf(y,`${o} has member 'type' that`)}}(e,"First parameter");if(Vi(this),i.type==="bytes"){if(n.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");(function(s,o,a){const c=Object.create(Le.prototype);let l,h,p;l=o.start!==void 0?()=>o.start(c):()=>{},h=o.pull!==void 0?()=>o.pull(c):()=>q(void 0),p=o.cancel!==void 0?w=>o.cancel(w):()=>q(void 0);const y=o.autoAllocateChunkSize;if(y===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");$a(s,c,l,h,p,a,y)})(this,i,yi(n,0))}else{const s=Ha(n);(function(o,a,c,l){const h=Object.create(Me.prototype);let p,y,w;p=a.start!==void 0?()=>a.start(h):()=>{},y=a.pull!==void 0?()=>a.pull(h):()=>q(void 0),w=a.cancel!==void 0?v=>a.cancel(v):()=>q(void 0),cc(o,h,p,y,w,c,l)})(this,i,yi(n,1),s)}}get locked(){if(!Fe(this))throw Qe("locked");return $e(this)}cancel(e=void 0){return Fe(this)?$e(this)?F(new TypeError("Cannot cancel a stream that already has a reader")):pe(this,e):F(Qe("cancel"))}getReader(e=void 0){if(!Fe(this))throw Qe("getReader");return function(r,n){je(r,n);const i=r?.mode;return{mode:i===void 0?void 0:Hl(i,`${n} has member 'mode' that`)}}(e,"First parameter").mode===void 0?xt(this):qa(this)}pipeThrough(e,r={}){if(!Fe(this))throw Qe("pipeThrough");ct(e,1,"pipeThrough");const n=function(s,o){je(s,o);const a=s?.readable;Ms(a,"readable","ReadableWritablePair"),Pi(a,`${o} has member 'readable' that`);const c=s?.writable;return Ms(c,"writable","ReadableWritablePair"),Ka(c,`${o} has member 'writable' that`),{readable:a,writable:c}}(e,"First parameter"),i=Ks(r,"Second parameter");if($e(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Ot(n.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return vr(Ys(this,n.writable,i.preventClose,i.preventAbort,i.preventCancel,i.signal)),n.readable}pipeTo(e,r={}){if(!Fe(this))return F(Qe("pipeTo"));if(e===void 0)return F("Parameter 1 is required in 'pipeTo'.");if(!St(e))return F(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let n;try{n=Ks(r,"Second parameter")}catch(i){return F(i)}return $e(this)?F(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Ot(e)?F(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Ys(this,e,n.preventClose,n.preventAbort,n.preventCancel,n.signal)}tee(){if(!Fe(this))throw Qe("tee");return sr(rf(this))}values(e=void 0){if(!Fe(this))throw Qe("values");return function(r,n){const i=xt(r),s=new Ta(i,n),o=Object.create(Oa);return o._asyncIteratorImpl=s,o}(this,function(r,n){return je(r,n),{preventCancel:!!r?.preventCancel}}(e,"First parameter").preventCancel)}[Sr](e){return this.values(e)}static from(e){return nf(e)}};function En(t,e,r,n=1,i=()=>1){const s=Object.create(Z.prototype);return Vi(s),cc(s,Object.create(Me.prototype),t,e,r,n,i),s}function Js(t,e,r){const n=Object.create(Z.prototype);return Vi(n),$a(n,Object.create(Le.prototype),t,e,r,0,void 0),n}function Vi(t){t._state="readable",t._reader=void 0,t._storedError=void 0,t._disturbed=!1}function Fe(t){return!!X(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readableStreamController")&&t instanceof Z}function $e(t){return t._reader!==void 0}function pe(t,e){if(t._disturbed=!0,t._state==="closed")return q(void 0);if(t._state==="errored")return F(t._storedError);Er(t);const r=t._reader;if(r!==void 0&&it(r)){const n=r._readIntoRequests;r._readIntoRequests=new he,n.forEach(i=>{i._closeSteps(void 0)})}return ot(t._readableStreamController[Oi](e),pr)}function Er(t){t._state="closed";const e=t._reader;if(e!==void 0&&(ya(e),Ue(e))){const r=e._readRequests;e._readRequests=new he,r.forEach(n=>{n._closeSteps()})}}function uc(t,e){t._state="errored",t._storedError=e;const r=t._reader;r!==void 0&&(Ci(r,e),Ue(r)?va(r,e):Va(r,e))}function Qe(t){return new TypeError(`ReadableStream.prototype.${t} can only be used on a ReadableStream`)}Object.defineProperties(Z,{from:{enumerable:!0}}),Object.defineProperties(Z.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),U(Z.from,"from"),U(Z.prototype.cancel,"cancel"),U(Z.prototype.getReader,"getReader"),U(Z.prototype.pipeThrough,"pipeThrough"),U(Z.prototype.pipeTo,"pipeTo"),U(Z.prototype.tee,"tee"),U(Z.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Z.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Z.prototype,Sr,{value:Z.prototype.values,writable:!0,configurable:!0});const uf=t=>t.byteLength;U(uf,"size");const lf=()=>1;U(lf,"size");function ff(t,e){qe(t._readable._readableStreamController,e),Hi(t,e)}function Hi(t,e){df(t._transformStreamController),gi(t._writable._writableStreamController,e),hf(t)}function hf(t){t._backpressure&&lc(t,!1)}function lc(t,e){t._backpressureChangePromise!==void 0&&t._backpressureChangePromise_resolve(),t._backpressureChangePromise=te(r=>{t._backpressureChangePromise_resolve=r}),t._backpressure=e}class bt{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!zr(this))throw Vr("desiredSize");return zi(this._controlledTransformStream._readable._readableStreamController)}enqueue(e=void 0){if(!zr(this))throw Vr("enqueue");pf(this,e)}error(e=void 0){if(!zr(this))throw Vr("error");var r;r=e,ff(this._controlledTransformStream,r)}terminate(){if(!zr(this))throw Vr("terminate");(function(e){const r=e._controlledTransformStream;At(r._readable._readableStreamController);const n=new TypeError("TransformStream terminated");Hi(r,n)})(this)}}function zr(t){return!!X(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledTransformStream")&&t instanceof bt}function df(t){t._transformAlgorithm=void 0,t._flushAlgorithm=void 0,t._cancelAlgorithm=void 0}function pf(t,e){const r=t._controlledTransformStream,n=r._readable._readableStreamController;if(!Ft(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{Pt(n,e)}catch(s){throw Hi(r,s),r._readable._storedError}(function(s){return!ac(s)})(n)!==r._backpressure&&lc(r,!0)}function Vr(t){return new TypeError(`TransformStreamDefaultController.prototype.${t} can only be used on a TransformStreamDefaultController`)}Object.defineProperties(bt.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),U(bt.prototype.enqueue,"enqueue"),U(bt.prototype.error,"error"),U(bt.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bt.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});const Oe={PATH_STR:"path must be a string, Buffer, or Uint8Array",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},{O_RDONLY:Gs,O_WRONLY:Hr,O_RDWR:mt,O_CREAT:Be,O_EXCL:Yr,O_TRUNC:Kr,O_APPEND:Jr,O_SYNC:Qs}=ee;var We;(function(t){t[t.r=Gs]="r",t[t["r+"]=mt]="r+",t[t.rs=Gs|Qs]="rs",t[t.sr=t.rs]="sr",t[t["rs+"]=mt|Qs]="rs+",t[t["sr+"]=t["rs+"]]="sr+",t[t.w=Hr|Be|Kr]="w",t[t.wx=Hr|Be|Kr|Yr]="wx",t[t.xw=t.wx]="xw",t[t["w+"]=mt|Be|Kr]="w+",t[t["wx+"]=mt|Be|Kr|Yr]="wx+",t[t["xw+"]=t["wx+"]]="xw+",t[t.a=Hr|Jr|Be]="a",t[t.ax=Hr|Jr|Be|Yr]="ax",t[t.xa=t.ax]="xa",t[t["a+"]=mt|Jr|Be]="a+",t[t["ax+"]=mt|Jr|Be|Yr]="ax+",t[t["xa+"]=t["ax+"]]="xa+"})(We||(We={}));const kt=typeof process<"u"?process.platform==="win32":!1;function M(t,e,r=n=>n){return(...n)=>new Promise((i,s)=>{t[e].bind(t)(...n,(o,a)=>o?s(o):i(r(a)))})}function Q(t){if(typeof t!="function")throw TypeError(Oe.CB);return t}function mf(t,e){if(typeof t=="number")return t;if(typeof t=="string")return parseInt(t,8);if(e)return oe(e)}function oe(t,e){const r=mf(t,e);if(typeof r!="number"||isNaN(r))throw new TypeError(Oe.MODE_INT);return r}function bi(t,e){if((""+t).indexOf("\0")!==-1){const r=new Error("Path must be a string without null bytes");throw r.code="ENOENT",r}return!0}function yf(t){if(t.hostname!=="")throw new yn("ERR_INVALID_FILE_URL_HOST",process.platform);const e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){const n=e.codePointAt(r+2)|32;if(e[r+1]==="2"&&n===102)throw new yn("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(e)}function B(t){if(t instanceof Uint8Array&&(t=Et(t)),typeof t!="string"&&!re.Buffer.isBuffer(t)){try{if(!(t instanceof require("url").URL))throw new TypeError(Oe.PATH_STR)}catch{throw new TypeError(Oe.PATH_STR)}t=yf(t)}const e=String(t);return bi(e),e}const wf="ENOENT",gf="EBADF",_f="EINVAL",bf="EPERM",vf="EPROTO",Sf="EEXIST",Ef="ENOTDIR",Rf="EMFILE",xf="EACCES",Tf="EISDIR",Of="ENOTEMPTY",kf="ENOSYS",If="ERR_FS_EISDIR",Bf="ERR_OUT_OF_RANGE";function Cf(t,e="",r="",n=""){let i="";switch(r&&(i=` '${r}'`),n&&(i+=` -> '${n}'`),t){case wf:return`ENOENT: no such file or directory, ${e}${i}`;case gf:return`EBADF: bad file descriptor, ${e}${i}`;case _f:return`EINVAL: invalid argument, ${e}${i}`;case bf:return`EPERM: operation not permitted, ${e}${i}`;case vf:return`EPROTO: protocol error, ${e}${i}`;case Sf:return`EEXIST: file already exists, ${e}${i}`;case Ef:return`ENOTDIR: not a directory, ${e}${i}`;case Tf:return`EISDIR: illegal operation on a directory, ${e}${i}`;case xf:return`EACCES: permission denied, ${e}${i}`;case Of:return`ENOTEMPTY: directory not empty, ${e}${i}`;case Rf:return`EMFILE: too many open files, ${e}${i}`;case kf:return`ENOSYS: function not implemented, ${e}${i}`;case If:return`[ERR_FS_EISDIR]: Path is a directory: ${e} returned EISDIR (is a directory) ${r}`;case Bf:return`[ERR_OUT_OF_RANGE]: value out of range, ${e}${i}`;default:return`${t}: error occurred, ${e}${i}`}}function L(t,e="",r="",n="",i=Error){const s=new i(Cf(t,e,r,n));return s.code=t,r&&(s.path=r),s}function Af(){return Math.random().toString(36).slice(2,8).padEnd(6,"0")}function yt(t){if(typeof t=="number")return t;if(typeof t=="string"){const e=We[t];if(typeof e<"u")return e}throw new yn("ERR_INVALID_OPT_VALUE","flags",t)}function Xe(t){return t>>>0===t}function nt(t){if(!Xe(t))throw TypeError(Oe.FD)}function Xs(t){const e=[];return new Promise((r,n)=>{t.on("data",i=>e.push(i)),t.on("end",()=>r(re.Buffer.concat(e))),t.on("error",n)})}function Rn(t,e=wn){return re.Buffer.isBuffer(t)?t:t instanceof Uint8Array?Et(t):Et(String(t),e)}const Pf=(t,e,r,n,i,s)=>{nt(t);let o=0,a,c=null,l,h;const p=typeof e,y=typeof r,w=typeof n,v=typeof i;p!=="string"?y==="function"?h=r:w==="function"?(o=r|0,h=n):v==="function"?(o=r|0,a=n,h=i):(o=r|0,a=n,c=i,h=s):y==="function"?h=r:w==="function"?(c=r,h=n):v==="function"&&(c=r,l=n,h=i);const g=Rn(e,l);p!=="string"?typeof a>"u"&&(a=g.length):(o=0,a=g.length);const E=Q(h);return[t,p==="string",g,o,a,c,E]},Ff=(t,e,r,n,i)=>{nt(t);let s,o,a,c;const l=typeof e!="string";l?(o=(r||0)|0,a=n,c=i):(c=r,s=n);const h=Rn(e,s);return l?typeof a>"u"&&(a=h.length):(o=0,a=h.length),[t,h,o||0,a,c]};function Nf(t,e){return!e||e==="buffer"?t:t.toString(e)}function Zs(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"&&t.readable===!0}const Lf=(t,e)=>{let r=t[e];return e>0&&(r==="/"||kt&&r==="\\")},Df=t=>{let e=t.length-1;if(e<2)return t;for(;Lf(t,e);)e--;return t.substr(0,e+1)},Mf=(t,e)=>{if(typeof t!="string")throw new TypeError("expected a string");return t=t.replace(/[\\\/]+/g,"/"),e!==!1&&(t=Df(t)),t},jf=(t,e=!0)=>kt?(t=Mf(t,e),t.replace(/^([a-zA-Z]+:|\.\/)/,"")):t;class Uf extends br.EventEmitter{fs;refs=1;closePromise=null;closeResolve;closeReject;position=0;fd;constructor(e,r){super(),this.fs=e,this.fd=r}getAsyncId(){return this.fd}appendFile(e,r){return M(this.fs,"appendFile")(this.fd,e,r)}chmod(e){return M(this.fs,"fchmod")(this.fd,e)}chown(e,r){return M(this.fs,"fchown")(this.fd,e,r)}close(){if(this.fd===-1)return Promise.resolve();if(this.closePromise)return this.closePromise;if(this.refs--,this.refs===0){const e=this.fd;this.fd=-1,this.closePromise=M(this.fs,"close")(e).finally(()=>{this.closePromise=null})}else this.closePromise=new Promise((e,r)=>{this.closeResolve=e,this.closeReject=r}).finally(()=>{this.closePromise=null,this.closeReject=void 0,this.closeResolve=void 0});return this.emit("close"),this.closePromise}datasync(){return M(this.fs,"fdatasync")(this.fd)}createReadStream(e){return this.fs.createReadStream("",{...e,fd:this})}createWriteStream(e){return this.fs.createWriteStream("",{...e,fd:this})}readableWebStream(e={}){const{type:r="bytes"}=e;let n=0,i=!1;if(this.fd===-1)throw new Error("The FileHandle is closed");if(this.closePromise)throw new Error("The FileHandle is closing");if(i)throw new Error("The FileHandle is locked");return i=!0,this.ref(),new ReadableStream({type:"bytes",autoAllocateChunkSize:16384,pull:async s=>{try{const o=s.byobRequest?.view;if(!o){const c=new Uint8Array(16384),l=await this.read(c,0,c.length,n);if(l.bytesRead===0){s.close(),this.unref();return}n+=l.bytesRead,s.enqueue(c.slice(0,l.bytesRead));return}const a=await this.read(o,o.byteOffset,o.byteLength,n);if(a.bytesRead===0){s.close(),this.unref();return}n+=a.bytesRead,s.byobRequest.respond(a.bytesRead)}catch(o){s.error(o),this.unref()}},cancel:async()=>{this.unref()}})}async read(e,r,n,i){const s=i??this.position,o=await M(this.fs,"read",a=>({bytesRead:a,buffer:e}))(this.fd,e,r,n,s);return i==null&&(this.position+=o.bytesRead),o}readv(e,r){return M(this.fs,"readv",n=>({bytesRead:n,buffers:e}))(this.fd,e,r)}readFile(e){return M(this.fs,"readFile")(this.fd,e)}stat(e){return M(this.fs,"fstat")(this.fd,e)}sync(){return M(this.fs,"fsync")(this.fd)}truncate(e){return M(this.fs,"ftruncate")(this.fd,e)}utimes(e,r){return M(this.fs,"futimes")(this.fd,e,r)}async write(e,r,n,i){const s=i??this.position,o=await M(this.fs,"write",a=>({bytesWritten:a,buffer:e}))(this.fd,e,r,n,s);return i==null&&(this.position+=o.bytesWritten),o}writev(e,r){return M(this.fs,"writev",n=>({bytesWritten:n,buffers:e}))(this.fd,e,r)}writeFile(e,r){return M(this.fs,"writeFile")(this.fd,e,r)}async[Symbol.asyncDispose](){await this.close()}ref(){this.refs++}unref(){this.refs--,this.refs===0&&(this.fd=-1,this.closeResolve&&M(this.fs,"close")(this.fd).then(this.closeResolve,this.closeReject))}}class $f{fs;path;options;watcher;eventQueue=[];resolveQueue=[];finished=!1;abortController;maxQueue;overflow;constructor(e,r,n={}){if(this.fs=e,this.path=r,this.options=n,this.maxQueue=n.maxQueue||2048,this.overflow=n.overflow||"ignore",this.startWatching(),n.signal){if(n.signal.aborted){this.finish();return}n.signal.addEventListener("abort",()=>{this.finish()})}}startWatching(){try{this.watcher=this.fs.watch(this.path,this.options,(e,r)=>{this.enqueueEvent({eventType:e,filename:r})})}catch(e){throw this.finish(),e}}enqueueEvent(e){if(!this.finished){if(this.eventQueue.length>=this.maxQueue)if(this.overflow==="throw"){const r=new Error(`Watch queue overflow: more than ${this.maxQueue} events queued`);this.finish(r);return}else this.eventQueue.shift(),console.warn(`Watch queue overflow: dropping event due to exceeding maxQueue of ${this.maxQueue}`);if(this.eventQueue.push(e),this.resolveQueue.length>0){const{resolve:r}=this.resolveQueue.shift(),n=this.eventQueue.shift();r({value:n,done:!1})}}}finish(e){if(!this.finished)for(this.finished=!0,this.watcher&&(this.watcher.close(),this.watcher=null);this.resolveQueue.length>0;){const{resolve:r,reject:n}=this.resolveQueue.shift();e?n(e):r({value:void 0,done:!0})}}async next(){return this.finished?{value:void 0,done:!0}:this.eventQueue.length>0?{value:this.eventQueue.shift(),done:!1}:new Promise((e,r)=>{this.resolveQueue.push({resolve:e,reject:r})})}async return(){return this.finish(),{value:void 0,done:!0}}async throw(e){throw this.finish(e),e}[Symbol.asyncIterator](){return this}}class qf{fs;FileHandle;constants=ee;cp;opendir;statfs;lutimes;access;chmod;chown;copyFile;lchmod;lchown;link;lstat;mkdir;mkdtemp;readdir;readlink;realpath;rename;rmdir;rm;stat;symlink;truncate;unlink;utimes;readFile;appendFile;open;writeFile;watch;constructor(e,r){this.fs=e,this.FileHandle=r,this.cp=M(this.fs,"cp"),this.opendir=M(this.fs,"opendir"),this.statfs=M(this.fs,"statfs"),this.lutimes=M(this.fs,"lutimes"),this.access=M(this.fs,"access"),this.chmod=M(this.fs,"chmod"),this.chown=M(this.fs,"chown"),this.copyFile=M(this.fs,"copyFile"),this.lchmod=M(this.fs,"lchmod"),this.lchown=M(this.fs,"lchown"),this.link=M(this.fs,"link"),this.lstat=M(this.fs,"lstat"),this.mkdir=M(this.fs,"mkdir"),this.mkdtemp=M(this.fs,"mkdtemp"),this.readdir=M(this.fs,"readdir"),this.readlink=M(this.fs,"readlink"),this.realpath=M(this.fs,"realpath"),this.rename=M(this.fs,"rename"),this.rmdir=M(this.fs,"rmdir"),this.rm=M(this.fs,"rm"),this.stat=M(this.fs,"stat"),this.symlink=M(this.fs,"symlink"),this.truncate=M(this.fs,"truncate"),this.unlink=M(this.fs,"unlink"),this.utimes=M(this.fs,"utimes"),this.readFile=(n,i)=>M(this.fs,"readFile")(n instanceof this.FileHandle?n.fd:n,i),this.appendFile=(n,i,s)=>M(this.fs,"appendFile")(n instanceof this.FileHandle?n.fd:n,i,s),this.open=(n,i="r",s)=>M(this.fs,"open",o=>new this.FileHandle(this.fs,o))(n,i,s),this.writeFile=(n,i,s)=>(Zs(i)?Xs(i):Promise.resolve(i)).then(a=>M(this.fs,"writeFile")(n instanceof this.FileHandle?n.fd:n,a,s))}writeFile=(e,r,n)=>(Zs(r)?Xs(r):Promise.resolve(r)).then(s=>M(this.fs,"writeFile")(e instanceof this.FileHandle?e.fd:e,s,n));watch=(e,r)=>{const n=typeof r=="string"?{encoding:r}:r||{};return new $f(this.fs,e,n)}}var ri={},rr={},eo;function Wf(){if(eo)return rr;eo=1,Object.defineProperty(rr,"__esModule",{value:!0}),rr.printTree=void 0;const t=(e="",r)=>{let n="",i=r.length-1;for(;i>=0&&!r[i];i--);for(let s=0;s<=i;s++){const o=r[s];if(!o)continue;const a=s===i,c=o(e+(a?" ":"│")+" "),l=c?a?"└─":"├─":"│";n+=`
19
- `+e+l+(c?" "+c:"")}return n};return rr.printTree=t,rr}var nr={},to;function zf(){if(to)return nr;to=1,Object.defineProperty(nr,"__esModule",{value:!0}),nr.printBinary=void 0;const t=(e="",r)=>{const n=r[0],i=r[1];let s="";return n&&(s+=`
20
- `+e+"← "+n(e+" ")),i&&(s+=`
21
- `+e+"→ "+i(e+" ")),s};return nr.printBinary=t,nr}var ro;function Vf(){return ro||(ro=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=gr;e.__exportStar(Wf(),t),e.__exportStar(zf(),t)}(ri)),ri}var Hf=Vf();const Yf=(t,e)=>{t[t.length-1]===e&&(t=t.slice(0,-1));const r=t.lastIndexOf(e);return r===-1?t:t.slice(r+1)},fc=(t,e={})=>{const r=e.separator||"/";let n=e.dir||r;n[n.length-1]!==r&&(n+=r);const i=e.tab||"",s=e.depth??10;let o=" (...)";if(s>0){const c=t.readdirSync(n,{withFileTypes:!0});o=Hf.printTree(i,c.map(l=>h=>l.isDirectory()?fc(t,{dir:n+l.name,depth:s-1,tab:h}):l.isSymbolicLink()?""+l.name+" → "+t.readlinkSync(n+l.name):""+l.name))}return Yf(n,r)+r+o},no={mode:511,recursive:!1},io=t=>typeof t=="number"?Object.assign({},no,{mode:t}):Object.assign({},no,t),Kf=t=>`Expected options to be either an object or a string, but got ${t} instead`;function Yi(t,e){let r;if(e){const n=typeof e;switch(n){case"string":r=Object.assign({},t,{encoding:e});break;case"object":r=Object.assign({},t,e);break;default:throw TypeError(Kf(n))}}else return t;return r.encoding!=="buffer"&&vl(r.encoding),r}function He(t){return e=>Yi(t,e)}function ht(t){return(e,r)=>typeof e=="function"?[t(),e]:[t(e),Q(r)]}const Ki={encoding:"utf8"},an=He(Ki),so=ht(an),Jf={recursive:!1},oo=t=>Object.assign({},Jf,t),Gf=He(Ki),Qf=ht(Gf),Xf={flag:"r"},ao=He(Xf),Zf={encoding:"utf8",recursive:!1,withFileTypes:!1},hc=He(Zf),eh=ht(hc),th={encoding:"utf8",bufferSize:32,recursive:!1},dc=He(th),rh=ht(dc),nh={encoding:"utf8",mode:438,flag:We[We.a]},pc=He(nh),ih=ht(pc),sh={bigint:!1},lr=(t={})=>Object.assign({},sh,t),ni=(t,e)=>typeof t=="function"?[lr(),t]:[lr(t),Q(e)],oh=Ki,mc=He(oh),ah=ht(mc),yc={encoding:"utf8",mode:438,flag:We[We.w]},co=He(yc);class ch{link;options;iteratorInfo=[];closed=!1;operationQueue=null;constructor(e,r){this.link=e,this.options=r,this.path=e.getPath(),this.iteratorInfo.push(e.children[Symbol.iterator]())}closeBase(){}readBase(e){let r,n,i,s;do{do if({done:r,value:n}=e[e.length-1].next(),!r)[i,s]=n;else break;while(i==="."||i==="..");if(r){if(e.pop(),e.length===0)break;r=!1}else return this.options.recursive&&s.children.size&&e.push(s.children[Symbol.iterator]()),_r.build(s,this.options.encoding)}while(!r);return null}path;close(e){if(e===void 0)return this.closed?Promise.reject(new Ke("ERR_DIR_CLOSED")):new Promise((r,n)=>{this.close(i=>{i?n(i):r()})});if(Q(e),this.closed){process.nextTick(e,new Ke("ERR_DIR_CLOSED"));return}if(this.operationQueue!==null){this.operationQueue.push(()=>{this.close(e)});return}this.closed=!0;try{this.closeBase(),process.nextTick(e)}catch(r){process.nextTick(e,r)}}closeSync(){if(this.closed)throw new Ke("ERR_DIR_CLOSED");if(this.operationQueue!==null)throw new Ke("ERR_DIR_CONCURRENT_OPERATION");this.closed=!0,this.closeBase()}read(e){if(e===void 0)return new Promise((r,n)=>{this.read((i,s)=>{i?n(i):r(s??null)})});if(Q(e),this.closed){process.nextTick(e,new Ke("ERR_DIR_CLOSED"));return}if(this.operationQueue!==null){this.operationQueue.push(()=>{this.read(e)});return}this.operationQueue=[];try{const r=this.readBase(this.iteratorInfo);process.nextTick(()=>{const n=this.operationQueue;this.operationQueue=null;for(const i of n)i();e(null,r)})}catch(r){process.nextTick(()=>{const n=this.operationQueue;this.operationQueue=null;for(const i of n)i();e(r)})}}readSync(){if(this.closed)throw new Ke("ERR_DIR_CLOSED");if(this.operationQueue!==null)throw new Ke("ERR_DIR_CONCURRENT_OPERATION");return this.readBase(this.iteratorInfo)}[Symbol.asyncIterator](){return{next:async()=>{try{const e=await this.read();return e!==null?{done:!1,value:e}:{done:!0,value:void 0}}catch(e){throw e}},[Symbol.asyncIterator](){return this}}}}const wc=ie.resolve,{O_RDONLY:ii,O_WRONLY:uo,O_RDWR:uh,O_CREAT:lo,O_EXCL:lh,O_TRUNC:fh,O_APPEND:hh,O_DIRECTORY:dh,O_SYMLINK:fo,F_OK:ho,COPYFILE_EXCL:ph,COPYFILE_FICLONE_FORCE:mh}=ee,{sep:be,relative:fr,join:cn,dirname:si}=ie.posix?ie.posix:ua,yh=128,wh="EPERM",Ce="ENOENT",oi="EBADF",Gr="EINVAL",Ae="EEXIST",Re="ENOTDIR",gh="EMFILE",_e="EACCES",Qr="EISDIR",_h="ENOTEMPTY",bh="ENOSYS",vh="ERR_FS_EISDIR",Sh="ERR_OUT_OF_RANGE";let xn=(t,e=In.cwd())=>wc(e,t);if(kt){const t=xn;xn=(e,r)=>jf(t(e,r))}function xe(t,e){const n=xn(t,e).substring(1);return n?n.split(be):[]}function ae(t){if(typeof t=="string"&&+t==t)return+t;if(t instanceof Date)return t.getTime()/1e3;if(isFinite(t))return t<0?Date.now()/1e3:t;throw new Error("Cannot parse time: "+t)}function wt(t){if(typeof t!="number")throw TypeError(Oe.UID)}function gt(t){if(typeof t!="number")throw TypeError(Oe.GID)}function Eh(t){const e={};function r(n,i){for(const s in i){const o=i[s],a=cn(n,s);typeof o=="string"||o instanceof re.Buffer?e[a]=o:typeof o=="object"&&o!==null&&Object.keys(o).length>0?r(a,o):e[a]=null}}return r("",t),e}const ai=()=>{throw new Error("Not implemented")};class hr{static fromJSON(e,r){const n=new hr;return n.fromJSON(e,r),n}static fromNestedJSON(e,r){const n=new hr;return n.fromNestedJSON(e,r),n}static fd=2147483647;root;ino=0;inodes={};releasedInos=[];fds={};releasedFds=[];maxFiles=1e4;openFiles=0;StatWatcher;ReadStream;WriteStream;FSWatcher;realpath;realpathSync;props;promisesApi=new qf(this,Uf);get promises(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi}constructor(e={}){this.props=Object.assign({Node:Dl,Link:dr,File:Ml},e);const r=this.createLink();r.setNode(this.createNode(ee.S_IFDIR|511));const n=this;this.StatWatcher=class extends xh{constructor(){super(n)}};const i=ke;this.ReadStream=class extends i{constructor(...c){super(n,...c)}};const s=ye;this.WriteStream=class extends s{constructor(...c){super(n,...c)}},this.FSWatcher=class extends Oh{constructor(){super(n)}},r.setChild(".",r),r.getNode().nlink++,r.setChild("..",r),r.getNode().nlink++,this.root=r;const o=(c,l,h)=>{const[p,y]=ah(l,h),w=B(c);n.wrapAsync(n.realpathBase,[w,p.encoding],y)},a=(c,l)=>n.realpathBase(B(c),mc(l).encoding);this.realpath=o,this.realpath.native=o,this.realpathSync=a,this.realpathSync.native=a}createLink(e,r,n=!1,i){if(!e)return new this.props.Link(this,null,"");if(!r)throw new Error("createLink: name cannot be empty");const s=i??(n?511:438),a=i&&i&ee.S_IFMT?i&ee.S_IFMT:n?ee.S_IFDIR:ee.S_IFREG,c=s&~ee.S_IFMT|a;return e.createChild(r,this.createNode(c))}deleteLink(e){const r=e.parent;return r?(r.deleteChild(e),!0):!1}newInoNumber(){const e=this.releasedInos.pop();return e||(this.ino=(this.ino+1)%4294967295,this.ino)}newFdNumber(){const e=this.releasedFds.pop();return typeof e=="number"?e:hr.fd--}createNode(e){const r=new this.props.Node(this.newInoNumber(),e);return this.inodes[r.ino]=r,r}deleteNode(e){e.del(),delete this.inodes[e.ino],this.releasedInos.push(e.ino)}walk(e,r=!1,n=!1,i=!1,s){let o,a;e instanceof dr?(o=e.steps,a=be+o.join(be)):typeof e=="string"?(o=xe(e),a=e):(o=e,a=be+o.join(be));let c=this.root,l=0;for(;l<o.length;){let h=c.getNode();if(h.isDirectory()){if(i&&!h.canExecute())throw L(_e,s,a)}else if(l<o.length-1)throw L(Re,s,a);if(c=c.getChild(o[l])??null,!c){if(n)throw L(Ce,s,a);return null}if(h=c?.getNode(),r&&h.isSymlink()){const p=ie.isAbsolute(h.symlink)?h.symlink:cn(ie.dirname(c.getPath()),h.symlink);o=xe(p).concat(o.slice(l+1)),c=this.root,l=0;continue}l++}return c}getLink(e){return this.walk(e,!1,!1,!1)}getLinkOrThrow(e,r){return this.walk(e,!1,!0,!0,r)}getResolvedLink(e){return this.walk(e,!0,!1,!1)}getResolvedLinkOrThrow(e,r){return this.walk(e,!0,!0,!0,r)}resolveSymlinks(e){return this.getResolvedLink(e.steps.slice(1))}getLinkAsDirOrThrow(e,r){const n=this.getLinkOrThrow(e,r);if(!n.getNode().isDirectory())throw L(Re,r,e);return n}getLinkParent(e){return this.getLink(e.slice(0,-1))}getLinkParentAsDirOrThrow(e,r){const n=(e instanceof Array?e:xe(e)).slice(0,-1),i=be+n.join(be),s=this.getLinkOrThrow(i,r);if(!s.getNode().isDirectory())throw L(Re,r,i);return s}getFileByFd(e){return this.fds[String(e)]}getFileByFdOrThrow(e,r){if(!Xe(e))throw TypeError(Oe.FD);const n=this.getFileByFd(e);if(!n)throw L(oi,r);return n}wrapAsync(e,r,n){Q(n),Promise.resolve().then(()=>{let i;try{i=e.apply(this,r)}catch(s){n(s);return}n(null,i)})}_toJSON(e=this.root,r={},n,i){let s=!0,o=e.children;e.getNode().isFile()&&(o=new Map([[e.getName(),e.parent.getChild(e.getName())]]),e=e.parent);for(const c of o.keys()){if(c==="."||c==="..")continue;s=!1;const l=e.getChild(c);if(!l)throw new Error("_toJSON: unexpected undefined");const h=l.getNode();if(h.isFile()){let p=l.getPath();n&&(p=fr(n,p)),r[p]=i?h.getBuffer():h.getString()}else h.isDirectory()&&this._toJSON(l,r,n,i)}let a=e.getPath();return n&&(a=fr(n,a)),a&&s&&(r[a]=null),r}toJSON(e,r={},n=!1,i=!1){const s=[];if(e){Array.isArray(e)||(e=[e]);for(const o of e){const a=B(o),c=this.getResolvedLink(a);c&&s.push(c)}}else s.push(this.root);if(!s.length)return r;for(const o of s)this._toJSON(o,r,n?o.getPath():"",i);return r}fromJSON(e,r=In.cwd()){for(let n in e){const i=e[n];if(n=xn(n,r),typeof i=="string"||i instanceof re.Buffer){const s=si(n);this.mkdirpBase(s,511),this.writeFileSync(n,i)}else this.mkdirpBase(n,511)}}fromNestedJSON(e,r){this.fromJSON(Eh(e),r)}toTree(e={separator:be}){return fc(this,e)}reset(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(ee.S_IFDIR|511))}mountSync(e,r){this.fromJSON(r,e)}openLink(e,r,n=!0){if(this.openFiles>=this.maxFiles)throw L(gh,"open",e.getPath());let i=e;n&&(i=this.getResolvedLinkOrThrow(e.getPath(),"open"));const s=i.getNode();if(s.isDirectory()){if((r&(ii|uh|uo))!==ii)throw L(Qr,"open",e.getPath())}else if(r&dh)throw L(Re,"open",e.getPath());if(!(r&uo)&&!s.canRead()||!(r&ii)&&!s.canWrite())throw L(_e,"open",e.getPath());const o=new this.props.File(e,s,r,this.newFdNumber());return this.fds[o.fd]=o,this.openFiles++,r&fh&&o.truncate(),o}openFile(e,r,n,i=!0){const s=xe(e);let o;try{if(o=i?this.getResolvedLinkOrThrow(e,"open"):this.getLinkOrThrow(e,"open"),o&&r&lo&&r&lh)throw L(Ae,"open",e)}catch(a){if(a.code===Ce&&r&lo){const c=ie.dirname(e),l=this.getResolvedLinkOrThrow(c),h=l.getNode();if(!h.isDirectory())throw L(Re,"open",e);if(!h.canExecute()||!h.canWrite())throw L(_e,"open",e);n??=438,o=this.createLink(l,s[s.length-1],!1,n)}else throw a}if(o)return this.openLink(o,r,i);throw L(Ce,"open",e)}openBase(e,r,n,i=!0){const s=this.openFile(e,r,n,i);if(!s)throw L(Ce,"open",e);return s.fd}openSync(e,r,n=438){const i=oe(n),s=B(e),o=yt(r);return this.openBase(s,o,i,!(o&fo))}open(e,r,n,i){let s=n,o=i;typeof n=="function"&&(s=438,o=n),s=s||438;const a=oe(s),c=B(e),l=yt(r);this.wrapAsync(this.openBase,[c,l,a,!(l&fo)],o)}closeFile(e){this.fds[e.fd]&&(this.openFiles--,delete this.fds[e.fd],this.releasedFds.push(e.fd))}closeSync(e){nt(e);const r=this.getFileByFdOrThrow(e,"close");this.closeFile(r)}close(e,r){nt(e);const n=this.getFileByFdOrThrow(e,"close");this.wrapAsync(this.closeFile,[n],r)}openFileOrGetById(e,r,n){if(typeof e=="number"){const i=this.fds[e];if(!i)throw L(Ce);return i}else return this.openFile(B(e),r,n)}readBase(e,r,n,i,s){if(r.byteLength<i)throw L(Sh,"read",void 0,void 0,RangeError);const o=this.getFileByFdOrThrow(e);if(o.node.isSymlink())throw L(wh,"read",o.link.getPath());return o.read(r,Number(n),Number(i),s===-1||typeof s!="number"?void 0:s)}readSync(e,r,n,i,s){return nt(e),this.readBase(e,r,n,i,s)}read(e,r,n,i,s,o){if(Q(o),i===0)return Bn(()=>{o&&o(null,0,r)});Promise.resolve().then(()=>{try{const a=this.readBase(e,r,n,i,s);o(null,a,r)}catch(a){o(a)}})}readvBase(e,r,n){const i=this.getFileByFdOrThrow(e);let s=n??void 0;s===-1&&(s=void 0);let o=0;for(const a of r){const c=i.read(a,0,a.byteLength,s);if(s=void 0,o+=c,c<a.byteLength)break}return o}readv(e,r,n,i){let s=n,o=i;typeof n=="function"&&(s=null,o=n),Q(o),Promise.resolve().then(()=>{try{const a=this.readvBase(e,r,s);o(null,a,r)}catch(a){o(a)}})}readvSync(e,r,n){return nt(e),this.readvBase(e,r,n)}readFileBase(e,r,n){let i;const o=typeof e=="number"&&Xe(e);let a;if(o)a=e;else{const c=B(e),l=this.getResolvedLinkOrThrow(c,"open");if(l.getNode().isDirectory())throw L(Qr,"open",l.getPath());a=this.openSync(e,r)}try{i=Nf(this.getFileByFdOrThrow(a).getBuffer(),n)}finally{o||this.closeSync(a)}return i}readFileSync(e,r){const n=ao(r),i=yt(n.flag);return this.readFileBase(e,i,n.encoding)}readFile(e,r,n){const[i,s]=ht(ao)(r,n),o=yt(i.flag);this.wrapAsync(this.readFileBase,[e,o,i.encoding],s)}writeBase(e,r,n,i,s){const o=this.getFileByFdOrThrow(e,"write");if(o.node.isSymlink())throw L(oi,"write",o.link.getPath());return o.write(r,n,i,s===-1||typeof s!="number"?void 0:s)}writeSync(e,r,n,i,s){const[,o,a,c,l]=Ff(e,r,n,i,s);return this.writeBase(e,o,a,c,l)}write(e,r,n,i,s,o){const[,a,c,l,h,p,y]=Pf(e,r,n,i,s,o);Promise.resolve().then(()=>{try{const w=this.writeBase(e,c,l,h,p);a?y(null,w,r):y(null,w,c)}catch(w){y(w)}})}writevBase(e,r,n){const i=this.getFileByFdOrThrow(e);let s=n??void 0;s===-1&&(s=void 0);let o=0;for(const a of r){const c=re.Buffer.from(a.buffer,a.byteOffset,a.byteLength),l=i.write(c,0,c.byteLength,s);if(s=void 0,o+=l,l<c.byteLength)break}return o}writev(e,r,n,i){let s=n,o=i;typeof n=="function"&&(s=null,o=n),Q(o),Promise.resolve().then(()=>{try{const a=this.writevBase(e,r,s);o(null,a,r)}catch(a){o(a)}})}writevSync(e,r,n){return nt(e),this.writevBase(e,r,n)}writeFileBase(e,r,n,i){const s=typeof e=="number";let o;s?o=e:o=this.openBase(B(e),n,i);let a=0,c=r.length,l=n&hh?void 0:0;try{for(;c>0;){const h=this.writeSync(o,r,a,c,l);a+=h,c-=h,l!==void 0&&(l+=h)}}finally{s||this.closeSync(o)}}writeFileSync(e,r,n){const i=co(n),s=yt(i.flag),o=oe(i.mode),a=Rn(r,i.encoding);this.writeFileBase(e,a,s,o)}writeFile(e,r,n,i){let s=n,o=i;typeof n=="function"&&(s=yc,o=n);const a=Q(o),c=co(s),l=yt(c.flag),h=oe(c.mode),p=Rn(r,c.encoding);this.wrapAsync(this.writeFileBase,[e,p,l,h],a)}linkBase(e,r){let n;try{n=this.getLinkOrThrow(e,"link")}catch(c){throw c.code&&(c=L(c.code,"link",e,r)),c}const i=ie.dirname(r);let s;try{s=this.getLinkOrThrow(i,"link")}catch(c){throw c.code&&(c=L(c.code,"link",e,r)),c}const o=ie.basename(r);if(s.getChild(o))throw L(Ae,"link",e,r);const a=n.getNode();a.nlink++,s.createChild(o,a)}copyFileBase(e,r,n){const i=this.readFileSync(e);if(n&ph&&this.existsSync(r))throw L(Ae,"copyFile",e,r);if(n&mh)throw L(bh,"copyFile",e,r);this.writeFileBase(r,i,We.w,438)}copyFileSync(e,r,n){const i=B(e),s=B(r);return this.copyFileBase(i,s,(n||0)|0)}copyFile(e,r,n,i){const s=B(e),o=B(r);let a,c;typeof n=="function"?(a=0,c=n):(a=n,c=i),Q(c),this.wrapAsync(this.copyFileBase,[s,o,a],c)}cpSyncBase(e,r,n){if(n.filter&&!n.filter(e,r))return;const i=n.dereference?this.statSync(e):this.lstatSync(e);let s=null;try{s=this.lstatSync(r)}catch(o){if(o.code!=="ENOENT")throw o}if(s&&this.areIdentical(i,s))throw L(Gr,"cp",e,r);if(s){if(i.isDirectory()&&!s.isDirectory())throw L(Qr,"cp",e,r);if(!i.isDirectory()&&s.isDirectory())throw L(Re,"cp",e,r)}if(i.isDirectory()&&this.isSrcSubdir(e,r))throw L(Gr,"cp",e,r);if(this.ensureParentDir(r),i.isDirectory()){if(!n.recursive)throw L(Qr,"cp",e);this.cpDirSync(i,s,e,r,n)}else if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())this.cpFileSync(i,s,e,r,n);else if(i.isSymbolicLink()&&!n.dereference)this.cpSymlinkSync(s,e,r,n);else throw L(Gr,"cp",e)}areIdentical(e,r){return e.ino===r.ino&&e.dev===r.dev}isSrcSubdir(e,r){const{relative:n,normalize:i}=ua;try{const s=i(e.startsWith("/")?e:"/"+e),o=i(r.startsWith("/")?r:"/"+r);if(s===o)return!0;const a=n(s,o);return a===""||!a.startsWith("..")&&!ie.isAbsolute(a)}catch{return!1}}ensureParentDir(e){const r=si(e);this.existsSync(r)||this.mkdirSync(r,{recursive:!0})}cpFileSync(e,r,n,i,s){if(r){if(s.errorOnExist)throw L(Ae,"cp",i);if(!s.force)return;this.unlinkSync(i)}this.copyFileSync(n,i,s.mode),s.preserveTimestamps&&this.utimesSync(i,e.atime,e.mtime),this.chmodSync(i,Number(e.mode))}cpDirSync(e,r,n,i,s){r||this.mkdirSync(i);const o=this.readdirSync(n);for(const a of o){const c=cn(n,a),l=cn(i,a);s.filter&&!s.filter(c,l)||this.cpSyncBase(c,l,s)}this.chmodSync(i,Number(e.mode))}cpSymlinkSync(e,r,n,i){let s=String(this.readlinkSync(r));!i.verbatimSymlinks&&!ie.isAbsolute(s)&&(s=wc(si(r),s)),e&&this.unlinkSync(n),this.symlinkSync(s,n)}linkSync(e,r){const n=B(e),i=B(r);this.linkBase(n,i)}link(e,r,n){const i=B(e),s=B(r);this.wrapAsync(this.linkBase,[i,s],n)}unlinkBase(e){const r=this.getLinkOrThrow(e,"unlink");if(r.length)throw Error("Dir not empty...");this.deleteLink(r);const n=r.getNode();n.nlink--,n.nlink<=0&&this.deleteNode(n)}unlinkSync(e){const r=B(e);this.unlinkBase(r)}unlink(e,r){const n=B(e);this.wrapAsync(this.unlinkBase,[n],r)}symlinkBase(e,r){const n=xe(r);let i;try{i=this.getLinkParentAsDirOrThrow(n)}catch(c){throw c.code&&(c=L(c.code,"symlink",e,r)),c}const s=n[n.length-1];if(i.getChild(s))throw L(Ae,"symlink",e,r);const o=i.getNode();if(!o.canExecute()||!o.canWrite())throw L(_e,"symlink",e,r);const a=i.createChild(s);return a.getNode().makeSymlink(e),a}symlinkSync(e,r,n){const i=B(e),s=B(r);this.symlinkBase(i,s)}symlink(e,r,n,i){const s=Q(typeof n=="function"?n:i),o=B(e),a=B(r);this.wrapAsync(this.symlinkBase,[o,a],s)}realpathBase(e,r){const n=this.getResolvedLinkOrThrow(e,"realpath");return ur(n.getPath()||"/",r)}lstatBase(e,r=!1,n=!1){let i;try{i=this.getLinkOrThrow(e,"lstat")}catch(s){if(s.code===Ce&&!n)return;throw s}return st.build(i.getNode(),r)}lstatSync(e,r){const{throwIfNoEntry:n=!0,bigint:i=!1}=lr(r);return this.lstatBase(B(e),i,n)}lstat(e,r,n){const[{throwIfNoEntry:i=!0,bigint:s=!1},o]=ni(r,n);this.wrapAsync(this.lstatBase,[B(e),s,i],o)}statBase(e,r=!1,n=!0){let i;try{i=this.getResolvedLinkOrThrow(e,"stat")}catch(s){if(s.code===Ce&&!n)return;throw s}return st.build(i.getNode(),r)}statSync(e,r){const{bigint:n=!0,throwIfNoEntry:i=!0}=lr(r);return this.statBase(B(e),n,i)}stat(e,r,n){const[{bigint:i=!1,throwIfNoEntry:s=!0},o]=ni(r,n);this.wrapAsync(this.statBase,[B(e),i,s],o)}fstatBase(e,r=!1){const n=this.getFileByFd(e);if(!n)throw L(oi,"fstat");return st.build(n.node,r)}fstatSync(e,r){return this.fstatBase(e,lr(r).bigint)}fstat(e,r,n){const[i,s]=ni(r,n);this.wrapAsync(this.fstatBase,[e,i.bigint],s)}renameBase(e,r){let n;try{n=this.getResolvedLinkOrThrow(e)}catch(l){throw l.code&&(l=L(l.code,"rename",e,r)),l}let i;try{i=this.getLinkParentAsDirOrThrow(r)}catch(l){throw l.code&&(l=L(l.code,"rename",e,r)),l}const s=n.parent,o=s.getNode(),a=i.getNode();if(!o.canExecute()||!o.canWrite()||!a.canExecute()||!a.canWrite())throw L(_e,"rename",e,r);s.deleteChild(n);const c=ie.basename(r);n.name=c,n.steps=[...i.steps,c],i.setChild(n.getName(),n)}renameSync(e,r){const n=B(e),i=B(r);this.renameBase(n,i)}rename(e,r,n){const i=B(e),s=B(r);this.wrapAsync(this.renameBase,[i,s],n)}existsBase(e){return!!this.statBase(e)}existsSync(e){try{return this.existsBase(B(e))}catch{return!1}}exists(e,r){const n=B(e);if(typeof r!="function")throw Error(Oe.CB);Promise.resolve().then(()=>{try{r(this.existsBase(n))}catch{r(!1)}})}accessBase(e,r){this.getLinkOrThrow(e,"access")}accessSync(e,r=ho){const n=B(e);r=r|0,this.accessBase(n,r)}access(e,r,n){let i=ho,s;typeof r!="function"?(i=r|0,s=Q(n)):s=r;const o=B(e);this.wrapAsync(this.accessBase,[o,i],s)}appendFileSync(e,r,n){const i=pc(n);(!i.flag||Xe(e))&&(i.flag="a"),this.writeFileSync(e,r,i)}appendFile(e,r,n,i){const[s,o]=ih(n,i);(!s.flag||Xe(e))&&(s.flag="a"),this.writeFile(e,r,s,o)}readdirBase(e,r){xe(e);const n=this.getResolvedLinkOrThrow(e,"scandir"),i=n.getNode();if(!i.isDirectory())throw L(Re,"scandir",e);if(!i.canRead())throw L(_e,"scandir",e);const s=[];for(const a of n.children.keys()){const c=n.getChild(a);if(!(!c||a==="."||a==="..")&&(s.push(_r.build(c,r.encoding)),r.recursive&&c.children.size)){const l={...r,recursive:!0,withFileTypes:!0},h=this.readdirBase(c.getPath(),l);s.push(...h)}}if(!kt&&r.encoding!=="buffer"&&s.sort((a,c)=>a.name<c.name?-1:a.name>c.name?1:0),r.withFileTypes)return s;let o=e;return kt&&(o=o.replace(/\\/g,"/")),s.map(a=>{if(r.recursive){let c=ie.join(a.parentPath,a.name.toString());return kt&&(c=c.replace(/\\/g,"/")),c.replace(o+ie.posix.sep,"")}return a.name})}readdirSync(e,r){const n=hc(r),i=B(e);return this.readdirBase(i,n)}readdir(e,r,n){const[i,s]=eh(r,n),o=B(e);this.wrapAsync(this.readdirBase,[o,i],s)}readlinkBase(e,r){const i=this.getLinkOrThrow(e,"readlink").getNode();if(!i.isSymlink())throw L(Gr,"readlink",e);return ur(i.symlink,r)}readlinkSync(e,r){const n=an(r),i=B(e);return this.readlinkBase(i,n.encoding)}readlink(e,r,n){const[i,s]=so(r,n),o=B(e);this.wrapAsync(this.readlinkBase,[o,i.encoding],s)}fsyncBase(e){this.getFileByFdOrThrow(e,"fsync")}fsyncSync(e){this.fsyncBase(e)}fsync(e,r){this.wrapAsync(this.fsyncBase,[e],r)}fdatasyncBase(e){this.getFileByFdOrThrow(e,"fdatasync")}fdatasyncSync(e){this.fdatasyncBase(e)}fdatasync(e,r){this.wrapAsync(this.fdatasyncBase,[e],r)}ftruncateBase(e,r){this.getFileByFdOrThrow(e,"ftruncate").truncate(r)}ftruncateSync(e,r){this.ftruncateBase(e,r)}ftruncate(e,r,n){const i=typeof r=="number"?r:0,s=Q(typeof r=="number"?n:r);this.wrapAsync(this.ftruncateBase,[e,i],s)}truncateBase(e,r){const n=this.openSync(e,"r+");try{this.ftruncateSync(n,r)}finally{this.closeSync(n)}}truncateSync(e,r){if(Xe(e))return this.ftruncateSync(e,r);this.truncateBase(e,r)}truncate(e,r,n){const i=typeof r=="number"?r:0,s=Q(typeof r=="number"?n:r);if(Xe(e))return this.ftruncate(e,i,s);this.wrapAsync(this.truncateBase,[e,i],s)}futimesBase(e,r,n){const s=this.getFileByFdOrThrow(e,"futimes").node;s.atime=new Date(r*1e3),s.mtime=new Date(n*1e3)}futimesSync(e,r,n){this.futimesBase(e,ae(r),ae(n))}futimes(e,r,n,i){this.wrapAsync(this.futimesBase,[e,ae(r),ae(n)],i)}utimesBase(e,r,n,i=!0){const o=(i?this.getResolvedLinkOrThrow(e,"utimes"):this.getLinkOrThrow(e,"lutimes")).getNode();o.atime=new Date(r*1e3),o.mtime=new Date(n*1e3)}utimesSync(e,r,n){this.utimesBase(B(e),ae(r),ae(n),!0)}utimes(e,r,n,i){this.wrapAsync(this.utimesBase,[B(e),ae(r),ae(n),!0],i)}lutimesSync(e,r,n){this.utimesBase(B(e),ae(r),ae(n),!1)}lutimes(e,r,n,i){this.wrapAsync(this.utimesBase,[B(e),ae(r),ae(n),!1],i)}mkdirBase(e,r){const n=xe(e);if(!n.length)throw L(Ae,"mkdir",e);const i=this.getLinkParentAsDirOrThrow(e,"mkdir"),s=n[n.length-1];if(i.getChild(s))throw L(Ae,"mkdir",e);const o=i.getNode();if(!o.canWrite()||!o.canExecute())throw L(_e,"mkdir",e);i.createChild(s,this.createNode(ee.S_IFDIR|r))}mkdirpBase(e,r){let n=!1;const i=xe(e);let s=null,o=i.length;for(o=i.length;o>=0&&(s=this.getResolvedLink(i.slice(0,o)),!s);o--);for(s||(s=this.root,o=0),s=this.getResolvedLinkOrThrow(be+i.slice(0,o).join(be),"mkdir"),o;o<i.length;o++){const a=s.getNode();if(a.isDirectory()){if(!a.canExecute()||!a.canWrite())throw L(_e,"mkdir",e)}else throw L(Re,"mkdir",e);n=!0,s=s.createChild(i[o],this.createNode(ee.S_IFDIR|r))}return n?e:void 0}mkdirSync(e,r){const n=io(r),i=oe(n.mode,511),s=B(e);if(n.recursive)return this.mkdirpBase(s,i);this.mkdirBase(s,i)}mkdir(e,r,n){const i=io(r),s=Q(typeof r=="function"?r:n),o=oe(i.mode,511),a=B(e);i.recursive?this.wrapAsync(this.mkdirpBase,[a,o],s):this.wrapAsync(this.mkdirBase,[a,o],s)}mkdtempBase(e,r,n=5){const i=e+Af();try{return this.mkdirBase(i,511),ur(i,r)}catch(s){if(s.code===Ae){if(n>1)return this.mkdtempBase(e,r,n-1);throw Error("Could not create temp dir.")}else throw s}}mkdtempSync(e,r){const{encoding:n}=an(r);if(!e||typeof e!="string")throw new TypeError("filename prefix is required");return bi(e),this.mkdtempBase(e,n)}mkdtemp(e,r,n){const[{encoding:i},s]=so(r,n);if(!e||typeof e!="string")throw new TypeError("filename prefix is required");bi(e)&&this.wrapAsync(this.mkdtempBase,[e,i],s)}rmdirBase(e,r){const n=oo(r),i=this.getLinkAsDirOrThrow(e,"rmdir");if(i.length&&!n.recursive)throw L(_h,"rmdir",e);this.deleteLink(i)}rmdirSync(e,r){this.rmdirBase(B(e),r)}rmdir(e,r,n){const i=oo(r),s=Q(typeof r=="function"?r:n);this.wrapAsync(this.rmdirBase,[B(e),i],s)}rmBase(e,r={}){let n;try{n=this.getResolvedLinkOrThrow(e,"stat")}catch(i){if(i.code===Ce&&r.force)return;throw i}if(n.getNode().isDirectory()&&!r.recursive)throw L(vh,"rm",e);if(!n.parent.getNode().canWrite())throw L(_e,"rm",e);this.deleteLink(n)}rmSync(e,r){this.rmBase(B(e),r)}rm(e,r,n){const[i,s]=Qf(r,n);this.wrapAsync(this.rmBase,[B(e),i],s)}fchmodBase(e,r){this.getFileByFdOrThrow(e,"fchmod").chmod(r)}fchmodSync(e,r){this.fchmodBase(e,oe(r))}fchmod(e,r,n){this.wrapAsync(this.fchmodBase,[e,oe(r)],n)}chmodBase(e,r,n=!0){(n?this.getResolvedLinkOrThrow(e,"chmod"):this.getLinkOrThrow(e,"chmod")).getNode().chmod(r)}chmodSync(e,r){const n=oe(r),i=B(e);this.chmodBase(i,n,!0)}chmod(e,r,n){const i=oe(r),s=B(e);this.wrapAsync(this.chmodBase,[s,i],n)}lchmodBase(e,r){this.chmodBase(e,r,!1)}lchmodSync(e,r){const n=oe(r),i=B(e);this.lchmodBase(i,n)}lchmod(e,r,n){const i=oe(r),s=B(e);this.wrapAsync(this.lchmodBase,[s,i],n)}fchownBase(e,r,n){this.getFileByFdOrThrow(e,"fchown").chown(r,n)}fchownSync(e,r,n){wt(r),gt(n),this.fchownBase(e,r,n)}fchown(e,r,n,i){wt(r),gt(n),this.wrapAsync(this.fchownBase,[e,r,n],i)}chownBase(e,r,n){this.getResolvedLinkOrThrow(e,"chown").getNode().chown(r,n)}chownSync(e,r,n){wt(r),gt(n),this.chownBase(B(e),r,n)}chown(e,r,n,i){wt(r),gt(n),this.wrapAsync(this.chownBase,[B(e),r,n],i)}lchownBase(e,r,n){this.getLinkOrThrow(e,"lchown").getNode().chown(r,n)}lchownSync(e,r,n){wt(r),gt(n),this.lchownBase(B(e),r,n)}lchown(e,r,n,i){wt(r),gt(n),this.wrapAsync(this.lchownBase,[B(e),r,n],i)}statWatchers={};watchFile(e,r,n){const i=B(e);let s=r,o=n;if(typeof s=="function"&&(o=r,s=null),typeof o!="function")throw Error('"watchFile()" requires a listener function');let a=5007,c=!0;s&&typeof s=="object"&&(typeof s.interval=="number"&&(a=s.interval),typeof s.persistent=="boolean"&&(c=s.persistent));let l=this.statWatchers[i];return l||(l=new this.StatWatcher,l.start(i,c,a),this.statWatchers[i]=l),l.addListener("change",o),l}unwatchFile(e,r){const n=B(e),i=this.statWatchers[n];i&&(typeof r=="function"?i.removeListener("change",r):i.removeAllListeners("change"),i.listenerCount("change")===0&&(i.stop(),delete this.statWatchers[n]))}createReadStream(e,r){return new this.ReadStream(e,r)}createWriteStream(e,r){return new this.WriteStream(e,r)}watch(e,r,n){const i=B(e);let s=r;typeof r=="function"&&(n=r,s=null);let{persistent:o,recursive:a,encoding:c}=an(s);o===void 0&&(o=!0),a===void 0&&(a=!1);const l=new this.FSWatcher;return l.start(i,o,a,c),n&&l.addListener("change",n),l}cpSync(e,r,n){const i=B(e),s=B(r),o={dereference:n?.dereference??!1,errorOnExist:n?.errorOnExist??!1,filter:n?.filter,force:n?.force??!0,mode:n?.mode??0,preserveTimestamps:n?.preserveTimestamps??!1,recursive:n?.recursive??!1,verbatimSymlinks:n?.verbatimSymlinks??!1};return this.cpSyncBase(i,s,o)}cp(e,r,n,i){const s=B(e),o=B(r);let a,c;typeof n=="function"?(a={},c=n):(a=n||{},c=i),Q(c);const l={dereference:a?.dereference??!1,errorOnExist:a?.errorOnExist??!1,filter:a?.filter,force:a?.force??!0,mode:a?.mode??0,preserveTimestamps:a?.preserveTimestamps??!1,recursive:a?.recursive??!1,verbatimSymlinks:a?.verbatimSymlinks??!1};this.wrapAsync(this.cpSyncBase,[s,o,l],c)}statfsSync=ai;statfs=ai;openAsBlob=ai;opendirBase(e,r){const n=this.getResolvedLinkOrThrow(e,"scandir");if(!n.getNode().isDirectory())throw L(Re,"scandir",e);return new ch(n,r)}opendirSync(e,r){const n=dc(r),i=B(e);return this.opendirBase(i,n)}opendir(e,r,n){const[i,s]=rh(r,n),o=B(e);this.wrapAsync(this.opendirBase,[o,i],s)}}function Rh(t){t.emit("stop")}class xh extends br.EventEmitter{vol;filename;interval;timeoutRef;setTimeout;prev;constructor(e){super(),this.vol=e}loop(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)}hasChanged(e){return e.mtimeMs>this.prev.mtimeMs||e.nlink!==this.prev.nlink}onInterval=()=>{try{const e=this.vol.statSync(this.filename);this.hasChanged(e)&&(this.emit("change",e,this.prev),this.prev=e)}finally{this.loop()}};start(e,r=!0,n=5007){this.filename=B(e),this.setTimeout=r?setTimeout.bind(typeof globalThis<"u"?globalThis:global):jl,this.interval=n,this.prev=this.vol.statSync(this.filename),this.loop()}stop(){clearTimeout(this.timeoutRef),Bn(()=>{Rh.call(this,this)})}}var le;function Th(t){le=Pe(t),le.used=0}sa(ke,Z);function ke(t,e,r){if(!(this instanceof ke))return new ke(t,e,r);if(this._vol=t,r=Object.assign({},Yi(r,{})),r.highWaterMark===void 0&&(r.highWaterMark=64*1024),Z.call(this,r),this.path=B(e),this.fd=r.fd===void 0?null:typeof r.fd!="number"?r.fd.fd:r.fd,this.flags=r.flags===void 0?"r":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}ke.prototype.open=function(){var t=this;this._vol.open(this.path,this.flags,this.mode,(e,r)=>{if(e){t.autoClose&&t.destroy&&t.destroy(),t.emit("error",e);return}t.fd=r,t.emit("open",r),t.read()})};ke.prototype._read=function(t){if(typeof this.fd!="number")return this.once("open",function(){this._read(t)});if(this.destroyed)return;(!le||le.length-le.used<yh)&&Th(this._readableState.highWaterMark);var e=le,r=Math.min(le.length-le.used,t),n=le.used;if(this.pos!==void 0&&(r=Math.min(this.end-this.pos+1,r)),r<=0)return this.push(null);var i=this;this._vol.read(this.fd,le,le.used,r,this.pos,s),this.pos!==void 0&&(this.pos+=r),le.used+=r;function s(o,a){if(o)i.autoClose&&i.destroy&&i.destroy(),i.emit("error",o);else{var c=null;a>0&&(i.bytesRead+=a,c=e.slice(n,n+a)),i.push(c)}}};ke.prototype._destroy=function(t,e){this.close(r=>{e(t||r)})};ke.prototype.close=function(t){if(t&&this.once("close",t),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",gc);return}return Bn(()=>this.emit("close"))}typeof this._readableState?.closed=="boolean"?this._readableState.closed=!0:this.closed=!0,this._vol.close(this.fd,e=>{e?this.emit("error",e):this.emit("close")}),this.fd=null};function gc(t){this.close()}sa(ye,De);function ye(t,e,r){if(!(this instanceof ye))return new ye(t,e,r);if(this._vol=t,r=Object.assign({},Yi(r,{})),De.call(this,r),this.path=B(e),this.fd=r.fd===void 0?null:typeof r.fd!="number"?r.fd.fd:r.fd,this.flags=r.flags===void 0?"w":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.autoClose=r.autoClose===void 0?!0:!!r.autoClose,this.pos=void 0,this.bytesWritten=0,this.pending=!0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}r.encoding&&this.setDefaultEncoding(r.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}ye.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,(function(t,e){if(t){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",t);return}this.fd=e,this.pending=!1,this.emit("open",e)}).bind(this))};ye.prototype._write=function(t,e,r){if(!(t instanceof re.Buffer||t instanceof Uint8Array))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(t,e,r)});var n=this;this._vol.write(this.fd,t,0,t.length,this.pos,(i,s)=>{if(i)return n.autoClose&&n.destroy&&n.destroy(),r(i);n.bytesWritten+=s,r()}),this.pos!==void 0&&(this.pos+=t.length)};ye.prototype._writev=function(t,e){if(typeof this.fd!="number")return this.once("open",function(){this._writev(t,e)});const r=this,n=t.length,i=new Array(n);for(var s=0,o=0;o<n;o++){var a=t[o].chunk;i[o]=a,s+=a.length}const c=re.Buffer.concat(i);this._vol.write(this.fd,c,0,c.length,this.pos,(l,h)=>{if(l)return r.destroy&&r.destroy(),e(l);r.bytesWritten+=h,e()}),this.pos!==void 0&&(this.pos+=s)};ye.prototype.close=function(t){if(t&&this.once("close",t),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",gc);return}return Bn(()=>this.emit("close"))}typeof this._writableState?.closed=="boolean"?this._writableState.closed=!0:this.closed=!0,this._vol.close(this.fd,e=>{e?this.emit("error",e):this.emit("close")}),this.fd=null};ye.prototype._destroy=ke.prototype._destroy;ye.prototype.destroySoon=ye.prototype.end;class Oh extends br.EventEmitter{_vol;_filename="";_steps;_filenameEncoded="";_recursive=!1;_encoding=wn;_link;_timer;_listenerRemovers=new Map;constructor(e){super(),this._vol=e}_getName(){return this._steps[this._steps.length-1]}_onParentChild=e=>{e.getName()===this._getName()&&this._emit("rename")};_emit=e=>{this.emit("change",e,this._filenameEncoded)};_persist=()=>{this._timer=setTimeout(this._persist,1e6)};start(e,r=!0,n=!1,i=wn){this._filename=B(e),this._steps=xe(this._filename),this._filenameEncoded=ur(this._filename),this._recursive=n,this._encoding=i;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(c){const l=new Error(`watch ${this._filename} ${c.code}`);throw l.code=c.code,l.errno=c.code,l}const s=c=>{const l=c.getPath(),h=c.getNode(),p=()=>{let w=fr(this._filename,l);return w||(w=this._getName()),this.emit("change","change",w)};h.on("change",p);const y=this._listenerRemovers.get(h.ino)??[];y.push(()=>h.removeListener("change",p)),this._listenerRemovers.set(h.ino,y)},o=c=>{const l=c.getNode(),h=w=>{this.emit("change","rename",fr(this._filename,w.getPath())),setTimeout(()=>{s(w),o(w)})},p=w=>{const v=g=>{const E=g.getNode().ino,I=this._listenerRemovers.get(E);I&&(I.forEach(P=>P()),this._listenerRemovers.delete(E));for(const[P,k]of g.children.entries())k&&P!=="."&&P!==".."&&v(k)};v(w),this.emit("change","rename",fr(this._filename,w.getPath()))};for(const[w,v]of c.children.entries())v&&w!=="."&&w!==".."&&s(v);if(c.on("child:add",h),c.on("child:delete",p),(this._listenerRemovers.get(l.ino)??[]).push(()=>{c.removeListener("child:add",h),c.removeListener("child:delete",p)}),n)for(const[w,v]of c.children.entries())v&&w!=="."&&w!==".."&&o(v)};s(this._link),o(this._link);const a=this._link.parent;a&&(a.setMaxListeners(a.getMaxListeners()+1),a.on("child:delete",this._onParentChild)),r&&this._persist()}close(){clearTimeout(this._timer),this._listenerRemovers.forEach(r=>{r.forEach(n=>n())}),this._listenerRemovers.clear();const e=this._link.parent;e&&e.removeListener("child:delete",this._onParentChild)}}const kh=["accessSync","appendFileSync","chmodSync","chownSync","closeSync","copyFileSync","existsSync","fchmodSync","fchownSync","fdatasyncSync","fstatSync","fsyncSync","ftruncateSync","futimesSync","lchmodSync","lchownSync","linkSync","lstatSync","mkdirSync","mkdtempSync","openSync","opendirSync","readdirSync","readFileSync","readlinkSync","readSync","readvSync","realpathSync","renameSync","rmdirSync","rmSync","statSync","symlinkSync","truncateSync","unlinkSync","utimesSync","lutimesSync","writeFileSync","writeSync","writevSync"],Ih=["access","appendFile","chmod","chown","close","copyFile","createReadStream","createWriteStream","exists","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","read","readv","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","unwatchFile","utimes","lutimes","watch","watchFile","write","writev","writeFile"];typeof window<"u"&&!window.process&&(window.process=ra);const{F_OK:Bh,R_OK:Ch,W_OK:Ah,X_OK:Ph}=ee,Fh=new hr;function Nh(t){const e={F_OK:Bh,R_OK:Ch,W_OK:Ah,X_OK:Ph,constants:ee,Stats:st,Dirent:_r};for(const r of kh)typeof t[r]=="function"&&(e[r]=t[r].bind(t));for(const r of Ih)typeof t[r]=="function"&&(e[r]=t[r].bind(t));return e.StatWatcher=t.StatWatcher,e.FSWatcher=t.FSWatcher,e.WriteStream=t.WriteStream,e.ReadStream=t.ReadStream,e.promises=t.promises,typeof t.realpath=="function"&&(e.realpath=t.realpath.bind(t),typeof t.realpath.native=="function"&&(e.realpath.native=t.realpath.native.bind(t))),typeof t.realpathSync=="function"&&(e.realpathSync=t.realpathSync.bind(t),typeof t.realpathSync.native=="function"&&(e.realpathSync.native=t.realpathSync.native.bind(t))),e._toUnixTimestamp=ae,e.__vol=t,e}const It=Nh(Fh);wr.set("asyncGenerator",jc);wr.set("watchOptions",Uc);let _c=[];const Lh=async({buffer:t,mountPoint:e="/"})=>{let r;try{try{if(t){console.debug(`Mounting filesystem snapshot at [${e}]...`,t);const n=t instanceof Uint8Array?t:new Uint8Array(t),i=n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);await mn.mount(new Uint8Array(i),{fs:It})}else{console.debug("Getting storage directory..."),console.debug("Got storage directory"),console.debug("Attempting to remove directory...");try{console.debug("Successfully removed directory")}catch(n){console.error("Error removing directory:",n)}}console.debug("Returning proxy from worker",It),r=Tn({fs:It}),_c.push(r)}catch(n){throw console.error("Worker initialization failed with error:",n),n}}catch(n){console.error("Error using memfs:",n)}return console.debug("mounting fs",{buffer:t,mountPoint:e}),r},Dh=async({url:t,mountPoint:e="/"})=>{let r;try{console.debug(`Loading and mounting filesystem snapshot from URL: ${t} at [${e}]...`);const n=performance.now();await mn.loadAndMount(t,{fs:It,path:e});const i=performance.now();console.debug(`Snapshot loaded and mounted in ${Math.round(i-n)}ms`),console.debug("Returning proxy from worker",It),r=Tn({fs:It}),_c.push(r)}catch(n){throw console.error("Error loading snapshot from URL:",n),n}return r};onconnect=async function(t){const[e]=t.ports;console.debug("workers/fs connected on port: ",e),e.addEventListener("close",()=>{console.debug("fs port closed")}),vi({mount:Lh,mountFromUrl:Dh},e)};