@stlite/desktop 0.87.0 → 0.89.0

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 (79) hide show
  1. package/bin/dump_artifacts.js +2 -2
  2. package/build/assets/{ErrorOutline.esm-C8z2dN3x.js → ErrorOutline.esm-D2SwfuYU.js} +1 -1
  3. package/build/assets/{FileDownload.esm-kSzyJagP.js → FileDownload.esm-C2Gywq_5.js} +1 -1
  4. package/build/assets/{FileHelper-BbrZYz8x.js → FileHelper-TEIN3a2s.js} +1 -1
  5. package/build/assets/{FormClearHelper-fvwQICEk.js → FormClearHelper-DBsQ33IR.js} +1 -1
  6. package/build/assets/{Hooks-CCS44jMc.js → Hooks-BdfQKLev.js} +1 -1
  7. package/build/assets/{InputInstructions-BgxdtQsQ.js → InputInstructions-CtPX8G6i.js} +1 -1
  8. package/build/assets/{Particles-C6lCS8Mc.js → Particles-CftaQRnu.js} +1 -1
  9. package/build/assets/{ProgressBar-CXipOcU9.js → ProgressBar-M7ATKOrt.js} +1 -1
  10. package/build/assets/{Toolbar-DiWCQxr5.js → Toolbar-AvCHJeN3.js} +1 -1
  11. package/build/assets/{base-input-D2OIsCyG.js → base-input-C1jq7mBd.js} +1 -1
  12. package/build/assets/{checkbox-BNaalk8J.js → checkbox-mkpBvvtC.js} +1 -1
  13. package/build/assets/{createSuper-CQM18OGw.js → createSuper-BqkNEFMI.js} +1 -1
  14. package/build/assets/{data-grid-overlay-editor-CK8RiHSC.js → data-grid-overlay-editor-Kkg8Jnuo.js} +1 -1
  15. package/build/assets/{downloader-CE817MUq.js → downloader-D5bOXv0f.js} +1 -1
  16. package/build/assets/{es6-D9GNxEuI.js → es6-dD9evgqV.js} +2 -2
  17. package/build/assets/{iframeResizer.contentWindow-CNYkPhE6.js → iframeResizer.contentWindow-CcIGM7Tj.js} +1 -1
  18. package/build/assets/{index-X9E9p-kg.js → index-65i-IYyx.js} +1 -1
  19. package/build/assets/{index-BGbl-ncy.js → index-6GmirbOq.js} +1 -1
  20. package/build/assets/{index-CjHv4qYi.js → index-B6MoDIcs.js} +1 -1
  21. package/build/assets/{index-BDOZpIxN.js → index-B6dp8D8K.js} +1 -1
  22. package/build/assets/{index-CKEBU2Tu.js → index-B_ESKJn8.js} +1 -1
  23. package/build/assets/{index-DFlTnZFo.js → index-Bn07Nrcj.js} +1 -1
  24. package/build/assets/{index-C1VFEx3W.js → index-BvsGq1E8.js} +1 -1
  25. package/build/assets/{index-CDtHDDVr.js → index-BwDs6Dqm.js} +1 -1
  26. package/build/assets/{index-Dc2c4xJB.js → index-BzxHONei.js} +1 -1
  27. package/build/assets/{index-DhxOxSgZ.js → index-C3s_fpYA.js} +1 -1
  28. package/build/assets/{index-DhqQeff3.js → index-COglCO5Z.js} +5 -5
  29. package/build/assets/{index-XLeMBlQJ.js → index-CRXKMFnY.js} +1 -1
  30. package/build/assets/{index-DyVqVg90.js → index-CZ-g3tsi.js} +1 -1
  31. package/build/assets/{index-B-7mLFMQ.js → index-CaQBKEJy.js} +1 -1
  32. package/build/assets/{index-Wzix0Ssr.js → index-Cbwanp8_.js} +1 -1
  33. package/build/assets/{index---v6J_Xe.js → index-CmCzhGLu.js} +1 -1
  34. package/build/assets/{index-DFWekVRf.js → index-Cmk6T6xH.js} +1 -1
  35. package/build/assets/{index-B5zkrGKq.js → index-CuAJIEXV.js} +1 -1
  36. package/build/assets/{index-CxsEqDQL.js → index-CyGIJHIN.js} +1 -1
  37. package/build/assets/{index-DXGgezsh.js → index-D9I-_Axj.js} +1 -1
  38. package/build/assets/{index-B3wu97uA.js → index-DRnW2Id8.js} +1 -1
  39. package/build/assets/{index-Bnvb95fQ.js → index-Dpl6MGkr.js} +1 -1
  40. package/build/assets/{index-Vs85zs5K.js → index-Du10bw-R.js} +1 -1
  41. package/build/assets/{index-C6fUDD3N.js → index-GIlSUqbu.js} +1 -1
  42. package/build/assets/{index-CI7_FxNG.js → index-GZIk974x.js} +1 -1
  43. package/build/assets/{index--SdlqSfi.js → index-GZgkD7uG.js} +1 -1
  44. package/build/assets/{index-mlKr_pQQ.js → index-N4aGA-cE.js} +1 -1
  45. package/build/assets/{index-CnRs0MgX.js → index-P6F5Xebr.js} +1 -1
  46. package/build/assets/{index-CGMUJ4kd.js → index-XJiwj79b.js} +1 -1
  47. package/build/assets/{index-BI9UgvCi.js → index-_maoKajI.js} +1 -1
  48. package/build/assets/{index-DDiZtaVk.js → index-cMy3wqhE.js} +1 -1
  49. package/build/assets/{index-DCNLpqIv.js → index-clm6On2Y.js} +4 -4
  50. package/build/assets/{index-D0YDqQsn.js → index-i6_APaSl.js} +1 -1
  51. package/build/assets/{index-DqnX_TF4.js → index-npEbF0j6.js} +1 -1
  52. package/build/assets/{index-cAlcGRT2.js → index-o_WbG_Oh.js} +1 -1
  53. package/build/assets/{index-CT5_r023.js → index-w_HPESMz.js} +1 -1
  54. package/build/assets/{index-7qt3HHfl.js → index-yIAfElop.js} +1 -1
  55. package/build/assets/{inherits-BWX75f6B.js → inherits-D8N0057t.js} +1 -1
  56. package/build/assets/{input-DTfsWA-x.js → input-D2HjwqoP.js} +1 -1
  57. package/build/assets/{memory-DS2CpVMo.js → memory-DWwc6pLO.js} +1 -1
  58. package/build/assets/{mergeWith-fWFIuGgc.js → mergeWith-BGcS1SpY.js} +1 -1
  59. package/build/assets/{number-overlay-editor-DDQgeQYn.js → number-overlay-editor-B6CLC0X9.js} +1 -1
  60. package/build/assets/{sandbox-VD4WfD0W.js → sandbox-C6oygvjW.js} +1 -1
  61. package/build/assets/{slicedToArray-CgI3PJi3.js → slicedToArray-DOoFLiRi.js} +1 -1
  62. package/build/assets/{timepicker-qd0SiRjC.js → timepicker-C7DrJdVV.js} +1 -1
  63. package/build/assets/{uniqueId-Dgo2nsPZ.js → uniqueId-C1Mkja_B.js} +1 -1
  64. package/build/assets/{useBasicWidgetState-9vtYd9vP.js → useBasicWidgetState-CCltHZT9.js} +1 -1
  65. package/build/assets/{useTextInputAutoExpand-BFx1z0yW.js → useTextInputAutoExpand-LP-kJAB7.js} +1 -1
  66. package/build/assets/{useUpdateUiValue-BF7Ryinr.js → useUpdateUiValue-JsRPimPm.js} +1 -1
  67. package/build/assets/{withFullScreenWrapper-C3PKUCi4.js → withFullScreenWrapper-CKQjmc-1.js} +1 -1
  68. package/build/assets/worker-CiNU4sgs.js +105 -0
  69. package/build/electron/worker.js +9 -9
  70. package/build/index.html +1 -1
  71. package/build/pyodide/pyodide-lock.json +1 -1
  72. package/build/pyodide/pyodide.asm.js +2 -4
  73. package/build/pyodide/pyodide.asm.wasm +0 -0
  74. package/build/pyodide/pyodide.mjs +3 -3
  75. package/build/pyodide/python_stdlib.zip +0 -0
  76. package/package.json +6 -6
  77. package/wheels/streamlit-1.48.0-cp313-none-any.whl +0 -0
  78. package/build/assets/worker-B7Gzidb7.js +0 -105
  79. package/wheels/streamlit-1.48.0-cp312-none-any.whl +0 -0
@@ -36,8 +36,8 @@ ${E}`),y.pop(),`{${k}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";
36
36
  `))}_onEvent(e,r){function i(n){e==="error"&&!this.transports.includes(r)&&this.add(r),this.emit(e,n,r)}r["__winston"+e]||(r["__winston"+e]=i.bind(this),r.on(e,r["__winston"+e]))}_addDefaultMeta(e){this.defaultMeta&&Object.assign(e,this.defaultMeta)}};function bo(t,e){let r=t[e];return!r&&r!==0?null:r}Object.defineProperty(Vn.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:t}=this._readableState;return Array.isArray(t)?t:[t].filter(Boolean)}});Ed.exports=Vn});var wo=w((fR,Rd)=>{"use strict";var{LEVEL:P1}=te(),D1=$n(),q1=Gn(),C1=ei()("winston:create-logger");function L1(t){return"is"+t.charAt(0).toUpperCase()+t.slice(1)+"Enabled"}Rd.exports=function(t={}){t.levels=t.levels||D1.npm.levels;class e extends q1{constructor(n){super(n)}}let r=new e(t);return Object.keys(t.levels).forEach(function(i){if(C1('Define prototype method for "%s"',i),i==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}e.prototype[i]=function(...n){let s=this||r;if(n.length===1){let[a]=n,o=a&&a.message&&a||{message:a};return o.level=o[P1]=i,s._addDefaultMeta(o),s.write(o),this||r}return n.length===0?(s.log(i,""),s):s.log(i,...n)},e.prototype[L1(i)]=function(){return(this||r).isLevelEnabled(i)}}),r}});var Md=w((hR,xd)=>{"use strict";var j1=wo();xd.exports=class{constructor(e={}){this.loggers=new Map,this.options=e}add(e,r){if(!this.loggers.has(e)){r=Object.assign({},r||this.options);let i=r.transports||this.options.transports;i?r.transports=Array.isArray(i)?i.slice():[i]:r.transports=[];let n=j1(r);n.on("close",()=>this._delete(e)),this.loggers.set(e,n)}return this.loggers.get(e)}get(e,r){return this.add(e,r)}has(e){return!!this.loggers.has(e)}close(e){if(e)return this._removeLogger(e);this.loggers.forEach((r,i)=>this._removeLogger(i))}_removeLogger(e){if(!this.loggers.has(e))return;this.loggers.get(e).close(),this._delete(e)}_delete(e){this.loggers.delete(e)}}});var Od=w(H=>{"use strict";var Td=Ws(),{warn:si}=Bs();H.version=cu().version;H.transports=Xh();H.config=$n();H.addColors=Td.levels;H.format=Td.format;H.createLogger=wo();H.Logger=Gn();H.ExceptionHandler=po();H.RejectionHandler=mo();H.Container=Md();H.Transport=ar();H.loggers=new H.Container;var Ze=H.createLogger();Object.keys(H.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(t=>H[t]=(...e)=>Ze[t](...e));Object.defineProperty(H,"level",{get(){return Ze.level},set(t){Ze.level=t}});Object.defineProperty(H,"exceptions",{get(){return Ze.exceptions}});Object.defineProperty(H,"rejections",{get(){return Ze.rejections}});["exitOnError"].forEach(t=>{Object.defineProperty(H,t,{get(){return Ze[t]},set(e){Ze[t]=e}})});Object.defineProperty(H,"default",{get(){return{exceptionHandlers:Ze.exceptionHandlers,rejectionHandlers:Ze.rejectionHandlers,transports:Ze.transports}}});si.deprecated(H,"setLevels");si.forFunctions(H,"useFormat",["cli"]);si.forProperties(H,"useFormat",["padLevels","stripColors"]);si.forFunctions(H,"deprecated",["addRewriter","addFilter","clone","extend"]);si.forProperties(H,"deprecated",["emitErrs","levelLength"])});var Jn=w((Kn,kd)=>{(function(t,e){typeof Kn=="object"&&typeof kd<"u"?e(Kn):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.Superstruct={}))})(Kn,function(t){"use strict";class e extends TypeError{constructor(g,m){let v,{message:T,explanation:D,...$}=g,{path:Z}=g,Q=Z.length===0?T:`At path: ${Z.join(".")} -- ${T}`;super(D??Q),D!=null&&(this.cause=Q),Object.assign(this,$),this.name=this.constructor.name,this.failures=()=>v??(v=[g,...m()])}}function r(p){return i(p)&&typeof p[Symbol.iterator]=="function"}function i(p){return typeof p=="object"&&p!=null}function n(p){return i(p)&&!Array.isArray(p)}function s(p){if(Object.prototype.toString.call(p)!=="[object Object]")return!1;let g=Object.getPrototypeOf(p);return g===null||g===Object.prototype}function a(p){return typeof p=="symbol"?p.toString():typeof p=="string"?JSON.stringify(p):`${p}`}function o(p){let{done:g,value:m}=p.next();return g?void 0:m}function l(p,g,m,v){if(p===!0)return;p===!1?p={}:typeof p=="string"&&(p={message:p});let{path:T,branch:D}=g,{type:$}=m,{refinement:Z,message:Q=`Expected a value of type \`${$}\`${Z?` with refinement \`${Z}\``:""}, but received: \`${a(v)}\``}=p;return{value:v,type:$,refinement:Z,key:T[T.length-1],path:T,branch:D,...p,message:Q}}function*u(p,g,m,v){r(p)||(p=[p]);for(let T of p){let D=l(T,g,m,v);D&&(yield D)}}function*c(p,g,m={}){let{path:v=[],branch:T=[p],coerce:D=!1,mask:$=!1}=m,Z={path:v,branch:T,mask:$};D&&(p=g.coercer(p,Z));let Q="valid";for(let re of g.validator(p,Z))re.explanation=m.message,Q="not_valid",yield[re,void 0];for(let[re,Pe,jp]of g.entries(p,Z)){let Np=c(Pe,jp,{path:re===void 0?v:[...v,re],branch:re===void 0?T:[...T,Pe],coerce:D,mask:$,message:m.message});for(let Oi of Np)Oi[0]?(Q=Oi[0].refinement!=null?"not_refined":"not_valid",yield[Oi[0],void 0]):D&&(Pe=Oi[1],re===void 0?p=Pe:p instanceof Map?p.set(re,Pe):p instanceof Set?p.add(Pe):i(p)&&(Pe!==void 0||re in p)&&(p[re]=Pe))}if(Q!=="not_valid")for(let re of g.refiner(p,Z))re.explanation=m.message,Q="not_refined",yield[re,void 0];Q==="valid"&&(yield[void 0,p])}class h{constructor(g){let{type:m,schema:v,validator:T,refiner:D,coercer:$=Q=>Q,entries:Z=function*(){}}=g;this.type=m,this.schema=v,this.entries=Z,this.coercer=$,T?this.validator=(Q,re)=>{let Pe=T(Q,re);return u(Pe,re,this,Q)}:this.validator=()=>[],D?this.refiner=(Q,re)=>{let Pe=D(Q,re);return u(Pe,re,this,Q)}:this.refiner=()=>[]}assert(g,m){return d(g,this,m)}create(g,m){return f(g,this,m)}is(g){return b(g,this)}mask(g,m){return y(g,this,m)}validate(g,m={}){return _(g,this,m)}}function d(p,g,m){let v=_(p,g,{message:m});if(v[0])throw v[0]}function f(p,g,m){let v=_(p,g,{coerce:!0,message:m});if(v[0])throw v[0];return v[1]}function y(p,g,m){let v=_(p,g,{coerce:!0,mask:!0,message:m});if(v[0])throw v[0];return v[1]}function b(p,g){return!_(p,g)[0]}function _(p,g,m={}){let v=c(p,g,m),T=o(v);return T[0]?[new e(T[0],function*(){for(let $ of v)$[0]&&(yield $[0])}),void 0]:[void 0,T[1]]}function E(...p){let g=p[0].type==="type",m=p.map(T=>T.schema),v=Object.assign({},...m);return g?ot(v):at(v)}function R(p,g){return new h({type:p,schema:null,validator:g})}function x(p,g){return new h({...p,refiner:(m,v)=>m===void 0||p.refiner(m,v),validator(m,v){return m===void 0?!0:(g(m,v),p.validator(m,v))}})}function M(p){return new h({type:"dynamic",schema:null,*entries(g,m){yield*p(g,m).entries(g,m)},validator(g,m){return p(g,m).validator(g,m)},coercer(g,m){return p(g,m).coercer(g,m)},refiner(g,m){return p(g,m).refiner(g,m)}})}function k(p){let g;return new h({type:"lazy",schema:null,*entries(m,v){g??(g=p()),yield*g.entries(m,v)},validator(m,v){return g??(g=p()),g.validator(m,v)},coercer(m,v){return g??(g=p()),g.coercer(m,v)},refiner(m,v){return g??(g=p()),g.refiner(m,v)}})}function j(p,g){let{schema:m}=p,v={...m};for(let T of g)delete v[T];switch(p.type){case"type":return ot(v);default:return at(v)}}function U(p){let g=p instanceof h,m=g?{...p.schema}:{...p};for(let v in m)m[v]=Tt(m[v]);return g&&p.type==="type"?ot(m):at(m)}function F(p,g){let{schema:m}=p,v={};for(let T of g)v[T]=m[T];switch(p.type){case"type":return ot(v);default:return at(v)}}function G(p,g){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),R(p,g)}function ne(){return R("any",()=>!0)}function J(p){return new h({type:"array",schema:p,*entries(g){if(p&&Array.isArray(g))for(let[m,v]of g.entries())yield[m,v,p]},coercer(g){return Array.isArray(g)?g.slice():g},validator(g){return Array.isArray(g)||`Expected an array value, but received: ${a(g)}`}})}function ye(){return R("bigint",p=>typeof p=="bigint")}function be(){return R("boolean",p=>typeof p=="boolean")}function et(){return R("date",p=>p instanceof Date&&!isNaN(p.getTime())||`Expected a valid \`Date\` object, but received: ${a(p)}`)}function ms(p){let g={},m=p.map(v=>a(v)).join();for(let v of p)g[v]=v;return new h({type:"enums",schema:g,validator(v){return p.includes(v)||`Expected one of \`${m}\`, but received: ${a(v)}`}})}function S(){return R("func",p=>typeof p=="function"||`Expected a function, but received: ${a(p)}`)}function O(p){return R("instance",g=>g instanceof p||`Expected a \`${p.name}\` instance, but received: ${a(g)}`)}function z(){return R("integer",p=>typeof p=="number"&&!isNaN(p)&&Number.isInteger(p)||`Expected an integer, but received: ${a(p)}`)}function pe(p){return new h({type:"intersection",schema:null,*entries(g,m){for(let v of p)yield*v.entries(g,m)},*validator(g,m){for(let v of p)yield*v.validator(g,m)},*refiner(g,m){for(let v of p)yield*v.refiner(g,m)}})}function P(p){let g=a(p),m=typeof p;return new h({type:"literal",schema:m==="string"||m==="number"||m==="boolean"?p:null,validator(v){return v===p||`Expected the literal \`${g}\`, but received: ${a(v)}`}})}function ke(p,g){return new h({type:"map",schema:null,*entries(m){if(p&&g&&m instanceof Map)for(let[v,T]of m.entries())yield[v,v,p],yield[v,T,g]},coercer(m){return m instanceof Map?new Map(m):m},validator(m){return m instanceof Map||`Expected a \`Map\` object, but received: ${a(m)}`}})}function Fe(){return R("never",()=>!1)}function Mt(p){return new h({...p,validator:(g,m)=>g===null||p.validator(g,m),refiner:(g,m)=>g===null||p.refiner(g,m)})}function Kt(){return R("number",p=>typeof p=="number"&&!isNaN(p)||`Expected a number, but received: ${a(p)}`)}function at(p){let g=p?Object.keys(p):[],m=Fe();return new h({type:"object",schema:p||null,*entries(v){if(p&&i(v)){let T=new Set(Object.keys(v));for(let D of g)T.delete(D),yield[D,v[D],p[D]];for(let D of T)yield[D,v[D],m]}},validator(v){return n(v)||`Expected an object, but received: ${a(v)}`},coercer(v,T){if(!n(v))return v;let D={...v};if(T.mask&&p)for(let $ in D)p[$]===void 0&&delete D[$];return D}})}function Tt(p){return new h({...p,validator:(g,m)=>g===void 0||p.validator(g,m),refiner:(g,m)=>g===void 0||p.refiner(g,m)})}function ys(p,g){return new h({type:"record",schema:null,*entries(m){if(i(m))for(let v in m){let T=m[v];yield[v,v,p],yield[v,T,g]}},validator(m){return n(m)||`Expected an object, but received: ${a(m)}`},coercer(m){return n(m)?{...m}:m}})}function xe(){return R("regexp",p=>p instanceof RegExp)}function Ei(p){return new h({type:"set",schema:null,*entries(g){if(p&&g instanceof Set)for(let m of g)yield[m,m,p]},coercer(g){return g instanceof Set?new Set(g):g},validator(g){return g instanceof Set||`Expected a \`Set\` object, but received: ${a(g)}`}})}function Ri(){return R("string",p=>typeof p=="string"||`Expected a string, but received: ${a(p)}`)}function xi(p){let g=Fe();return new h({type:"tuple",schema:null,*entries(m){if(Array.isArray(m)){let v=Math.max(p.length,m.length);for(let T=0;T<v;T++)yield[T,m[T],p[T]||g]}},validator(m){return Array.isArray(m)||`Expected an array, but received: ${a(m)}`},coercer(m){return Array.isArray(m)?m.slice():m}})}function ot(p){let g=Object.keys(p);return new h({type:"type",schema:p,*entries(m){if(i(m))for(let v of g)yield[v,m[v],p[v]]},validator(m){return n(m)||`Expected an object, but received: ${a(m)}`},coercer(m){return n(m)?{...m}:m}})}function Jt(p){let g=p.map(m=>m.type).join(" | ");return new h({type:"union",schema:null,coercer(m,v){for(let T of p){let[D,$]=T.validate(m,{coerce:!0,mask:v.mask});if(!D)return $}return m},validator(m,v){let T=[];for(let D of p){let[...$]=c(m,D,v),[Z]=$;if(Z[0])for(let[Q]of $)Q&&T.push(Q);else return[]}return[`Expected the value to satisfy a union of \`${g}\`, but received: ${a(m)}`,...T]}})}function Ot(){return R("unknown",()=>!0)}function xr(p,g,m){return new h({...p,coercer:(v,T)=>b(v,g)?p.coercer(m(v,T),T):p.coercer(v,T)})}function At(p,g,m={}){return xr(p,Ot(),v=>{let T=typeof g=="function"?g():g;if(v===void 0)return T;if(!m.strict&&s(v)&&s(T)){let D={...v},$=!1;for(let Z in T)D[Z]===void 0&&(D[Z]=T[Z],$=!0);if($)return D}return v})}function lt(p){return xr(p,Ri(),g=>g.trim())}function Mr(p){return kt(p,"empty",g=>{let m=Mi(g);return m===0||`Expected an empty ${p.type} but received one with a size of \`${m}\``})}function Mi(p){return p instanceof Map||p instanceof Set?p.size:p.length}function Ti(p,g,m={}){let{exclusive:v}=m;return kt(p,"max",T=>v?T<g:T<=g||`Expected a ${p.type} less than ${v?"":"or equal to "}${g} but received \`${T}\``)}function Dp(p,g,m={}){let{exclusive:v}=m;return kt(p,"min",T=>v?T>g:T>=g||`Expected a ${p.type} greater than ${v?"":"or equal to "}${g} but received \`${T}\``)}function qp(p){return kt(p,"nonempty",g=>Mi(g)>0||`Expected a nonempty ${p.type} but received an empty one`)}function Cp(p,g){return kt(p,"pattern",m=>g.test(m)||`Expected a ${p.type} matching \`/${g.source}/\` but received "${m}"`)}function Lp(p,g,m=g){let v=`Expected a ${p.type}`,T=g===m?`of \`${g}\``:`between \`${g}\` and \`${m}\``;return kt(p,"size",D=>{if(typeof D=="number"||D instanceof Date)return g<=D&&D<=m||`${v} ${T} but received \`${D}\``;if(D instanceof Map||D instanceof Set){let{size:$}=D;return g<=$&&$<=m||`${v} with a size ${T} but received one with a size of \`${$}\``}else{let{length:$}=D;return g<=$&&$<=m||`${v} with a length ${T} but received one with a length of \`${$}\``}})}function kt(p,g,m){return new h({...p,*refiner(v,T){yield*p.refiner(v,T);let D=m(v,T),$=u(D,T,p,v);for(let Z of $)yield{...Z,refinement:g}}})}t.Struct=h,t.StructError=e,t.any=ne,t.array=J,t.assert=d,t.assign=E,t.bigint=ye,t.boolean=be,t.coerce=xr,t.create=f,t.date=et,t.defaulted=At,t.define=R,t.deprecated=x,t.dynamic=M,t.empty=Mr,t.enums=ms,t.func=S,t.instance=O,t.integer=z,t.intersection=pe,t.is=b,t.lazy=k,t.literal=P,t.map=ke,t.mask=y,t.max=Ti,t.min=Dp,t.never=Fe,t.nonempty=qp,t.nullable=Mt,t.number=Kt,t.object=at,t.omit=j,t.optional=Tt,t.partial=U,t.pattern=Cp,t.pick=F,t.record=ys,t.refine=kt,t.regexp=xe,t.set=Ei,t.size=Lp,t.string=Ri,t.struct=G,t.trimmed=lt,t.tuple=xi,t.type=ot,t.union=Jt,t.unknown=Ot,t.validate=_})});import CS from"yargs";import{hideBin as LS}from"yargs/helpers";import de from"node:path";import xt from"node:fs/promises";import{fileURLToPath as jS}from"node:url";import Wo from"fs-extra";import{loadPyodide as Op,version as NS}from"pyodide";import Ad from"node:path";import N1 from"node:fs/promises";var _t=Ai(Od(),1),I=_t.createLogger({transports:[new _t.transports.Console({format:_t.format.combine(_t.format.splat(),_t.format.cli())})]});function ai(t){process.emitWarning(t,{type:"DeprecationWarning"})}var Yn=class{sourceUrl;isRemote;_data=null;constructor(e){e.startsWith("file://")&&(e=e.slice(7)),this.sourceUrl=e,this.isRemote=e.includes("://")}async readJson(e){if(this.isRemote){let r=Ad.posix.join(this.sourceUrl,e);I.debug(`Fetching ${r}`);let i=await fetch(r);if(!i.ok)throw new Error(`Failed to download ${r}: ${i.status} ${i.statusText}`);return await i.json()}else{let r=Ad.join(this.sourceUrl,e);I.debug(`Reading ${r}`);let i=await N1.readFile(r);return JSON.parse(i.toString())}}async loadPrebuiltPackageData(){if(this._data!=null)return this._data;I.info("Load pyodide-lock.json");let e=await this.readJson("pyodide-lock.json");return this._data=e.packages,e.packages}async getPackageInfoByName(e){let r=await this.loadPrebuiltPackageData(),i=Object.values(r).find(n=>n.name===e);if(i==null)throw new Error(`Package ${e} is not found in the lock file.`);return i}};var Dd=Ai(Jn(),1);import F1 from"node:fs/promises";var X=Ai(Jn(),1),Pd=X.object({entrypoint:X.string(),embed:X.defaulted(X.boolean(),!1),idbfsMountpoints:X.optional(X.array(X.string())),nodeJsWorker:X.defaulted(X.boolean(),!1),nodefsMountpoints:X.optional(X.record(X.string(),X.string()))});function I1(t){let e=Dd.mask(t??{},Pd);if(e.nodeJsWorker){if(e.idbfsMountpoints!=null)throw new Error("The `idbfsMountpoints` field is not allowed when `nodeJsWorker` is true.")}else if(e.nodefsMountpoints!=null)throw new Error("The `nodefsMountpoints` field is not allowed when `nodeJsWorker` is false.");return e}async function qd(t){let e=I1({...t.packageJsonStliteDesktopField,...t.fallbacks});I.info("App manifest: %j",e);let r=JSON.stringify(e,null,2);I.info(`Dump the manifest file -> ${t.manifestFilePath}`),await F1.writeFile(t.manifestFilePath,r,{encoding:"utf-8"})}var ce=Ai(Jn(),1);import $1 from"node:path";async function Cd(t){let{files:e,entrypoint:r}=W1(t),i=await B1(t),n=await U1(t);return{files:e,entrypoint:r,dependencies:i,requirementsTxtFilePaths:n}}function W1(t){let{packageJsonStliteDesktopField:e,fallbacks:{appHomeDirSource:r}}=t,i=e?.files,n=e?.entrypoint;if(i==null||n==null){ai("Missing `stlite.desktop.files` and `stlite.desktop.entrypoint` in `package.json`. Falling back to the `appHomeDirSource` argument to determine the app directory. Please update your `package.json` as this fallback is deprecated and will be removed in a future release.");let s=r;if(typeof s!="string")throw new Error("The `appHomeDirSource` argument is required when `stlite.desktop.files` and `stlite.desktop.entrypoint` are not found in the package.json. Note that `appHomeDirSource` is deprecated and will be removed in the future, so please specify `stlite.desktop.files` and `stlite.desktop.entrypoint` in the package.json.");i=[s],n=`./${s}/streamlit_app.py`}else r!=null&&ai("The `appHomeDirSource` argument is deprecated and has been ignored because `stlite.desktop.files` is specified in `package.json`.");return ce.assert(n,ce.string(),"The `stlite.desktop.entrypoint` field must be a string."),ce.assert(i,ce.array(ce.string()),"The `stlite.desktop.files` field must be an array of strings."),{files:i,entrypoint:n}}async function B1(t){let{packageJsonStliteDesktopField:e,fallbacks:{packages:r}}=t,i=e?.dependencies;ce.assert(i,ce.optional(ce.array(ce.string())),"The `stlite.desktop.dependencies` field must be an array of strings.");let n=[];return r!=null&&(ai("The `packages` argument is deprecated and will be removed in a future release. Use `stlite.desktop.dependencies` in your `package.json` instead."),n=r),[...i??[],...n]}async function U1(t){let{pathResolutionRoot:e,packageJsonStliteDesktopField:r,fallbacks:{requirementsTxtFilePaths:i}}=t,n=r?.requirementsTxtFiles;ce.assert(n,ce.optional(ce.array(ce.string())),"The `stlite.desktop.requirementsTxtFiles` field must be an array of strings.");let s=n?.map(o=>$1.resolve(e,o)),a=[];return i!=null&&i.length>0&&(ai("The `requirement` argument is deprecated and will be removed in a future release. Use `stlite.desktop.requirementsTxtFiles` in your `package.json` instead."),a=i),[...s??[],...a]}var z1="[",H1="(<=>!~",G1=";",V1="@",Y1=new RegExp(`[${z1+H1+G1+V1}]`);function K1(t){return t.split(Y1)[0].trim()}function Ld(t){return t.forEach(r=>{let i;try{i=new URL(r)}catch{return}if(i.protocol==="emfs:"||i.protocol==="file:")throw new Error(`"emfs:" and "file:" protocols are not allowed for the requirement (${r})`)}),t.filter(r=>K1(r)==="streamlit"?(console.warn(`Streamlit is specified in the requirements ("${r}"), but it will be ignored. A built-in version of Streamlit will be used.`),!1):!0)}var J1=/\s#.*$/;function jd(t){return t.split(`
37
37
  `).filter(e=>!e.startsWith("#")).map(e=>e.replace(J1,"")).map(e=>e.trim()).filter(e=>e!=="")}var vo=(t,e,r)=>{let i=t instanceof RegExp?Nd(t,r):t,n=e instanceof RegExp?Nd(e,r):e,s=i!==null&&n!=null&&Z1(i,n,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+i.length,s[1]),post:r.slice(s[1]+n.length)}},Nd=(t,e)=>{let r=e.match(t);return r?r[0]:null},Z1=(t,e,r)=>{let i,n,s,a,o,l=r.indexOf(t),u=r.indexOf(e,l+1),c=l;if(l>=0&&u>0){if(t===e)return[l,u];for(i=[],s=r.length;c>=0&&!o;){if(c===l)i.push(c),l=r.indexOf(t,c+1);else if(i.length===1){let h=i.pop();h!==void 0&&(o=[h,u])}else n=i.pop(),n!==void 0&&n<s&&(s=n,a=u),u=r.indexOf(e,c+1);c=l<u&&l>=0?l:u}i.length&&a!==void 0&&(o=[s,a])}return o};var Fd="\0SLASH"+Math.random()+"\0",Id="\0OPEN"+Math.random()+"\0",So="\0CLOSE"+Math.random()+"\0",$d="\0COMMA"+Math.random()+"\0",Wd="\0PERIOD"+Math.random()+"\0",Q1=new RegExp(Fd,"g"),X1=new RegExp(Id,"g"),e_=new RegExp(So,"g"),t_=new RegExp($d,"g"),r_=new RegExp(Wd,"g"),i_=/\\\\/g,n_=/\\{/g,s_=/\\}/g,a_=/\\,/g,o_=/\\./g;function _o(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function l_(t){return t.replace(i_,Fd).replace(n_,Id).replace(s_,So).replace(a_,$d).replace(o_,Wd)}function u_(t){return t.replace(Q1,"\\").replace(X1,"{").replace(e_,"}").replace(t_,",").replace(r_,".")}function Bd(t){if(!t)return[""];let e=[],r=vo("{","}",t);if(!r)return t.split(",");let{pre:i,body:n,post:s}=r,a=i.split(",");a[a.length-1]+="{"+n+"}";let o=Bd(s);return s.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),e.push.apply(e,a),e}function Ud(t){return t?(t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),oi(l_(t),!0).map(u_)):[]}function f_(t){return"{"+t+"}"}function c_(t){return/^-?0\d/.test(t)}function h_(t,e){return t<=e}function d_(t,e){return t>=e}function oi(t,e){let r=[],i=vo("{","}",t);if(!i)return[t];let n=i.pre,s=i.post.length?oi(i.post,!1):[""];if(/\$$/.test(i.pre))for(let a=0;a<s.length;a++){let o=n+"{"+i.body+"}"+s[a];r.push(o)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),l=a||o,u=i.body.indexOf(",")>=0;if(!l&&!u)return i.post.match(/,(?!,).*\}/)?(t=i.pre+"{"+i.body+So+i.post,oi(t)):[t];let c;if(l)c=i.body.split(/\.\./);else if(c=Bd(i.body),c.length===1&&c[0]!==void 0&&(c=oi(c[0],!1).map(f_),c.length===1))return s.map(d=>i.pre+c[0]+d);let h;if(l&&c[0]!==void 0&&c[1]!==void 0){let d=_o(c[0]),f=_o(c[1]),y=Math.max(c[0].length,c[1].length),b=c.length===3&&c[2]!==void 0?Math.abs(_o(c[2])):1,_=h_;f<d&&(b*=-1,_=d_);let R=c.some(c_);h=[];for(let x=d;_(x,f);x+=b){let M;if(o)M=String.fromCharCode(x),M==="\\"&&(M="");else if(M=String(x),R){let k=y-M.length;if(k>0){let j=new Array(k+1).join("0");x<0?M="-"+j+M.slice(1):M=j+M}}h.push(M)}}else{h=[];for(let d=0;d<c.length;d++)h.push.apply(h,oi(c[d],!1))}for(let d=0;d<h.length;d++)for(let f=0;f<s.length;f++){let y=n+h[d]+s[f];(!e||l||y)&&r.push(y)}}return r}var li=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var p_={"[: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]},ui=t=>t.replace(/[[\]\\-]/g,"\\$&"),g_=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),zd=t=>t.join(""),Hd=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let i=[],n=[],s=r+1,a=!1,o=!1,l=!1,u=!1,c=r,h="";e:for(;s<t.length;){let b=t.charAt(s);if((b==="!"||b==="^")&&s===r+1){u=!0,s++;continue}if(b==="]"&&a&&!l){c=s+1;break}if(a=!0,b==="\\"&&!l){l=!0,s++;continue}if(b==="["&&!l){for(let[_,[E,R,x]]of Object.entries(p_))if(t.startsWith(_,s)){if(h)return["$.",!1,t.length-r,!0];s+=_.length,x?n.push(E):i.push(E),o=o||R;continue e}}if(l=!1,h){b>h?i.push(ui(h)+"-"+ui(b)):b===h&&i.push(ui(b)),h="",s++;continue}if(t.startsWith("-]",s+1)){i.push(ui(b+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=b,s+=2;continue}i.push(ui(b)),s++}if(c<s)return["",!1,0,!1];if(!i.length&&!n.length)return["$.",!1,t.length-r,!0];if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!u){let b=i[0].length===2?i[0].slice(-1):i[0];return[g_(b),!1,c-r,!1]}let d="["+(u?"^":"")+zd(i)+"]",f="["+(u?"":"^")+zd(n)+"]";return[i.length&&n.length?"("+d+"|"+f+")":i.length?d:f,o,c-r,!0]};var Be=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var m_=new Set(["!","?","+","*","@"]),Gd=t=>m_.has(t),y_="(?!(?:^|/)\\.\\.?(?:$|/))",Zn="(?!\\.)",b_=new Set(["[","."]),w_=new Set(["..","."]),v_=new Set("().*{}+?[]^$\\!"),__=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Eo="[^/]",Vd=Eo+"*?",Yd=Eo+"+?",gr=class t{type;#e;#t;#s=!1;#i=[];#a;#v;#u;#c=!1;#o;#l;#n=!1;constructor(e,r,i={}){this.type=e,e&&(this.#t=!0),this.#a=r,this.#e=this.#a?this.#a.#e:this,this.#o=this.#e===this?i:this.#e.#o,this.#u=this.#e===this?[]:this.#e.#u,e==="!"&&!this.#e.#c&&this.#u.push(this),this.#v=this.#a?this.#a.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#l=this.#i.map(e=>String(e)).join("")}#m(){if(this!==this.#e)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let e;for(;e=this.#u.pop();){if(e.type!=="!")continue;let r=e,i=r.#a;for(;i;){for(let n=r.#v+1;!i.type&&n<i.#i.length;n++)for(let s of e.#i){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#i[n])}r=i,i=r.#a}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#a===this))throw new Error("invalid part: "+r);this.#i.push(r)}}toJSON(){let e=this.type===null?this.#i.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#i.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#c&&this.#a?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#a?.isStart())return!1;if(this.#v===0)return!0;let e=this.#a;for(let r=0;r<this.#v;r++){let i=e.#i[r];if(!(i instanceof t&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#a?.type==="!")return!0;if(!this.#a?.isEnd())return!1;if(!this.type)return this.#a?.isEnd();let e=this.#a?this.#a.#i.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let i of this.#i)r.copyIn(i);return r}static#y(e,r,i,n){let s=!1,a=!1,o=-1,l=!1;if(r.type===null){let f=i,y="";for(;f<e.length;){let b=e.charAt(f++);if(s||b==="\\"){s=!s,y+=b;continue}if(a){f===o+1?(b==="^"||b==="!")&&(l=!0):b==="]"&&!(f===o+2&&l)&&(a=!1),y+=b;continue}else if(b==="["){a=!0,o=f,l=!1,y+=b;continue}if(!n.noext&&Gd(b)&&e.charAt(f)==="("){r.push(y),y="";let _=new t(b,r);f=t.#y(e,_,f,n),r.push(_);continue}y+=b}return r.push(y),f}let u=i+1,c=new t(null,r),h=[],d="";for(;u<e.length;){let f=e.charAt(u++);if(s||f==="\\"){s=!s,d+=f;continue}if(a){u===o+1?(f==="^"||f==="!")&&(l=!0):f==="]"&&!(u===o+2&&l)&&(a=!1),d+=f;continue}else if(f==="["){a=!0,o=u,l=!1,d+=f;continue}if(Gd(f)&&e.charAt(u)==="("){c.push(d),d="";let y=new t(f,c);c.push(y),u=t.#y(e,y,u,n);continue}if(f==="|"){c.push(d),d="",h.push(c),c=new t(null,r);continue}if(f===")")return d===""&&r.#i.length===0&&(r.#n=!0),c.push(d),d="",r.push(...h,c),u;d+=f}return r.type=null,r.#t=void 0,r.#i=[e.substring(i-1)],u}static fromGlob(e,r={}){let i=new t(null,void 0,r);return t.#y(e,i,0,r),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[r,i,n,s]=this.toRegExpSource();if(!(n||this.#t||this.#o.nocase&&!this.#o.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let o=(this.#o.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,o),{_src:r,_glob:e})}get options(){return this.#o}toRegExpSource(e){let r=e??!!this.#o.dot;if(this.#e===this&&this.#m(),!this.type){let l=this.isStart()&&this.isEnd(),u=this.#i.map(f=>{let[y,b,_,E]=typeof f=="string"?t.#h(f,this.#t,l):f.toRegExpSource(e);return this.#t=this.#t||_,this.#s=this.#s||E,y}).join(""),c="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&w_.has(this.#i[0]))){let y=b_,b=r&&y.has(u.charAt(0))||u.startsWith("\\.")&&y.has(u.charAt(2))||u.startsWith("\\.\\.")&&y.has(u.charAt(4)),_=!r&&!e&&y.has(u.charAt(0));c=b?y_:_?Zn:""}let h="";return this.isEnd()&&this.#e.#c&&this.#a?.type==="!"&&(h="(?:$|\\/)"),[c+u+h,Be(u),this.#t=!!this.#t,this.#s]}let i=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#d(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString();return this.#i=[l],this.type=null,this.#t=void 0,[l,Be(this.toString()),!1,!1]}let a=!i||e||r||!Zn?"":this.#d(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let o="";if(this.type==="!"&&this.#n)o=(this.isStart()&&!r?Zn:"")+Yd;else{let l=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Zn:"")+Vd+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=n+s+l}return[o,Be(s),this.#t=!!this.#t,this.#s]}#d(e){return this.#i.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[i,n,s,a]=r.toRegExpSource(e);return this.#s=this.#s||a,i}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#h(e,r,i=!1){let n=!1,s="",a=!1;for(let o=0;o<e.length;o++){let l=e.charAt(o);if(n){n=!1,s+=(v_.has(l)?"\\":"")+l;continue}if(l==="\\"){o===e.length-1?s+="\\\\":n=!0;continue}if(l==="["){let[u,c,h,d]=Hd(e,o);if(h){s+=u,a=a||c,o+=h-1,r=r||d;continue}}if(l==="*"){i&&e==="*"?s+=Yd:s+=Vd,r=!0;continue}if(l==="?"){s+=Eo,r=!0;continue}s+=__(l)}return[s,Be(e),!!r,a]}};var mr=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var _e=(t,e,r={})=>(li(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Oe(e,r).match(t)),S_=/^\*+([^+@!?\*\[\(]*)$/,E_=t=>e=>!e.startsWith(".")&&e.endsWith(t),R_=t=>e=>e.endsWith(t),x_=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),M_=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),T_=/^\*+\.\*+$/,O_=t=>!t.startsWith(".")&&t.includes("."),A_=t=>t!=="."&&t!==".."&&t.includes("."),k_=/^\.\*+$/,P_=t=>t!=="."&&t!==".."&&t.startsWith("."),D_=/^\*+$/,q_=t=>t.length!==0&&!t.startsWith("."),C_=t=>t.length!==0&&t!=="."&&t!=="..",L_=/^\?+([^+@!?\*\[\(]*)?$/,j_=([t,e=""])=>{let r=Zd([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},N_=([t,e=""])=>{let r=Qd([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},F_=([t,e=""])=>{let r=Qd([t]);return e?i=>r(i)&&i.endsWith(e):r},I_=([t,e=""])=>{let r=Zd([t]);return e?i=>r(i)&&i.endsWith(e):r},Zd=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},Qd=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},Xd=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Kd={win32:{sep:"\\"},posix:{sep:"/"}},$_=Xd==="win32"?Kd.win32.sep:Kd.posix.sep;_e.sep=$_;var he=Symbol("globstar **");_e.GLOBSTAR=he;var W_="[^/]",B_=W_+"*?",U_="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",z_="(?:(?!(?:\\/|^)\\.).)*?",H_=(t,e={})=>r=>_e(r,t,e);_e.filter=H_;var Le=(t,e={})=>Object.assign({},t,e),G_=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return _e;let e=_e;return Object.assign((i,n,s={})=>e(i,n,Le(t,s)),{Minimatch:class extends e.Minimatch{constructor(n,s={}){super(n,Le(t,s))}static defaults(n){return e.defaults(Le(t,n)).Minimatch}},AST:class extends e.AST{constructor(n,s,a={}){super(n,s,Le(t,a))}static fromGlob(n,s={}){return e.AST.fromGlob(n,Le(t,s))}},unescape:(i,n={})=>e.unescape(i,Le(t,n)),escape:(i,n={})=>e.escape(i,Le(t,n)),filter:(i,n={})=>e.filter(i,Le(t,n)),defaults:i=>e.defaults(Le(t,i)),makeRe:(i,n={})=>e.makeRe(i,Le(t,n)),braceExpand:(i,n={})=>e.braceExpand(i,Le(t,n)),match:(i,n,s={})=>e.match(i,n,Le(t,s)),sep:e.sep,GLOBSTAR:he})};_e.defaults=G_;var ep=(t,e={})=>(li(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Ud(t));_e.braceExpand=ep;var V_=(t,e={})=>new Oe(t,e).makeRe();_e.makeRe=V_;var Y_=(t,e,r={})=>{let i=new Oe(e,r);return t=t.filter(n=>i.match(n)),i.options.nonull&&!t.length&&t.push(e),t};_e.match=Y_;var Jd=/[?*]|[+@!]\(.*?\)|\[|\]/,K_=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Oe=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){li(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||Xd,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(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let 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);let i=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let n=this.globParts.map((s,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!Jd.test(s[2]))&&!Jd.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(c=>this.parse(c))];if(u)return[s[0],...s.slice(1).map(c=>this.parse(c))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,n),this.set=n.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let i=0;i<e.length;i++)for(let n=0;n<e[i].length;n++)e[i][n]==="**"&&(e[i][n]="*");let{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 i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let n=i;for(;r[n+1]==="**";)n++;n!==i&&r.splice(i,n-i)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((i,n)=>{let s=i[i.length-1];return n==="**"&&s==="**"?i:n===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(n),i)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let s=e[n];n===1&&s===""&&e[0]===""||(s==="."||s==="")&&(r=!0,e.splice(n,1),n--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let n=e[i-1];n&&n!=="."&&n!==".."&&n!=="**"&&(r=!0,e.splice(i-1,2),i-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let i of e){let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let a=n;for(;i[a+1]==="**";)a++;a>n&&i.splice(n+1,a-n);let o=i[n+1],l=i[n+2],u=i[n+3];if(o!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;r=!0,i.splice(n,1);let c=i.slice(0);c[n]="**",e.push(c),n--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let o=i[a];a===1&&o===""&&i[0]===""||(o==="."||o==="")&&(r=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(r=!0,i.pop())}let s=0;for(;(s=i.indexOf("..",s+1))!==-1;){let a=i[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){r=!0;let l=s===1&&i[s+1]==="**"?["."]:[];i.splice(s-1,2,...l),i.length===0&&i.push(""),s-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let i=r+1;i<e.length;i++){let n=this.partsMatch(e[r],e[i],!this.preserveMultipleSlashes);if(n){e[r]=[],e[i]=n;break}}return e.filter(r=>r.length)}partsMatch(e,r,i=!1){let n=0,s=0,a=[],o="";for(;n<e.length&&s<r.length;)if(e[n]===r[s])a.push(o==="b"?r[s]:e[n]),n++,s++;else if(i&&e[n]==="**"&&r[s]===e[n+1])a.push(e[n]),n++;else if(i&&r[s]==="**"&&e[n]===r[s+1])a.push(r[s]),s++;else if(e[n]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(o==="b")return!1;o="a",a.push(e[n]),n++,s++}else if(r[s]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(o==="a")return!1;o="b",a.push(r[s]),n++,s++}else return!1;return e.length===r.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,i=0;for(let n=0;n<e.length&&e.charAt(n)==="!";n++)r=!r,i++;i&&(this.pattern=e.slice(i)),this.negate=r}matchOne(e,r,i=!1){let n=this.options;if(this.isWindows){let b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),_=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),R=!E&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),x=_?3:b?0:void 0,M=R?3:E?0:void 0;if(typeof x=="number"&&typeof M=="number"){let[k,j]=[e[x],r[M]];k.toLowerCase()===j.toLowerCase()&&(r[M]=k,M>x?r=r.slice(M):x>M&&(e=e.slice(x)))}}let{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 a=0,o=0,l=e.length,u=r.length;a<l&&o<u;a++,o++){this.debug("matchOne loop");var c=r[o],h=e[a];if(this.debug(r,c,h),c===!1)return!1;if(c===he){this.debug("GLOBSTAR",[r,c,h]);var d=a,f=o+1;if(f===u){for(this.debug("** at the end");a<l;a++)if(e[a]==="."||e[a]===".."||!n.dot&&e[a].charAt(0)===".")return!1;return!0}for(;d<l;){var y=e[d];if(this.debug(`
38
38
  globstar while`,e,d,r,f,y),this.matchOne(e.slice(d),r.slice(f),i))return this.debug("globstar found match!",d,l,y),!0;if(y==="."||y===".."||!n.dot&&y.charAt(0)==="."){this.debug("dot detected!",e,d,r,f);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(i&&(this.debug(`
39
- >>> no match, partial?`,e,d,r,f),d===l))}let b;if(typeof c=="string"?(b=h===c,this.debug("string match",c,h,b)):(b=c.test(h),this.debug("pattern match",c,h,b)),!b)return!1}if(a===l&&o===u)return!0;if(a===l)return i;if(o===u)return a===l-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return ep(this.pattern,this.options)}parse(e){li(e);let r=this.options;if(e==="**")return he;if(e==="")return"";let i,n=null;(i=e.match(D_))?n=r.dot?C_:q_:(i=e.match(S_))?n=(r.nocase?r.dot?M_:x_:r.dot?R_:E_)(i[1]):(i=e.match(L_))?n=(r.nocase?r.dot?N_:j_:r.dot?F_:I_)(i):(i=e.match(T_))?n=r.dot?A_:O_:(i=e.match(k_))&&(n=P_);let s=gr.fromGlob(e,this.options).toMMPattern();return n&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:n}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,i=r.noglobstar?B_:r.dot?U_:z_,n=new Set(r.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(c=>{if(c instanceof RegExp)for(let h of c.flags.split(""))n.add(h);return typeof c=="string"?K_(c):c===he?he:c._src});return u.forEach((c,h)=>{let d=u[h+1],f=u[h-1];c!==he||f===he||(f===void 0?d!==void 0&&d!==he?u[h+1]="(?:\\/|"+i+"\\/)?"+d:u[h]=i:d===void 0?u[h-1]=f+"(?:\\/|"+i+")?":d!==he&&(u[h-1]=f+"(?:\\/|\\/"+i+"\\/)"+d,u[h+1]=he))}),u.filter(c=>c!==he).join("/")}).join("|"),[a,o]=e.length>1?["(?:",")"]:["",""];s="^"+a+s+o+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...n].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;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let n=this.slashSplit(e);this.debug(this.pattern,"split",n);let s=this.set;this.debug(this.pattern,"set",s);let a=n[n.length-1];if(!a)for(let o=n.length-2;!a&&o>=0;o--)a=n[o];for(let o=0;o<s.length;o++){let l=s[o],u=n;if(i.matchBase&&l.length===1&&(u=[a]),this.matchOne(u,l,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return _e.defaults(e).Minimatch}};_e.AST=gr;_e.Minimatch=Oe;_e.escape=mr;_e.unescape=Be;import{fileURLToPath as TS}from"node:url";var yr=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,rp=new Set,Ro=typeof process=="object"&&process?process:{},ip=(t,e,r,i)=>{typeof Ro.emitWarning=="function"?Ro.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`)},Qn=globalThis.AbortController,tp=globalThis.AbortSignal;if(typeof Qn>"u"){tp=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,n){this._onabort.push(n)}},Qn=class{constructor(){e()}signal=new tp;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let n of this.signal._onabort)n(i);this.signal.onabort?.(i)}}};let t=Ro.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,ip("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var J_=t=>!rp.has(t),ix=Symbol("type"),St=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),np=t=>St(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?br:null:null,br=class extends Array{constructor(e){super(e),this.fill(0)}},xo=class t{heap;length;static#e=!1;static create(e){let r=np(e);if(!r)return[];t.#e=!0;let i=new t(e,r);return t.#e=!1,i}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},fi=class t{#e;#t;#s;#i;#a;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#c;#o;#l;#n;#m;#y;#d;#h;#E;#g;#R;#x;#w;#_;#S;#p;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#w,sizes:e.#R,keyMap:e.#o,keyList:e.#l,valList:e.#n,next:e.#m,prev:e.#y,get head(){return e.#d},get tail(){return e.#h},free:e.#E,isBackgroundFetch:r=>e.#f(r),backgroundFetch:(r,i,n,s)=>e.#F(r,i,n,s),moveToTail:r=>e.#$(r),indexes:r=>e.#T(r),rindexes:r=>e.#O(r),isStale:r=>e.#b(r)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#c}get size(){return this.#u}get fetchMethod(){return this.#a}get memoMethod(){return this.#v}get dispose(){return this.#s}get disposeAfter(){return this.#i}constructor(e){let{max:r=0,ttl:i,ttlResolution:n=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:o,allowStale:l,dispose:u,disposeAfter:c,noDisposeOnSet:h,noUpdateTTL:d,maxSize:f=0,maxEntrySize:y=0,sizeCalculation:b,fetchMethod:_,memoMethod:E,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:x,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:k,ignoreFetchAbort:j}=e;if(r!==0&&!St(r))throw new TypeError("max option must be a nonnegative integer");let U=r?np(r):Array;if(!U)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=f,this.maxEntrySize=y||this.#t,this.sizeCalculation=b,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=E,_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=_,this.#S=!!_,this.#o=new Map,this.#l=new Array(r).fill(void 0),this.#n=new Array(r).fill(void 0),this.#m=new U(r),this.#y=new U(r),this.#d=0,this.#h=0,this.#E=xo.create(r),this.#u=0,this.#c=0,typeof u=="function"&&(this.#s=u),typeof c=="function"?(this.#i=c,this.#g=[]):(this.#i=void 0,this.#g=void 0),this.#_=!!this.#s,this.#p=!!this.#i,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!j,this.maxEntrySize!==0){if(this.#t!==0&&!St(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!St(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#k()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!x,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!o,this.ttlResolution=St(n)||n===0?n:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!St(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#A()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let F="LRU_CACHE_UNBOUNDED";J_(F)&&(rp.add(F),ip("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",F,t))}}getRemainingTTL(e){return this.#o.has(e)?1/0:0}#A(){let e=new br(this.#e),r=new br(this.#e);this.#w=e,this.#x=r,this.#D=(s,a,o=yr.now())=>{if(r[s]=a!==0?o:0,e[s]=a,a!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#b(s)&&this.#P(this.#l[s],"expire")},a+1);l.unref&&l.unref()}},this.#M=s=>{r[s]=e[s]!==0?yr.now():0},this.#r=(s,a)=>{if(e[a]){let o=e[a],l=r[a];if(!o||!l)return;s.ttl=o,s.start=l,s.now=i||n();let u=s.now-l;s.remainingTTL=o-u}};let i=0,n=()=>{let s=yr.now();if(this.ttlResolution>0){i=s;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return s};this.getRemainingTTL=s=>{let a=this.#o.get(s);if(a===void 0)return 0;let o=e[a],l=r[a];if(!o||!l)return 1/0;let u=(i||n())-l;return o-u},this.#b=s=>{let a=r[s],o=e[s];return!!o&&!!a&&(i||n())-a>o}}#M=()=>{};#r=()=>{};#D=()=>{};#b=()=>!1;#k(){let e=new br(this.#e);this.#c=0,this.#R=e,this.#q=r=>{this.#c-=e[r],e[r]=0},this.#L=(r,i,n,s)=>{if(this.#f(i))return 0;if(!St(n))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(n=s(i,r),!St(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n},this.#C=(r,i,n)=>{if(e[r]=i,this.#t){let s=this.#t-e[r];for(;this.#c>s;)this.#N(!0)}this.#c+=e[r],n&&(n.entrySize=i,n.totalCalculatedSize=this.#c)}}#q=e=>{};#C=(e,r,i)=>{};#L=(e,r,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:e=this.allowStale}={}){if(this.#u)for(let r=this.#h;!(!this.#j(r)||((e||!this.#b(r))&&(yield r),r===this.#d));)r=this.#y[r]}*#O({allowStale:e=this.allowStale}={}){if(this.#u)for(let r=this.#d;!(!this.#j(r)||((e||!this.#b(r))&&(yield r),r===this.#h));)r=this.#m[r]}#j(e){return e!==void 0&&this.#o.get(this.#l[e])===e}*entries(){for(let e of this.#T())this.#n[e]!==void 0&&this.#l[e]!==void 0&&!this.#f(this.#n[e])&&(yield[this.#l[e],this.#n[e]])}*rentries(){for(let e of this.#O())this.#n[e]!==void 0&&this.#l[e]!==void 0&&!this.#f(this.#n[e])&&(yield[this.#l[e],this.#n[e]])}*keys(){for(let e of this.#T()){let r=this.#l[e];r!==void 0&&!this.#f(this.#n[e])&&(yield r)}}*rkeys(){for(let e of this.#O()){let r=this.#l[e];r!==void 0&&!this.#f(this.#n[e])&&(yield r)}}*values(){for(let e of this.#T())this.#n[e]!==void 0&&!this.#f(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#O())this.#n[e]!==void 0&&!this.#f(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let i of this.#T()){let n=this.#n[i],s=this.#f(n)?n.__staleWhileFetching:n;if(s!==void 0&&e(s,this.#l[i],this))return this.get(this.#l[i],r)}}forEach(e,r=this){for(let i of this.#T()){let n=this.#n[i],s=this.#f(n)?n.__staleWhileFetching:n;s!==void 0&&e.call(r,s,this.#l[i],this)}}rforEach(e,r=this){for(let i of this.#O()){let n=this.#n[i],s=this.#f(n)?n.__staleWhileFetching:n;s!==void 0&&e.call(r,s,this.#l[i],this)}}purgeStale(){let e=!1;for(let r of this.#O({allowStale:!0}))this.#b(r)&&(this.#P(this.#l[r],"expire"),e=!0);return e}info(e){let r=this.#o.get(e);if(r===void 0)return;let i=this.#n[r],n=this.#f(i)?i.__staleWhileFetching:i;if(n===void 0)return;let s={value:n};if(this.#w&&this.#x){let a=this.#w[r],o=this.#x[r];if(a&&o){let l=a-(yr.now()-o);s.ttl=l,s.start=Date.now()}}return this.#R&&(s.size=this.#R[r]),s}dump(){let e=[];for(let r of this.#T({allowStale:!0})){let i=this.#l[r],n=this.#n[r],s=this.#f(n)?n.__staleWhileFetching:n;if(s===void 0||i===void 0)continue;let a={value:s};if(this.#w&&this.#x){a.ttl=this.#w[r];let o=yr.now()-this.#x[r];a.start=Math.floor(Date.now()-o)}this.#R&&(a.size=this.#R[r]),e.unshift([i,a])}return e}load(e){this.clear();for(let[r,i]of e){if(i.start){let n=Date.now()-i.start;i.start=yr.now()-n}this.set(r,i.value,i)}}set(e,r,i={}){if(r===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:s,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:l}=i,{noUpdateTTL:u=this.noUpdateTTL}=i,c=this.#L(e,r,i.size||0,o);if(this.maxEntrySize&&c>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let h=this.#u===0?void 0:this.#o.get(e);if(h===void 0)h=this.#u===0?this.#h:this.#E.length!==0?this.#E.pop():this.#u===this.#e?this.#N(!1):this.#u,this.#l[h]=e,this.#n[h]=r,this.#o.set(e,h),this.#m[this.#h]=h,this.#y[h]=this.#h,this.#h=h,this.#u++,this.#C(h,c,l),l&&(l.set="add"),u=!1;else{this.#$(h);let d=this.#n[h];if(r!==d){if(this.#S&&this.#f(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=d;f!==void 0&&!a&&(this.#_&&this.#s?.(f,e,"set"),this.#p&&this.#g?.push([f,e,"set"]))}else a||(this.#_&&this.#s?.(d,e,"set"),this.#p&&this.#g?.push([d,e,"set"]));if(this.#q(h),this.#C(h,c,l),this.#n[h]=r,l){l.set="replace";let f=d&&this.#f(d)?d.__staleWhileFetching:d;f!==void 0&&(l.oldValue=f)}}else l&&(l.set="update")}if(n!==0&&!this.#w&&this.#A(),this.#w&&(u||this.#D(h,n,s),l&&this.#r(l,h)),!a&&this.#p&&this.#g){let d=this.#g,f;for(;f=d?.shift();)this.#i?.(...f)}return this}pop(){try{for(;this.#u;){let e=this.#n[this.#d];if(this.#N(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#g){let e=this.#g,r;for(;r=e?.shift();)this.#i?.(...r)}}}#N(e){let r=this.#d,i=this.#l[r],n=this.#n[r];return this.#S&&this.#f(n)?n.__abortController.abort(new Error("evicted")):(this.#_||this.#p)&&(this.#_&&this.#s?.(n,i,"evict"),this.#p&&this.#g?.push([n,i,"evict"])),this.#q(r),e&&(this.#l[r]=void 0,this.#n[r]=void 0,this.#E.push(r)),this.#u===1?(this.#d=this.#h=0,this.#E.length=0):this.#d=this.#m[r],this.#o.delete(i),this.#u--,r}has(e,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=r,s=this.#o.get(e);if(s!==void 0){let a=this.#n[s];if(this.#f(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#b(s))n&&(n.has="stale",this.#r(n,s));else return i&&this.#M(s),n&&(n.has="hit",this.#r(n,s)),!0}else n&&(n.has="miss");return!1}peek(e,r={}){let{allowStale:i=this.allowStale}=r,n=this.#o.get(e);if(n===void 0||!i&&this.#b(n))return;let s=this.#n[n];return this.#f(s)?s.__staleWhileFetching:s}#F(e,r,i,n){let s=r===void 0?void 0:this.#n[r];if(this.#f(s))return s;let a=new Qn,{signal:o}=i;o?.addEventListener("abort",()=>a.abort(o.reason),{signal:a.signal});let l={signal:a.signal,options:i,context:n},u=(b,_=!1)=>{let{aborted:E}=a.signal,R=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(E&&!_?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,R&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),E&&!R&&!_)return h(a.signal.reason);let x=f;return this.#n[r]===f&&(b===void 0?x.__staleWhileFetching?this.#n[r]=x.__staleWhileFetching:this.#P(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,b,l.options))),b},c=b=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=b),h(b)),h=b=>{let{aborted:_}=a.signal,E=_&&i.allowStaleOnFetchAbort,R=E||i.allowStaleOnFetchRejection,x=R||i.noDeleteOnFetchRejection,M=f;if(this.#n[r]===f&&(!x||M.__staleWhileFetching===void 0?this.#P(e,"fetch"):E||(this.#n[r]=M.__staleWhileFetching)),R)return i.status&&M.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),M.__staleWhileFetching;if(M.__returned===M)throw b},d=(b,_)=>{let E=this.#a?.(e,s,l);E&&E instanceof Promise&&E.then(R=>b(R===void 0?void 0:R),_),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=R=>u(R,!0)))})};i.status&&(i.status.fetchDispatched=!0);let f=new Promise(d).then(u,c),y=Object.assign(f,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,y,{...l.options,status:void 0}),r=this.#o.get(e)):this.#n[r]=y,y}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Qn}async fetch(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:b,forceRefresh:_=!1,status:E,signal:R}=r;if(!this.#S)return E&&(E.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,status:E});let x={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,ttl:a,noDisposeOnSet:o,size:l,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:f,status:E,signal:R},M=this.#o.get(e);if(M===void 0){E&&(E.fetch="miss");let k=this.#F(e,M,x,b);return k.__returned=k}else{let k=this.#n[M];if(this.#f(k)){let ne=i&&k.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",ne&&(E.returnedStale=!0)),ne?k.__staleWhileFetching:k.__returned=k}let j=this.#b(M);if(!_&&!j)return E&&(E.fetch="hit"),this.#$(M),n&&this.#M(M),E&&this.#r(E,M),k;let U=this.#F(e,M,x,b),G=U.__staleWhileFetching!==void 0&&i;return E&&(E.fetch=j?"stale":"refresh",G&&j&&(E.returnedStale=!0)),G?U.__staleWhileFetching:U.__returned=U}}async forceFetch(e,r={}){let i=await this.fetch(e,r);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,r={}){let i=this.#v;if(!i)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:s,...a}=r,o=this.get(e,a);if(!s&&o!==void 0)return o;let l=i(e,o,{options:a,context:n});return this.set(e,l,a),l}get(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:a}=r,o=this.#o.get(e);if(o!==void 0){let l=this.#n[o],u=this.#f(l);return a&&this.#r(a,o),this.#b(o)?(a&&(a.get="stale"),u?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?l.__staleWhileFetching:void 0):(s||this.#P(e,"expire"),a&&i&&(a.returnedStale=!0),i?l:void 0)):(a&&(a.get="hit"),u?l.__staleWhileFetching:(this.#$(o),n&&this.#M(o),l))}else a&&(a.get="miss")}#I(e,r){this.#y[r]=e,this.#m[e]=r}#$(e){e!==this.#h&&(e===this.#d?this.#d=this.#m[e]:this.#I(this.#y[e],this.#m[e]),this.#I(this.#h,e),this.#h=e)}delete(e){return this.#P(e,"delete")}#P(e,r){let i=!1;if(this.#u!==0){let n=this.#o.get(e);if(n!==void 0)if(i=!0,this.#u===1)this.#W(r);else{this.#q(n);let s=this.#n[n];if(this.#f(s)?s.__abortController.abort(new Error("deleted")):(this.#_||this.#p)&&(this.#_&&this.#s?.(s,e,r),this.#p&&this.#g?.push([s,e,r])),this.#o.delete(e),this.#l[n]=void 0,this.#n[n]=void 0,n===this.#h)this.#h=this.#y[n];else if(n===this.#d)this.#d=this.#m[n];else{let a=this.#y[n];this.#m[a]=this.#m[n];let o=this.#m[n];this.#y[o]=this.#y[n]}this.#u--,this.#E.push(n)}}if(this.#p&&this.#g?.length){let n=this.#g,s;for(;s=n?.shift();)this.#i?.(...s)}return i}clear(){return this.#W("delete")}#W(e){for(let r of this.#O({allowStale:!0})){let i=this.#n[r];if(this.#f(i))i.__abortController.abort(new Error("deleted"));else{let n=this.#l[r];this.#_&&this.#s?.(i,n,e),this.#p&&this.#g?.push([i,n,e])}}if(this.#o.clear(),this.#n.fill(void 0),this.#l.fill(void 0),this.#w&&this.#x&&(this.#w.fill(0),this.#x.fill(0)),this.#R&&this.#R.fill(0),this.#d=0,this.#h=0,this.#E.length=0,this.#c=0,this.#u=0,this.#p&&this.#g){let r=this.#g,i;for(;i=r?.shift();)this.#i?.(...i)}}};import{posix as oS,win32 as Lo}from"node:path";import{fileURLToPath as lS}from"node:url";import{lstatSync as uS,readdir as fS,readdirSync as cS,readlinkSync as hS,realpathSync as dS}from"fs";import*as pS from"node:fs";import{lstat as mS,readdir as yS,readlink as bS,realpath as wS}from"node:fs/promises";import{EventEmitter as Do}from"node:events";import up from"node:stream";import{StringDecoder as Z_}from"node:string_decoder";var sp=typeof process=="object"&&process?process:{stdout:null,stderr:null},Q_=t=>!!t&&typeof t=="object"&&(t instanceof Rt||t instanceof up||X_(t)||eS(t)),X_=t=>!!t&&typeof t=="object"&&t instanceof Do&&typeof t.pipe=="function"&&t.pipe!==up.Writable.prototype.pipe,eS=t=>!!t&&typeof t=="object"&&t instanceof Do&&typeof t.write=="function"&&typeof t.end=="function",nt=Symbol("EOF"),st=Symbol("maybeEmitEnd"),Et=Symbol("emittedEnd"),Xn=Symbol("emittingEnd"),ci=Symbol("emittedError"),es=Symbol("closed"),ap=Symbol("read"),ts=Symbol("flush"),op=Symbol("flushChunk"),Ue=Symbol("encoding"),wr=Symbol("decoder"),ae=Symbol("flowing"),hi=Symbol("paused"),vr=Symbol("resume"),oe=Symbol("buffer"),Se=Symbol("pipes"),le=Symbol("bufferLength"),Mo=Symbol("bufferPush"),rs=Symbol("bufferShift"),ge=Symbol("objectMode"),ee=Symbol("destroyed"),To=Symbol("error"),Oo=Symbol("emitData"),lp=Symbol("emitEnd"),Ao=Symbol("emitEnd2"),Qe=Symbol("async"),ko=Symbol("abort"),is=Symbol("aborted"),di=Symbol("signal"),Vt=Symbol("dataListeners"),Ae=Symbol("discarded"),pi=t=>Promise.resolve().then(t),tS=t=>t(),rS=t=>t==="end"||t==="finish"||t==="prefinish",iS=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,nS=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),ns=class{src;dest;opts;ondrain;constructor(e,r,i){this.src=e,this.dest=r,this.opts=i,this.ondrain=()=>e[vr](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Po=class extends ns{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,i){super(e,r,i),this.proxyErrors=n=>r.emit("error",n),e.on("error",this.proxyErrors)}},sS=t=>!!t.objectMode,aS=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Rt=class extends Do{[ae]=!1;[hi]=!1;[Se]=[];[oe]=[];[ge];[Ue];[Qe];[wr];[nt]=!1;[Et]=!1;[Xn]=!1;[es]=!1;[ci]=null;[le]=0;[ee]=!1;[di];[is]=!1;[Vt]=0;[Ae]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");sS(r)?(this[ge]=!0,this[Ue]=null):aS(r)?(this[Ue]=r.encoding,this[ge]=!1):(this[ge]=!1,this[Ue]=null),this[Qe]=!!r.async,this[wr]=this[Ue]?new Z_(this[Ue]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[oe]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Se]});let{signal:i}=r;i&&(this[di]=i,i.aborted?this[ko]():i.addEventListener("abort",()=>this[ko]()))}get bufferLength(){return this[le]}get encoding(){return this[Ue]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[ge]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Qe]}set async(e){this[Qe]=this[Qe]||!!e}[ko](){this[is]=!0,this.emit("abort",this[di]?.reason),this.destroy(this[di]?.reason)}get aborted(){return this[is]}set aborted(e){}write(e,r,i){if(this[is])return!1;if(this[nt])throw new Error("write after end");if(this[ee])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(i=r,r="utf8"),r||(r="utf8");let n=this[Qe]?pi:tS;if(!this[ge]&&!Buffer.isBuffer(e)){if(nS(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(iS(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[ge]?(this[ae]&&this[le]!==0&&this[ts](!0),this[ae]?this.emit("data",e):this[Mo](e),this[le]!==0&&this.emit("readable"),i&&n(i),this[ae]):e.length?(typeof e=="string"&&!(r===this[Ue]&&!this[wr]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[Ue]&&(e=this[wr].write(e)),this[ae]&&this[le]!==0&&this[ts](!0),this[ae]?this.emit("data",e):this[Mo](e),this[le]!==0&&this.emit("readable"),i&&n(i),this[ae]):(this[le]!==0&&this.emit("readable"),i&&n(i),this[ae])}read(e){if(this[ee])return null;if(this[Ae]=!1,this[le]===0||e===0||e&&e>this[le])return this[st](),null;this[ge]&&(e=null),this[oe].length>1&&!this[ge]&&(this[oe]=[this[Ue]?this[oe].join(""):Buffer.concat(this[oe],this[le])]);let r=this[ap](e||null,this[oe][0]);return this[st](),r}[ap](e,r){if(this[ge])this[rs]();else{let i=r;e===i.length||e===null?this[rs]():typeof i=="string"?(this[oe][0]=i.slice(e),r=i.slice(0,e),this[le]-=e):(this[oe][0]=i.subarray(e),r=i.subarray(0,e),this[le]-=e)}return this.emit("data",r),!this[oe].length&&!this[nt]&&this.emit("drain"),r}end(e,r,i){return typeof e=="function"&&(i=e,e=void 0),typeof r=="function"&&(i=r,r="utf8"),e!==void 0&&this.write(e,r),i&&this.once("end",i),this[nt]=!0,this.writable=!1,(this[ae]||!this[hi])&&this[st](),this}[vr](){this[ee]||(!this[Vt]&&!this[Se].length&&(this[Ae]=!0),this[hi]=!1,this[ae]=!0,this.emit("resume"),this[oe].length?this[ts]():this[nt]?this[st]():this.emit("drain"))}resume(){return this[vr]()}pause(){this[ae]=!1,this[hi]=!0,this[Ae]=!1}get destroyed(){return this[ee]}get flowing(){return this[ae]}get paused(){return this[hi]}[Mo](e){this[ge]?this[le]+=1:this[le]+=e.length,this[oe].push(e)}[rs](){return this[ge]?this[le]-=1:this[le]-=this[oe][0].length,this[oe].shift()}[ts](e=!1){do;while(this[op](this[rs]())&&this[oe].length);!e&&!this[oe].length&&!this[nt]&&this.emit("drain")}[op](e){return this.emit("data",e),this[ae]}pipe(e,r){if(this[ee])return e;this[Ae]=!1;let i=this[Et];return r=r||{},e===sp.stdout||e===sp.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,i?r.end&&e.end():(this[Se].push(r.proxyErrors?new Po(this,e,r):new ns(this,e,r)),this[Qe]?pi(()=>this[vr]()):this[vr]()),e}unpipe(e){let r=this[Se].find(i=>i.dest===e);r&&(this[Se].length===1?(this[ae]&&this[Vt]===0&&(this[ae]=!1),this[Se]=[]):this[Se].splice(this[Se].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let i=super.on(e,r);if(e==="data")this[Ae]=!1,this[Vt]++,!this[Se].length&&!this[ae]&&this[vr]();else if(e==="readable"&&this[le]!==0)super.emit("readable");else if(rS(e)&&this[Et])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[ci]){let n=r;this[Qe]?pi(()=>n.call(this,this[ci])):n.call(this,this[ci])}return i}removeListener(e,r){return this.off(e,r)}off(e,r){let i=super.off(e,r);return e==="data"&&(this[Vt]=this.listeners("data").length,this[Vt]===0&&!this[Ae]&&!this[Se].length&&(this[ae]=!1)),i}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Vt]=0,!this[Ae]&&!this[Se].length&&(this[ae]=!1)),r}get emittedEnd(){return this[Et]}[st](){!this[Xn]&&!this[Et]&&!this[ee]&&this[oe].length===0&&this[nt]&&(this[Xn]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[es]&&this.emit("close"),this[Xn]=!1)}emit(e,...r){let i=r[0];if(e!=="error"&&e!=="close"&&e!==ee&&this[ee])return!1;if(e==="data")return!this[ge]&&!i?!1:this[Qe]?(pi(()=>this[Oo](i)),!0):this[Oo](i);if(e==="end")return this[lp]();if(e==="close"){if(this[es]=!0,!this[Et]&&!this[ee])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[ci]=i,super.emit(To,i);let s=!this[di]||this.listeners("error").length?super.emit("error",i):!1;return this[st](),s}else if(e==="resume"){let s=super.emit("resume");return this[st](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let n=super.emit(e,...r);return this[st](),n}[Oo](e){for(let i of this[Se])i.dest.write(e)===!1&&this.pause();let r=this[Ae]?!1:super.emit("data",e);return this[st](),r}[lp](){return this[Et]?!1:(this[Et]=!0,this.readable=!1,this[Qe]?(pi(()=>this[Ao]()),!0):this[Ao]())}[Ao](){if(this[wr]){let r=this[wr].end();if(r){for(let i of this[Se])i.dest.write(r);this[Ae]||super.emit("data",r)}}for(let r of this[Se])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[ge]||(e.dataLength=0);let r=this.promise();return this.on("data",i=>{e.push(i),this[ge]||(e.dataLength+=i.length)}),await r,e}async concat(){if(this[ge])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Ue]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(ee,()=>r(new Error("stream destroyed"))),this.on("error",i=>r(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Ae]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[nt])return r();let s,a,o=h=>{this.off("data",l),this.off("end",u),this.off(ee,c),r(),a(h)},l=h=>{this.off("error",o),this.off("end",u),this.off(ee,c),this.pause(),s({value:h,done:!!this[nt]})},u=()=>{this.off("error",o),this.off("data",l),this.off(ee,c),r(),s({done:!0,value:void 0})},c=()=>o(new Error("stream destroyed"));return new Promise((h,d)=>{a=d,s=h,this.once(ee,c),this.once("error",o),this.once("end",u),this.once("data",l)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Ae]=!1;let e=!1,r=()=>(this.pause(),this.off(To,r),this.off(ee,r),this.off("end",r),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return r();let n=this.read();return n===null?r():{done:!1,value:n}};return this.once("end",r),this.once(To,r),this.once(ee,r),{next:i,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[ee])return e?this.emit("error",e):this.emit(ee),this;this[ee]=!0,this[Ae]=!0,this[oe].length=0,this[le]=0;let r=this;return typeof r.close=="function"&&!this[es]&&r.close(),e?this.emit("error",e):this.emit(ee),this}static get isStream(){return Q_}};var gS=dS.native,mi={lstatSync:uS,readdir:fS,readdirSync:cS,readlinkSync:hS,realpathSync:gS,promises:{lstat:mS,readdir:yS,readlink:bS,realpath:wS}},pp=t=>!t||t===mi||t===pS?mi:{...mi,...t,promises:{...mi.promises,...t.promises||{}}},gp=/^\\\\\?\\([a-z]:)\\?$/i,vS=t=>t.replace(/\//g,"\\").replace(gp,"$1\\"),_S=/[\\\/]/,Ne=0,mp=1,yp=2,Xe=4,bp=6,wp=8,Yt=10,vp=12,je=15,gi=~je,qo=16,fp=32,yi=64,ze=128,ss=256,os=512,cp=yi|ze|os,SS=1023,Co=t=>t.isFile()?wp:t.isDirectory()?Xe:t.isSymbolicLink()?Yt:t.isCharacterDevice()?yp:t.isBlockDevice()?bp:t.isSocket()?vp:t.isFIFO()?mp:Ne,hp=new Map,bi=t=>{let e=hp.get(t);if(e)return e;let r=t.normalize("NFKD");return hp.set(t,r),r},dp=new Map,as=t=>{let e=dp.get(t);if(e)return e;let r=bi(t.toLowerCase());return dp.set(t,r),r},ls=class extends fi{constructor(){super({max:256})}},jo=class extends fi{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},_p=Symbol("PathScurry setAsCwd"),me=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#i;get nlink(){return this.#i}#a;get uid(){return this.#a}#v;get gid(){return this.#v}#u;get rdev(){return this.#u}#c;get blksize(){return this.#c}#o;get ino(){return this.#o}#l;get size(){return this.#l}#n;get blocks(){return this.#n}#m;get atimeMs(){return this.#m}#y;get mtimeMs(){return this.#y}#d;get ctimeMs(){return this.#d}#h;get birthtimeMs(){return this.#h}#E;get atime(){return this.#E}#g;get mtime(){return this.#g}#R;get ctime(){return this.#R}#x;get birthtime(){return this.#x}#w;#_;#S;#p;#A;#M;#r;#D;#b;#k;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=Ne,i,n,s,a,o){this.name=e,this.#w=s?as(e):bi(e),this.#r=r&SS,this.nocase=s,this.roots=n,this.root=i||this,this.#D=a,this.#S=o.fullpath,this.#A=o.relative,this.#M=o.relativePosix,this.parent=o.parent,this.parent?this.#e=this.parent.#e:this.#e=pp(o.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#D}resolve(e){if(!e)return this;let r=this.getRootString(e),n=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#q(n):this.#q(n)}#q(e){let r=this;for(let i of e)r=r.child(i);return r}children(){let e=this.#D.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#D.set(this,r),this.#r&=~qo,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),n=this.nocase?as(e):bi(e);for(let l of i)if(l.#w===n)return l;let s=this.parent?this.sep:"",a=this.#S?this.#S+s+e:void 0,o=this.newChild(e,Ne,{...r,parent:this,fullpath:a});return this.canReaddir()||(o.#r|=ze),i.push(o),o}relative(){if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let e=this.name,r=this.parent;if(!r)return this.#A=this.name;let i=r.relative();return i+(!i||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#M!==void 0)return this.#M;let e=this.name,r=this.parent;if(!r)return this.#M=this.fullpathPosix();let i=r.relativePosix();return i+(!i||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let n=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=n}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let n=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(n)?this.#p=`//?/${n}`:this.#p=n}let e=this.parent,r=e.fullpathPosix(),i=r+(!r||!e.parent?"":"/")+this.name;return this.#p=i}isUnknown(){return(this.#r&je)===Ne}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#r&je)===wp}isDirectory(){return(this.#r&je)===Xe}isCharacterDevice(){return(this.#r&je)===yp}isBlockDevice(){return(this.#r&je)===bp}isFIFO(){return(this.#r&je)===mp}isSocket(){return(this.#r&je)===vp}isSymbolicLink(){return(this.#r&Yt)===Yt}lstatCached(){return this.#r&fp?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#k}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#r&je;return!(e!==Ne&&e!==Yt||this.#r&ss||this.#r&ze)}calledReaddir(){return!!(this.#r&qo)}isENOENT(){return!!(this.#r&ze)}isNamed(e){return this.nocase?this.#w===as(e):this.#w===bi(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(r);if(i)return this.#b=i}catch(r){this.#f(r.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(r);if(i)return this.#b=i}catch(r){this.#f(r.code);return}}#C(e){this.#r|=qo;for(let r=e.provisional;r<e.length;r++){let i=e[r];i&&i.#L()}}#L(){this.#r&ze||(this.#r=(this.#r|ze)&gi,this.#T())}#T(){let e=this.children();e.provisional=0;for(let r of e)r.#L()}#O(){this.#r|=os,this.#j()}#j(){if(this.#r&yi)return;let e=this.#r;(e&je)===Xe&&(e&=gi),this.#r=e|yi,this.#T()}#N(e=""){e==="ENOTDIR"||e==="EPERM"?this.#j():e==="ENOENT"?this.#L():this.children().provisional=0}#F(e=""){e==="ENOTDIR"?this.parent.#j():e==="ENOENT"&&this.#L()}#f(e=""){let r=this.#r;r|=ss,e==="ENOENT"&&(r|=ze),(e==="EINVAL"||e==="UNKNOWN")&&(r&=gi),this.#r=r,e==="ENOTDIR"&&this.parent&&this.parent.#j()}#I(e,r){return this.#P(e,r)||this.#$(e,r)}#$(e,r){let i=Co(e),n=this.newChild(e.name,i,{parent:this}),s=n.#r&je;return s!==Xe&&s!==Yt&&s!==Ne&&(n.#r|=yi),r.unshift(n),r.provisional++,n}#P(e,r){for(let i=r.provisional;i<r.length;i++){let n=r[i];if((this.nocase?as(e.name):bi(e.name))===n.#w)return this.#W(e,n,i,r)}}#W(e,r,i,n){let s=r.name;return r.#r=r.#r&gi|Co(e),s!==e.name&&(r.name=e.name),i!==n.provisional&&(i===n.length-1?n.pop():n.splice(i,1),n.unshift(r)),n.provisional++,r}async lstat(){if((this.#r&ze)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if((this.#r&ze)===0)try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#F(e.code)}}#H(e){let{atime:r,atimeMs:i,birthtime:n,birthtimeMs:s,blksize:a,blocks:o,ctime:l,ctimeMs:u,dev:c,gid:h,ino:d,mode:f,mtime:y,mtimeMs:b,nlink:_,rdev:E,size:R,uid:x}=e;this.#E=r,this.#m=i,this.#x=n,this.#h=s,this.#c=a,this.#n=o,this.#R=l,this.#d=u,this.#t=c,this.#v=h,this.#o=d,this.#s=f,this.#g=y,this.#y=b,this.#i=_,this.#u=E,this.#l=R,this.#a=x;let M=Co(e);this.#r=this.#r&gi|M|fp,M!==Ne&&M!==Xe&&M!==Yt&&(this.#r|=yi)}#U=[];#z=!1;#G(e){this.#z=!1;let r=this.#U.slice();this.#U.length=0,r.forEach(i=>i(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let s=i.slice(0,i.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#U.push(e),this.#z)return;this.#z=!0;let n=this.fullpath();this.#e.readdir(n,{withFileTypes:!0},(s,a)=>{if(s)this.#N(s.code),i.provisional=0;else{for(let o of a)this.#I(o,i);this.#C(i)}this.#G(i.slice(0,i.provisional))})}#B;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#B)await this.#B;else{let i=()=>{};this.#B=new Promise(n=>i=n);try{for(let n of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#I(n,e);this.#C(e)}catch(n){this.#N(n.code),e.provisional=0}this.#B=void 0,i()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let i of this.#e.readdirSync(r,{withFileTypes:!0}))this.#I(i,e);this.#C(e)}catch(i){this.#N(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#r&cp)return!1;let e=je&this.#r;return e===Ne||e===Xe||e===Yt}shouldWalk(e,r){return(this.#r&Xe)===Xe&&!(this.#r&cp)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#k)return this.#k;if(!((os|ss|ze)&this.#r))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#k=this.resolve(e)}catch{this.#O()}}realpathSync(){if(this.#k)return this.#k;if(!((os|ss|ze)&this.#r))try{let e=this.#e.realpathSync(this.fullpath());return this.#k=this.resolve(e)}catch{this.#O()}}[_p](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),i=[],n=this;for(;n&&n.parent;)r.add(n),n.#A=i.join(this.sep),n.#M=i.join("/"),n=n.parent,i.push("..");for(n=e;n&&n.parent&&!r.has(n);)n.#A=void 0,n.#M=void 0,n=n.parent}},us=class t extends me{sep="\\";splitSep=_S;constructor(e,r=Ne,i,n,s,a,o){super(e,r,i,n,s,a,o)}newChild(e,r=Ne,i={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return Lo.parse(e).root}getRoot(e){if(e=vS(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,i]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=i;return this.roots[e]=new _r(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(gp,"$1\\"),e===r}},fs=class t extends me{splitSep="/";sep="/";constructor(e,r=Ne,i,n,s,a,o){super(e,r,i,n,s,a,o)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=Ne,i={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}},cs=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#i;constructor(e=process.cwd(),r,i,{nocase:n,childrenCacheSize:s=16*1024,fs:a=mi}={}){this.#i=pp(a),(e instanceof URL||e.startsWith("file://"))&&(e=lS(e));let o=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#e=new ls,this.#t=new ls,this.#s=new jo(s);let l=o.substring(this.rootPath.length).split(i);if(l.length===1&&!l[0]&&l.pop(),n===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=n,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let u=this.root,c=l.length-1,h=r.sep,d=this.rootPath,f=!1;for(let y of l){let b=c--;u=u.child(y,{relative:new Array(b).fill("..").join(h),relativePosix:new Array(b).fill("..").join("/"),fullpath:d+=(f?"":h)+y}),f=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let i=this.#e.get(r);if(i!==void 0)return i;let n=this.cwd.resolve(r).fullpath();return this.#e.set(r,n),n}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let i=this.#t.get(r);if(i!==void 0)return i;let n=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,n),n}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i}=r;if(e.canReaddir()){let n=await e.readdir();return i?n:n.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0}=r;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(n=>n.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e.withFileTypes,e=this.cwd);let i=await e.readlink();return r?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return r?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e.withFileTypes,e=this.cwd);let i=await e.realpath();return r?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return r?i:i?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r,o=[];(!s||s(e))&&o.push(i?e:e.fullpath());let l=new Set,u=(h,d)=>{l.add(h),h.readdirCB((f,y)=>{if(f)return d(f);let b=y.length;if(!b)return d();let _=()=>{--b===0&&d()};for(let E of y)(!s||s(E))&&o.push(i?E:E.fullpath()),n&&E.isSymbolicLink()?E.realpath().then(R=>R?.isUnknown()?R.lstat():R).then(R=>R?.shouldWalk(l,a)?u(R,_):_()):E.shouldWalk(l,a)?u(E,_):_()},!0)},c=e;return new Promise((h,d)=>{u(c,f=>{if(f)return d(f);h(o)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r,o=[];(!s||s(e))&&o.push(i?e:e.fullpath());let l=new Set([e]);for(let u of l){let c=u.readdirSync();for(let h of c){(!s||s(h))&&o.push(i?h:h.fullpath());let d=h;if(h.isSymbolicLink()){if(!(n&&(d=h.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(l,a)&&l.add(d)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r;(!s||s(e))&&(yield i?e:e.fullpath());let o=new Set([e]);for(let l of o){let u=l.readdirSync();for(let c of u){(!s||s(c))&&(yield i?c:c.fullpath());let h=c;if(c.isSymbolicLink()){if(!(n&&(h=c.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(o,a)&&o.add(h)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r,o=new Rt({objectMode:!0});(!s||s(e))&&o.write(i?e:e.fullpath());let l=new Set,u=[e],c=0,h=()=>{let d=!1;for(;!d;){let f=u.shift();if(!f){c===0&&o.end();return}c++,l.add(f);let y=(_,E,R=!1)=>{if(_)return o.emit("error",_);if(n&&!R){let x=[];for(let M of E)M.isSymbolicLink()&&x.push(M.realpath().then(k=>k?.isUnknown()?k.lstat():k));if(x.length){Promise.all(x).then(()=>y(null,E,!0));return}}for(let x of E)x&&(!s||s(x))&&(o.write(i?x:x.fullpath())||(d=!0));c--;for(let x of E){let M=x.realpathCached()||x;M.shouldWalk(l,a)&&u.push(M)}d&&!o.flowing?o.once("drain",h):b||h()},b=!0;f.readdirCB(y,!0),b=!1}};return h(),o}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r,o=new Rt({objectMode:!0}),l=new Set;(!s||s(e))&&o.write(i?e:e.fullpath());let u=[e],c=0,h=()=>{let d=!1;for(;!d;){let f=u.shift();if(!f){c===0&&o.end();return}c++,l.add(f);let y=f.readdirSync();for(let b of y)(!s||s(b))&&(o.write(i?b:b.fullpath())||(d=!0));c--;for(let b of y){let _=b;if(b.isSymbolicLink()){if(!(n&&(_=b.realpathSync())))continue;_.isUnknown()&&_.lstatSync()}_.shouldWalk(l,a)&&u.push(_)}}d&&!o.flowing&&o.once("drain",h)};return h(),o}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[_p](r)}},_r=class extends cs{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,Lo,"\\",{...r,nocase:i}),this.nocase=i;for(let n=this.cwd;n;n=n.parent)n.nocase=this.nocase}parseRootPath(e){return Lo.parse(e).root.toUpperCase()}newRoot(e){return new us(this.rootPath,Xe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Sr=class extends cs{sep="/";constructor(e=process.cwd(),r={}){let{nocase:i=!1}=r;super(e,oS,"/",{...r,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new fs(this.rootPath,Xe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},wi=class extends Sr{constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,{...r,nocase:i})}},gx=process.platform==="win32"?us:fs,Sp=process.platform==="win32"?_r:process.platform==="darwin"?wi:Sr;var ES=t=>t.length>=1,RS=t=>t.length>=1,Er=class t{#e;#t;#s;length;#i;#a;#v;#u;#c;#o;#l=!0;constructor(e,r,i,n){if(!ES(e))throw new TypeError("empty pattern list");if(!RS(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=r,this.#s=i,this.#i=n,this.#s===0){if(this.isUNC()){let[s,a,o,l,...u]=this.#e,[c,h,d,f,...y]=this.#t;u[0]===""&&(u.shift(),y.shift());let b=[s,a,o,l,""].join("/"),_=[c,h,d,f,""].join("/");this.#e=[b,...u],this.#t=[_,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...a]=this.#e,[o,...l]=this.#t;a[0]===""&&(a.shift(),l.shift());let u=s+"/",c=o+"/";this.#e=[u,...a],this.#t=[c,...l],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===he}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#a!==void 0?this.#a:this.hasMore()?(this.#a=new t(this.#e,this.#t,this.#s+1,this.#i),this.#a.#o=this.#o,this.#a.#c=this.#c,this.#a.#u=this.#u,this.#a):this.#a=null}isUNC(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=this.#i==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#i==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#o!==void 0?this.#o:this.#o=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var xS=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Rr=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:i,noext:n,noglobstar:s,platform:a=xS}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:r,nocase:i,noext:n,noglobstar:s,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let o of e)this.add(o)}add(e){let r=new Oe(e,this.mmopts);for(let i=0;i<r.set.length;i++){let n=r.set[i],s=r.globParts[i];if(!n||!s)throw new Error("invalid pattern object");for(;n[0]==="."&&s[0]===".";)n.shift(),s.shift();let a=new Er(n,s,0,this.platform),o=new Oe(a.globString(),this.mmopts),l=s[s.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(o):this.relative.push(o),l&&(u?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(e){let r=e.fullpath(),i=`${r}/`,n=e.relative()||".",s=`${n}/`;for(let a of this.relative)if(a.match(n)||a.match(s))return!0;for(let a of this.absolute)if(a.match(r)||a.match(i))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let n of this.relativeChildren)if(n.match(i))return!0;for(let n of this.absoluteChildren)if(n.match(r))return!0;return!1}};var No=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let i=e.fullpath(),n=this.store.get(i);n?n.add(r.globString()):this.store.set(i,new Set([r.globString()]))}},Fo=class{store=new Map;add(e,r,i){let n=(r?2:0)|(i?1:0),s=this.store.get(e);this.store.set(e,s===void 0?n:n&s)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},Io=class{store=new Map;add(e,r){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(n=>n.globString()===r.globString())||i.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},vi=class t{hasWalkedCache;matches=new Fo;subwalks=new Io;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new No}processPatterns(e,r){this.patterns=r;let i=r.map(n=>[e,n]);for(let[n,s]of i){this.hasWalkedCache.storeWalked(n,s);let a=s.root(),o=s.isAbsolute()&&this.opts.absolute!==!1;if(a){n=n.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let h=s.rest();if(h)s=h;else{this.matches.add(n,!0,!1);continue}}if(n.isENOENT())continue;let l,u,c=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)n=n.resolve(l),s=u,c=!0;if(l=s.pattern(),u=s.rest(),c){if(this.hasWalkedCache.hasWalked(n,s))continue;this.hasWalkedCache.storeWalked(n,s)}if(typeof l=="string"){let h=l===".."||l===""||l===".";this.matches.add(n.resolve(l),o,h);continue}else if(l===he){(!n.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(n,s);let h=u?.pattern(),d=u?.rest();if(!u||(h===""||h===".")&&!d)this.matches.add(n,o,h===""||h===".");else if(h===".."){let f=n.parent||n;d?this.hasWalkedCache.hasWalked(f,d)||this.subwalks.add(f,d):this.matches.add(f,o,!0)}}else l instanceof RegExp&&this.subwalks.add(n,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let i=this.subwalks.get(e),n=this.child();for(let s of r)for(let a of i){let o=a.isAbsolute(),l=a.pattern(),u=a.rest();l===he?n.testGlobstar(s,a,u,o):l instanceof RegExp?n.testRegExp(s,l,u,o):n.testString(s,l,u,o)}return n}testGlobstar(e,r,i,n){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,n,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(i&&r.checkFollowGlobstar()?this.subwalks.add(e,i):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),i){let s=i.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,i.rest(),n);else if(s===".."){let a=e.parent||e;this.subwalks.add(a,i)}else s instanceof RegExp&&this.testRegExp(e,s,i.rest(),n)}}testRegExp(e,r,i,n){r.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}testString(e,r,i,n){e.isNamed(r)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}};var MS=(t,e)=>typeof t=="string"?new Rr([t],e):Array.isArray(t)?new Rr(t,e):t,hs=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,r,i){if(this.patterns=e,this.path=r,this.opts=i,this.#s=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#t=MS(i.ignore??[],i),!this.includeChildMatches&&typeof this.#t.add!="function")){let n="cannot ignore child matches, ignore lacks add() method.";throw new Error(n)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#a(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=await s.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(s,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=s.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(s,r)}matchFinish(e,r){if(this.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let i=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let n=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+n)}else{let s=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?a+s+n:"."+n)}}async match(e,r,i){let n=await this.matchCheck(e,i);n&&this.matchFinish(n,r)}matchSync(e,r,i){let n=this.matchCheckSync(e,i);n&&this.matchFinish(n,r)}walkCB(e,r,i){this.signal?.aborted&&i(),this.walkCB2(e,r,new vi(this.opts),i)}walkCB2(e,r,i,n){if(this.#a(e))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2(e,r,i,n));return}i.processPatterns(e,r);let s=1,a=()=>{--s===0&&n()};for(let[o,l,u]of i.matches.entries())this.#i(o)||(s++,this.match(o,l,u).then(()=>a()));for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;s++;let l=o.readdirCached();o.calledReaddir()?this.walkCB3(o,l,i,a):o.readdirCB((u,c)=>this.walkCB3(o,c,i,a),!0)}a()}walkCB3(e,r,i,n){i=i.filterEntries(e,r);let s=1,a=()=>{--s===0&&n()};for(let[o,l,u]of i.matches.entries())this.#i(o)||(s++,this.match(o,l,u).then(()=>a()));for(let[o,l]of i.subwalks.entries())s++,this.walkCB2(o,l,i.child(),a);a()}walkCBSync(e,r,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,r,new vi(this.opts),i)}walkCB2Sync(e,r,i,n){if(this.#a(e))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,i,n));return}i.processPatterns(e,r);let s=1,a=()=>{--s===0&&n()};for(let[o,l,u]of i.matches.entries())this.#i(o)||this.matchSync(o,l,u);for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;s++;let l=o.readdirSync();this.walkCB3Sync(o,l,i,a)}a()}walkCB3Sync(e,r,i,n){i=i.filterEntries(e,r);let s=1,a=()=>{--s===0&&n()};for(let[o,l,u]of i.matches.entries())this.#i(o)||this.matchSync(o,l,u);for(let[o,l]of i.subwalks.entries())s++,this.walkCB2Sync(o,l,i.child(),a);a()}},_i=class extends hs{matches=new Set;constructor(e,r,i){super(e,r,i)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Si=class extends hs{results;constructor(e,r,i){super(e,r,i),this.results=new Rt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var OS=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",He=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=TS(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=r.platform||OS,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=r.platform==="win32"?_r:r.platform==="darwin"?wi:r.platform?Sr:Sp;this.scurry=new l(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new Oe(l,n)),[a,o]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=a.map((l,u)=>{let c=o[u];if(!c)throw new Error("invalid pattern object");return new Er(l,c,0,this.platform)})}async walk(){return[...await new _i(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new _i(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Si(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Si(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var $o=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Oe(r,e).hasMagic())return!0;return!1};function ps(t,e={}){return new He(t,e).streamSync()}function Rp(t,e={}){return new He(t,e).stream()}function xp(t,e={}){return new He(t,e).walkSync()}async function Ep(t,e={}){return new He(t,e).walk()}function gs(t,e={}){return new He(t,e).iterateSync()}function Mp(t,e={}){return new He(t,e).iterate()}var AS=ps,kS=Object.assign(Rp,{sync:ps}),PS=gs,DS=Object.assign(Mp,{sync:gs}),qS=Object.assign(xp,{stream:ps,iterate:gs}),ds=Object.assign(Ep,{glob:Ep,globSync:xp,sync:qS,globStream:Rp,stream:kS,globStreamSync:ps,streamSync:AS,globIterate:Mp,iterate:DS,globIterateSync:gs,iterateSync:PS,Glob:He,hasMagic:$o,escape:mr,unescape:Be});ds.glob=ds;var FS="../build",IS="../wheels",$S="streamlit-1.48.0-cp312-none-any.whl",WS="stlite_lib-0.1.0-py3-none-any.whl",BS=jS(import.meta.url),Ap=de.dirname(BS);async function kp(t,e){let r=[],i=n=>{r.push(n)};if(await t.loadPackage(e,{errorCallback:i}),r.length>0)throw new Error(r.join(`
40
- `))}async function US(t){I.info("Copy the build directory (the bare built app files) to this directory...");let e=de.resolve(Ap,FS);if(!(await xt.stat(e)).isDirectory())throw new Error(`The source ${e} does not exist.`);if(e===t.copyTo){I.warn(`sourceDir == destDir (${e}). Are you in the development environment? Skip copying the directory.`);return}if(t.keepOld)try{await xt.access(t.copyTo),I.info(`${t.copyTo} already exists. Use it and skip copying.`);return}catch{throw new Error(`${t.copyTo} does not exist even though the \`keepOld\` option is specified`)}I.debug(`Copy ${e} to ${t.copyTo}`),await xt.rm(t.copyTo,{recursive:!0,force:!0}),await Wo.copy(e,t.copyTo,{errorOnExist:!0})}async function zS(t){if(t.requirements.length===0)return[];let e=await Op({packageCacheDir:t.pyodideRuntimeDir});return e._api.setCdnUrl(t.pyodideSource),await Pp(e,{requirements:t.requirements}),Object.entries(e.loadedPackages).filter(([,r])=>r==="default channel").map(([r])=>r)}async function Tp(t,e){I.debug("Preparing the local wheel: %s",e);let r=await xt.readFile(e),i="/tmp/"+de.basename(e);t.FS.writeFile(i,r);let n=`emfs:${i}`;return I.debug("The local wheel %s is prepared as %s",e,n),n}async function Pp(t,e){await kp(t,"micropip");let r=t.pyimport("micropip"),i=[...e.requirements],n=de.join(Ap,IS),s=await Tp(t,de.join(n,WS));i.push(s);let a=await Tp(t,de.join(n,$S));i.push(a),I.info("Install the packages: %j",i),await r.install.callKwargs(i,{keep_going:!0})}async function HS(t){I.info("Create the site-packages snapshot file...");let e=await Op({packageCacheDir:t.pyodideRuntimeDir});e._api.setCdnUrl(t.pyodideSource),await kp(e,"micropip");let r=e.pyimport("micropip"),i=new Yn(t.pyodideSource),n=[];if(t.usedPrebuiltPackages.length>0){I.info("Mocking prebuilt packages so that they will not be included in the site-packages snapshot because these will be installed from the vendored wheel files at runtime...");for(let o of t.usedPrebuiltPackages){let l=await i.getPackageInfoByName(o);if(l==null)throw new Error(`Package ${o} is not found in the lock file.`);I.debug(`Mock ${l.name} ${l.version}`),r.add_mock_package(l.name,l.version),n.push(l.name)}}I.info("Install the requirements %j",t.requirements),await Pp(e,{requirements:t.requirements}),I.info("Remove the mocked packages: %j",n),n.forEach(o=>r.remove_mock_package(o)),I.info("Archive the site-packages director(y|ies)");let s="/tmp/site-packages-snapshot.tar.gz";await e.runPythonAsync(`
39
+ >>> no match, partial?`,e,d,r,f),d===l))}let b;if(typeof c=="string"?(b=h===c,this.debug("string match",c,h,b)):(b=c.test(h),this.debug("pattern match",c,h,b)),!b)return!1}if(a===l&&o===u)return!0;if(a===l)return i;if(o===u)return a===l-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return ep(this.pattern,this.options)}parse(e){li(e);let r=this.options;if(e==="**")return he;if(e==="")return"";let i,n=null;(i=e.match(D_))?n=r.dot?C_:q_:(i=e.match(S_))?n=(r.nocase?r.dot?M_:x_:r.dot?R_:E_)(i[1]):(i=e.match(L_))?n=(r.nocase?r.dot?N_:j_:r.dot?F_:I_)(i):(i=e.match(T_))?n=r.dot?A_:O_:(i=e.match(k_))&&(n=P_);let s=gr.fromGlob(e,this.options).toMMPattern();return n&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:n}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,i=r.noglobstar?B_:r.dot?U_:z_,n=new Set(r.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(c=>{if(c instanceof RegExp)for(let h of c.flags.split(""))n.add(h);return typeof c=="string"?K_(c):c===he?he:c._src});return u.forEach((c,h)=>{let d=u[h+1],f=u[h-1];c!==he||f===he||(f===void 0?d!==void 0&&d!==he?u[h+1]="(?:\\/|"+i+"\\/)?"+d:u[h]=i:d===void 0?u[h-1]=f+"(?:\\/|"+i+")?":d!==he&&(u[h-1]=f+"(?:\\/|\\/"+i+"\\/)"+d,u[h+1]=he))}),u.filter(c=>c!==he).join("/")}).join("|"),[a,o]=e.length>1?["(?:",")"]:["",""];s="^"+a+s+o+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...n].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;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let n=this.slashSplit(e);this.debug(this.pattern,"split",n);let s=this.set;this.debug(this.pattern,"set",s);let a=n[n.length-1];if(!a)for(let o=n.length-2;!a&&o>=0;o--)a=n[o];for(let o=0;o<s.length;o++){let l=s[o],u=n;if(i.matchBase&&l.length===1&&(u=[a]),this.matchOne(u,l,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return _e.defaults(e).Minimatch}};_e.AST=gr;_e.Minimatch=Oe;_e.escape=mr;_e.unescape=Be;import{fileURLToPath as TS}from"node:url";var yr=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,rp=new Set,Ro=typeof process=="object"&&process?process:{},ip=(t,e,r,i)=>{typeof Ro.emitWarning=="function"?Ro.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`)},Qn=globalThis.AbortController,tp=globalThis.AbortSignal;if(typeof Qn>"u"){tp=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,n){this._onabort.push(n)}},Qn=class{constructor(){e()}signal=new tp;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let n of this.signal._onabort)n(i);this.signal.onabort?.(i)}}};let t=Ro.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,ip("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var J_=t=>!rp.has(t),ix=Symbol("type"),St=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),np=t=>St(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?br:null:null,br=class extends Array{constructor(e){super(e),this.fill(0)}},xo=class t{heap;length;static#e=!1;static create(e){let r=np(e);if(!r)return[];t.#e=!0;let i=new t(e,r);return t.#e=!1,i}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},fi=class t{#e;#t;#s;#i;#a;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#c;#o;#l;#n;#m;#y;#d;#h;#E;#g;#R;#x;#w;#_;#S;#p;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#w,sizes:e.#R,keyMap:e.#o,keyList:e.#l,valList:e.#n,next:e.#m,prev:e.#y,get head(){return e.#d},get tail(){return e.#h},free:e.#E,isBackgroundFetch:r=>e.#f(r),backgroundFetch:(r,i,n,s)=>e.#F(r,i,n,s),moveToTail:r=>e.#$(r),indexes:r=>e.#T(r),rindexes:r=>e.#O(r),isStale:r=>e.#b(r)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#c}get size(){return this.#u}get fetchMethod(){return this.#a}get memoMethod(){return this.#v}get dispose(){return this.#s}get disposeAfter(){return this.#i}constructor(e){let{max:r=0,ttl:i,ttlResolution:n=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:o,allowStale:l,dispose:u,disposeAfter:c,noDisposeOnSet:h,noUpdateTTL:d,maxSize:f=0,maxEntrySize:y=0,sizeCalculation:b,fetchMethod:_,memoMethod:E,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:x,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:k,ignoreFetchAbort:j}=e;if(r!==0&&!St(r))throw new TypeError("max option must be a nonnegative integer");let U=r?np(r):Array;if(!U)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=f,this.maxEntrySize=y||this.#t,this.sizeCalculation=b,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=E,_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=_,this.#S=!!_,this.#o=new Map,this.#l=new Array(r).fill(void 0),this.#n=new Array(r).fill(void 0),this.#m=new U(r),this.#y=new U(r),this.#d=0,this.#h=0,this.#E=xo.create(r),this.#u=0,this.#c=0,typeof u=="function"&&(this.#s=u),typeof c=="function"?(this.#i=c,this.#g=[]):(this.#i=void 0,this.#g=void 0),this.#_=!!this.#s,this.#p=!!this.#i,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!j,this.maxEntrySize!==0){if(this.#t!==0&&!St(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!St(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#k()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!x,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!o,this.ttlResolution=St(n)||n===0?n:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!St(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#A()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let F="LRU_CACHE_UNBOUNDED";J_(F)&&(rp.add(F),ip("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",F,t))}}getRemainingTTL(e){return this.#o.has(e)?1/0:0}#A(){let e=new br(this.#e),r=new br(this.#e);this.#w=e,this.#x=r,this.#D=(s,a,o=yr.now())=>{if(r[s]=a!==0?o:0,e[s]=a,a!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#b(s)&&this.#P(this.#l[s],"expire")},a+1);l.unref&&l.unref()}},this.#M=s=>{r[s]=e[s]!==0?yr.now():0},this.#r=(s,a)=>{if(e[a]){let o=e[a],l=r[a];if(!o||!l)return;s.ttl=o,s.start=l,s.now=i||n();let u=s.now-l;s.remainingTTL=o-u}};let i=0,n=()=>{let s=yr.now();if(this.ttlResolution>0){i=s;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return s};this.getRemainingTTL=s=>{let a=this.#o.get(s);if(a===void 0)return 0;let o=e[a],l=r[a];if(!o||!l)return 1/0;let u=(i||n())-l;return o-u},this.#b=s=>{let a=r[s],o=e[s];return!!o&&!!a&&(i||n())-a>o}}#M=()=>{};#r=()=>{};#D=()=>{};#b=()=>!1;#k(){let e=new br(this.#e);this.#c=0,this.#R=e,this.#q=r=>{this.#c-=e[r],e[r]=0},this.#L=(r,i,n,s)=>{if(this.#f(i))return 0;if(!St(n))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(n=s(i,r),!St(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n},this.#C=(r,i,n)=>{if(e[r]=i,this.#t){let s=this.#t-e[r];for(;this.#c>s;)this.#N(!0)}this.#c+=e[r],n&&(n.entrySize=i,n.totalCalculatedSize=this.#c)}}#q=e=>{};#C=(e,r,i)=>{};#L=(e,r,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:e=this.allowStale}={}){if(this.#u)for(let r=this.#h;!(!this.#j(r)||((e||!this.#b(r))&&(yield r),r===this.#d));)r=this.#y[r]}*#O({allowStale:e=this.allowStale}={}){if(this.#u)for(let r=this.#d;!(!this.#j(r)||((e||!this.#b(r))&&(yield r),r===this.#h));)r=this.#m[r]}#j(e){return e!==void 0&&this.#o.get(this.#l[e])===e}*entries(){for(let e of this.#T())this.#n[e]!==void 0&&this.#l[e]!==void 0&&!this.#f(this.#n[e])&&(yield[this.#l[e],this.#n[e]])}*rentries(){for(let e of this.#O())this.#n[e]!==void 0&&this.#l[e]!==void 0&&!this.#f(this.#n[e])&&(yield[this.#l[e],this.#n[e]])}*keys(){for(let e of this.#T()){let r=this.#l[e];r!==void 0&&!this.#f(this.#n[e])&&(yield r)}}*rkeys(){for(let e of this.#O()){let r=this.#l[e];r!==void 0&&!this.#f(this.#n[e])&&(yield r)}}*values(){for(let e of this.#T())this.#n[e]!==void 0&&!this.#f(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#O())this.#n[e]!==void 0&&!this.#f(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let i of this.#T()){let n=this.#n[i],s=this.#f(n)?n.__staleWhileFetching:n;if(s!==void 0&&e(s,this.#l[i],this))return this.get(this.#l[i],r)}}forEach(e,r=this){for(let i of this.#T()){let n=this.#n[i],s=this.#f(n)?n.__staleWhileFetching:n;s!==void 0&&e.call(r,s,this.#l[i],this)}}rforEach(e,r=this){for(let i of this.#O()){let n=this.#n[i],s=this.#f(n)?n.__staleWhileFetching:n;s!==void 0&&e.call(r,s,this.#l[i],this)}}purgeStale(){let e=!1;for(let r of this.#O({allowStale:!0}))this.#b(r)&&(this.#P(this.#l[r],"expire"),e=!0);return e}info(e){let r=this.#o.get(e);if(r===void 0)return;let i=this.#n[r],n=this.#f(i)?i.__staleWhileFetching:i;if(n===void 0)return;let s={value:n};if(this.#w&&this.#x){let a=this.#w[r],o=this.#x[r];if(a&&o){let l=a-(yr.now()-o);s.ttl=l,s.start=Date.now()}}return this.#R&&(s.size=this.#R[r]),s}dump(){let e=[];for(let r of this.#T({allowStale:!0})){let i=this.#l[r],n=this.#n[r],s=this.#f(n)?n.__staleWhileFetching:n;if(s===void 0||i===void 0)continue;let a={value:s};if(this.#w&&this.#x){a.ttl=this.#w[r];let o=yr.now()-this.#x[r];a.start=Math.floor(Date.now()-o)}this.#R&&(a.size=this.#R[r]),e.unshift([i,a])}return e}load(e){this.clear();for(let[r,i]of e){if(i.start){let n=Date.now()-i.start;i.start=yr.now()-n}this.set(r,i.value,i)}}set(e,r,i={}){if(r===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:s,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:l}=i,{noUpdateTTL:u=this.noUpdateTTL}=i,c=this.#L(e,r,i.size||0,o);if(this.maxEntrySize&&c>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let h=this.#u===0?void 0:this.#o.get(e);if(h===void 0)h=this.#u===0?this.#h:this.#E.length!==0?this.#E.pop():this.#u===this.#e?this.#N(!1):this.#u,this.#l[h]=e,this.#n[h]=r,this.#o.set(e,h),this.#m[this.#h]=h,this.#y[h]=this.#h,this.#h=h,this.#u++,this.#C(h,c,l),l&&(l.set="add"),u=!1;else{this.#$(h);let d=this.#n[h];if(r!==d){if(this.#S&&this.#f(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=d;f!==void 0&&!a&&(this.#_&&this.#s?.(f,e,"set"),this.#p&&this.#g?.push([f,e,"set"]))}else a||(this.#_&&this.#s?.(d,e,"set"),this.#p&&this.#g?.push([d,e,"set"]));if(this.#q(h),this.#C(h,c,l),this.#n[h]=r,l){l.set="replace";let f=d&&this.#f(d)?d.__staleWhileFetching:d;f!==void 0&&(l.oldValue=f)}}else l&&(l.set="update")}if(n!==0&&!this.#w&&this.#A(),this.#w&&(u||this.#D(h,n,s),l&&this.#r(l,h)),!a&&this.#p&&this.#g){let d=this.#g,f;for(;f=d?.shift();)this.#i?.(...f)}return this}pop(){try{for(;this.#u;){let e=this.#n[this.#d];if(this.#N(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#g){let e=this.#g,r;for(;r=e?.shift();)this.#i?.(...r)}}}#N(e){let r=this.#d,i=this.#l[r],n=this.#n[r];return this.#S&&this.#f(n)?n.__abortController.abort(new Error("evicted")):(this.#_||this.#p)&&(this.#_&&this.#s?.(n,i,"evict"),this.#p&&this.#g?.push([n,i,"evict"])),this.#q(r),e&&(this.#l[r]=void 0,this.#n[r]=void 0,this.#E.push(r)),this.#u===1?(this.#d=this.#h=0,this.#E.length=0):this.#d=this.#m[r],this.#o.delete(i),this.#u--,r}has(e,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=r,s=this.#o.get(e);if(s!==void 0){let a=this.#n[s];if(this.#f(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#b(s))n&&(n.has="stale",this.#r(n,s));else return i&&this.#M(s),n&&(n.has="hit",this.#r(n,s)),!0}else n&&(n.has="miss");return!1}peek(e,r={}){let{allowStale:i=this.allowStale}=r,n=this.#o.get(e);if(n===void 0||!i&&this.#b(n))return;let s=this.#n[n];return this.#f(s)?s.__staleWhileFetching:s}#F(e,r,i,n){let s=r===void 0?void 0:this.#n[r];if(this.#f(s))return s;let a=new Qn,{signal:o}=i;o?.addEventListener("abort",()=>a.abort(o.reason),{signal:a.signal});let l={signal:a.signal,options:i,context:n},u=(b,_=!1)=>{let{aborted:E}=a.signal,R=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(E&&!_?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,R&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),E&&!R&&!_)return h(a.signal.reason);let x=f;return this.#n[r]===f&&(b===void 0?x.__staleWhileFetching?this.#n[r]=x.__staleWhileFetching:this.#P(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,b,l.options))),b},c=b=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=b),h(b)),h=b=>{let{aborted:_}=a.signal,E=_&&i.allowStaleOnFetchAbort,R=E||i.allowStaleOnFetchRejection,x=R||i.noDeleteOnFetchRejection,M=f;if(this.#n[r]===f&&(!x||M.__staleWhileFetching===void 0?this.#P(e,"fetch"):E||(this.#n[r]=M.__staleWhileFetching)),R)return i.status&&M.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),M.__staleWhileFetching;if(M.__returned===M)throw b},d=(b,_)=>{let E=this.#a?.(e,s,l);E&&E instanceof Promise&&E.then(R=>b(R===void 0?void 0:R),_),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=R=>u(R,!0)))})};i.status&&(i.status.fetchDispatched=!0);let f=new Promise(d).then(u,c),y=Object.assign(f,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,y,{...l.options,status:void 0}),r=this.#o.get(e)):this.#n[r]=y,y}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Qn}async fetch(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:b,forceRefresh:_=!1,status:E,signal:R}=r;if(!this.#S)return E&&(E.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,status:E});let x={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,ttl:a,noDisposeOnSet:o,size:l,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:f,status:E,signal:R},M=this.#o.get(e);if(M===void 0){E&&(E.fetch="miss");let k=this.#F(e,M,x,b);return k.__returned=k}else{let k=this.#n[M];if(this.#f(k)){let ne=i&&k.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",ne&&(E.returnedStale=!0)),ne?k.__staleWhileFetching:k.__returned=k}let j=this.#b(M);if(!_&&!j)return E&&(E.fetch="hit"),this.#$(M),n&&this.#M(M),E&&this.#r(E,M),k;let U=this.#F(e,M,x,b),G=U.__staleWhileFetching!==void 0&&i;return E&&(E.fetch=j?"stale":"refresh",G&&j&&(E.returnedStale=!0)),G?U.__staleWhileFetching:U.__returned=U}}async forceFetch(e,r={}){let i=await this.fetch(e,r);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,r={}){let i=this.#v;if(!i)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:s,...a}=r,o=this.get(e,a);if(!s&&o!==void 0)return o;let l=i(e,o,{options:a,context:n});return this.set(e,l,a),l}get(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:a}=r,o=this.#o.get(e);if(o!==void 0){let l=this.#n[o],u=this.#f(l);return a&&this.#r(a,o),this.#b(o)?(a&&(a.get="stale"),u?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?l.__staleWhileFetching:void 0):(s||this.#P(e,"expire"),a&&i&&(a.returnedStale=!0),i?l:void 0)):(a&&(a.get="hit"),u?l.__staleWhileFetching:(this.#$(o),n&&this.#M(o),l))}else a&&(a.get="miss")}#I(e,r){this.#y[r]=e,this.#m[e]=r}#$(e){e!==this.#h&&(e===this.#d?this.#d=this.#m[e]:this.#I(this.#y[e],this.#m[e]),this.#I(this.#h,e),this.#h=e)}delete(e){return this.#P(e,"delete")}#P(e,r){let i=!1;if(this.#u!==0){let n=this.#o.get(e);if(n!==void 0)if(i=!0,this.#u===1)this.#W(r);else{this.#q(n);let s=this.#n[n];if(this.#f(s)?s.__abortController.abort(new Error("deleted")):(this.#_||this.#p)&&(this.#_&&this.#s?.(s,e,r),this.#p&&this.#g?.push([s,e,r])),this.#o.delete(e),this.#l[n]=void 0,this.#n[n]=void 0,n===this.#h)this.#h=this.#y[n];else if(n===this.#d)this.#d=this.#m[n];else{let a=this.#y[n];this.#m[a]=this.#m[n];let o=this.#m[n];this.#y[o]=this.#y[n]}this.#u--,this.#E.push(n)}}if(this.#p&&this.#g?.length){let n=this.#g,s;for(;s=n?.shift();)this.#i?.(...s)}return i}clear(){return this.#W("delete")}#W(e){for(let r of this.#O({allowStale:!0})){let i=this.#n[r];if(this.#f(i))i.__abortController.abort(new Error("deleted"));else{let n=this.#l[r];this.#_&&this.#s?.(i,n,e),this.#p&&this.#g?.push([i,n,e])}}if(this.#o.clear(),this.#n.fill(void 0),this.#l.fill(void 0),this.#w&&this.#x&&(this.#w.fill(0),this.#x.fill(0)),this.#R&&this.#R.fill(0),this.#d=0,this.#h=0,this.#E.length=0,this.#c=0,this.#u=0,this.#p&&this.#g){let r=this.#g,i;for(;i=r?.shift();)this.#i?.(...i)}}};import{posix as oS,win32 as Lo}from"node:path";import{fileURLToPath as lS}from"node:url";import{lstatSync as uS,readdir as fS,readdirSync as cS,readlinkSync as hS,realpathSync as dS}from"fs";import*as pS from"node:fs";import{lstat as mS,readdir as yS,readlink as bS,realpath as wS}from"node:fs/promises";import{EventEmitter as Do}from"node:events";import up from"node:stream";import{StringDecoder as Z_}from"node:string_decoder";var sp=typeof process=="object"&&process?process:{stdout:null,stderr:null},Q_=t=>!!t&&typeof t=="object"&&(t instanceof Rt||t instanceof up||X_(t)||eS(t)),X_=t=>!!t&&typeof t=="object"&&t instanceof Do&&typeof t.pipe=="function"&&t.pipe!==up.Writable.prototype.pipe,eS=t=>!!t&&typeof t=="object"&&t instanceof Do&&typeof t.write=="function"&&typeof t.end=="function",nt=Symbol("EOF"),st=Symbol("maybeEmitEnd"),Et=Symbol("emittedEnd"),Xn=Symbol("emittingEnd"),ci=Symbol("emittedError"),es=Symbol("closed"),ap=Symbol("read"),ts=Symbol("flush"),op=Symbol("flushChunk"),Ue=Symbol("encoding"),wr=Symbol("decoder"),ae=Symbol("flowing"),hi=Symbol("paused"),vr=Symbol("resume"),oe=Symbol("buffer"),Se=Symbol("pipes"),le=Symbol("bufferLength"),Mo=Symbol("bufferPush"),rs=Symbol("bufferShift"),ge=Symbol("objectMode"),ee=Symbol("destroyed"),To=Symbol("error"),Oo=Symbol("emitData"),lp=Symbol("emitEnd"),Ao=Symbol("emitEnd2"),Qe=Symbol("async"),ko=Symbol("abort"),is=Symbol("aborted"),di=Symbol("signal"),Vt=Symbol("dataListeners"),Ae=Symbol("discarded"),pi=t=>Promise.resolve().then(t),tS=t=>t(),rS=t=>t==="end"||t==="finish"||t==="prefinish",iS=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,nS=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),ns=class{src;dest;opts;ondrain;constructor(e,r,i){this.src=e,this.dest=r,this.opts=i,this.ondrain=()=>e[vr](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Po=class extends ns{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,i){super(e,r,i),this.proxyErrors=n=>r.emit("error",n),e.on("error",this.proxyErrors)}},sS=t=>!!t.objectMode,aS=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Rt=class extends Do{[ae]=!1;[hi]=!1;[Se]=[];[oe]=[];[ge];[Ue];[Qe];[wr];[nt]=!1;[Et]=!1;[Xn]=!1;[es]=!1;[ci]=null;[le]=0;[ee]=!1;[di];[is]=!1;[Vt]=0;[Ae]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");sS(r)?(this[ge]=!0,this[Ue]=null):aS(r)?(this[Ue]=r.encoding,this[ge]=!1):(this[ge]=!1,this[Ue]=null),this[Qe]=!!r.async,this[wr]=this[Ue]?new Z_(this[Ue]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[oe]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Se]});let{signal:i}=r;i&&(this[di]=i,i.aborted?this[ko]():i.addEventListener("abort",()=>this[ko]()))}get bufferLength(){return this[le]}get encoding(){return this[Ue]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[ge]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Qe]}set async(e){this[Qe]=this[Qe]||!!e}[ko](){this[is]=!0,this.emit("abort",this[di]?.reason),this.destroy(this[di]?.reason)}get aborted(){return this[is]}set aborted(e){}write(e,r,i){if(this[is])return!1;if(this[nt])throw new Error("write after end");if(this[ee])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(i=r,r="utf8"),r||(r="utf8");let n=this[Qe]?pi:tS;if(!this[ge]&&!Buffer.isBuffer(e)){if(nS(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(iS(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[ge]?(this[ae]&&this[le]!==0&&this[ts](!0),this[ae]?this.emit("data",e):this[Mo](e),this[le]!==0&&this.emit("readable"),i&&n(i),this[ae]):e.length?(typeof e=="string"&&!(r===this[Ue]&&!this[wr]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[Ue]&&(e=this[wr].write(e)),this[ae]&&this[le]!==0&&this[ts](!0),this[ae]?this.emit("data",e):this[Mo](e),this[le]!==0&&this.emit("readable"),i&&n(i),this[ae]):(this[le]!==0&&this.emit("readable"),i&&n(i),this[ae])}read(e){if(this[ee])return null;if(this[Ae]=!1,this[le]===0||e===0||e&&e>this[le])return this[st](),null;this[ge]&&(e=null),this[oe].length>1&&!this[ge]&&(this[oe]=[this[Ue]?this[oe].join(""):Buffer.concat(this[oe],this[le])]);let r=this[ap](e||null,this[oe][0]);return this[st](),r}[ap](e,r){if(this[ge])this[rs]();else{let i=r;e===i.length||e===null?this[rs]():typeof i=="string"?(this[oe][0]=i.slice(e),r=i.slice(0,e),this[le]-=e):(this[oe][0]=i.subarray(e),r=i.subarray(0,e),this[le]-=e)}return this.emit("data",r),!this[oe].length&&!this[nt]&&this.emit("drain"),r}end(e,r,i){return typeof e=="function"&&(i=e,e=void 0),typeof r=="function"&&(i=r,r="utf8"),e!==void 0&&this.write(e,r),i&&this.once("end",i),this[nt]=!0,this.writable=!1,(this[ae]||!this[hi])&&this[st](),this}[vr](){this[ee]||(!this[Vt]&&!this[Se].length&&(this[Ae]=!0),this[hi]=!1,this[ae]=!0,this.emit("resume"),this[oe].length?this[ts]():this[nt]?this[st]():this.emit("drain"))}resume(){return this[vr]()}pause(){this[ae]=!1,this[hi]=!0,this[Ae]=!1}get destroyed(){return this[ee]}get flowing(){return this[ae]}get paused(){return this[hi]}[Mo](e){this[ge]?this[le]+=1:this[le]+=e.length,this[oe].push(e)}[rs](){return this[ge]?this[le]-=1:this[le]-=this[oe][0].length,this[oe].shift()}[ts](e=!1){do;while(this[op](this[rs]())&&this[oe].length);!e&&!this[oe].length&&!this[nt]&&this.emit("drain")}[op](e){return this.emit("data",e),this[ae]}pipe(e,r){if(this[ee])return e;this[Ae]=!1;let i=this[Et];return r=r||{},e===sp.stdout||e===sp.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,i?r.end&&e.end():(this[Se].push(r.proxyErrors?new Po(this,e,r):new ns(this,e,r)),this[Qe]?pi(()=>this[vr]()):this[vr]()),e}unpipe(e){let r=this[Se].find(i=>i.dest===e);r&&(this[Se].length===1?(this[ae]&&this[Vt]===0&&(this[ae]=!1),this[Se]=[]):this[Se].splice(this[Se].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let i=super.on(e,r);if(e==="data")this[Ae]=!1,this[Vt]++,!this[Se].length&&!this[ae]&&this[vr]();else if(e==="readable"&&this[le]!==0)super.emit("readable");else if(rS(e)&&this[Et])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[ci]){let n=r;this[Qe]?pi(()=>n.call(this,this[ci])):n.call(this,this[ci])}return i}removeListener(e,r){return this.off(e,r)}off(e,r){let i=super.off(e,r);return e==="data"&&(this[Vt]=this.listeners("data").length,this[Vt]===0&&!this[Ae]&&!this[Se].length&&(this[ae]=!1)),i}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Vt]=0,!this[Ae]&&!this[Se].length&&(this[ae]=!1)),r}get emittedEnd(){return this[Et]}[st](){!this[Xn]&&!this[Et]&&!this[ee]&&this[oe].length===0&&this[nt]&&(this[Xn]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[es]&&this.emit("close"),this[Xn]=!1)}emit(e,...r){let i=r[0];if(e!=="error"&&e!=="close"&&e!==ee&&this[ee])return!1;if(e==="data")return!this[ge]&&!i?!1:this[Qe]?(pi(()=>this[Oo](i)),!0):this[Oo](i);if(e==="end")return this[lp]();if(e==="close"){if(this[es]=!0,!this[Et]&&!this[ee])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[ci]=i,super.emit(To,i);let s=!this[di]||this.listeners("error").length?super.emit("error",i):!1;return this[st](),s}else if(e==="resume"){let s=super.emit("resume");return this[st](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let n=super.emit(e,...r);return this[st](),n}[Oo](e){for(let i of this[Se])i.dest.write(e)===!1&&this.pause();let r=this[Ae]?!1:super.emit("data",e);return this[st](),r}[lp](){return this[Et]?!1:(this[Et]=!0,this.readable=!1,this[Qe]?(pi(()=>this[Ao]()),!0):this[Ao]())}[Ao](){if(this[wr]){let r=this[wr].end();if(r){for(let i of this[Se])i.dest.write(r);this[Ae]||super.emit("data",r)}}for(let r of this[Se])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[ge]||(e.dataLength=0);let r=this.promise();return this.on("data",i=>{e.push(i),this[ge]||(e.dataLength+=i.length)}),await r,e}async concat(){if(this[ge])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Ue]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(ee,()=>r(new Error("stream destroyed"))),this.on("error",i=>r(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Ae]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[nt])return r();let s,a,o=h=>{this.off("data",l),this.off("end",u),this.off(ee,c),r(),a(h)},l=h=>{this.off("error",o),this.off("end",u),this.off(ee,c),this.pause(),s({value:h,done:!!this[nt]})},u=()=>{this.off("error",o),this.off("data",l),this.off(ee,c),r(),s({done:!0,value:void 0})},c=()=>o(new Error("stream destroyed"));return new Promise((h,d)=>{a=d,s=h,this.once(ee,c),this.once("error",o),this.once("end",u),this.once("data",l)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Ae]=!1;let e=!1,r=()=>(this.pause(),this.off(To,r),this.off(ee,r),this.off("end",r),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return r();let n=this.read();return n===null?r():{done:!1,value:n}};return this.once("end",r),this.once(To,r),this.once(ee,r),{next:i,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[ee])return e?this.emit("error",e):this.emit(ee),this;this[ee]=!0,this[Ae]=!0,this[oe].length=0,this[le]=0;let r=this;return typeof r.close=="function"&&!this[es]&&r.close(),e?this.emit("error",e):this.emit(ee),this}static get isStream(){return Q_}};var gS=dS.native,mi={lstatSync:uS,readdir:fS,readdirSync:cS,readlinkSync:hS,realpathSync:gS,promises:{lstat:mS,readdir:yS,readlink:bS,realpath:wS}},pp=t=>!t||t===mi||t===pS?mi:{...mi,...t,promises:{...mi.promises,...t.promises||{}}},gp=/^\\\\\?\\([a-z]:)\\?$/i,vS=t=>t.replace(/\//g,"\\").replace(gp,"$1\\"),_S=/[\\\/]/,Ne=0,mp=1,yp=2,Xe=4,bp=6,wp=8,Yt=10,vp=12,je=15,gi=~je,qo=16,fp=32,yi=64,ze=128,ss=256,os=512,cp=yi|ze|os,SS=1023,Co=t=>t.isFile()?wp:t.isDirectory()?Xe:t.isSymbolicLink()?Yt:t.isCharacterDevice()?yp:t.isBlockDevice()?bp:t.isSocket()?vp:t.isFIFO()?mp:Ne,hp=new Map,bi=t=>{let e=hp.get(t);if(e)return e;let r=t.normalize("NFKD");return hp.set(t,r),r},dp=new Map,as=t=>{let e=dp.get(t);if(e)return e;let r=bi(t.toLowerCase());return dp.set(t,r),r},ls=class extends fi{constructor(){super({max:256})}},jo=class extends fi{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},_p=Symbol("PathScurry setAsCwd"),me=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#i;get nlink(){return this.#i}#a;get uid(){return this.#a}#v;get gid(){return this.#v}#u;get rdev(){return this.#u}#c;get blksize(){return this.#c}#o;get ino(){return this.#o}#l;get size(){return this.#l}#n;get blocks(){return this.#n}#m;get atimeMs(){return this.#m}#y;get mtimeMs(){return this.#y}#d;get ctimeMs(){return this.#d}#h;get birthtimeMs(){return this.#h}#E;get atime(){return this.#E}#g;get mtime(){return this.#g}#R;get ctime(){return this.#R}#x;get birthtime(){return this.#x}#w;#_;#S;#p;#A;#M;#r;#D;#b;#k;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=Ne,i,n,s,a,o){this.name=e,this.#w=s?as(e):bi(e),this.#r=r&SS,this.nocase=s,this.roots=n,this.root=i||this,this.#D=a,this.#S=o.fullpath,this.#A=o.relative,this.#M=o.relativePosix,this.parent=o.parent,this.parent?this.#e=this.parent.#e:this.#e=pp(o.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#D}resolve(e){if(!e)return this;let r=this.getRootString(e),n=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#q(n):this.#q(n)}#q(e){let r=this;for(let i of e)r=r.child(i);return r}children(){let e=this.#D.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#D.set(this,r),this.#r&=~qo,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),n=this.nocase?as(e):bi(e);for(let l of i)if(l.#w===n)return l;let s=this.parent?this.sep:"",a=this.#S?this.#S+s+e:void 0,o=this.newChild(e,Ne,{...r,parent:this,fullpath:a});return this.canReaddir()||(o.#r|=ze),i.push(o),o}relative(){if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let e=this.name,r=this.parent;if(!r)return this.#A=this.name;let i=r.relative();return i+(!i||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#M!==void 0)return this.#M;let e=this.name,r=this.parent;if(!r)return this.#M=this.fullpathPosix();let i=r.relativePosix();return i+(!i||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let n=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=n}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let n=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(n)?this.#p=`//?/${n}`:this.#p=n}let e=this.parent,r=e.fullpathPosix(),i=r+(!r||!e.parent?"":"/")+this.name;return this.#p=i}isUnknown(){return(this.#r&je)===Ne}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#r&je)===wp}isDirectory(){return(this.#r&je)===Xe}isCharacterDevice(){return(this.#r&je)===yp}isBlockDevice(){return(this.#r&je)===bp}isFIFO(){return(this.#r&je)===mp}isSocket(){return(this.#r&je)===vp}isSymbolicLink(){return(this.#r&Yt)===Yt}lstatCached(){return this.#r&fp?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#k}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#r&je;return!(e!==Ne&&e!==Yt||this.#r&ss||this.#r&ze)}calledReaddir(){return!!(this.#r&qo)}isENOENT(){return!!(this.#r&ze)}isNamed(e){return this.nocase?this.#w===as(e):this.#w===bi(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(r);if(i)return this.#b=i}catch(r){this.#f(r.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(r);if(i)return this.#b=i}catch(r){this.#f(r.code);return}}#C(e){this.#r|=qo;for(let r=e.provisional;r<e.length;r++){let i=e[r];i&&i.#L()}}#L(){this.#r&ze||(this.#r=(this.#r|ze)&gi,this.#T())}#T(){let e=this.children();e.provisional=0;for(let r of e)r.#L()}#O(){this.#r|=os,this.#j()}#j(){if(this.#r&yi)return;let e=this.#r;(e&je)===Xe&&(e&=gi),this.#r=e|yi,this.#T()}#N(e=""){e==="ENOTDIR"||e==="EPERM"?this.#j():e==="ENOENT"?this.#L():this.children().provisional=0}#F(e=""){e==="ENOTDIR"?this.parent.#j():e==="ENOENT"&&this.#L()}#f(e=""){let r=this.#r;r|=ss,e==="ENOENT"&&(r|=ze),(e==="EINVAL"||e==="UNKNOWN")&&(r&=gi),this.#r=r,e==="ENOTDIR"&&this.parent&&this.parent.#j()}#I(e,r){return this.#P(e,r)||this.#$(e,r)}#$(e,r){let i=Co(e),n=this.newChild(e.name,i,{parent:this}),s=n.#r&je;return s!==Xe&&s!==Yt&&s!==Ne&&(n.#r|=yi),r.unshift(n),r.provisional++,n}#P(e,r){for(let i=r.provisional;i<r.length;i++){let n=r[i];if((this.nocase?as(e.name):bi(e.name))===n.#w)return this.#W(e,n,i,r)}}#W(e,r,i,n){let s=r.name;return r.#r=r.#r&gi|Co(e),s!==e.name&&(r.name=e.name),i!==n.provisional&&(i===n.length-1?n.pop():n.splice(i,1),n.unshift(r)),n.provisional++,r}async lstat(){if((this.#r&ze)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if((this.#r&ze)===0)try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#F(e.code)}}#H(e){let{atime:r,atimeMs:i,birthtime:n,birthtimeMs:s,blksize:a,blocks:o,ctime:l,ctimeMs:u,dev:c,gid:h,ino:d,mode:f,mtime:y,mtimeMs:b,nlink:_,rdev:E,size:R,uid:x}=e;this.#E=r,this.#m=i,this.#x=n,this.#h=s,this.#c=a,this.#n=o,this.#R=l,this.#d=u,this.#t=c,this.#v=h,this.#o=d,this.#s=f,this.#g=y,this.#y=b,this.#i=_,this.#u=E,this.#l=R,this.#a=x;let M=Co(e);this.#r=this.#r&gi|M|fp,M!==Ne&&M!==Xe&&M!==Yt&&(this.#r|=yi)}#U=[];#z=!1;#G(e){this.#z=!1;let r=this.#U.slice();this.#U.length=0,r.forEach(i=>i(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let s=i.slice(0,i.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#U.push(e),this.#z)return;this.#z=!0;let n=this.fullpath();this.#e.readdir(n,{withFileTypes:!0},(s,a)=>{if(s)this.#N(s.code),i.provisional=0;else{for(let o of a)this.#I(o,i);this.#C(i)}this.#G(i.slice(0,i.provisional))})}#B;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#B)await this.#B;else{let i=()=>{};this.#B=new Promise(n=>i=n);try{for(let n of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#I(n,e);this.#C(e)}catch(n){this.#N(n.code),e.provisional=0}this.#B=void 0,i()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let i of this.#e.readdirSync(r,{withFileTypes:!0}))this.#I(i,e);this.#C(e)}catch(i){this.#N(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#r&cp)return!1;let e=je&this.#r;return e===Ne||e===Xe||e===Yt}shouldWalk(e,r){return(this.#r&Xe)===Xe&&!(this.#r&cp)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#k)return this.#k;if(!((os|ss|ze)&this.#r))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#k=this.resolve(e)}catch{this.#O()}}realpathSync(){if(this.#k)return this.#k;if(!((os|ss|ze)&this.#r))try{let e=this.#e.realpathSync(this.fullpath());return this.#k=this.resolve(e)}catch{this.#O()}}[_p](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),i=[],n=this;for(;n&&n.parent;)r.add(n),n.#A=i.join(this.sep),n.#M=i.join("/"),n=n.parent,i.push("..");for(n=e;n&&n.parent&&!r.has(n);)n.#A=void 0,n.#M=void 0,n=n.parent}},us=class t extends me{sep="\\";splitSep=_S;constructor(e,r=Ne,i,n,s,a,o){super(e,r,i,n,s,a,o)}newChild(e,r=Ne,i={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return Lo.parse(e).root}getRoot(e){if(e=vS(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,i]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=i;return this.roots[e]=new _r(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(gp,"$1\\"),e===r}},fs=class t extends me{splitSep="/";sep="/";constructor(e,r=Ne,i,n,s,a,o){super(e,r,i,n,s,a,o)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=Ne,i={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}},cs=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#i;constructor(e=process.cwd(),r,i,{nocase:n,childrenCacheSize:s=16*1024,fs:a=mi}={}){this.#i=pp(a),(e instanceof URL||e.startsWith("file://"))&&(e=lS(e));let o=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#e=new ls,this.#t=new ls,this.#s=new jo(s);let l=o.substring(this.rootPath.length).split(i);if(l.length===1&&!l[0]&&l.pop(),n===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=n,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let u=this.root,c=l.length-1,h=r.sep,d=this.rootPath,f=!1;for(let y of l){let b=c--;u=u.child(y,{relative:new Array(b).fill("..").join(h),relativePosix:new Array(b).fill("..").join("/"),fullpath:d+=(f?"":h)+y}),f=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let i=this.#e.get(r);if(i!==void 0)return i;let n=this.cwd.resolve(r).fullpath();return this.#e.set(r,n),n}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let a=e[s];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let i=this.#t.get(r);if(i!==void 0)return i;let n=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,n),n}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i}=r;if(e.canReaddir()){let n=await e.readdir();return i?n:n.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0}=r;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(n=>n.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e.withFileTypes,e=this.cwd);let i=await e.readlink();return r?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return r?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e.withFileTypes,e=this.cwd);let i=await e.realpath();return r?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return r?i:i?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r,o=[];(!s||s(e))&&o.push(i?e:e.fullpath());let l=new Set,u=(h,d)=>{l.add(h),h.readdirCB((f,y)=>{if(f)return d(f);let b=y.length;if(!b)return d();let _=()=>{--b===0&&d()};for(let E of y)(!s||s(E))&&o.push(i?E:E.fullpath()),n&&E.isSymbolicLink()?E.realpath().then(R=>R?.isUnknown()?R.lstat():R).then(R=>R?.shouldWalk(l,a)?u(R,_):_()):E.shouldWalk(l,a)?u(E,_):_()},!0)},c=e;return new Promise((h,d)=>{u(c,f=>{if(f)return d(f);h(o)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r,o=[];(!s||s(e))&&o.push(i?e:e.fullpath());let l=new Set([e]);for(let u of l){let c=u.readdirSync();for(let h of c){(!s||s(h))&&o.push(i?h:h.fullpath());let d=h;if(h.isSymbolicLink()){if(!(n&&(d=h.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(l,a)&&l.add(d)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r;(!s||s(e))&&(yield i?e:e.fullpath());let o=new Set([e]);for(let l of o){let u=l.readdirSync();for(let c of u){(!s||s(c))&&(yield i?c:c.fullpath());let h=c;if(c.isSymbolicLink()){if(!(n&&(h=c.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(o,a)&&o.add(h)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r,o=new Rt({objectMode:!0});(!s||s(e))&&o.write(i?e:e.fullpath());let l=new Set,u=[e],c=0,h=()=>{let d=!1;for(;!d;){let f=u.shift();if(!f){c===0&&o.end();return}c++,l.add(f);let y=(_,E,R=!1)=>{if(_)return o.emit("error",_);if(n&&!R){let x=[];for(let M of E)M.isSymbolicLink()&&x.push(M.realpath().then(k=>k?.isUnknown()?k.lstat():k));if(x.length){Promise.all(x).then(()=>y(null,E,!0));return}}for(let x of E)x&&(!s||s(x))&&(o.write(i?x:x.fullpath())||(d=!0));c--;for(let x of E){let M=x.realpathCached()||x;M.shouldWalk(l,a)&&u.push(M)}d&&!o.flowing?o.once("drain",h):b||h()},b=!0;f.readdirCB(y,!0),b=!1}};return h(),o}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof me||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:n=!1,filter:s,walkFilter:a}=r,o=new Rt({objectMode:!0}),l=new Set;(!s||s(e))&&o.write(i?e:e.fullpath());let u=[e],c=0,h=()=>{let d=!1;for(;!d;){let f=u.shift();if(!f){c===0&&o.end();return}c++,l.add(f);let y=f.readdirSync();for(let b of y)(!s||s(b))&&(o.write(i?b:b.fullpath())||(d=!0));c--;for(let b of y){let _=b;if(b.isSymbolicLink()){if(!(n&&(_=b.realpathSync())))continue;_.isUnknown()&&_.lstatSync()}_.shouldWalk(l,a)&&u.push(_)}}d&&!o.flowing&&o.once("drain",h)};return h(),o}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[_p](r)}},_r=class extends cs{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,Lo,"\\",{...r,nocase:i}),this.nocase=i;for(let n=this.cwd;n;n=n.parent)n.nocase=this.nocase}parseRootPath(e){return Lo.parse(e).root.toUpperCase()}newRoot(e){return new us(this.rootPath,Xe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Sr=class extends cs{sep="/";constructor(e=process.cwd(),r={}){let{nocase:i=!1}=r;super(e,oS,"/",{...r,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new fs(this.rootPath,Xe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},wi=class extends Sr{constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,{...r,nocase:i})}},gx=process.platform==="win32"?us:fs,Sp=process.platform==="win32"?_r:process.platform==="darwin"?wi:Sr;var ES=t=>t.length>=1,RS=t=>t.length>=1,Er=class t{#e;#t;#s;length;#i;#a;#v;#u;#c;#o;#l=!0;constructor(e,r,i,n){if(!ES(e))throw new TypeError("empty pattern list");if(!RS(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=r,this.#s=i,this.#i=n,this.#s===0){if(this.isUNC()){let[s,a,o,l,...u]=this.#e,[c,h,d,f,...y]=this.#t;u[0]===""&&(u.shift(),y.shift());let b=[s,a,o,l,""].join("/"),_=[c,h,d,f,""].join("/");this.#e=[b,...u],this.#t=[_,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...a]=this.#e,[o,...l]=this.#t;a[0]===""&&(a.shift(),l.shift());let u=s+"/",c=o+"/";this.#e=[u,...a],this.#t=[c,...l],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===he}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#a!==void 0?this.#a:this.hasMore()?(this.#a=new t(this.#e,this.#t,this.#s+1,this.#i),this.#a.#o=this.#o,this.#a.#c=this.#c,this.#a.#u=this.#u,this.#a):this.#a=null}isUNC(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=this.#i==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#i==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#o!==void 0?this.#o:this.#o=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var xS=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Rr=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:i,noext:n,noglobstar:s,platform:a=xS}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:r,nocase:i,noext:n,noglobstar:s,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let o of e)this.add(o)}add(e){let r=new Oe(e,this.mmopts);for(let i=0;i<r.set.length;i++){let n=r.set[i],s=r.globParts[i];if(!n||!s)throw new Error("invalid pattern object");for(;n[0]==="."&&s[0]===".";)n.shift(),s.shift();let a=new Er(n,s,0,this.platform),o=new Oe(a.globString(),this.mmopts),l=s[s.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(o):this.relative.push(o),l&&(u?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(e){let r=e.fullpath(),i=`${r}/`,n=e.relative()||".",s=`${n}/`;for(let a of this.relative)if(a.match(n)||a.match(s))return!0;for(let a of this.absolute)if(a.match(r)||a.match(i))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let n of this.relativeChildren)if(n.match(i))return!0;for(let n of this.absoluteChildren)if(n.match(r))return!0;return!1}};var No=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let i=e.fullpath(),n=this.store.get(i);n?n.add(r.globString()):this.store.set(i,new Set([r.globString()]))}},Fo=class{store=new Map;add(e,r,i){let n=(r?2:0)|(i?1:0),s=this.store.get(e);this.store.set(e,s===void 0?n:n&s)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},Io=class{store=new Map;add(e,r){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(n=>n.globString()===r.globString())||i.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},vi=class t{hasWalkedCache;matches=new Fo;subwalks=new Io;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new No}processPatterns(e,r){this.patterns=r;let i=r.map(n=>[e,n]);for(let[n,s]of i){this.hasWalkedCache.storeWalked(n,s);let a=s.root(),o=s.isAbsolute()&&this.opts.absolute!==!1;if(a){n=n.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let h=s.rest();if(h)s=h;else{this.matches.add(n,!0,!1);continue}}if(n.isENOENT())continue;let l,u,c=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)n=n.resolve(l),s=u,c=!0;if(l=s.pattern(),u=s.rest(),c){if(this.hasWalkedCache.hasWalked(n,s))continue;this.hasWalkedCache.storeWalked(n,s)}if(typeof l=="string"){let h=l===".."||l===""||l===".";this.matches.add(n.resolve(l),o,h);continue}else if(l===he){(!n.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(n,s);let h=u?.pattern(),d=u?.rest();if(!u||(h===""||h===".")&&!d)this.matches.add(n,o,h===""||h===".");else if(h===".."){let f=n.parent||n;d?this.hasWalkedCache.hasWalked(f,d)||this.subwalks.add(f,d):this.matches.add(f,o,!0)}}else l instanceof RegExp&&this.subwalks.add(n,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let i=this.subwalks.get(e),n=this.child();for(let s of r)for(let a of i){let o=a.isAbsolute(),l=a.pattern(),u=a.rest();l===he?n.testGlobstar(s,a,u,o):l instanceof RegExp?n.testRegExp(s,l,u,o):n.testString(s,l,u,o)}return n}testGlobstar(e,r,i,n){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,n,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(i&&r.checkFollowGlobstar()?this.subwalks.add(e,i):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),i){let s=i.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,i.rest(),n);else if(s===".."){let a=e.parent||e;this.subwalks.add(a,i)}else s instanceof RegExp&&this.testRegExp(e,s,i.rest(),n)}}testRegExp(e,r,i,n){r.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}testString(e,r,i,n){e.isNamed(r)&&(i?this.subwalks.add(e,i):this.matches.add(e,n,!1))}};var MS=(t,e)=>typeof t=="string"?new Rr([t],e):Array.isArray(t)?new Rr(t,e):t,hs=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,r,i){if(this.patterns=e,this.path=r,this.opts=i,this.#s=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#t=MS(i.ignore??[],i),!this.includeChildMatches&&typeof this.#t.add!="function")){let n="cannot ignore child matches, ignore lacks add() method.";throw new Error(n)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#a(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=await s.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(s,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let a=s.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(s,r)}matchFinish(e,r){if(this.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let i=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let n=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+n)}else{let s=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?a+s+n:"."+n)}}async match(e,r,i){let n=await this.matchCheck(e,i);n&&this.matchFinish(n,r)}matchSync(e,r,i){let n=this.matchCheckSync(e,i);n&&this.matchFinish(n,r)}walkCB(e,r,i){this.signal?.aborted&&i(),this.walkCB2(e,r,new vi(this.opts),i)}walkCB2(e,r,i,n){if(this.#a(e))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2(e,r,i,n));return}i.processPatterns(e,r);let s=1,a=()=>{--s===0&&n()};for(let[o,l,u]of i.matches.entries())this.#i(o)||(s++,this.match(o,l,u).then(()=>a()));for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;s++;let l=o.readdirCached();o.calledReaddir()?this.walkCB3(o,l,i,a):o.readdirCB((u,c)=>this.walkCB3(o,c,i,a),!0)}a()}walkCB3(e,r,i,n){i=i.filterEntries(e,r);let s=1,a=()=>{--s===0&&n()};for(let[o,l,u]of i.matches.entries())this.#i(o)||(s++,this.match(o,l,u).then(()=>a()));for(let[o,l]of i.subwalks.entries())s++,this.walkCB2(o,l,i.child(),a);a()}walkCBSync(e,r,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,r,new vi(this.opts),i)}walkCB2Sync(e,r,i,n){if(this.#a(e))return n();if(this.signal?.aborted&&n(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,i,n));return}i.processPatterns(e,r);let s=1,a=()=>{--s===0&&n()};for(let[o,l,u]of i.matches.entries())this.#i(o)||this.matchSync(o,l,u);for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;s++;let l=o.readdirSync();this.walkCB3Sync(o,l,i,a)}a()}walkCB3Sync(e,r,i,n){i=i.filterEntries(e,r);let s=1,a=()=>{--s===0&&n()};for(let[o,l,u]of i.matches.entries())this.#i(o)||this.matchSync(o,l,u);for(let[o,l]of i.subwalks.entries())s++,this.walkCB2Sync(o,l,i.child(),a);a()}},_i=class extends hs{matches=new Set;constructor(e,r,i){super(e,r,i)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Si=class extends hs{results;constructor(e,r,i){super(e,r,i),this.results=new Rt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var OS=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",He=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=TS(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=r.platform||OS,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=r.platform==="win32"?_r:r.platform==="darwin"?wi:r.platform?Sr:Sp;this.scurry=new l(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",n={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new Oe(l,n)),[a,o]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=a.map((l,u)=>{let c=o[u];if(!c)throw new Error("invalid pattern object");return new Er(l,c,0,this.platform)})}async walk(){return[...await new _i(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new _i(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Si(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Si(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var $o=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Oe(r,e).hasMagic())return!0;return!1};function ps(t,e={}){return new He(t,e).streamSync()}function Rp(t,e={}){return new He(t,e).stream()}function xp(t,e={}){return new He(t,e).walkSync()}async function Ep(t,e={}){return new He(t,e).walk()}function gs(t,e={}){return new He(t,e).iterateSync()}function Mp(t,e={}){return new He(t,e).iterate()}var AS=ps,kS=Object.assign(Rp,{sync:ps}),PS=gs,DS=Object.assign(Mp,{sync:gs}),qS=Object.assign(xp,{stream:ps,iterate:gs}),ds=Object.assign(Ep,{glob:Ep,globSync:xp,sync:qS,globStream:Rp,stream:kS,globStreamSync:ps,streamSync:AS,globIterate:Mp,iterate:DS,globIterateSync:gs,iterateSync:PS,Glob:He,hasMagic:$o,escape:mr,unescape:Be});ds.glob=ds;var FS="../build",IS="../wheels",$S="streamlit-1.48.0-cp313-none-any.whl",WS="stlite_lib-0.1.0-py3-none-any.whl",BS=jS(import.meta.url),Ap=de.dirname(BS);async function kp(t,e){let r=[],i=n=>{r.push(n)};if(await t.loadPackage(e,{errorCallback:i}),r.length>0)throw new Error(r.join(`
40
+ `))}async function US(t){I.info("Copy the build directory (the bare built app files) to this directory...");let e=de.resolve(Ap,FS);if(!(await xt.stat(e)).isDirectory())throw new Error(`The source ${e} does not exist.`);if(e===t.copyTo){I.warn(`sourceDir == destDir (${e}). Are you in the development environment? Skip copying the directory.`);return}if(t.keepOld)try{await xt.access(t.copyTo),I.info(`${t.copyTo} already exists. Use it and skip copying.`);return}catch{throw new Error(`${t.copyTo} does not exist even though the \`keepOld\` option is specified`)}I.debug(`Copy ${e} to ${t.copyTo}`),await xt.rm(t.copyTo,{recursive:!0,force:!0}),await Wo.copy(e,t.copyTo,{errorOnExist:!0})}async function zS(t){if(t.requirements.length===0)return[];let e=await Op({packageBaseUrl:t.pyodideSource,packageCacheDir:t.pyodideRuntimeDir});return await Pp(e,{requirements:t.requirements}),Object.entries(e.loadedPackages).filter(([,r])=>r==="default channel").map(([r])=>r)}async function Tp(t,e){I.debug("Preparing the local wheel: %s",e);let r=await xt.readFile(e),i="/tmp/"+de.basename(e);t.FS.writeFile(i,r);let n=`emfs:${i}`;return I.debug("The local wheel %s is prepared as %s",e,n),n}async function Pp(t,e){await kp(t,"micropip");let r=t.pyimport("micropip"),i=[...e.requirements],n=de.join(Ap,IS),s=await Tp(t,de.join(n,WS));i.push(s);let a=await Tp(t,de.join(n,$S));i.push(a),I.info("Install the packages: %j",i),await r.install.callKwargs(i,{keep_going:!0})}async function HS(t){I.info("Create the site-packages snapshot file...");let e=await Op({packageBaseUrl:t.pyodideSource,packageCacheDir:t.pyodideRuntimeDir});await kp(e,"micropip");let r=e.pyimport("micropip"),i=new Yn(t.pyodideSource),n=[];if(t.usedPrebuiltPackages.length>0){I.info("Mocking prebuilt packages so that they will not be included in the site-packages snapshot because these will be installed from the vendored wheel files at runtime...");for(let o of t.usedPrebuiltPackages){let l=await i.getPackageInfoByName(o);if(l==null)throw new Error(`Package ${o} is not found in the lock file.`);I.debug(`Mock ${l.name} ${l.version}`),r.add_mock_package(l.name,l.version),n.push(l.name)}}I.info("Install the requirements %j",t.requirements),await Pp(e,{requirements:t.requirements}),I.info("Remove the mocked packages: %j",n),n.forEach(o=>r.remove_mock_package(o)),I.info("Archive the site-packages director(y|ies)");let s="/tmp/site-packages-snapshot.tar.gz";await e.runPythonAsync(`
41
41
  import os
42
42
  import tarfile
43
43
  import site
@@ -1 +1 @@
1
- import{r,E as i,_ as n}from"./index-DCNLpqIv.js";var e=r.forwardRef(function(t,o){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(i,n({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:o}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});e.displayName="ErrorOutline";export{e as E};
1
+ import{r,E as i,_ as n}from"./index-clm6On2Y.js";var e=r.forwardRef(function(t,o){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(i,n({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:o}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});e.displayName="ErrorOutline";export{e as E};
@@ -1 +1 @@
1
- import{r as e,E as n,_ as a}from"./index-DCNLpqIv.js";var i=e.forwardRef(function(r,t){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});i.displayName="Delete";var o=e.forwardRef(function(r,t){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});o.displayName="FileDownload";export{i as D,o as F};
1
+ import{r as e,E as n,_ as a}from"./index-clm6On2Y.js";var i=e.forwardRef(function(r,t){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});i.displayName="Delete";var o=e.forwardRef(function(r,t){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});o.displayName="FileDownload";export{i as D,o as F};