@expo/repack-app 0.4.1 → 0.4.2

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 (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +6 -5
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ ${i}`),Object.assign(w,W),c(w)}else a(W)},f=k=>{u?r.removeListener("exit",d):r.r
31
31
  `;s=s.replace(r,n)}}await qo.default.writeFile(e,s)}async function Pg(t,o){let e=Xo.default.join(t,"res/values/public.xml"),s=await qo.default.readFile(e,"utf8"),i=new Ss.Parser,r=new Set,n=await i.parseStringPromise(s),a=0,c=0,u=0;for(let k of n.resources.public){let v=parseInt(k.$.id,16);k.$.type==="drawable"?(a=Math.max(a,v),r.add(k.$.name)):k.$.type==="raw"&&(c=Math.max(c,v),r.add(k.$.name)),u=Math.max(u,v)}(0,Wt.default)(a!==0,"Drawable resources must be defined."),c===0&&(c=(u&4294901760)+65536);let m=(a&4294901760)+65536,x=(c&4294901760)+65536,g=new Set([...o.keys()].filter(k=>!r.has(k)));for(let k of g){let v=o.get(k);v!=null&&(v.type==="drawable"?(a+=1,(0,Wt.default)(a<m,"Drawable resource ID boundary exceeded."),n.resources.public.push({$:{type:"drawable",name:v.name,id:`0x${a.toString(16)}`}})):v.type==="raw"&&(c+=1,(0,Wt.default)(c<x,"Raw resource ID boundary exceeded."),n.resources.public.push({$:{type:"raw",name:v.name,id:`0x${c.toString(16)}`}})))}let f=new Ss.Builder().buildObject(n);await qo.default.writeFile(e,f)}function Lg(t){if(t.startsWith("drawable"))return"drawable";if(t==="raw")return"raw";throw new Error(`Unsupported asset type for ${t}`)}async function Fc(t,o,e=0,s=2,i=void 0,r=new Map){await qo.default.mkdir(o,{recursive:!0});let n=await qo.default.readdir(t,{withFileTypes:!0});return await Promise.all(n.map(async a=>{let c=Xo.default.join(t,a.name),u=Xo.default.join(o,a.name);if(a.isDirectory()){let m=i??Lg(a.name);e<s-1?await Fc(c,u,e+1,s,m,r):await qo.default.mkdir(u,{recursive:!0})}else{await qo.default.copyFile(c,u);let{name:m}=Xo.default.parse(a.name);(0,Wt.default)(i,"Asset type must be defined."),r.set(m,{name:m,type:i})}})),r}var Or=(t,o,e)=>{let s=t instanceof RegExp?Mc(t,e):t,i=o instanceof RegExp?Mc(o,e):o,r=s!==null&&i!=null&&Tg(s,i,e);return r&&{start:r[0],end:r[1],pre:e.slice(0,r[0]),body:e.slice(r[0]+s.length,r[1]),post:e.slice(r[1]+i.length)}},Mc=(t,o)=>{let e=o.match(t);return e?e[0]:null},Tg=(t,o,e)=>{let s,i,r,n,a,c=e.indexOf(t),u=e.indexOf(o,c+1),m=c;if(c>=0&&u>0){if(t===o)return[c,u];for(s=[],r=e.length;m>=0&&!a;){if(m===c)s.push(m),c=e.indexOf(t,m+1);else if(s.length===1){let x=s.pop();x!==void 0&&(a=[x,u])}else i=s.pop(),i!==void 0&&i<r&&(r=i,n=u),u=e.indexOf(o,m+1);m=c<u&&c>=0?c:u}s.length&&n!==void 0&&(a=[r,n])}return a};var Ec="\0SLASH"+Math.random()+"\0",Vc="\0OPEN"+Math.random()+"\0",wr="\0CLOSE"+Math.random()+"\0",Xc="\0COMMA"+Math.random()+"\0",Yc="\0PERIOD"+Math.random()+"\0",Ug=new RegExp(Ec,"g"),Ag=new RegExp(Vc,"g"),Qg=new RegExp(wr,"g"),jg=new RegExp(Xc,"g"),Rg=new RegExp(Yc,"g"),Jg=/\\\\/g,Bg=/\\{/g,Dg=/\\}/g,$g=/\\,/g,Hg=/\\./g;function dr(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function oO(t){return t.replace(Jg,Ec).replace(Bg,Vc).replace(Dg,wr).replace($g,Xc).replace(Hg,Yc)}function tO(t){return t.replace(Ug,"\\").replace(Ag,"{").replace(Qg,"}").replace(jg,",").replace(Rg,".")}function Ic(t){if(!t)return[""];let o=[],e=Or("{","}",t);if(!e)return t.split(",");let{pre:s,body:i,post:r}=e,n=s.split(",");n[n.length-1]+="{"+i+"}";let a=Ic(r);return r.length&&(n[n.length-1]+=a.shift(),n.push.apply(n,a)),o.push.apply(o,n),o}function Zc(t){return t?(t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),We(oO(t),!0).map(tO)):[]}function eO(t){return"{"+t+"}"}function sO(t){return/^-?0\d/.test(t)}function iO(t,o){return t<=o}function rO(t,o){return t>=o}function We(t,o){let e=[],s=Or("{","}",t);if(!s)return[t];let i=s.pre,r=s.post.length?We(s.post,!1):[""];if(/\$$/.test(s.pre))for(let n=0;n<r.length;n++){let a=i+"{"+s.body+"}"+r[n];e.push(a)}else{let n=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),c=n||a,u=s.body.indexOf(",")>=0;if(!c&&!u)return s.post.match(/,(?!,).*\}/)?(t=s.pre+"{"+s.body+wr+s.post,We(t)):[t];let m;if(c)m=s.body.split(/\.\./);else if(m=Ic(s.body),m.length===1&&m[0]!==void 0&&(m=We(m[0],!1).map(eO),m.length===1))return r.map(g=>s.pre+m[0]+g);let x;if(c&&m[0]!==void 0&&m[1]!==void 0){let g=dr(m[0]),d=dr(m[1]),f=Math.max(m[0].length,m[1].length),k=m.length===3&&m[2]!==void 0?Math.abs(dr(m[2])):1,v=iO;d<g&&(k*=-1,v=rO);let q=m.some(sO);x=[];for(let w=g;v(w,d);w+=k){let l;if(a)l=String.fromCharCode(w),l==="\\"&&(l="");else if(l=String(w),q){let O=f-l.length;if(O>0){let _=new Array(O+1).join("0");w<0?l="-"+_+l.slice(1):l=_+l}}x.push(l)}}else{x=[];for(let g=0;g<m.length;g++)x.push.apply(x,We(m[g],!1))}for(let g=0;g<x.length;g++)for(let d=0;d<r.length;d++){let f=i+x[g]+r[d];(!o||c||f)&&e.push(f)}}return e}var qe=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var nO={"[: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]},Ce=t=>t.replace(/[[\]\\-]/g,"\\$&"),aO=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Pc=t=>t.join(""),Lc=(t,o)=>{let e=o;if(t.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],i=[],r=e+1,n=!1,a=!1,c=!1,u=!1,m=e,x="";o:for(;r<t.length;){let k=t.charAt(r);if((k==="!"||k==="^")&&r===e+1){u=!0,r++;continue}if(k==="]"&&n&&!c){m=r+1;break}if(n=!0,k==="\\"&&!c){c=!0,r++;continue}if(k==="["&&!c){for(let[v,[W,q,w]]of Object.entries(nO))if(t.startsWith(v,r)){if(x)return["$.",!1,t.length-e,!0];r+=v.length,w?i.push(W):s.push(W),a=a||q;continue o}}if(c=!1,x){k>x?s.push(Ce(x)+"-"+Ce(k)):k===x&&s.push(Ce(k)),x="",r++;continue}if(t.startsWith("-]",r+1)){s.push(Ce(k+"-")),r+=2;continue}if(t.startsWith("-",r+1)){x=k,r+=2;continue}s.push(Ce(k)),r++}if(m<r)return["",!1,0,!1];if(!s.length&&!i.length)return["$.",!1,t.length-e,!0];if(i.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!u){let k=s[0].length===2?s[0].slice(-1):s[0];return[aO(k),!1,m-e,!1]}let g="["+(u?"^":"")+Pc(s)+"]",d="["+(u?"":"^")+Pc(i)+"]";return[s.length&&i.length?"("+g+"|"+d+")":s.length?g:d,a,m-e,!0]};var Yo=(t,{windowsPathsNoEscape:o=!1,magicalBraces:e=!0}={})=>e?o?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):o?t.replace(/\[([^\/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var cO=new Set(["!","?","+","*","@"]),Tc=t=>cO.has(t),lO="(?!(?:^|/)\\.\\.?(?:$|/))",Fs="(?!\\.)",uO=new Set(["[","."]),_O=new Set(["..","."]),xO=new Set("().*{}+?[]^$\\!"),mO=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),yr="[^/]",Uc=yr+"*?",Ac=yr+"+?",Lt=class t{type;#o;#t;#r=!1;#e=[];#n;#f;#l;#_=!1;#a;#c;#i=!1;constructor(o,e,s={}){this.type=o,o&&(this.#t=!0),this.#n=e,this.#o=this.#n?this.#n.#o:this,this.#a=this.#o===this?s:this.#o.#a,this.#l=this.#o===this?[]:this.#o.#l,o==="!"&&!this.#o.#_&&this.#l.push(this),this.#f=this.#n?this.#n.#e.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let o of this.#e)if(typeof o!="string"&&(o.type||o.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#e.map(o=>String(o)).join("|")+")":this.#c=this.#e.map(o=>String(o)).join("")}#d(){if(this!==this.#o)throw new Error("should only call on root");if(this.#_)return this;this.toString(),this.#_=!0;let o;for(;o=this.#l.pop();){if(o.type!=="!")continue;let e=o,s=e.#n;for(;s;){for(let i=e.#f+1;!s.type&&i<s.#e.length;i++)for(let r of o.#e){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(s.#e[i])}e=s,s=e.#n}}return this}push(...o){for(let e of o)if(e!==""){if(typeof e!="string"&&!(e instanceof t&&e.#n===this))throw new Error("invalid part: "+e);this.#e.push(e)}}toJSON(){let o=this.type===null?this.#e.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#e.map(e=>e.toJSON())];return this.isStart()&&!this.type&&o.unshift([]),this.isEnd()&&(this===this.#o||this.#o.#_&&this.#n?.type==="!")&&o.push({}),o}isStart(){if(this.#o===this)return!0;if(!this.#n?.isStart())return!1;if(this.#f===0)return!0;let o=this.#n;for(let e=0;e<this.#f;e++){let s=o.#e[e];if(!(s instanceof t&&s.type==="!"))return!1}return!0}isEnd(){if(this.#o===this||this.#n?.type==="!")return!0;if(!this.#n?.isEnd())return!1;if(!this.type)return this.#n?.isEnd();let o=this.#n?this.#n.#e.length:0;return this.#f===o-1}copyIn(o){typeof o=="string"?this.push(o):this.push(o.clone(this))}clone(o){let e=new t(this.type,o);for(let s of this.#e)e.copyIn(s);return e}static#w(o,e,s,i){let r=!1,n=!1,a=-1,c=!1;if(e.type===null){let d=s,f="";for(;d<o.length;){let k=o.charAt(d++);if(r||k==="\\"){r=!r,f+=k;continue}if(n){d===a+1?(k==="^"||k==="!")&&(c=!0):k==="]"&&!(d===a+2&&c)&&(n=!1),f+=k;continue}else if(k==="["){n=!0,a=d,c=!1,f+=k;continue}if(!i.noext&&Tc(k)&&o.charAt(d)==="("){e.push(f),f="";let v=new t(k,e);d=t.#w(o,v,d,i),e.push(v);continue}f+=k}return e.push(f),d}let u=s+1,m=new t(null,e),x=[],g="";for(;u<o.length;){let d=o.charAt(u++);if(r||d==="\\"){r=!r,g+=d;continue}if(n){u===a+1?(d==="^"||d==="!")&&(c=!0):d==="]"&&!(u===a+2&&c)&&(n=!1),g+=d;continue}else if(d==="["){n=!0,a=u,c=!1,g+=d;continue}if(Tc(d)&&o.charAt(u)==="("){m.push(g),g="";let f=new t(d,m);m.push(f),u=t.#w(o,f,u,i);continue}if(d==="|"){m.push(g),g="",x.push(m),m=new t(null,e);continue}if(d===")")return g===""&&e.#e.length===0&&(e.#i=!0),m.push(g),g="",e.push(...x,m),u;g+=d}return e.type=null,e.#t=void 0,e.#e=[o.substring(s-1)],u}static fromGlob(o,e={}){let s=new t(null,void 0,e);return t.#w(o,s,0,e),s}toMMPattern(){if(this!==this.#o)return this.#o.toMMPattern();let o=this.toString(),[e,s,i,r]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&o.toUpperCase()!==o.toLowerCase()))return s;let a=(this.#a.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,a),{_src:e,_glob:o})}get options(){return this.#a}toRegExpSource(o){let e=o??!!this.#a.dot;if(this.#o===this&&this.#d(),!this.type){let c=this.isStart()&&this.isEnd()&&!this.#e.some(d=>typeof d!="string"),u=this.#e.map(d=>{let[f,k,v,W]=typeof d=="string"?t.#x(d,this.#t,c):d.toRegExpSource(o);return this.#t=this.#t||v,this.#r=this.#r||W,f}).join(""),m="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&_O.has(this.#e[0]))){let f=uO,k=e&&f.has(u.charAt(0))||u.startsWith("\\.")&&f.has(u.charAt(2))||u.startsWith("\\.\\.")&&f.has(u.charAt(4)),v=!e&&!o&&f.has(u.charAt(0));m=k?lO:v?Fs:""}let x="";return this.isEnd()&&this.#o.#_&&this.#n?.type==="!"&&(x="(?:$|\\/)"),[m+u+x,Yo(u),this.#t=!!this.#t,this.#r]}let s=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#m(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let c=this.toString();return this.#e=[c],this.type=null,this.#t=void 0,[c,Yo(this.toString()),!1,!1]}let n=!s||o||e||!Fs?"":this.#m(!0);n===r&&(n=""),n&&(r=`(?:${r})(?:${n})*?`);let a="";if(this.type==="!"&&this.#i)a=(this.isStart()&&!e?Fs:"")+Ac;else{let c=this.type==="!"?"))"+(this.isStart()&&!e&&!o?Fs:"")+Uc+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&n?")":this.type==="*"&&n?")?":`)${this.type}`;a=i+r+c}return[a,Yo(r),this.#t=!!this.#t,this.#r]}#m(o){return this.#e.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,i,r,n]=e.toRegExpSource(o);return this.#r=this.#r||n,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#x(o,e,s=!1){let i=!1,r="",n=!1;for(let a=0;a<o.length;a++){let c=o.charAt(a);if(i){i=!1,r+=(xO.has(c)?"\\":"")+c;continue}if(c==="\\"){a===o.length-1?r+="\\\\":i=!0;continue}if(c==="["){let[u,m,x,g]=Lc(o,a);if(x){r+=u,n=n||m,a+=x-1,e=e||g;continue}}if(c==="*"){r+=s&&o==="*"?Ac:Uc,e=!0;continue}if(c==="?"){r+=yr,e=!0;continue}r+=mO(c)}return[r,Yo(o),!!e,n]}};var Tt=(t,{windowsPathsNoEscape:o=!1,magicalBraces:e=!1}={})=>e?o?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):o?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var mo=(t,o,e={})=>(qe(o),!e.nocomment&&o.charAt(0)==="#"?!1:new ko(o,e).match(t)),gO=/^\*+([^+@!?\*\[\(]*)$/,OO=t=>o=>!o.startsWith(".")&&o.endsWith(t),dO=t=>o=>o.endsWith(t),wO=t=>(t=t.toLowerCase(),o=>!o.startsWith(".")&&o.toLowerCase().endsWith(t)),yO=t=>(t=t.toLowerCase(),o=>o.toLowerCase().endsWith(t)),hO=/^\*+\.\*+$/,fO=t=>!t.startsWith(".")&&t.includes("."),zO=t=>t!=="."&&t!==".."&&t.includes("."),kO=/^\.\*+$/,bO=t=>t!=="."&&t!==".."&&t.startsWith("."),KO=/^\*+$/,GO=t=>t.length!==0&&!t.startsWith("."),pO=t=>t.length!==0&&t!=="."&&t!=="..",vO=/^\?+([^+@!?\*\[\(]*)?$/,WO=([t,o=""])=>{let e=Rc([t]);return o?(o=o.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(o)):e},qO=([t,o=""])=>{let e=Jc([t]);return o?(o=o.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(o)):e},CO=([t,o=""])=>{let e=Jc([t]);return o?s=>e(s)&&s.endsWith(o):e},NO=([t,o=""])=>{let e=Rc([t]);return o?s=>e(s)&&s.endsWith(o):e},Rc=([t])=>{let o=t.length;return e=>e.length===o&&!e.startsWith(".")},Jc=([t])=>{let o=t.length;return e=>e.length===o&&e!=="."&&e!==".."},Bc=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Qc={win32:{sep:"\\"},posix:{sep:"/"}},SO=Bc==="win32"?Qc.win32.sep:Qc.posix.sep;mo.sep=SO;var ro=Symbol("globstar **");mo.GLOBSTAR=ro;var FO="[^/]",MO=FO+"*?",EO="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",VO="(?:(?!(?:\\/|^)\\.).)*?",XO=(t,o={})=>e=>mo(e,t,o);mo.filter=XO;var Co=(t,o={})=>Object.assign({},t,o),YO=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return mo;let o=mo;return Object.assign((s,i,r={})=>o(s,i,Co(t,r)),{Minimatch:class extends o.Minimatch{constructor(i,r={}){super(i,Co(t,r))}static defaults(i){return o.defaults(Co(t,i)).Minimatch}},AST:class extends o.AST{constructor(i,r,n={}){super(i,r,Co(t,n))}static fromGlob(i,r={}){return o.AST.fromGlob(i,Co(t,r))}},unescape:(s,i={})=>o.unescape(s,Co(t,i)),escape:(s,i={})=>o.escape(s,Co(t,i)),filter:(s,i={})=>o.filter(s,Co(t,i)),defaults:s=>o.defaults(Co(t,s)),makeRe:(s,i={})=>o.makeRe(s,Co(t,i)),braceExpand:(s,i={})=>o.braceExpand(s,Co(t,i)),match:(s,i,r={})=>o.match(s,i,Co(t,r)),sep:o.sep,GLOBSTAR:ro})};mo.defaults=YO;var Dc=(t,o={})=>(qe(t),o.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Zc(t));mo.braceExpand=Dc;var IO=(t,o={})=>new ko(t,o).makeRe();mo.makeRe=IO;var ZO=(t,o,e={})=>{let s=new ko(o,e);return t=t.filter(i=>s.match(i)),s.options.nonull&&!t.length&&t.push(o),t};mo.match=ZO;var jc=/[?*]|[+@!]\(.*?\)|\[|\]/,PO=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ko=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(o,e={}){qe(o),e=e||{},this.options=e,this.pattern=o,this.platform=e.platform||Bc,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.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 o of this.set)for(let e of o)if(typeof e!="string")return!0;return!1}debug(...o){}make(){let o=this.pattern,e=this.options;if(!e.nocomment&&o.charAt(0)==="#"){this.comment=!0;return}if(!o){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let i=this.globParts.map((r,n,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=r[0]===""&&r[1]===""&&(r[2]==="?"||!jc.test(r[2]))&&!jc.test(r[3]),u=/^[a-z]:/i.test(r[0]);if(c)return[...r.slice(0,4),...r.slice(4).map(m=>this.parse(m))];if(u)return[r[0],...r.slice(1).map(m=>this.parse(m))]}return r.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let n=this.set[r];n[0]===""&&n[1]===""&&this.globParts[r][2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])&&(n[2]="?")}this.debug(this.pattern,this.set)}preprocess(o){if(this.options.noglobstar)for(let s=0;s<o.length;s++)for(let i=0;i<o[s].length;i++)o[s][i]==="**"&&(o[s][i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(o=this.firstPhasePreProcess(o),o=this.secondPhasePreProcess(o)):e>=1?o=this.levelOneOptimize(o):o=this.adjascentGlobstarOptimize(o),o}adjascentGlobstarOptimize(o){return o.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let i=s;for(;e[i+1]==="**";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(o){return o.map(e=>(e=e.reduce((s,i)=>{let r=s[s.length-1];return i==="**"&&r==="**"?s:i===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(s.pop(),s):(s.push(i),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(o){Array.isArray(o)||(o=this.slashSplit(o));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let i=1;i<o.length-1;i++){let r=o[i];i===1&&r===""&&o[0]===""||(r==="."||r==="")&&(e=!0,o.splice(i,1),i--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(e=!0,o.pop())}let s=0;for(;(s=o.indexOf("..",s+1))!==-1;){let i=o[s-1];i&&i!=="."&&i!==".."&&i!=="**"&&(e=!0,o.splice(s-1,2),s-=2)}}while(e);return o.length===0?[""]:o}firstPhasePreProcess(o){let e=!1;do{e=!1;for(let s of o){let i=-1;for(;(i=s.indexOf("**",i+1))!==-1;){let n=i;for(;s[n+1]==="**";)n++;n>i&&s.splice(i+1,n-i);let a=s[i+1],c=s[i+2],u=s[i+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;e=!0,s.splice(i,1);let m=s.slice(0);m[i]="**",o.push(m),i--}if(!this.preserveMultipleSlashes){for(let n=1;n<s.length-1;n++){let a=s[n];n===1&&a===""&&s[0]===""||(a==="."||a==="")&&(e=!0,s.splice(n,1),n--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let r=0;for(;(r=s.indexOf("..",r+1))!==-1;){let n=s[r-1];if(n&&n!=="."&&n!==".."&&n!=="**"){e=!0;let c=r===1&&s[r+1]==="**"?["."]:[];s.splice(r-1,2,...c),s.length===0&&s.push(""),r-=2}}}}while(e);return o}secondPhasePreProcess(o){for(let e=0;e<o.length-1;e++)for(let s=e+1;s<o.length;s++){let i=this.partsMatch(o[e],o[s],!this.preserveMultipleSlashes);if(i){o[e]=[],o[s]=i;break}}return o.filter(e=>e.length)}partsMatch(o,e,s=!1){let i=0,r=0,n=[],a="";for(;i<o.length&&r<e.length;)if(o[i]===e[r])n.push(a==="b"?e[r]:o[i]),i++,r++;else if(s&&o[i]==="**"&&e[r]===o[i+1])n.push(o[i]),i++;else if(s&&e[r]==="**"&&o[i]===e[r+1])n.push(e[r]),r++;else if(o[i]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="b")return!1;a="a",n.push(o[i]),i++,r++}else if(e[r]==="*"&&o[i]&&(this.options.dot||!o[i].startsWith("."))&&o[i]!=="**"){if(a==="a")return!1;a="b",n.push(e[r]),i++,r++}else return!1;return o.length===e.length&&n}parseNegate(){if(this.nonegate)return;let o=this.pattern,e=!1,s=0;for(let i=0;i<o.length&&o.charAt(i)==="!";i++)e=!e,s++;s&&(this.pattern=o.slice(s)),this.negate=e}matchOne(o,e,s=!1){let i=this.options;if(this.isWindows){let k=typeof o[0]=="string"&&/^[a-z]:$/i.test(o[0]),v=!k&&o[0]===""&&o[1]===""&&o[2]==="?"&&/^[a-z]:$/i.test(o[3]),W=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),q=!W&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),w=v?3:k?0:void 0,l=q?3:W?0:void 0;if(typeof w=="number"&&typeof l=="number"){let[O,_]=[o[w],e[l]];O.toLowerCase()===_.toLowerCase()&&(e[l]=O,l>w?e=e.slice(l):w>l&&(o=o.slice(w)))}}let{optimizationLevel:r=1}=this.options;r>=2&&(o=this.levelTwoFileOptimize(o)),this.debug("matchOne",this,{file:o,pattern:e}),this.debug("matchOne",o.length,e.length);for(var n=0,a=0,c=o.length,u=e.length;n<c&&a<u;n++,a++){this.debug("matchOne loop");var m=e[a],x=o[n];if(this.debug(e,m,x),m===!1)return!1;if(m===ro){this.debug("GLOBSTAR",[e,m,x]);var g=n,d=a+1;if(d===u){for(this.debug("** at the end");n<c;n++)if(o[n]==="."||o[n]===".."||!i.dot&&o[n].charAt(0)===".")return!1;return!0}for(;g<c;){var f=o[g];if(this.debug(`
32
32
  globstar while`,o,g,e,d,f),this.matchOne(o.slice(g),e.slice(d),s))return this.debug("globstar found match!",g,c,f),!0;if(f==="."||f===".."||!i.dot&&f.charAt(0)==="."){this.debug("dot detected!",o,g,e,d);break}this.debug("globstar swallow a segment, and continue"),g++}return!!(s&&(this.debug(`
33
33
  >>> no match, partial?`,o,g,e,d),g===c))}let k;if(typeof m=="string"?(k=x===m,this.debug("string match",m,x,k)):(k=m.test(x),this.debug("pattern match",m,x,k)),!k)return!1}if(n===c&&a===u)return!0;if(n===c)return s;if(a===u)return n===c-1&&o[n]==="";throw new Error("wtf?")}braceExpand(){return Dc(this.pattern,this.options)}parse(o){qe(o);let e=this.options;if(o==="**")return ro;if(o==="")return"";let s,i=null;(s=o.match(KO))?i=e.dot?pO:GO:(s=o.match(gO))?i=(e.nocase?e.dot?yO:wO:e.dot?dO:OO)(s[1]):(s=o.match(vO))?i=(e.nocase?e.dot?qO:WO:e.dot?CO:NO)(s):(s=o.match(hO))?i=e.dot?zO:fO:(s=o.match(kO))&&(i=bO);let r=Lt.fromGlob(o,this.options).toMMPattern();return i&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:i}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let o=this.set;if(!o.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?MO:e.dot?EO:VO,i=new Set(e.nocase?["i"]:[]),r=o.map(c=>{let u=c.map(x=>{if(x instanceof RegExp)for(let g of x.flags.split(""))i.add(g);return typeof x=="string"?PO(x):x===ro?ro:x._src});u.forEach((x,g)=>{let d=u[g+1],f=u[g-1];x!==ro||f===ro||(f===void 0?d!==void 0&&d!==ro?u[g+1]="(?:\\/|"+s+"\\/)?"+d:u[g]=s:d===void 0?u[g-1]=f+"(?:\\/|\\/"+s+")?":d!==ro&&(u[g-1]=f+"(?:\\/|\\/"+s+"\\/)"+d,u[g+1]=ro))});let m=u.filter(x=>x!==ro);if(this.partial&&m.length>=1){let x=[];for(let g=1;g<=m.length;g++)x.push(m.slice(0,g).join("/"));return"(?:"+x.join("|")+")"}return m.join("/")}).join("|"),[n,a]=o.length>1?["(?:",")"]:["",""];r="^"+n+r+a+"$",this.partial&&(r="^(?:\\/|"+n+r.slice(1,-1)+a+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(o){return this.preserveMultipleSlashes?o.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(o)?["",...o.split(/\/+/)]:o.split(/\/+/)}match(o,e=this.partial){if(this.debug("match",o,this.pattern),this.comment)return!1;if(this.empty)return o==="";if(o==="/"&&e)return!0;let s=this.options;this.isWindows&&(o=o.split("\\").join("/"));let i=this.slashSplit(o);this.debug(this.pattern,"split",i);let r=this.set;this.debug(this.pattern,"set",r);let n=i[i.length-1];if(!n)for(let a=i.length-2;!n&&a>=0;a--)n=i[a];for(let a=0;a<r.length;a++){let c=r[a],u=i;if(s.matchBase&&c.length===1&&(u=[n]),this.matchOne(u,c,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(o){return mo.defaults(o).Minimatch}};mo.AST=Lt;mo.Minimatch=ko;mo.escape=Tt;mo.unescape=Yo;var zl=require("node:url");var Ut=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Hc=new Set,hr=typeof process=="object"&&process?process:{},ol=(t,o,e,s)=>{typeof hr.emitWarning=="function"?hr.emitWarning(t,o,e,s):console.error(`[${e}] ${o}: ${t}`)},Ms=globalThis.AbortController,$c=globalThis.AbortSignal;if(typeof Ms>"u"){$c=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,i){this._onabort.push(i)}},Ms=class{constructor(){o()}signal=new $c;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let i of this.signal._onabort)i(s);this.signal.onabort?.(s)}}};let t=hr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",o=()=>{t&&(t=!1,ol("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",o))}}var LO=t=>!Hc.has(t);var dt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),tl=t=>dt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?At:null:null,At=class extends Array{constructor(o){super(o),this.fill(0)}},fr=class t{heap;length;static#o=!1;static create(o){let e=tl(o);if(!e)return[];t.#o=!0;let s=new t(o,e);return t.#o=!1,s}constructor(o,e){if(!t.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(o),this.length=0}push(o){this.heap[this.length++]=o}pop(){return this.heap[--this.length]}},Ne=class t{#o;#t;#r;#e;#n;#f;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#_;#a;#c;#i;#d;#w;#m;#x;#b;#O;#K;#G;#h;#z;#k;#g;static unsafeExposeInternals(o){return{starts:o.#G,ttls:o.#h,sizes:o.#K,keyMap:o.#a,keyList:o.#c,valList:o.#i,next:o.#d,prev:o.#w,get head(){return o.#m},get tail(){return o.#x},free:o.#b,isBackgroundFetch:e=>o.#u(e),backgroundFetch:(e,s,i,r)=>o.#Y(e,s,i,r),moveToTail:e=>o.#Z(e),indexes:e=>o.#v(e),rindexes:e=>o.#W(e),isStale:e=>o.#y(e)}}get max(){return this.#o}get maxSize(){return this.#t}get calculatedSize(){return this.#_}get size(){return this.#l}get fetchMethod(){return this.#n}get memoMethod(){return this.#f}get dispose(){return this.#r}get disposeAfter(){return this.#e}constructor(o){let{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:r,updateAgeOnGet:n,updateAgeOnHas:a,allowStale:c,dispose:u,disposeAfter:m,noDisposeOnSet:x,noUpdateTTL:g,maxSize:d=0,maxEntrySize:f=0,sizeCalculation:k,fetchMethod:v,memoMethod:W,noDeleteOnFetchRejection:q,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:l,allowStaleOnFetchAbort:O,ignoreFetchAbort:_}=o;if(e!==0&&!dt(e))throw new TypeError("max option must be a nonnegative integer");let K=e?tl(e):Array;if(!K)throw new Error("invalid max value: "+e);if(this.#o=e,this.#t=d,this.maxEntrySize=f||this.#t,this.sizeCalculation=k,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(W!==void 0&&typeof W!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=W,v!==void 0&&typeof v!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#n=v,this.#k=!!v,this.#a=new Map,this.#c=new Array(e).fill(void 0),this.#i=new Array(e).fill(void 0),this.#d=new K(e),this.#w=new K(e),this.#m=0,this.#x=0,this.#b=fr.create(e),this.#l=0,this.#_=0,typeof u=="function"&&(this.#r=u),typeof m=="function"?(this.#e=m,this.#O=[]):(this.#e=void 0,this.#O=void 0),this.#z=!!this.#r,this.#g=!!this.#e,this.noDisposeOnSet=!!x,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!q,this.allowStaleOnFetchRejection=!!l,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!_,this.maxEntrySize!==0){if(this.#t!==0&&!dt(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!dt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!a,this.ttlResolution=dt(i)||i===0?i:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!dt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#q()}if(this.#o===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#t){let y="LRU_CACHE_UNBOUNDED";LO(y)&&(Hc.add(y),ol("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",y,t))}}getRemainingTTL(o){return this.#a.has(o)?1/0:0}#q(){let o=new At(this.#o),e=new At(this.#o);this.#h=o,this.#G=e,this.#S=(r,n,a=Ut.now())=>{if(e[r]=n!==0?a:0,o[r]=n,n!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#y(r)&&this.#N(this.#c[r],"expire")},n+1);c.unref&&c.unref()}},this.#p=r=>{e[r]=o[r]!==0?Ut.now():0},this.#s=(r,n)=>{if(o[n]){let a=o[n],c=e[n];if(!a||!c)return;r.ttl=a,r.start=c,r.now=s||i();let u=r.now-c;r.remainingTTL=a-u}};let s=0,i=()=>{let r=Ut.now();if(this.ttlResolution>0){s=r;let n=setTimeout(()=>s=0,this.ttlResolution);n.unref&&n.unref()}return r};this.getRemainingTTL=r=>{let n=this.#a.get(r);if(n===void 0)return 0;let a=o[n],c=e[n];if(!a||!c)return 1/0;let u=(s||i())-c;return a-u},this.#y=r=>{let n=e[r],a=o[r];return!!a&&!!n&&(s||i())-n>a}}#p=()=>{};#s=()=>{};#S=()=>{};#y=()=>!1;#C(){let o=new At(this.#o);this.#_=0,this.#K=o,this.#F=e=>{this.#_-=o[e],o[e]=0},this.#E=(e,s,i,r)=>{if(this.#u(s))return 0;if(!dt(i))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(i=r(s,e),!dt(i))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 i},this.#M=(e,s,i)=>{if(o[e]=s,this.#t){let r=this.#t-o[e];for(;this.#_>r;)this.#X(!0)}this.#_+=o[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#_)}}#F=o=>{};#M=(o,e,s)=>{};#E=(o,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#v({allowStale:o=this.allowStale}={}){if(this.#l)for(let e=this.#x;!(!this.#V(e)||((o||!this.#y(e))&&(yield e),e===this.#m));)e=this.#w[e]}*#W({allowStale:o=this.allowStale}={}){if(this.#l)for(let e=this.#m;!(!this.#V(e)||((o||!this.#y(e))&&(yield e),e===this.#x));)e=this.#d[e]}#V(o){return o!==void 0&&this.#a.get(this.#c[o])===o}*entries(){for(let o of this.#v())this.#i[o]!==void 0&&this.#c[o]!==void 0&&!this.#u(this.#i[o])&&(yield[this.#c[o],this.#i[o]])}*rentries(){for(let o of this.#W())this.#i[o]!==void 0&&this.#c[o]!==void 0&&!this.#u(this.#i[o])&&(yield[this.#c[o],this.#i[o]])}*keys(){for(let o of this.#v()){let e=this.#c[o];e!==void 0&&!this.#u(this.#i[o])&&(yield e)}}*rkeys(){for(let o of this.#W()){let e=this.#c[o];e!==void 0&&!this.#u(this.#i[o])&&(yield e)}}*values(){for(let o of this.#v())this.#i[o]!==void 0&&!this.#u(this.#i[o])&&(yield this.#i[o])}*rvalues(){for(let o of this.#W())this.#i[o]!==void 0&&!this.#u(this.#i[o])&&(yield this.#i[o])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(o,e={}){for(let s of this.#v()){let i=this.#i[s],r=this.#u(i)?i.__staleWhileFetching:i;if(r!==void 0&&o(r,this.#c[s],this))return this.get(this.#c[s],e)}}forEach(o,e=this){for(let s of this.#v()){let i=this.#i[s],r=this.#u(i)?i.__staleWhileFetching:i;r!==void 0&&o.call(e,r,this.#c[s],this)}}rforEach(o,e=this){for(let s of this.#W()){let i=this.#i[s],r=this.#u(i)?i.__staleWhileFetching:i;r!==void 0&&o.call(e,r,this.#c[s],this)}}purgeStale(){let o=!1;for(let e of this.#W({allowStale:!0}))this.#y(e)&&(this.#N(this.#c[e],"expire"),o=!0);return o}info(o){let e=this.#a.get(o);if(e===void 0)return;let s=this.#i[e],i=this.#u(s)?s.__staleWhileFetching:s;if(i===void 0)return;let r={value:i};if(this.#h&&this.#G){let n=this.#h[e],a=this.#G[e];if(n&&a){let c=n-(Ut.now()-a);r.ttl=c,r.start=Date.now()}}return this.#K&&(r.size=this.#K[e]),r}dump(){let o=[];for(let e of this.#v({allowStale:!0})){let s=this.#c[e],i=this.#i[e],r=this.#u(i)?i.__staleWhileFetching:i;if(r===void 0||s===void 0)continue;let n={value:r};if(this.#h&&this.#G){n.ttl=this.#h[e];let a=Ut.now()-this.#G[e];n.start=Math.floor(Date.now()-a)}this.#K&&(n.size=this.#K[e]),o.unshift([s,n])}return o}load(o){this.clear();for(let[e,s]of o){if(s.start){let i=Date.now()-s.start;s.start=Ut.now()-i}this.set(e,s.value,s)}}set(o,e,s={}){if(e===void 0)return this.delete(o),this;let{ttl:i=this.ttl,start:r,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=s,{noUpdateTTL:u=this.noUpdateTTL}=s,m=this.#E(o,e,s.size||0,a);if(this.maxEntrySize&&m>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#N(o,"set"),this;let x=this.#l===0?void 0:this.#a.get(o);if(x===void 0)x=this.#l===0?this.#x:this.#b.length!==0?this.#b.pop():this.#l===this.#o?this.#X(!1):this.#l,this.#c[x]=o,this.#i[x]=e,this.#a.set(o,x),this.#d[this.#x]=x,this.#w[x]=this.#x,this.#x=x,this.#l++,this.#M(x,m,c),c&&(c.set="add"),u=!1;else{this.#Z(x);let g=this.#i[x];if(e!==g){if(this.#k&&this.#u(g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=g;d!==void 0&&!n&&(this.#z&&this.#r?.(d,o,"set"),this.#g&&this.#O?.push([d,o,"set"]))}else n||(this.#z&&this.#r?.(g,o,"set"),this.#g&&this.#O?.push([g,o,"set"]));if(this.#F(x),this.#M(x,m,c),this.#i[x]=e,c){c.set="replace";let d=g&&this.#u(g)?g.__staleWhileFetching:g;d!==void 0&&(c.oldValue=d)}}else c&&(c.set="update")}if(i!==0&&!this.#h&&this.#q(),this.#h&&(u||this.#S(x,i,r),c&&this.#s(c,x)),!n&&this.#g&&this.#O){let g=this.#O,d;for(;d=g?.shift();)this.#e?.(...d)}return this}pop(){try{for(;this.#l;){let o=this.#i[this.#m];if(this.#X(!0),this.#u(o)){if(o.__staleWhileFetching)return o.__staleWhileFetching}else if(o!==void 0)return o}}finally{if(this.#g&&this.#O){let o=this.#O,e;for(;e=o?.shift();)this.#e?.(...e)}}}#X(o){let e=this.#m,s=this.#c[e],i=this.#i[e];return this.#k&&this.#u(i)?i.__abortController.abort(new Error("evicted")):(this.#z||this.#g)&&(this.#z&&this.#r?.(i,s,"evict"),this.#g&&this.#O?.push([i,s,"evict"])),this.#F(e),o&&(this.#c[e]=void 0,this.#i[e]=void 0,this.#b.push(e)),this.#l===1?(this.#m=this.#x=0,this.#b.length=0):this.#m=this.#d[e],this.#a.delete(s),this.#l--,e}has(o,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,r=this.#a.get(o);if(r!==void 0){let n=this.#i[r];if(this.#u(n)&&n.__staleWhileFetching===void 0)return!1;if(this.#y(r))i&&(i.has="stale",this.#s(i,r));else return s&&this.#p(r),i&&(i.has="hit",this.#s(i,r)),!0}else i&&(i.has="miss");return!1}peek(o,e={}){let{allowStale:s=this.allowStale}=e,i=this.#a.get(o);if(i===void 0||!s&&this.#y(i))return;let r=this.#i[i];return this.#u(r)?r.__staleWhileFetching:r}#Y(o,e,s,i){let r=e===void 0?void 0:this.#i[e];if(this.#u(r))return r;let n=new Ms,{signal:a}=s;a?.addEventListener("abort",()=>n.abort(a.reason),{signal:n.signal});let c={signal:n.signal,options:s,context:i},u=(k,v=!1)=>{let{aborted:W}=n.signal,q=s.ignoreFetchAbort&&k!==void 0;if(s.status&&(W&&!v?(s.status.fetchAborted=!0,s.status.fetchError=n.signal.reason,q&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),W&&!q&&!v)return x(n.signal.reason);let w=d;return this.#i[e]===d&&(k===void 0?w.__staleWhileFetching?this.#i[e]=w.__staleWhileFetching:this.#N(o,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(o,k,c.options))),k},m=k=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=k),x(k)),x=k=>{let{aborted:v}=n.signal,W=v&&s.allowStaleOnFetchAbort,q=W||s.allowStaleOnFetchRejection,w=q||s.noDeleteOnFetchRejection,l=d;if(this.#i[e]===d&&(!w||l.__staleWhileFetching===void 0?this.#N(o,"fetch"):W||(this.#i[e]=l.__staleWhileFetching)),q)return s.status&&l.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw k},g=(k,v)=>{let W=this.#n?.(o,r,c);W&&W instanceof Promise&&W.then(q=>k(q===void 0?void 0:q),v),n.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(k(void 0),s.allowStaleOnFetchAbort&&(k=q=>u(q,!0)))})};s.status&&(s.status.fetchDispatched=!0);let d=new Promise(g).then(u,m),f=Object.assign(d,{__abortController:n,__staleWhileFetching:r,__returned:void 0});return e===void 0?(this.set(o,f,{...c.options,status:void 0}),e=this.#a.get(o)):this.#i[e]=f,f}#u(o){if(!this.#k)return!1;let e=o;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof Ms}async fetch(o,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:x=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:k,forceRefresh:v=!1,status:W,signal:q}=e;if(!this.#k)return W&&(W.fetch="get"),this.get(o,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:W});let w={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:n,noDisposeOnSet:a,size:c,sizeCalculation:u,noUpdateTTL:m,noDeleteOnFetchRejection:x,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:f,ignoreFetchAbort:d,status:W,signal:q},l=this.#a.get(o);if(l===void 0){W&&(W.fetch="miss");let O=this.#Y(o,l,w,k);return O.__returned=O}else{let O=this.#i[l];if(this.#u(O)){let z=s&&O.__staleWhileFetching!==void 0;return W&&(W.fetch="inflight",z&&(W.returnedStale=!0)),z?O.__staleWhileFetching:O.__returned=O}let _=this.#y(l);if(!v&&!_)return W&&(W.fetch="hit"),this.#Z(l),i&&this.#p(l),W&&this.#s(W,l),O;let K=this.#Y(o,l,w,k),h=K.__staleWhileFetching!==void 0&&s;return W&&(W.fetch=_?"stale":"refresh",h&&_&&(W.returnedStale=!0)),h?K.__staleWhileFetching:K.__returned=K}}async forceFetch(o,e={}){let s=await this.fetch(o,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(o,e={}){let s=this.#f;if(!s)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:r,...n}=e,a=this.get(o,n);if(!r&&a!==void 0)return a;let c=s(o,a,{options:n,context:i});return this.set(o,c,n),c}get(o,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:n}=e,a=this.#a.get(o);if(a!==void 0){let c=this.#i[a],u=this.#u(c);return n&&this.#s(n,a),this.#y(a)?(n&&(n.get="stale"),u?(n&&s&&c.__staleWhileFetching!==void 0&&(n.returnedStale=!0),s?c.__staleWhileFetching:void 0):(r||this.#N(o,"expire"),n&&s&&(n.returnedStale=!0),s?c:void 0)):(n&&(n.get="hit"),u?c.__staleWhileFetching:(this.#Z(a),i&&this.#p(a),c))}else n&&(n.get="miss")}#I(o,e){this.#w[e]=o,this.#d[o]=e}#Z(o){o!==this.#x&&(o===this.#m?this.#m=this.#d[o]:this.#I(this.#w[o],this.#d[o]),this.#I(this.#x,o),this.#x=o)}delete(o){return this.#N(o,"delete")}#N(o,e){let s=!1;if(this.#l!==0){let i=this.#a.get(o);if(i!==void 0)if(s=!0,this.#l===1)this.#P(e);else{this.#F(i);let r=this.#i[i];if(this.#u(r)?r.__abortController.abort(new Error("deleted")):(this.#z||this.#g)&&(this.#z&&this.#r?.(r,o,e),this.#g&&this.#O?.push([r,o,e])),this.#a.delete(o),this.#c[i]=void 0,this.#i[i]=void 0,i===this.#x)this.#x=this.#w[i];else if(i===this.#m)this.#m=this.#d[i];else{let n=this.#w[i];this.#d[n]=this.#d[i];let a=this.#d[i];this.#w[a]=this.#w[i]}this.#l--,this.#b.push(i)}}if(this.#g&&this.#O?.length){let i=this.#O,r;for(;r=i?.shift();)this.#e?.(...r)}return s}clear(){return this.#P("delete")}#P(o){for(let e of this.#W({allowStale:!0})){let s=this.#i[e];if(this.#u(s))s.__abortController.abort(new Error("deleted"));else{let i=this.#c[e];this.#z&&this.#r?.(s,i,o),this.#g&&this.#O?.push([s,i,o])}}if(this.#a.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#h&&this.#G&&(this.#h.fill(0),this.#G.fill(0)),this.#K&&this.#K.fill(0),this.#m=0,this.#x=0,this.#b.length=0,this.#_=0,this.#l=0,this.#g&&this.#O){let e=this.#O,s;for(;s=e?.shift();)this.#e?.(...s)}}};var Rt=require("node:path"),_l=require("node:url"),Ro=require("fs"),$O=P(require("node:fs"),1),ht=require("node:fs/promises");var Ps=require("node:events"),vr=P(require("node:stream"),1),nl=require("node:string_decoder"),el=typeof process=="object"&&process?process:{stdout:null,stderr:null},TO=t=>!!t&&typeof t=="object"&&(t instanceof yt||t instanceof vr.default||UO(t)||AO(t)),UO=t=>!!t&&typeof t=="object"&&t instanceof Ps.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==vr.default.Writable.prototype.pipe,AO=t=>!!t&&typeof t=="object"&&t instanceof Ps.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",it=Symbol("EOF"),rt=Symbol("maybeEmitEnd"),wt=Symbol("emittedEnd"),Es=Symbol("emittingEnd"),Se=Symbol("emittedError"),Vs=Symbol("closed"),sl=Symbol("read"),Xs=Symbol("flush"),il=Symbol("flushChunk"),Io=Symbol("encoding"),Qt=Symbol("decoder"),D=Symbol("flowing"),Fe=Symbol("paused"),jt=Symbol("resume"),$=Symbol("buffer"),go=Symbol("pipes"),H=Symbol("bufferLength"),zr=Symbol("bufferPush"),Ys=Symbol("bufferShift"),lo=Symbol("objectMode"),A=Symbol("destroyed"),kr=Symbol("error"),br=Symbol("emitData"),rl=Symbol("emitEnd"),Kr=Symbol("emitEnd2"),Qo=Symbol("async"),Gr=Symbol("abort"),Is=Symbol("aborted"),Me=Symbol("signal"),qt=Symbol("dataListeners"),bo=Symbol("discarded"),Ee=t=>Promise.resolve().then(t),QO=t=>t(),jO=t=>t==="end"||t==="finish"||t==="prefinish",RO=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,JO=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Zs=class{src;dest;opts;ondrain;constructor(o,e,s){this.src=o,this.dest=e,this.opts=s,this.ondrain=()=>o[jt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(o){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},pr=class extends Zs{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(o,e,s){super(o,e,s),this.proxyErrors=i=>e.emit("error",i),o.on("error",this.proxyErrors)}},BO=t=>!!t.objectMode,DO=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",yt=class extends Ps.EventEmitter{[D]=!1;[Fe]=!1;[go]=[];[$]=[];[lo];[Io];[Qo];[Qt];[it]=!1;[wt]=!1;[Es]=!1;[Vs]=!1;[Se]=null;[H]=0;[A]=!1;[Me];[Is]=!1;[qt]=0;[bo]=!1;writable=!0;readable=!0;constructor(...o){let e=o[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");BO(e)?(this[lo]=!0,this[Io]=null):DO(e)?(this[Io]=e.encoding,this[lo]=!1):(this[lo]=!1,this[Io]=null),this[Qo]=!!e.async,this[Qt]=this[Io]?new nl.StringDecoder(this[Io]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[$]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[go]});let{signal:s}=e;s&&(this[Me]=s,s.aborted?this[Gr]():s.addEventListener("abort",()=>this[Gr]()))}get bufferLength(){return this[H]}get encoding(){return this[Io]}set encoding(o){throw new Error("Encoding must be set at instantiation time")}setEncoding(o){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[lo]}set objectMode(o){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Qo]}set async(o){this[Qo]=this[Qo]||!!o}[Gr](){this[Is]=!0,this.emit("abort",this[Me]?.reason),this.destroy(this[Me]?.reason)}get aborted(){return this[Is]}set aborted(o){}write(o,e,s){if(this[Is])return!1;if(this[it])throw new Error("write after end");if(this[A])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let i=this[Qo]?Ee:QO;if(!this[lo]&&!Buffer.isBuffer(o)){if(JO(o))o=Buffer.from(o.buffer,o.byteOffset,o.byteLength);else if(RO(o))o=Buffer.from(o);else if(typeof o!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[lo]?(this[D]&&this[H]!==0&&this[Xs](!0),this[D]?this.emit("data",o):this[zr](o),this[H]!==0&&this.emit("readable"),s&&i(s),this[D]):o.length?(typeof o=="string"&&!(e===this[Io]&&!this[Qt]?.lastNeed)&&(o=Buffer.from(o,e)),Buffer.isBuffer(o)&&this[Io]&&(o=this[Qt].write(o)),this[D]&&this[H]!==0&&this[Xs](!0),this[D]?this.emit("data",o):this[zr](o),this[H]!==0&&this.emit("readable"),s&&i(s),this[D]):(this[H]!==0&&this.emit("readable"),s&&i(s),this[D])}read(o){if(this[A])return null;if(this[bo]=!1,this[H]===0||o===0||o&&o>this[H])return this[rt](),null;this[lo]&&(o=null),this[$].length>1&&!this[lo]&&(this[$]=[this[Io]?this[$].join(""):Buffer.concat(this[$],this[H])]);let e=this[sl](o||null,this[$][0]);return this[rt](),e}[sl](o,e){if(this[lo])this[Ys]();else{let s=e;o===s.length||o===null?this[Ys]():typeof s=="string"?(this[$][0]=s.slice(o),e=s.slice(0,o),this[H]-=o):(this[$][0]=s.subarray(o),e=s.subarray(0,o),this[H]-=o)}return this.emit("data",e),!this[$].length&&!this[it]&&this.emit("drain"),e}end(o,e,s){return typeof o=="function"&&(s=o,o=void 0),typeof e=="function"&&(s=e,e="utf8"),o!==void 0&&this.write(o,e),s&&this.once("end",s),this[it]=!0,this.writable=!1,(this[D]||!this[Fe])&&this[rt](),this}[jt](){this[A]||(!this[qt]&&!this[go].length&&(this[bo]=!0),this[Fe]=!1,this[D]=!0,this.emit("resume"),this[$].length?this[Xs]():this[it]?this[rt]():this.emit("drain"))}resume(){return this[jt]()}pause(){this[D]=!1,this[Fe]=!0,this[bo]=!1}get destroyed(){return this[A]}get flowing(){return this[D]}get paused(){return this[Fe]}[zr](o){this[lo]?this[H]+=1:this[H]+=o.length,this[$].push(o)}[Ys](){return this[lo]?this[H]-=1:this[H]-=this[$][0].length,this[$].shift()}[Xs](o=!1){do;while(this[il](this[Ys]())&&this[$].length);!o&&!this[$].length&&!this[it]&&this.emit("drain")}[il](o){return this.emit("data",o),this[D]}pipe(o,e){if(this[A])return o;this[bo]=!1;let s=this[wt];return e=e||{},o===el.stdout||o===el.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&o.end():(this[go].push(e.proxyErrors?new pr(this,o,e):new Zs(this,o,e)),this[Qo]?Ee(()=>this[jt]()):this[jt]()),o}unpipe(o){let e=this[go].find(s=>s.dest===o);e&&(this[go].length===1?(this[D]&&this[qt]===0&&(this[D]=!1),this[go]=[]):this[go].splice(this[go].indexOf(e),1),e.unpipe())}addListener(o,e){return this.on(o,e)}on(o,e){let s=super.on(o,e);if(o==="data")this[bo]=!1,this[qt]++,!this[go].length&&!this[D]&&this[jt]();else if(o==="readable"&&this[H]!==0)super.emit("readable");else if(jO(o)&&this[wt])super.emit(o),this.removeAllListeners(o);else if(o==="error"&&this[Se]){let i=e;this[Qo]?Ee(()=>i.call(this,this[Se])):i.call(this,this[Se])}return s}removeListener(o,e){return this.off(o,e)}off(o,e){let s=super.off(o,e);return o==="data"&&(this[qt]=this.listeners("data").length,this[qt]===0&&!this[bo]&&!this[go].length&&(this[D]=!1)),s}removeAllListeners(o){let e=super.removeAllListeners(o);return(o==="data"||o===void 0)&&(this[qt]=0,!this[bo]&&!this[go].length&&(this[D]=!1)),e}get emittedEnd(){return this[wt]}[rt](){!this[Es]&&!this[wt]&&!this[A]&&this[$].length===0&&this[it]&&(this[Es]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Vs]&&this.emit("close"),this[Es]=!1)}emit(o,...e){let s=e[0];if(o!=="error"&&o!=="close"&&o!==A&&this[A])return!1;if(o==="data")return!this[lo]&&!s?!1:this[Qo]?(Ee(()=>this[br](s)),!0):this[br](s);if(o==="end")return this[rl]();if(o==="close"){if(this[Vs]=!0,!this[wt]&&!this[A])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(o==="error"){this[Se]=s,super.emit(kr,s);let r=!this[Me]||this.listeners("error").length?super.emit("error",s):!1;return this[rt](),r}else if(o==="resume"){let r=super.emit("resume");return this[rt](),r}else if(o==="finish"||o==="prefinish"){let r=super.emit(o);return this.removeAllListeners(o),r}let i=super.emit(o,...e);return this[rt](),i}[br](o){for(let s of this[go])s.dest.write(o)===!1&&this.pause();let e=this[bo]?!1:super.emit("data",o);return this[rt](),e}[rl](){return this[wt]?!1:(this[wt]=!0,this.readable=!1,this[Qo]?(Ee(()=>this[Kr]()),!0):this[Kr]())}[Kr](){if(this[Qt]){let e=this[Qt].end();if(e){for(let s of this[go])s.dest.write(e);this[bo]||super.emit("data",e)}}for(let e of this[go])e.end();let o=super.emit("end");return this.removeAllListeners("end"),o}async collect(){let o=Object.assign([],{dataLength:0});this[lo]||(o.dataLength=0);let e=this.promise();return this.on("data",s=>{o.push(s),this[lo]||(o.dataLength+=s.length)}),await e,o}async concat(){if(this[lo])throw new Error("cannot concat in objectMode");let o=await this.collect();return this[Io]?o.join(""):Buffer.concat(o,o.dataLength)}async promise(){return new Promise((o,e)=>{this.on(A,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>o())})}[Symbol.asyncIterator](){this[bo]=!1;let o=!1,e=async()=>(this.pause(),o=!0,{value:void 0,done:!0});return{next:()=>{if(o)return e();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[it])return e();let r,n,a=x=>{this.off("data",c),this.off("end",u),this.off(A,m),e(),n(x)},c=x=>{this.off("error",a),this.off("end",u),this.off(A,m),this.pause(),r({value:x,done:!!this[it]})},u=()=>{this.off("error",a),this.off("data",c),this.off(A,m),e(),r({done:!0,value:void 0})},m=()=>a(new Error("stream destroyed"));return new Promise((x,g)=>{n=g,r=x,this.once(A,m),this.once("error",a),this.once("end",u),this.once("data",c)})},throw:e,return:e,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[bo]=!1;let o=!1,e=()=>(this.pause(),this.off(kr,e),this.off(A,e),this.off("end",e),o=!0,{done:!0,value:void 0}),s=()=>{if(o)return e();let i=this.read();return i===null?e():{done:!1,value:i}};return this.once("end",e),this.once(kr,e),this.once(A,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this}}}destroy(o){if(this[A])return o?this.emit("error",o):this.emit(A),this;this[A]=!0,this[bo]=!0,this[$].length=0,this[H]=0;let e=this;return typeof e.close=="function"&&!this[Vs]&&e.close(),o?this.emit("error",o):this.emit(A),this}static get isStream(){return TO}};var HO=Ro.realpathSync.native,Xe={lstatSync:Ro.lstatSync,readdir:Ro.readdir,readdirSync:Ro.readdirSync,readlinkSync:Ro.readlinkSync,realpathSync:HO,promises:{lstat:ht.lstat,readdir:ht.readdir,readlink:ht.readlink,realpath:ht.realpath}},xl=t=>!t||t===Xe||t===$O?Xe:{...Xe,...t,promises:{...Xe.promises,...t.promises||{}}},ml=/^\\\\\?\\([a-z]:)\\?$/i,od=t=>t.replace(/\//g,"\\").replace(ml,"$1\\"),td=/[\\\/]/,So=0,gl=1,Ol=2,jo=4,dl=6,wl=8,Ct=10,yl=12,No=15,Ve=~No,Wr=16,al=32,Ye=64,Zo=128,Ls=256,Us=512,cl=Ye|Zo|Us,ed=1023,qr=t=>t.isFile()?wl:t.isDirectory()?jo:t.isSymbolicLink()?Ct:t.isCharacterDevice()?Ol:t.isBlockDevice()?dl:t.isSocket()?yl:t.isFIFO()?gl:So,ll=new Map,Ie=t=>{let o=ll.get(t);if(o)return o;let e=t.normalize("NFKD");return ll.set(t,e),e},ul=new Map,Ts=t=>{let o=ul.get(t);if(o)return o;let e=Ie(t.toLowerCase());return ul.set(t,e),e},As=class extends Ne{constructor(){super({max:256})}},Cr=class extends Ne{constructor(o=16*1024){super({maxSize:o,sizeCalculation:e=>e.length+1})}},hl=Symbol("PathScurry setAsCwd"),uo=class{name;root;roots;parent;nocase;isCWD=!1;#o;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#e;get nlink(){return this.#e}#n;get uid(){return this.#n}#f;get gid(){return this.#f}#l;get rdev(){return this.#l}#_;get blksize(){return this.#_}#a;get ino(){return this.#a}#c;get size(){return this.#c}#i;get blocks(){return this.#i}#d;get atimeMs(){return this.#d}#w;get mtimeMs(){return this.#w}#m;get ctimeMs(){return this.#m}#x;get birthtimeMs(){return this.#x}#b;get atime(){return this.#b}#O;get mtime(){return this.#O}#K;get ctime(){return this.#K}#G;get birthtime(){return this.#G}#h;#z;#k;#g;#q;#p;#s;#S;#y;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(o,e=So,s,i,r,n,a){this.name=o,this.#h=r?Ts(o):Ie(o),this.#s=e&ed,this.nocase=r,this.roots=i,this.root=s||this,this.#S=n,this.#k=a.fullpath,this.#q=a.relative,this.#p=a.relativePosix,this.parent=a.parent,this.parent?this.#o=this.parent.#o:this.#o=xl(a.fs)}depth(){return this.#z!==void 0?this.#z:this.parent?this.#z=this.parent.depth()+1:this.#z=0}childrenCache(){return this.#S}resolve(o){if(!o)return this;let e=this.getRootString(o),i=o.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#F(i):this.#F(i)}#F(o){let e=this;for(let s of o)e=e.child(s);return e}children(){let o=this.#S.get(this);if(o)return o;let e=Object.assign([],{provisional:0});return this.#S.set(this,e),this.#s&=~Wr,e}child(o,e){if(o===""||o===".")return this;if(o==="..")return this.parent||this;let s=this.children(),i=this.nocase?Ts(o):Ie(o);for(let c of s)if(c.#h===i)return c;let r=this.parent?this.sep:"",n=this.#k?this.#k+r+o:void 0,a=this.newChild(o,So,{...e,parent:this,fullpath:n});return this.canReaddir()||(a.#s|=Zo),s.push(a),a}relative(){if(this.isCWD)return"";if(this.#q!==void 0)return this.#q;let o=this.name,e=this.parent;if(!e)return this.#q=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+o}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#p!==void 0)return this.#p;let o=this.name,e=this.parent;if(!e)return this.#p=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+o}fullpath(){if(this.#k!==void 0)return this.#k;let o=this.name,e=this.parent;if(!e)return this.#k=this.name;let i=e.fullpath()+(e.parent?this.sep:"")+o;return this.#k=i}fullpathPosix(){if(this.#g!==void 0)return this.#g;if(this.sep==="/")return this.#g=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#g=`//?/${i}`:this.#g=i}let o=this.parent,e=o.fullpathPosix(),s=e+(!e||!o.parent?"":"/")+this.name;return this.#g=s}isUnknown(){return(this.#s&No)===So}isType(o){return this[`is${o}`]()}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.#s&No)===wl}isDirectory(){return(this.#s&No)===jo}isCharacterDevice(){return(this.#s&No)===Ol}isBlockDevice(){return(this.#s&No)===dl}isFIFO(){return(this.#s&No)===gl}isSocket(){return(this.#s&No)===yl}isSymbolicLink(){return(this.#s&Ct)===Ct}lstatCached(){return this.#s&al?this:void 0}readlinkCached(){return this.#y}realpathCached(){return this.#C}readdirCached(){let o=this.children();return o.slice(0,o.provisional)}canReadlink(){if(this.#y)return!0;if(!this.parent)return!1;let o=this.#s&No;return!(o!==So&&o!==Ct||this.#s&Ls||this.#s&Zo)}calledReaddir(){return!!(this.#s&Wr)}isENOENT(){return!!(this.#s&Zo)}isNamed(o){return this.nocase?this.#h===Ts(o):this.#h===Ie(o)}async readlink(){let o=this.#y;if(o)return o;if(this.canReadlink()&&this.parent)try{let e=await this.#o.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#y=s}catch(e){this.#u(e.code);return}}readlinkSync(){let o=this.#y;if(o)return o;if(this.canReadlink()&&this.parent)try{let e=this.#o.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#y=s}catch(e){this.#u(e.code);return}}#M(o){this.#s|=Wr;for(let e=o.provisional;e<o.length;e++){let s=o[e];s&&s.#E()}}#E(){this.#s&Zo||(this.#s=(this.#s|Zo)&Ve,this.#v())}#v(){let o=this.children();o.provisional=0;for(let e of o)e.#E()}#W(){this.#s|=Us,this.#V()}#V(){if(this.#s&Ye)return;let o=this.#s;(o&No)===jo&&(o&=Ve),this.#s=o|Ye,this.#v()}#X(o=""){o==="ENOTDIR"||o==="EPERM"?this.#V():o==="ENOENT"?this.#E():this.children().provisional=0}#Y(o=""){o==="ENOTDIR"?this.parent.#V():o==="ENOENT"&&this.#E()}#u(o=""){let e=this.#s;e|=Ls,o==="ENOENT"&&(e|=Zo),(o==="EINVAL"||o==="UNKNOWN")&&(e&=Ve),this.#s=e,o==="ENOTDIR"&&this.parent&&this.parent.#V()}#I(o,e){return this.#N(o,e)||this.#Z(o,e)}#Z(o,e){let s=qr(o),i=this.newChild(o.name,s,{parent:this}),r=i.#s&No;return r!==jo&&r!==Ct&&r!==So&&(i.#s|=Ye),e.unshift(i),e.provisional++,i}#N(o,e){for(let s=e.provisional;s<e.length;s++){let i=e[s];if((this.nocase?Ts(o.name):Ie(o.name))===i.#h)return this.#P(o,i,s,e)}}#P(o,e,s,i){let r=e.name;return e.#s=e.#s&Ve|qr(o),r!==o.name&&(e.name=o.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(e)),i.provisional++,e}async lstat(){if((this.#s&Zo)===0)try{return this.#A(await this.#o.promises.lstat(this.fullpath())),this}catch(o){this.#Y(o.code)}}lstatSync(){if((this.#s&Zo)===0)try{return this.#A(this.#o.lstatSync(this.fullpath())),this}catch(o){this.#Y(o.code)}}#A(o){let{atime:e,atimeMs:s,birthtime:i,birthtimeMs:r,blksize:n,blocks:a,ctime:c,ctimeMs:u,dev:m,gid:x,ino:g,mode:d,mtime:f,mtimeMs:k,nlink:v,rdev:W,size:q,uid:w}=o;this.#b=e,this.#d=s,this.#G=i,this.#x=r,this.#_=n,this.#i=a,this.#K=c,this.#m=u,this.#t=m,this.#f=x,this.#a=g,this.#r=d,this.#O=f,this.#w=k,this.#e=v,this.#l=W,this.#c=q,this.#n=w;let l=qr(o);this.#s=this.#s&Ve|l|al,l!==So&&l!==jo&&l!==Ct&&(this.#s|=Ye)}#T=[];#U=!1;#Q(o){this.#U=!1;let e=this.#T.slice();this.#T.length=0,e.forEach(s=>s(null,o))}readdirCB(o,e=!1){if(!this.canReaddir()){e?o(null,[]):queueMicrotask(()=>o(null,[]));return}let s=this.children();if(this.calledReaddir()){let r=s.slice(0,s.provisional);e?o(null,r):queueMicrotask(()=>o(null,r));return}if(this.#T.push(o),this.#U)return;this.#U=!0;let i=this.fullpath();this.#o.readdir(i,{withFileTypes:!0},(r,n)=>{if(r)this.#X(r.code),s.provisional=0;else{for(let a of n)this.#I(a,s);this.#M(s)}this.#Q(s.slice(0,s.provisional))})}#L;async readdir(){if(!this.canReaddir())return[];let o=this.children();if(this.calledReaddir())return o.slice(0,o.provisional);let e=this.fullpath();if(this.#L)await this.#L;else{let s=()=>{};this.#L=new Promise(i=>s=i);try{for(let i of await this.#o.promises.readdir(e,{withFileTypes:!0}))this.#I(i,o);this.#M(o)}catch(i){this.#X(i.code),o.provisional=0}this.#L=void 0,s()}return o.slice(0,o.provisional)}readdirSync(){if(!this.canReaddir())return[];let o=this.children();if(this.calledReaddir())return o.slice(0,o.provisional);let e=this.fullpath();try{for(let s of this.#o.readdirSync(e,{withFileTypes:!0}))this.#I(s,o);this.#M(o)}catch(s){this.#X(s.code),o.provisional=0}return o.slice(0,o.provisional)}canReaddir(){if(this.#s&cl)return!1;let o=No&this.#s;return o===So||o===jo||o===Ct}shouldWalk(o,e){return(this.#s&jo)===jo&&!(this.#s&cl)&&!o.has(this)&&(!e||e(this))}async realpath(){if(this.#C)return this.#C;if(!((Us|Ls|Zo)&this.#s))try{let o=await this.#o.promises.realpath(this.fullpath());return this.#C=this.resolve(o)}catch{this.#W()}}realpathSync(){if(this.#C)return this.#C;if(!((Us|Ls|Zo)&this.#s))try{let o=this.#o.realpathSync(this.fullpath());return this.#C=this.resolve(o)}catch{this.#W()}}[hl](o){if(o===this)return;o.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],i=this;for(;i&&i.parent;)e.add(i),i.#q=s.join(this.sep),i.#p=s.join("/"),i=i.parent,s.push("..");for(i=o;i&&i.parent&&!e.has(i);)i.#q=void 0,i.#p=void 0,i=i.parent}},Qs=class t extends uo{sep="\\";splitSep=td;constructor(o,e=So,s,i,r,n,a){super(o,e,s,i,r,n,a)}newChild(o,e=So,s={}){return new t(o,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(o){return Rt.win32.parse(o).root}getRoot(o){if(o=od(o.toUpperCase()),o===this.root.name)return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(o,e))return this.roots[o]=s;return this.roots[o]=new Jt(o,this).root}sameRoot(o,e=this.root.name){return o=o.toUpperCase().replace(/\//g,"\\").replace(ml,"$1\\"),o===e}},js=class t extends uo{splitSep="/";sep="/";constructor(o,e=So,s,i,r,n,a){super(o,e,s,i,r,n,a)}getRootString(o){return o.startsWith("/")?"/":""}getRoot(o){return this.root}newChild(o,e=So,s={}){return new t(o,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}},Rs=class{root;rootPath;roots;cwd;#o;#t;#r;nocase;#e;constructor(o=process.cwd(),e,s,{nocase:i,childrenCacheSize:r=16*1024,fs:n=Xe}={}){this.#e=xl(n),(o instanceof URL||o.startsWith("file://"))&&(o=(0,_l.fileURLToPath)(o));let a=e.resolve(o);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#o=new As,this.#t=new As,this.#r=new Cr(r);let c=a.substring(this.rootPath.length).split(s);if(c.length===1&&!c[0]&&c.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#e),this.roots[this.rootPath]=this.root;let u=this.root,m=c.length-1,x=e.sep,g=this.rootPath,d=!1;for(let f of c){let k=m--;u=u.child(f,{relative:new Array(k).fill("..").join(x),relativePosix:new Array(k).fill("..").join("/"),fullpath:g+=(d?"":x)+f}),d=!0}this.cwd=u}depth(o=this.cwd){return typeof o=="string"&&(o=this.cwd.resolve(o)),o.depth()}childrenCache(){return this.#r}resolve(...o){let e="";for(let r=o.length-1;r>=0;r--){let n=o[r];if(!(!n||n===".")&&(e=e?`${n}/${e}`:n,this.isAbsolute(n)))break}let s=this.#o.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpath();return this.#o.set(e,i),i}resolvePosix(...o){let e="";for(let r=o.length-1;r>=0;r--){let n=o[r];if(!(!n||n===".")&&(e=e?`${n}/${e}`:n,this.isAbsolute(n)))break}let s=this.#t.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpathPosix();return this.#t.set(e,i),i}relative(o=this.cwd){return typeof o=="string"&&(o=this.cwd.resolve(o)),o.relative()}relativePosix(o=this.cwd){return typeof o=="string"&&(o=this.cwd.resolve(o)),o.relativePosix()}basename(o=this.cwd){return typeof o=="string"&&(o=this.cwd.resolve(o)),o.name}dirname(o=this.cwd){return typeof o=="string"&&(o=this.cwd.resolve(o)),(o.parent||o).fullpath()}async readdir(o=this.cwd,e={withFileTypes:!0}){typeof o=="string"?o=this.cwd.resolve(o):o instanceof uo||(e=o,o=this.cwd);let{withFileTypes:s}=e;if(o.canReaddir()){let i=await o.readdir();return s?i:i.map(r=>r.name)}else return[]}readdirSync(o=this.cwd,e={withFileTypes:!0}){typeof o=="string"?o=this.cwd.resolve(o):o instanceof uo||(e=o,o=this.cwd);let{withFileTypes:s=!0}=e;return o.canReaddir()?s?o.readdirSync():o.readdirSync().map(i=>i.name):[]}async lstat(o=this.cwd){return typeof o=="string"&&(o=this.cwd.resolve(o)),o.lstat()}lstatSync(o=this.cwd){return typeof o=="string"&&(o=this.cwd.resolve(o)),o.lstatSync()}async readlink(o=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof o=="string"?o=this.cwd.resolve(o):o instanceof uo||(e=o.withFileTypes,o=this.cwd);let s=await o.readlink();return e?s:s?.fullpath()}readlinkSync(o=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof o=="string"?o=this.cwd.resolve(o):o instanceof uo||(e=o.withFileTypes,o=this.cwd);let s=o.readlinkSync();return e?s:s?.fullpath()}async realpath(o=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof o=="string"?o=this.cwd.resolve(o):o instanceof uo||(e=o.withFileTypes,o=this.cwd);let s=await o.realpath();return e?s:s?.fullpath()}realpathSync(o=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof o=="string"?o=this.cwd.resolve(o):o instanceof uo||(e=o.withFileTypes,o=this.cwd);let s=o.realpathSync();return e?s:s?.fullpath()}async walk(o=this.cwd,e={}){typeof o=="string"?o=this.cwd.resolve(o):o instanceof uo||(e=o,o=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e,a=[];(!r||r(o))&&a.push(s?o:o.fullpath());let c=new Set,u=(x,g)=>{c.add(x),x.readdirCB((d,f)=>{if(d)return g(d);let k=f.length;if(!k)return g();let v=()=>{--k===0&&g()};for(let W of f)(!r||r(W))&&a.push(s?W:W.fullpath()),i&&W.isSymbolicLink()?W.realpath().then(q=>q?.isUnknown()?q.lstat():q).then(q=>q?.shouldWalk(c,n)?u(q,v):v()):W.shouldWalk(c,n)?u(W,v):v()},!0)},m=o;return new Promise((x,g)=>{u(m,d=>{if(d)return g(d);x(a)})})}walkSync(o=this.cwd,e={}){typeof o=="string"?o=this.cwd.resolve(o):o instanceof uo||(e=o,o=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e,a=[];(!r||r(o))&&a.push(s?o:o.fullpath());let c=new Set([o]);for(let u of c){let m=u.readdirSync();for(let x of m){(!r||r(x))&&a.push(s?x:x.fullpath());let g=x;if(x.isSymbolicLink()){if(!(i&&(g=x.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(c,n)&&c.add(g)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(o=this.cwd,e={}){return typeof o=="string"?o=this.cwd.resolve(o):o instanceof uo||(e=o,o=this.cwd),this.stream(o,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(o=this.cwd,e={}){typeof o=="string"?o=this.cwd.resolve(o):o instanceof uo||(e=o,o=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e;(!r||r(o))&&(yield s?o:o.fullpath());let a=new Set([o]);for(let c of a){let u=c.readdirSync();for(let m of u){(!r||r(m))&&(yield s?m:m.fullpath());let x=m;if(m.isSymbolicLink()){if(!(i&&(x=m.realpathSync())))continue;x.isUnknown()&&x.lstatSync()}x.shouldWalk(a,n)&&a.add(x)}}}stream(o=this.cwd,e={}){typeof o=="string"?o=this.cwd.resolve(o):o instanceof uo||(e=o,o=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e,a=new yt({objectMode:!0});(!r||r(o))&&a.write(s?o:o.fullpath());let c=new Set,u=[o],m=0,x=()=>{let g=!1;for(;!g;){let d=u.shift();if(!d){m===0&&a.end();return}m++,c.add(d);let f=(v,W,q=!1)=>{if(v)return a.emit("error",v);if(i&&!q){let w=[];for(let l of W)l.isSymbolicLink()&&w.push(l.realpath().then(O=>O?.isUnknown()?O.lstat():O));if(w.length){Promise.all(w).then(()=>f(null,W,!0));return}}for(let w of W)w&&(!r||r(w))&&(a.write(s?w:w.fullpath())||(g=!0));m--;for(let w of W){let l=w.realpathCached()||w;l.shouldWalk(c,n)&&u.push(l)}g&&!a.flowing?a.once("drain",x):k||x()},k=!0;d.readdirCB(f,!0),k=!1}};return x(),a}streamSync(o=this.cwd,e={}){typeof o=="string"?o=this.cwd.resolve(o):o instanceof uo||(e=o,o=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e,a=new yt({objectMode:!0}),c=new Set;(!r||r(o))&&a.write(s?o:o.fullpath());let u=[o],m=0,x=()=>{let g=!1;for(;!g;){let d=u.shift();if(!d){m===0&&a.end();return}m++,c.add(d);let f=d.readdirSync();for(let k of f)(!r||r(k))&&(a.write(s?k:k.fullpath())||(g=!0));m--;for(let k of f){let v=k;if(k.isSymbolicLink()){if(!(i&&(v=k.realpathSync())))continue;v.isUnknown()&&v.lstatSync()}v.shouldWalk(c,n)&&u.push(v)}}g&&!a.flowing&&a.once("drain",x)};return x(),a}chdir(o=this.cwd){let e=this.cwd;this.cwd=typeof o=="string"?this.cwd.resolve(o):o,this.cwd[hl](e)}},Jt=class extends Rs{sep="\\";constructor(o=process.cwd(),e={}){let{nocase:s=!0}=e;super(o,Rt.win32,"\\",{...e,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(o){return Rt.win32.parse(o).root.toUpperCase()}newRoot(o){return new Qs(this.rootPath,jo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:o})}isAbsolute(o){return o.startsWith("/")||o.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(o)}},Bt=class extends Rs{sep="/";constructor(o=process.cwd(),e={}){let{nocase:s=!1}=e;super(o,Rt.posix,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(o){return"/"}newRoot(o){return new js(this.rootPath,jo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:o})}isAbsolute(o){return o.startsWith("/")}},Ze=class extends Bt{constructor(o=process.cwd(),e={}){let{nocase:s=!0}=e;super(o,{...e,nocase:s})}},Dh=process.platform==="win32"?Qs:js,fl=process.platform==="win32"?Jt:process.platform==="darwin"?Ze:Bt;var sd=t=>t.length>=1,id=t=>t.length>=1,Dt=class t{#o;#t;#r;length;#e;#n;#f;#l;#_;#a;#c=!0;constructor(o,e,s,i){if(!sd(o))throw new TypeError("empty pattern list");if(!id(e))throw new TypeError("empty glob list");if(e.length!==o.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=o.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#o=o,this.#t=e,this.#r=s,this.#e=i,this.#r===0){if(this.isUNC()){let[r,n,a,c,...u]=this.#o,[m,x,g,d,...f]=this.#t;u[0]===""&&(u.shift(),f.shift());let k=[r,n,a,c,""].join("/"),v=[m,x,g,d,""].join("/");this.#o=[k,...u],this.#t=[v,...f],this.length=this.#o.length}else if(this.isDrive()||this.isAbsolute()){let[r,...n]=this.#o,[a,...c]=this.#t;n[0]===""&&(n.shift(),c.shift());let u=r+"/",m=a+"/";this.#o=[u,...n],this.#t=[m,...c],this.length=this.#o.length}}}pattern(){return this.#o[this.#r]}isString(){return typeof this.#o[this.#r]=="string"}isGlobstar(){return this.#o[this.#r]===ro}isRegExp(){return this.#o[this.#r]instanceof RegExp}globString(){return this.#f=this.#f||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#n!==void 0?this.#n:this.hasMore()?(this.#n=new t(this.#o,this.#t,this.#r+1,this.#e),this.#n.#a=this.#a,this.#n.#_=this.#_,this.#n.#l=this.#l,this.#n):this.#n=null}isUNC(){let o=this.#o;return this.#_!==void 0?this.#_:this.#_=this.#e==="win32"&&this.#r===0&&o[0]===""&&o[1]===""&&typeof o[2]=="string"&&!!o[2]&&typeof o[3]=="string"&&!!o[3]}isDrive(){let o=this.#o;return this.#l!==void 0?this.#l:this.#l=this.#e==="win32"&&this.#r===0&&this.length>1&&typeof o[0]=="string"&&/^[a-z]:$/i.test(o[0])}isAbsolute(){let o=this.#o;return this.#a!==void 0?this.#a:this.#a=o[0]===""&&o.length>1||this.isDrive()||this.isUNC()}root(){let o=this.#o[0];return typeof o=="string"&&this.isAbsolute()&&this.#r===0?o:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var rd=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",$t=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(o,{nobrace:e,nocase:s,noext:i,noglobstar:r,platform:n=rd}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=n,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:r,optimizationLevel:2,platform:n,nocomment:!0,nonegate:!0};for(let a of o)this.add(a)}add(o){let e=new ko(o,this.mmopts);for(let s=0;s<e.set.length;s++){let i=e.set[s],r=e.globParts[s];if(!i||!r)throw new Error("invalid pattern object");for(;i[0]==="."&&r[0]===".";)i.shift(),r.shift();let n=new Dt(i,r,0,this.platform),a=new ko(n.globString(),this.mmopts),c=r[r.length-1]==="**",u=n.isAbsolute();u?this.absolute.push(a):this.relative.push(a),c&&(u?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(o){let e=o.fullpath(),s=`${e}/`,i=o.relative()||".",r=`${i}/`;for(let n of this.relative)if(n.match(i)||n.match(r))return!0;for(let n of this.absolute)if(n.match(e)||n.match(s))return!0;return!1}childrenIgnored(o){let e=o.fullpath()+"/",s=(o.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(s))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}};var Nr=class t{store;constructor(o=new Map){this.store=o}copy(){return new t(new Map(this.store))}hasWalked(o,e){return this.store.get(o.fullpath())?.has(e.globString())}storeWalked(o,e){let s=o.fullpath(),i=this.store.get(s);i?i.add(e.globString()):this.store.set(s,new Set([e.globString()]))}},Sr=class{store=new Map;add(o,e,s){let i=(e?2:0)|(s?1:0),r=this.store.get(o);this.store.set(o,r===void 0?i:i&r)}entries(){return[...this.store.entries()].map(([o,e])=>[o,!!(e&2),!!(e&1)])}},Fr=class{store=new Map;add(o,e){if(!o.canReaddir())return;let s=this.store.get(o);s?s.find(i=>i.globString()===e.globString())||s.push(e):this.store.set(o,[e])}get(o){let e=this.store.get(o);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(o=>[o,this.store.get(o)])}keys(){return[...this.store.keys()].filter(o=>o.canReaddir())}},Pe=class t{hasWalkedCache;matches=new Sr;subwalks=new Fr;patterns;follow;dot;opts;constructor(o,e){this.opts=o,this.follow=!!o.follow,this.dot=!!o.dot,this.hasWalkedCache=e?e.copy():new Nr}processPatterns(o,e){this.patterns=e;let s=e.map(i=>[o,i]);for(let[i,r]of s){this.hasWalkedCache.storeWalked(i,r);let n=r.root(),a=r.isAbsolute()&&this.opts.absolute!==!1;if(n){i=i.resolve(n==="/"&&this.opts.root!==void 0?this.opts.root:n);let x=r.rest();if(x)r=x;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let c,u,m=!1;for(;typeof(c=r.pattern())=="string"&&(u=r.rest());)i=i.resolve(c),r=u,m=!0;if(c=r.pattern(),u=r.rest(),m){if(this.hasWalkedCache.hasWalked(i,r))continue;this.hasWalkedCache.storeWalked(i,r)}if(typeof c=="string"){let x=c===".."||c===""||c===".";this.matches.add(i.resolve(c),a,x);continue}else if(c===ro){(!i.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(i,r);let x=u?.pattern(),g=u?.rest();if(!u||(x===""||x===".")&&!g)this.matches.add(i,a,x===""||x===".");else if(x===".."){let d=i.parent||i;g?this.hasWalkedCache.hasWalked(d,g)||this.subwalks.add(d,g):this.matches.add(d,a,!0)}}else c instanceof RegExp&&this.subwalks.add(i,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(o,e){let s=this.subwalks.get(o),i=this.child();for(let r of e)for(let n of s){let a=n.isAbsolute(),c=n.pattern(),u=n.rest();c===ro?i.testGlobstar(r,n,u,a):c instanceof RegExp?i.testRegExp(r,c,u,a):i.testString(r,c,u,a)}return i}testGlobstar(o,e,s,i){if((this.dot||!o.name.startsWith("."))&&(e.hasMore()||this.matches.add(o,i,!1),o.canReaddir()&&(this.follow||!o.isSymbolicLink()?this.subwalks.add(o,e):o.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(o,s):e.markFollowGlobstar()&&this.subwalks.add(o,e)))),s){let r=s.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(o,r,s.rest(),i);else if(r===".."){let n=o.parent||o;this.subwalks.add(n,s)}else r instanceof RegExp&&this.testRegExp(o,r,s.rest(),i)}}testRegExp(o,e,s,i){e.test(o.name)&&(s?this.subwalks.add(o,s):this.matches.add(o,i,!1))}testString(o,e,s,i){o.isNamed(e)&&(s?this.subwalks.add(o,s):this.matches.add(o,i,!1))}};var nd=(t,o)=>typeof t=="string"?new $t([t],o):Array.isArray(t)?new $t(t,o):t,Js=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#o=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(o,e,s){if(this.patterns=o,this.path=e,this.opts=s,this.#r=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#t=nd(s.ignore??[],s),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#o.length=0}))}#e(o){return this.seen.has(o)||!!this.#t?.ignored?.(o)}#n(o){return!!this.#t?.childrenIgnored?.(o)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let o;for(;!this.paused&&(o=this.#o.shift());)o()}onResume(o){this.signal?.aborted||(this.paused?this.#o.push(o):o())}async matchCheck(o,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=o.realpathCached()||await o.realpath(),!s)return;o=s}let r=o.isUnknown()||this.opts.stat?await o.lstat():o;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let n=await r.realpath();n&&(n.isUnknown()||this.opts.stat)&&await n.lstat()}return this.matchCheckTest(r,e)}matchCheckTest(o,e){return o&&(this.maxDepth===1/0||o.depth()<=this.maxDepth)&&(!e||o.canReaddir())&&(!this.opts.nodir||!o.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!o.isSymbolicLink()||!o.realpathCached()?.isDirectory())&&!this.#e(o)?o:void 0}matchCheckSync(o,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=o.realpathCached()||o.realpathSync(),!s)return;o=s}let r=o.isUnknown()||this.opts.stat?o.lstatSync():o;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let n=r.realpathSync();n&&(n?.isUnknown()||this.opts.stat)&&n.lstatSync()}return this.matchCheckTest(r,e)}matchFinish(o,e){if(this.#e(o))return;if(!this.includeChildMatches&&this.#t?.add){let r=`${o.relativePosix()}/**`;this.#t.add(r)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(o);let i=this.opts.mark&&o.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(o);else if(s){let r=this.opts.posix?o.fullpathPosix():o.fullpath();this.matchEmit(r+i)}else{let r=this.opts.posix?o.relativePosix():o.relative(),n=this.opts.dotRelative&&!r.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(r?n+r+i:"."+i)}}async match(o,e,s){let i=await this.matchCheck(o,s);i&&this.matchFinish(i,e)}matchSync(o,e,s){let i=this.matchCheckSync(o,s);i&&this.matchFinish(i,e)}walkCB(o,e,s){this.signal?.aborted&&s(),this.walkCB2(o,e,new Pe(this.opts),s)}walkCB2(o,e,s,i){if(this.#n(o))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(o,e,s,i));return}s.processPatterns(o,e);let r=1,n=()=>{--r===0&&i()};for(let[a,c,u]of s.matches.entries())this.#e(a)||(r++,this.match(a,c,u).then(()=>n()));for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,s,n):a.readdirCB((u,m)=>this.walkCB3(a,m,s,n),!0)}n()}walkCB3(o,e,s,i){s=s.filterEntries(o,e);let r=1,n=()=>{--r===0&&i()};for(let[a,c,u]of s.matches.entries())this.#e(a)||(r++,this.match(a,c,u).then(()=>n()));for(let[a,c]of s.subwalks.entries())r++,this.walkCB2(a,c,s.child(),n);n()}walkCBSync(o,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(o,e,new Pe(this.opts),s)}walkCB2Sync(o,e,s,i){if(this.#n(o))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(o,e,s,i));return}s.processPatterns(o,e);let r=1,n=()=>{--r===0&&i()};for(let[a,c,u]of s.matches.entries())this.#e(a)||this.matchSync(a,c,u);for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let c=a.readdirSync();this.walkCB3Sync(a,c,s,n)}n()}walkCB3Sync(o,e,s,i){s=s.filterEntries(o,e);let r=1,n=()=>{--r===0&&i()};for(let[a,c,u]of s.matches.entries())this.#e(a)||this.matchSync(a,c,u);for(let[a,c]of s.subwalks.entries())r++,this.walkCB2Sync(a,c,s.child(),n);n()}},Le=class extends Js{matches=new Set;constructor(o,e,s){super(o,e,s)}matchEmit(o){this.matches.add(o)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((o,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):o(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}},Te=class extends Js{results;constructor(o,e,s){super(o,e,s),this.results=new yt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(o){this.results.write(o),this.results.flowing||this.pause()}stream(){let o=this.path;return o.isUnknown()?o.lstat().then(()=>{this.walkCB(o,this.patterns,()=>this.results.end())}):this.walkCB(o,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 ad=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Po=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(o,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,zl.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof o=="string"&&(o=[o]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(o=o.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");o=o.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=o,this.platform=e.platform||ad,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=e.platform==="win32"?Jt:e.platform==="darwin"?Ze:e.platform?Bt:fl;this.scurry=new c(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",i={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map(c=>new ko(c,i)),[n,a]=r.reduce((c,u)=>(c[0].push(...u.set),c[1].push(...u.globParts),c),[[],[]]);this.patterns=n.map((c,u)=>{let m=a[u];if(!m)throw new Error("invalid pattern object");return new Dt(c,m,0,this.platform)})}async walk(){return[...await new Le(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 Le(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 Te(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 Te(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 Mr=(t,o={})=>{Array.isArray(t)||(t=[t]);for(let e of t)if(new ko(e,o).hasMagic())return!0;return!1};function Bs(t,o={}){return new Po(t,o).streamSync()}function bl(t,o={}){return new Po(t,o).stream()}function Kl(t,o={}){return new Po(t,o).walkSync()}async function kl(t,o={}){return new Po(t,o).walk()}function Ds(t,o={}){return new Po(t,o).iterateSync()}function Gl(t,o={}){return new Po(t,o).iterate()}var cd=Bs,ld=Object.assign(bl,{sync:Bs}),ud=Ds,_d=Object.assign(Gl,{sync:Ds}),xd=Object.assign(Kl,{stream:Bs,iterate:Ds}),Jo=Object.assign(kl,{glob:kl,globSync:Kl,sync:xd,globStream:bl,stream:ld,globStreamSync:Bs,streamSync:cd,globIterate:Gl,iterate:_d,globIterateSync:Ds,iterateSync:ud,Glob:Po,hasMagic:Mr,escape:Tt,unescape:Yo});Jo.glob=Jo;var Vr=P(require("node:assert")),Xr=P(require("node:fs/promises")),Nt=P(require("node:path")),Er=null;async function pl(t){if(Er==null){let o=t?.androidBuildToolsDir??await md(t);(0,Vr.default)(o!=null,"Unable to find the Android build-tools directory."),Er={aapt2Path:Nt.default.join(o,"aapt2"),apksignerPath:Nt.default.join(o,"apksigner"),dexdumpPath:Nt.default.join(o,"dexdump")}}return Er}async function vl(t,o,e){let{spawnAsync:s,workingDirectory:i}=o,{apksignerPath:r}=await pl(o),n=Nt.default.join(i,"resigned.apk");await Xr.default.copyFile(t,n);let a=["sign","--ks",e.keyStorePath,"--ks-pass",e.keyStorePassword];return e.keyAlias&&a.push("--ks-key-alias",e.keyAlias),e.keyPassword&&a.push("--key-pass",e.keyPassword),a.push(n),await s(r,a),n}async function md(t){let{logger:o}=t,e=process.env.ANDROID_SDK_ROOT;(0,Vr.default)(e!=null,"ANDROID_SDK_ROOT environment variable is not set");let s=Nt.default.join(e,"build-tools");try{let r=(await Xr.default.readdir(s,{withFileTypes:!0})).filter(n=>n.isDirectory()).map(n=>n.name).sort((n,a)=>{let c=n.split(".").map(Number),u=a.split(".").map(Number);for(let m=0;m<Math.min(c.length,u.length);m++)if(c[m]!==u[m])return u[m]-c[m];return u.length-c.length});return r.length>0?Nt.default.join(s,r[0]):(o.error("No build-tools directories found."),null)}catch(i){return o.error(`Failed to read the build-tools directory: ${i}`),null}}async function Wl(t,o,e){let{spawnAsync:s}=e,{dexdumpPath:i}=await pl(e),r=o.replace(/\./g,"/"),n=new RegExp(`^ Class descriptor : 'L(${r}\\/.*);`,"gm"),a=new Set,c=await Jo("classes*.dex",{cwd:t}),u=s(i,["-e","-n",...c],{cwd:t});return u.child.stdout?.on("data",m=>{let x=String(m).split(`
34
- `);for(let g of x){let d=n.exec(g);d&&a.add(d[1].replace(/\//g,"."))}}),await u,a}var Mt=P(require("node:assert")),at=P(require("node:fs/promises")),Fo=P(require("node:path")),li=P(gr());var oi=P(require("node:assert")),Lo=P(require("node:fs/promises")),oo=P(require("node:path")),se=P(Sl());var Gu=P(ku()),pu=P(require("node:assert")),St=P(require("node:fs/promises")),te=P(require("node:path"));async function Ft(t){return(await St.default.stat(t).catch(()=>null))?.isFile()??!1}async function nt(t){return(await St.default.stat(t).catch(()=>null))?.isDirectory()??!1}function Ae(t){return(0,pu.default)(t!=null,"Expected value to be non-null"),t}async function Qe(t){let o=t.platform==="android"?".apk":".ipa";return{...t,projectRoot:te.default.resolve(t.projectRoot),workingDirectory:t.workingDirectory??await St.default.mkdtemp(te.default.join(Ku(),"repack-app-")),outputPath:t.outputPath??te.default.join(t.projectRoot,`repacked${o}`),logger:Qd(t.logger),spawnAsync:t.spawnAsync??jd(!!t.verbose)}}function Qd(t){return t!=null?Hs.isBunyanLikeLogger(t)?new Hs(t):t:new Ue}var Ue=class{debug(...o){console.debug(...o)}info(...o){console.log(...o)}warn(...o){console.warn(...o)}error(...o){console.error(...o)}time(o){console.time(o)}timeEnd(o){console.timeEnd(o)}},Hs=class{constructor(o){this.logger=o}timerMap={};static isBunyanLikeLogger(o){return o.info&&o.time===void 0}debug(...o){this.logger.debug(o.join(""))}info(...o){this.logger.info(o.join(""))}warn(...o){this.logger.warn(o.join(""))}error(...o){this.logger.error(o.join(""))}time(o){this.timerMap[o]=Date.now()}timeEnd(o){if(this.timerMap[o]==null){this.logger.warn(`Timer '${o}' does not exist`);return}let e=Date.now()-this.timerMap[o];this.logger.info(`${o}: ${e} ms`),delete this.timerMap[o]}};function jd(t){return function(e,s,i){return(0,Gu.default)(e,s,{stdio:t?"inherit":"pipe",...i})}}async function ee(t,o){await St.default.mkdir(o,{recursive:!0});let e=await St.default.readdir(t,{withFileTypes:!0});for(let s of e){let i=te.default.join(t,s.name),r=te.default.join(o,s.name);s.isDirectory()?await ee(i,r):s.isFile()&&await St.default.copyFile(i,r)}}async function ti(t,o){let{workingDirectory:e}=t,s=oo.default.join(e,"app.config");return await Lo.default.writeFile(s,JSON.stringify(o)),s}async function ei(t){let{platform:o,projectRoot:e,spawnAsync:s,workingDirectory:i}=t,{stdout:r}=await s("node",["-e","require('expo/scripts/resolveAppEntry')",e,o,"absolute"],{cwd:e,stdio:"pipe"}),n=se.default.silent(t.projectRoot,"expo-updates/utils/build/createUpdatesResources.js");return(0,oi.default)(n,"Failed to resolve `createUpdatesResources.js` within expo-updates package"),await s("node",[n,o,e,i,"all",r.trim()],{cwd:e}),oo.default.join(i,"app.manifest")}function si(t){let o=vu(t);(0,oi.default)(o,"Failed to resolve '@expo/config' package in the project");let{getPackageJson:e}=require(o),s=e(t);return!!(s.dependencies&&"expo-updates"in s.dependencies)}async function ii(t,o){let{projectRoot:e,spawnAsync:s}=t,i=se.default.silent(e,"expo-updates/bin/cli")??(0,se.default)(e,"expo-updates/bin/cli.js"),{stdout:r}=await s(i,["runtimeversion:resolve","--platform","android","--workflow","managed"],{cwd:e,stdio:"pipe"});return JSON.parse(r).runtimeVersion??null}function vu(t){let o=se.default.silent(t,"expo/package.json");return o?se.default.silent(oo.default.dirname(o),"@expo/config")??null:null}function ri(t,o){let e=vu(t);(0,oi.default)(e,"Failed to resolve '@expo/config' package in the project");let{getConfig:s}=require(e);return s(t,o)}async function ni(t,o){let{projectRoot:e,platform:s,spawnAsync:i,workingDirectory:r}=o,n=oo.default.resolve(r,"bundles");await Lo.default.mkdir(n,{recursive:!0});let a=oo.default.join(n,"assets");await Lo.default.mkdir(a,{recursive:!0});let{stdout:c}=await i("node",["-e","require('expo/scripts/resolveAppEntry')",e,s,"absolute"],{cwd:e,stdio:"pipe"}),u=Rd(t,s),m=s==="android"?"index.android.bundle":"main.bundle",x=oo.default.join(n,m),g=oo.default.join(n,"bundle.map"),d=["expo","export:embed","--platform",s,"--entry-file",c.trim(),"--bundle-output",oo.default.join(n,m),"--assets-dest",oo.default.join(n,"assets"),"--dev","false","--reset-cache","--sourcemap-output",g];return u?(d.push("--minify","false"),d.push("--bytecode","true"),d.push("--unstable-transform-profile","hermes")):d.push("--minify","true"),await i("npx",d,{cwd:e}),o.exportEmbedOptions?.sourcemapOutput&&await Lo.default.copyFile(g,o.exportEmbedOptions.sourcemapOutput),{bundleOutputPath:x,assetRoot:a}}async function ai({appWorkingDirectory:t,options:o}){if(o.exportEmbedOptions!=null)return!0;let e;return o.platform==="android"?e=oo.default.join(t,"assets","index.android.bundle"):e=oo.default.join(t,"main.jsbundle"),await Ft(e)}function Rd(t,o){switch(o){case"android":return(t.android?.jsEngine??t.jsEngine)!=="jsc";case"ios":return(t.ios?.jsEngine??t.jsEngine)!=="jsc";default:return!1}}async function ci(t,o){let{spawnAsync:e,workingDirectory:s}=o,i=o.platform==="ios"?"ios":"android",r=oo.default.join(s,`prebuild-${i}`),n=oo.default.join(t,"package.json"),a=oo.default.join(t,"package-repack.json");await Lo.default.cp(n,a,{force:!0});let c=oo.default.join(t,i),u=await nt(c);try{return u&&await Lo.default.rename(c,oo.default.join(t,`${i}-repack-backup`)),await e("npx",["expo","prebuild","--platform",i,"--no-install"],{cwd:t}),await Lo.default.cp(c,r,{recursive:!0,force:!0}),await Lo.default.rm(c,{recursive:!0,force:!0}),r}finally{u&&await Lo.default.rename(oo.default.join(t,`${i}-repack-backup`),c),await Lo.default.rename(a,n)}}async function Wu({config:t,decodedApkRoot:o}){let e=Fo.default.join(o,"res","values","strings.xml"),s=await at.default.readFile(e,"utf8");s=s.replace(/(<string name="app_name">)(.+)(<\/string>)/,`$1${t.name}$3`),await at.default.writeFile(e,s)}async function qu({config:t,androidManiestXml:o,dexClasses:e,originalAppIdSet:s,updatesRuntimeVersion:i}){let r=Ae(t.android?.package),n=o.manifest.$.package!==r;Dr(o,d=>{for(let f of s)if(d.startsWith(f)&&!e.has(d))return d.replace(new RegExp(`^${f}`),r);return d});let a=Br("manifest",o.manifest,(d,f)=>d==="intent-filter"&&Br(d,f,(k,v)=>k==="action"&&v[0].$?.["android:name"]==="android.intent.action.VIEW").length>0),c=Array.isArray(t.scheme)?t.scheme[0]:t.scheme;for(let d of a)Dr(d,f=>{let k=f;for(let v of s)k=k.replace(new RegExp(`^${v}`),r);return k=k.replace(/^exp\+.+$/g,`exp+${Ae(t.slug)}`),c&&(k=k.replace(/^myapp$/g,c)),k});let u=o.manifest.application[0];(0,Mt.default)(u.$?.["android:name"]?.endsWith(".MainApplication"),"Expected application node to be named as MainApplication"),Bd(u,t,i),t.android?.adaptiveIcon?((0,Mt.default)(u.$,"Expected application node to have attributes"),u.$["android:roundIcon"]="@mipmap/ic_launcher_round"):delete u.$?.["android:roundIcon"],o.manifest.$.package=r;let x=t.android?.version||t.version||"1.0.0",g=Number(t.android?.versionCode??1);return o.manifest.$["android:versionName"]=x,o.manifest.$["android:versionCode"]=g,{isPackageNameChanged:n}}async function $r(t){let o=await at.default.readFile(t,"utf8");return await new li.Parser().parseStringPromise(o)}async function Hr(t,o){let s=new li.Builder().buildObject(t);await at.default.writeFile(o,s)}function Cu(t){let o=t.manifest.$.package;return(0,Mt.default)(o!=null,"Expected package attribute to be present in AndroidManifest.xml"),o}function Nu(t,o){let e=t.manifest.application?.[0]?.$?.["android:name"];if(e){let s=e.replace(/\.[^.]+$/,"");if(s!==e&&s!==o)return s}return null}async function Su(t,o,e){let{projectRoot:s}=o,i=await ci(s,o),r=Fo.default.join(i,"app","src","main","res"),n=Fo.default.join(t,"res"),a=["mipmap-mdpi","mipmap-hdpi","mipmap-xhdpi","mipmap-xxhdpi","mipmap-xxxhdpi","mipmap-anydpi-v26"],c=["ic_launcher.webp","ic_launcher.png","ic_launcher_round.webp","ic_launcher_round.png","ic_launcher_foreground.webp","ic_launcher_foreground.png","ic_launcher_background.webp","ic_launcher_background.png","ic_launcher_monochrome.webp","ic_launcher_monochrome.png","ic_launcher.xml","ic_launcher_round.xml"];for(let m of a){let x=Fo.default.join(n,m);await nt(x)&&await Promise.all(c.map(d=>at.default.rm(Fo.default.join(x,d),{force:!0})));let g=Fo.default.join(r,m);await Promise.all(c.map(async d=>{await Ft(Fo.default.join(g,d))&&(await nt(x)||await at.default.mkdir(x,{recursive:!0}),await at.default.cp(Fo.default.join(g,d),Fo.default.join(x,d)))}))}let u=e.android?.adaptiveIcon?.backgroundColor??null;await Jd(t,u)}async function Jd(t,o){let e=Fo.default.join(t,"res","values","colors.xml"),s;await Ft(e)?s=await $r(e):s={resources:{color:[]}},s.resources||={},Array.isArray(s.resources.color)||(s.resources.color=[]);let i=s.resources.color.findIndex(r=>r.$?.name==="iconBackground");if(o===null)i>=0&&s.resources.color.splice(i,1);else{let r={$:{name:"iconBackground"},_:o};i>=0?s.resources.color[i]=r:s.resources.color.push(r)}await at.default.mkdir(Fo.default.dirname(e),{recursive:!0}),await Hr(s,e)}function Bd(t,o,e){let s=t["meta-data"]??[],i=o.updates?.enabled??!0,r=s.find(u=>u.$?.["android:name"]==="expo.modules.updates.ENABLED");r!=null?((0,Mt.default)(r.$!=null),r.$["android:value"]=i?"true":"false"):s.push({$:{"android:name":"expo.modules.updates.ENABLED","android:value":i?"true":"false"}});let n=s.find(u=>u.$?.["android:name"]==="expo.modules.updates.EXPO_RUNTIME_VERSION");e!=null&&(n!=null?((0,Mt.default)(n.$!=null),n.$["android:value"]=e):s.push({$:{"android:name":"expo.modules.updates.EXPO_RUNTIME_VERSION","android:value":e}}));let a=s.find(u=>u.$?.["android:name"]==="expo.modules.updates.EXPO_UPDATE_URL"),c=o.updates?.url;c&&(a!=null?((0,Mt.default)(a.$!=null),a.$["android:value"]=c):s.push({$:{"android:name":"expo.modules.updates.EXPO_UPDATE_URL","android:value":c}}))}function Br(t,o,e){return o==null?[]:e(t,o)?[o]:Object.keys(o).filter(s=>s!=="$"&&s!=="_").flatMap(s=>{let i=o[s];return Br(s,i,e)})}function Dr(t,o){if(t==null)return;let e=t.$??{};for(let[s,i]of Object.entries(e))e[s]=o(i);for(let[s,i]of Object.entries(t))s==="$"||s==="_"||Dr(i,o)}var Fu="./debug.keystore";var Z_=P(I_());function Ki(t,o){let e=process.env;for(let[s,i]of Object.entries(o??{})){if(e[s]!==void 0)continue;let r;i==null?r="":typeof i=="string"?r=i:r=JSON.stringify(i),e[s]=r}my("development"),(0,Z_.loadProjectEnv)(t)}function my(t){process.env.NODE_ENV=process.env.NODE_ENV||t,process.env.BABEL_ENV=process.env.BABEL_ENV||process.env.NODE_ENV,globalThis.__DEV__=process.env.NODE_ENV!=="production"}var gy=zt.default.resolve(__dirname,Fu);async function L_(t){let o=await Qe(t),{logger:e,workingDirectory:s}=o,i=o.jsBundleOnly??!1;await me.default.mkdir(s,{recursive:!0}),Ki(o.projectRoot,o.env);let{exp:r}=ri(o.projectRoot,{isPublicConfig:!0,skipSDKVersionRequirement:!0}),n=await qc(zt.default.resolve(o.sourceAppPath),o),a=si(o.projectRoot);if(await ai({appWorkingDirectory:n,options:o})){e.time("Generating bundle");let{assetRoot:x,bundleOutputPath:g}=await ni(r,o);if(e.timeEnd("Generating bundle"),e.time("Adding bundled resources"),await Nc({decodedApkRoot:n,assetRoot:x,bundleOutputPath:g}),e.timeEnd("Adding bundled resources"),a){e.time("Generating 'app.manifest' for expo-updates");let d=await ei(o),f=zt.default.join(n,"assets");await me.default.copyFile(d,zt.default.join(f,zt.default.basename(d))),e.timeEnd("Generating 'app.manifest' for expo-updates")}}i||await Oy({exp:r,decodedApkRoot:n,logger:e,options:o,useExpoUpdates:a}),e.time("Creating updated apk");let u=await Cc(n,o),m=await vl(u,o,{keyStorePath:o.androidSigningOptions?.keyStorePath??gy,keyStorePassword:o.androidSigningOptions?.keyStorePassword??"pass:android",keyAlias:o.androidSigningOptions?.keyAlias,keyPassword:o.androidSigningOptions?.keyPassword});if(e.timeEnd("Creating updated apk"),await me.default.rename(m,o.outputPath),!o.skipWorkingDirCleanup)try{await me.default.rm(s,{recursive:!0})}catch{}return o.outputPath}async function Oy({exp:t,decodedApkRoot:o,logger:e,options:s,useExpoUpdates:i}){(0,bn.default)(t.android?.package,"Expected app ID (`android.package`) to be defined in app.json");let r=i?await ii(s,t):null;e.info(P_.default.dim(`Resolved runtime version: ${r}`)),e.time("Updating AndroidManifest.xml");let n=zt.default.join(o,"AndroidManifest.xml"),a=await $r(n),c=Cu(a),u=new Set([c]),m=Nu(a,c);m!=null&&u.add(m);let x=new Set;for(let f of u){let k=await Wl(o,f,s);for(let v of k)x.add(v)}(0,bn.default)(x!=null,"Failed to search for dex classes with appId in the APK");let{isPackageNameChanged:g}=await qu({config:t,androidManiestXml:a,dexClasses:x,originalAppIdSet:u,options:s,updatesRuntimeVersion:r});g&&await Sc(o,t.android.package),await Hr(a,n),e.timeEnd("Updating AndroidManifest.xml"),e.time("Updating resources"),await Wu({config:t,decodedApkRoot:o}),await Su(o,s,t),e.timeEnd("Updating resources"),e.time("Generating app config");let d=await ti(s,t);await me.default.copyFile(d,zt.default.join(o,"assets","app.config")),e.timeEnd("Generating app config")}var or=P(require("node:assert")),pt=P(require("node:fs/promises")),Uo=P(require("node:path")),pg=P(sr());var Q_=P(require("node:assert")),ge=P(require("node:fs/promises")),no=P(require("node:path"));var A_=P(T_());function Gi(t){return U_(t)||U_((0,A_.default)(t))||"app"}function U_(t){return t.replace(/[\W_]+/g,"").normalize("NFD").replace(/[\u0300-\u036f]/g,"")}async function j_(t){let{spawnAsync:o,sourceAppPath:e}=t,s=no.default.join(t.workingDirectory,"extracted");if(await ge.default.mkdir(s,{recursive:!0}),e.endsWith(".zip")||e.endsWith(".ipa"))await o("unzip",[e,"-d",s]);else if(e.endsWith(".tar.gz"))await o("tar",["-xzf",e,"-C",s]);else if(e.endsWith(".app")){let n=no.default.basename(e);await ee(e,no.default.join(s,n))}else throw new Error("Unsupported file type. Please provide a .zip, .tar.gz, or .app file.");let r=(await Jo("{Payload/*.app,*.app}",{cwd:s,absolute:!0}))[0];return(0,Q_.default)(r,`Failed to find the .app directory in the extracted artifact: ${s}`),r}async function R_({config:t,appWorkingDirectory:o,executableName:e}){let{dir:s,name:i}=no.default.parse(o),r=Gi(t.name),n=no.default.join(s,`${r}.app`);return await ge.default.rename(no.default.join(s,`${i}.app`),n),await ge.default.rename(no.default.join(n,e),no.default.join(n,r)),n}async function J_(t,o){let e=no.default.resolve(t.workingDirectory,no.default.basename(o));return await ee(o,e),e}async function B_(t,o){let{spawnAsync:e,workingDirectory:s}=t;await ge.default.mkdir(no.default.join(s,"Payload"),{recursive:!0}),await ge.default.rename(o,no.default.join(s,"Payload",no.default.basename(o)));let i=no.default.resolve(s,"repacked.ipa");return await e("zip",["-r",i,"Payload"],{cwd:s}),i}function D_(t,o,e){let s=e.keychainPath?`keychain_path: "${e.keychainPath}",`:"",i;if(typeof e.provisioningProfile=="string")i=`provisioning_profile: "${no.default.resolve(e.provisioningProfile)}",`;else if(typeof e.provisioningProfile=="object"&&!Array.isArray(e.provisioningProfile)){let n="";for(let[a,c]of Object.entries(e.provisioningProfile))n+=` "${a}" => "${no.default.resolve(c)}",
34
+ `);for(let g of x){let d=n.exec(g);d&&a.add(d[1].replace(/\//g,"."))}}),await u,a}var Mt=P(require("node:assert")),at=P(require("node:fs/promises")),Fo=P(require("node:path")),li=P(gr());var oi=P(require("node:assert")),Lo=P(require("node:fs/promises")),oo=P(require("node:path")),se=P(Sl());var Gu=P(ku()),pu=P(require("node:assert")),St=P(require("node:fs/promises")),te=P(require("node:path"));async function Ft(t){return(await St.default.stat(t).catch(()=>null))?.isFile()??!1}async function nt(t){return(await St.default.stat(t).catch(()=>null))?.isDirectory()??!1}function Ae(t){return(0,pu.default)(t!=null,"Expected value to be non-null"),t}async function Qe(t){let o=t.platform==="android"?".apk":".ipa";return{...t,projectRoot:te.default.resolve(t.projectRoot),workingDirectory:t.workingDirectory??await St.default.mkdtemp(te.default.join(Ku(),"repack-app-")),outputPath:t.outputPath??te.default.join(t.projectRoot,`repacked${o}`),logger:Qd(t.logger),spawnAsync:t.spawnAsync??jd(!!t.verbose)}}function Qd(t){return t!=null?Hs.isBunyanLikeLogger(t)?new Hs(t):t:new Ue}var Ue=class{debug(...o){console.debug(...o)}info(...o){console.log(...o)}warn(...o){console.warn(...o)}error(...o){console.error(...o)}time(o){console.time(o)}timeEnd(o){console.timeEnd(o)}},Hs=class{constructor(o){this.logger=o}timerMap={};static isBunyanLikeLogger(o){return o.info&&o.time===void 0}debug(...o){this.logger.debug(o.join(""))}info(...o){this.logger.info(o.join(""))}warn(...o){this.logger.warn(o.join(""))}error(...o){this.logger.error(o.join(""))}time(o){this.timerMap[o]=Date.now()}timeEnd(o){if(this.timerMap[o]==null){this.logger.warn(`Timer '${o}' does not exist`);return}let e=Date.now()-this.timerMap[o];this.logger.info(`${o}: ${e} ms`),delete this.timerMap[o]}};function jd(t){return function(e,s,i){return(0,Gu.default)(e,s,{stdio:t?"inherit":"pipe",...i})}}async function ee(t,o){await St.default.mkdir(o,{recursive:!0});let e=await St.default.readdir(t,{withFileTypes:!0});for(let s of e){let i=te.default.join(t,s.name),r=te.default.join(o,s.name);s.isDirectory()?await ee(i,r):s.isFile()&&await St.default.copyFile(i,r)}}async function ti(t,o){let{workingDirectory:e}=t,s=oo.default.join(e,"app.config");return await Lo.default.writeFile(s,JSON.stringify(o)),s}async function ei(t){let{platform:o,projectRoot:e,spawnAsync:s,workingDirectory:i}=t,{stdout:r}=await s("node",["-e","require('expo/scripts/resolveAppEntry')",e,o,"absolute"],{cwd:e,stdio:"pipe"}),n=se.default.silent(t.projectRoot,"expo-updates/utils/build/createUpdatesResources.js");return(0,oi.default)(n,"Failed to resolve `createUpdatesResources.js` within expo-updates package"),await s("node",[n,o,e,i,"all",r.trim()],{cwd:e}),oo.default.join(i,"app.manifest")}function si(t){let o=vu(t);(0,oi.default)(o,"Failed to resolve '@expo/config' package in the project");let{getPackageJson:e}=require(o),s=e(t);return!!(s.dependencies&&"expo-updates"in s.dependencies)}async function ii(t,o){let{projectRoot:e,spawnAsync:s}=t,i=se.default.silent(e,"expo-updates/bin/cli")??(0,se.default)(e,"expo-updates/bin/cli.js"),{stdout:r}=await s(i,["runtimeversion:resolve","--platform","android","--workflow","managed"],{cwd:e,stdio:"pipe"});return JSON.parse(r).runtimeVersion??null}function vu(t){let o=se.default.silent(t,"expo/package.json");return o?se.default.silent(oo.default.dirname(o),"@expo/config")??null:null}function ri(t,o){let e=vu(t);(0,oi.default)(e,"Failed to resolve '@expo/config' package in the project");let{getConfig:s}=require(e);return s(t,o)}async function ni(t,o){let{projectRoot:e,platform:s,spawnAsync:i,workingDirectory:r}=o,n=oo.default.resolve(r,"bundles");await Lo.default.mkdir(n,{recursive:!0});let a=oo.default.join(n,"assets");await Lo.default.mkdir(a,{recursive:!0});let{stdout:c}=await i("node",["-e","require('expo/scripts/resolveAppEntry')",e,s,"absolute"],{cwd:e,stdio:"pipe"}),u=Rd(t,s),m=s==="android"?"index.android.bundle":"main.bundle",x=oo.default.join(n,m),g=oo.default.join(n,"bundle.map"),d=["expo","export:embed","--platform",s,"--entry-file",c.trim(),"--bundle-output",oo.default.join(n,m),"--assets-dest",oo.default.join(n,"assets"),"--dev","false","--reset-cache","--sourcemap-output",g];return u?(d.push("--minify","false"),d.push("--bytecode","true"),d.push("--unstable-transform-profile","hermes")):d.push("--minify","true"),await i("npx",d,{cwd:e}),o.exportEmbedOptions?.sourcemapOutput&&await Lo.default.copyFile(g,o.exportEmbedOptions.sourcemapOutput),{bundleOutputPath:x,assetRoot:a}}async function ai({appWorkingDirectory:t,options:o}){if(o.exportEmbedOptions!=null)return!0;let e;return o.platform==="android"?e=oo.default.join(t,"assets","index.android.bundle"):e=oo.default.join(t,"main.jsbundle"),await Ft(e)}function Rd(t,o){switch(o){case"android":return(t.android?.jsEngine??t.jsEngine)!=="jsc";case"ios":return(t.ios?.jsEngine??t.jsEngine)!=="jsc";default:return!1}}async function ci(t,o){let{spawnAsync:e,workingDirectory:s}=o,i=o.platform==="ios"?"ios":"android",r=oo.default.join(s,`prebuild-${i}`),n=oo.default.join(t,"package.json"),a=oo.default.join(t,"package-repack.json");await Lo.default.cp(n,a,{force:!0});let c=oo.default.join(t,i),u=await nt(c);try{return u&&await Lo.default.rename(c,oo.default.join(t,`${i}-repack-backup`)),await e("npx",["expo","prebuild","--platform",i,"--no-install"],{cwd:t}),await Lo.default.cp(c,r,{recursive:!0,force:!0}),await Lo.default.rm(c,{recursive:!0,force:!0}),r}finally{u&&await Lo.default.rename(oo.default.join(t,`${i}-repack-backup`),c),await Lo.default.rename(a,n)}}async function Wu({config:t,decodedApkRoot:o}){let e=Fo.default.join(o,"res","values","strings.xml"),s=await at.default.readFile(e,"utf8");s=s.replace(/(<string name="app_name">)(.+)(<\/string>)/,`$1${t.name}$3`),await at.default.writeFile(e,s)}async function qu({config:t,androidManiestXml:o,dexClasses:e,originalAppIdSet:s,updatesRuntimeVersion:i}){let r=Ae(t.android?.package),n=o.manifest.$.package!==r;Dr(o,d=>{for(let f of s)if(d.startsWith(f)&&!e.has(d))return d.replace(new RegExp(`^${f}`),r);return d});let a=Br("manifest",o.manifest,(d,f)=>d==="intent-filter"&&Br(d,f,(k,v)=>k==="action"&&v[0].$?.["android:name"]==="android.intent.action.VIEW").length>0),c=Array.isArray(t.scheme)?t.scheme[0]:t.scheme;for(let d of a)Dr(d,f=>{let k=f;for(let v of s)k=k.replace(new RegExp(`^${v}`),r);return k=k.replace(/^exp\+.+$/g,`exp+${Ae(t.slug)}`),c&&(k=k.replace(/^myapp$/g,c)),k});let u=o.manifest.application[0];(0,Mt.default)(u.$?.["android:name"]?.endsWith(".MainApplication"),"Expected application node to be named as MainApplication"),Bd(u,t,i),t.android?.adaptiveIcon?((0,Mt.default)(u.$,"Expected application node to have attributes"),u.$["android:roundIcon"]="@mipmap/ic_launcher_round"):delete u.$?.["android:roundIcon"],o.manifest.$.package=r;let x=t.android?.version||t.version||"1.0.0",g=Number(t.android?.versionCode??1);return o.manifest.$["android:versionName"]=x,o.manifest.$["android:versionCode"]=g,{isPackageNameChanged:n}}async function $r(t){let o=await at.default.readFile(t,"utf8");return await new li.Parser().parseStringPromise(o)}async function Hr(t,o){let s=new li.Builder().buildObject(t);await at.default.writeFile(o,s)}function Cu(t){let o=t.manifest.$.package;return(0,Mt.default)(o!=null,"Expected package attribute to be present in AndroidManifest.xml"),o}function Nu(t,o){let e=t.manifest.application?.[0]?.$?.["android:name"];if(e){let s=e.replace(/\.[^.]+$/,"");if(s!==e&&s!==o)return s}return null}async function Su(t,o,e){let{projectRoot:s}=o,i=await ci(s,o),r=Fo.default.join(i,"app","src","main","res"),n=Fo.default.join(t,"res"),a=["mipmap-mdpi","mipmap-hdpi","mipmap-xhdpi","mipmap-xxhdpi","mipmap-xxxhdpi","mipmap-anydpi-v26"],c=["ic_launcher.webp","ic_launcher.png","ic_launcher_round.webp","ic_launcher_round.png","ic_launcher_foreground.webp","ic_launcher_foreground.png","ic_launcher_background.webp","ic_launcher_background.png","ic_launcher_monochrome.webp","ic_launcher_monochrome.png","ic_launcher.xml","ic_launcher_round.xml"];for(let m of a){let x=Fo.default.join(n,m);await nt(x)&&await Promise.all(c.map(d=>at.default.rm(Fo.default.join(x,d),{force:!0})));let g=Fo.default.join(r,m);await Promise.all(c.map(async d=>{await Ft(Fo.default.join(g,d))&&(await nt(x)||await at.default.mkdir(x,{recursive:!0}),await at.default.cp(Fo.default.join(g,d),Fo.default.join(x,d)))}))}let u=e.android?.adaptiveIcon?.backgroundColor??null;await Jd(t,u)}async function Jd(t,o){let e=Fo.default.join(t,"res","values","colors.xml"),s;await Ft(e)?s=await $r(e):s={resources:{color:[]}},s.resources||={},Array.isArray(s.resources.color)||(s.resources.color=[]);let i=s.resources.color.findIndex(r=>r.$?.name==="iconBackground");if(o===null)i>=0&&s.resources.color.splice(i,1);else{let r={$:{name:"iconBackground"},_:o};i>=0?s.resources.color[i]=r:s.resources.color.push(r)}await at.default.mkdir(Fo.default.dirname(e),{recursive:!0}),await Hr(s,e)}function Bd(t,o,e){let s=t["meta-data"]??[],i=o.updates?.enabled??!0,r=s.find(u=>u.$?.["android:name"]==="expo.modules.updates.ENABLED");r!=null?((0,Mt.default)(r.$!=null),r.$["android:value"]=i?"true":"false"):s.push({$:{"android:name":"expo.modules.updates.ENABLED","android:value":i?"true":"false"}});let n=s.find(u=>u.$?.["android:name"]==="expo.modules.updates.EXPO_RUNTIME_VERSION");e!=null&&(n!=null?((0,Mt.default)(n.$!=null),n.$["android:value"]=e):s.push({$:{"android:name":"expo.modules.updates.EXPO_RUNTIME_VERSION","android:value":e}}));let a=s.find(u=>u.$?.["android:name"]==="expo.modules.updates.EXPO_UPDATE_URL"),c=o.updates?.url;c&&(a!=null?((0,Mt.default)(a.$!=null),a.$["android:value"]=c):s.push({$:{"android:name":"expo.modules.updates.EXPO_UPDATE_URL","android:value":c}}))}function Br(t,o,e){return o==null?[]:e(t,o)?[o]:Object.keys(o).filter(s=>s!=="$"&&s!=="_").flatMap(s=>{let i=o[s];return Br(s,i,e)})}function Dr(t,o){if(t==null)return;let e=t.$??{};for(let[s,i]of Object.entries(e))e[s]=o(i);for(let[s,i]of Object.entries(t))s==="$"||s==="_"||Dr(i,o)}var Fu="./debug.keystore";var Z_=P(I_());function Ki(t,o){let e=process.env;for(let[s,i]of Object.entries(o??{})){if(e[s]!==void 0)continue;let r;i==null?r="":typeof i=="string"?r=i:r=JSON.stringify(i),e[s]=r}my("development"),(0,Z_.loadProjectEnv)(t)}function my(t){process.env.NODE_ENV=process.env.NODE_ENV||t,process.env.BABEL_ENV=process.env.BABEL_ENV||process.env.NODE_ENV,globalThis.__DEV__=process.env.NODE_ENV!=="production"}var gy=zt.default.resolve(__dirname,Fu);async function L_(t){let o=await Qe(t),{logger:e,workingDirectory:s}=o,i=o.jsBundleOnly??!1;process.chdir(o.projectRoot),await me.default.mkdir(s,{recursive:!0}),Ki(o.projectRoot,o.env);let{exp:r}=ri(o.projectRoot,{isPublicConfig:!0,skipPlugins:!0,skipSDKVersionRequirement:!0}),n=await qc(zt.default.resolve(o.sourceAppPath),o),a=si(o.projectRoot);if(await ai({appWorkingDirectory:n,options:o})){e.time("Generating bundle");let{assetRoot:x,bundleOutputPath:g}=await ni(r,o);if(e.timeEnd("Generating bundle"),e.time("Adding bundled resources"),await Nc({decodedApkRoot:n,assetRoot:x,bundleOutputPath:g}),e.timeEnd("Adding bundled resources"),a){e.time("Generating 'app.manifest' for expo-updates");let d=await ei(o),f=zt.default.join(n,"assets");await me.default.copyFile(d,zt.default.join(f,zt.default.basename(d))),e.timeEnd("Generating 'app.manifest' for expo-updates")}}i||await Oy({exp:r,decodedApkRoot:n,logger:e,options:o,useExpoUpdates:a}),e.time("Creating updated apk");let u=await Cc(n,o),m=await vl(u,o,{keyStorePath:o.androidSigningOptions?.keyStorePath??gy,keyStorePassword:o.androidSigningOptions?.keyStorePassword??"pass:android",keyAlias:o.androidSigningOptions?.keyAlias,keyPassword:o.androidSigningOptions?.keyPassword});if(e.timeEnd("Creating updated apk"),await me.default.rename(m,o.outputPath),!o.skipWorkingDirCleanup)try{await me.default.rm(s,{recursive:!0})}catch{}return o.outputPath}async function Oy({exp:t,decodedApkRoot:o,logger:e,options:s,useExpoUpdates:i}){(0,bn.default)(t.android?.package,"Expected app ID (`android.package`) to be defined in app.json");let r=i?await ii(s,t):null;e.info(P_.default.dim(`Resolved runtime version: ${r}`)),e.time("Updating AndroidManifest.xml");let n=zt.default.join(o,"AndroidManifest.xml"),a=await $r(n),c=Cu(a),u=new Set([c]),m=Nu(a,c);m!=null&&u.add(m);let x=new Set;for(let f of u){let k=await Wl(o,f,s);for(let v of k)x.add(v)}(0,bn.default)(x!=null,"Failed to search for dex classes with appId in the APK");let{isPackageNameChanged:g}=await qu({config:t,androidManiestXml:a,dexClasses:x,originalAppIdSet:u,options:s,updatesRuntimeVersion:r});g&&await Sc(o,t.android.package),await Hr(a,n),e.timeEnd("Updating AndroidManifest.xml"),e.time("Updating resources"),await Wu({config:t,decodedApkRoot:o}),await Su(o,s,t),e.timeEnd("Updating resources"),e.time("Generating app config");let d=await ti(s,t);await me.default.copyFile(d,zt.default.join(o,"assets","app.config")),e.timeEnd("Generating app config")}var or=P(require("node:assert")),pt=P(require("node:fs/promises")),Uo=P(require("node:path")),pg=P(sr());var Q_=P(require("node:assert")),ge=P(require("node:fs/promises")),no=P(require("node:path"));var A_=P(T_());function Gi(t){return U_(t)||U_((0,A_.default)(t))||"app"}function U_(t){return t.replace(/[\W_]+/g,"").normalize("NFD").replace(/[\u0300-\u036f]/g,"")}async function j_(t){let{spawnAsync:o,sourceAppPath:e}=t,s=no.default.join(t.workingDirectory,"extracted");if(await ge.default.mkdir(s,{recursive:!0}),e.endsWith(".zip")||e.endsWith(".ipa"))await o("unzip",[e,"-d",s]);else if(e.endsWith(".tar.gz"))await o("tar",["-xzf",e,"-C",s]);else if(e.endsWith(".app")){let n=no.default.basename(e);await ee(e,no.default.join(s,n))}else throw new Error("Unsupported file type. Please provide a .zip, .tar.gz, or .app file.");let r=(await Jo("{Payload/*.app,*.app}",{cwd:s,absolute:!0}))[0];return(0,Q_.default)(r,`Failed to find the .app directory in the extracted artifact: ${s}`),r}async function R_({config:t,appWorkingDirectory:o,executableName:e}){let{dir:s,name:i}=no.default.parse(o),r=Gi(t.name),n=no.default.join(s,`${r}.app`);return await ge.default.rename(no.default.join(s,`${i}.app`),n),await ge.default.rename(no.default.join(n,e),no.default.join(n,r)),n}async function J_(t,o){let e=no.default.resolve(t.workingDirectory,no.default.basename(o));return await ee(o,e),e}async function B_(t,o){let{spawnAsync:e,workingDirectory:s}=t;await ge.default.mkdir(no.default.join(s,"Payload"),{recursive:!0}),await ge.default.rename(o,no.default.join(s,"Payload",no.default.basename(o)));let i=no.default.resolve(s,"repacked.ipa");return await e("zip",["-r",i,"Payload"],{cwd:s}),i}function D_(t,o,e){let s=e.keychainPath?`keychain_path: "${e.keychainPath}",`:"",i;if(typeof e.provisioningProfile=="string")i=`provisioning_profile: "${no.default.resolve(e.provisioningProfile)}",`;else if(typeof e.provisioningProfile=="object"&&!Array.isArray(e.provisioningProfile)){let n="";for(let[a,c]of Object.entries(e.provisioningProfile))n+=` "${a}" => "${no.default.resolve(c)}",
35
35
  `;i=`provisioning_profile: {
36
36
  ${n}
37
37
  },`}else i="";return`lane :${t} do
@@ -42,7 +42,7 @@ ${n}
42
42
  ${i}
43
43
  )
44
44
  end
45
- `.replace(/^\s*[\r\n]/gm,"")}var Dn=P(hg());var $i=P(require("node:assert")),po=P(require("node:fs/promises")),ao=P(require("node:path"));async function fg({config:t,infoPlistPath:o,originalAppId:e,version:s,buildNumber:i,options:r}){let n=t.ios?.bundleIdentifier;(0,$i.default)(n,"The `bundleIdentifier` must be specified in the `ios` config.");let a=Array.isArray(t.scheme)?t.scheme[0]:t.scheme;await Hi(o,r,c=>{let u=c.CFBundleURLTypes.slice();for(let g of u)if(Array.isArray(g.CFBundleURLSchemes)){let d=g.CFBundleURLSchemes.map(f=>{let k=f.replace(e,n).replace(/^exp\+.+$/g,`exp+${Ae(t.slug)}`);return a&&(k=f.replace(/^myapp$/g,a)),k});g.CFBundleURLSchemes=d}let m={...c,CFBundleDisplayName:t.name,CFBundleName:t.name,CFBundleExecutable:Gi(t.name),CFBundleIdentifier:n,CFBundleVersion:i,CFBundleShortVersionString:s},x=c.NSUserActivityTypes?.map(g=>g.replace(e,n));return x&&(m.NSUserActivityTypes=x),m})}async function zg(t,o,e,s){await Hi(o,s,i=>{let r=t.updates?.enabled??!0,n={...i,EXUpdatesEnabled:r};e&&(n.EXUpdatesRuntimeVersion=e);let a=t.updates?.url;return a&&(n.EXUpdatesURL=a),n})}async function kg(t,o){let e,s;return await Hi(t,o,i=>(e=i.CFBundleIdentifier,s=i.CFBundleExecutable,i)),(0,$i.default)(e,"Expected `CFBundleIdentifier` to be present in Info.plist"),(0,$i.default)(s,"Expected `CFBundleExecutable` to be present in Info.plist"),{appId:e,executableName:s}}async function bg({appWorkingDirectory:t,assetRoot:o,bundleOutputPath:e}){await Promise.all([po.default.rm(ao.default.join(t,"main.jsbundle"),{force:!0}),po.default.rm(ao.default.join(t,"assets"),{recursive:!0,force:!0})]),await po.default.copyFile(e,ao.default.join(t,"main.jsbundle")),await nt(o)&&await ee(o,t)}async function Kg(t,o,e){let{spawnAsync:s}=o,i=await ah(o),{metadata:r}=await ch(ao.default.join(t,"Assets.car"),o),n=r.PlatformVersion||"15.1",a=ao.default.join(o.workingDirectory,"actool-temp");await po.default.mkdir(a,{recursive:!0});let c=null;typeof e.ios?.icon=="string"&&ao.default.extname(e.ios.icon)===".icon"&&(c=ao.default.resolve(o.projectRoot,e.ios.icon));let u=[i,c,"--compile",a,"--output-format","human-readable-text","--notices","--warnings","--app-icon","AppIcon","--compress-pngs","--enable-on-demand-resources","YES","--target-device","iphone","--target-device","ipad","--minimum-deployment-target",n,"--platform","iphonesimulator","--output-partial-info-plist",ao.default.join(a,"partial.plist"),"--development-region","en","--generate-swift-asset-symbol-extensions","NO"].filter(Boolean);return await s("actool",u),await po.default.rm(ao.default.join(t,"Assets.car"),{force:!0}),await po.default.cp(ao.default.join(a,"Assets.car"),ao.default.join(t,"Assets.car")),ao.default.join(a,"Assets.car")}async function Gg({appWorkingDirectory:t,originalAppId:o,bundleIdentifier:e,version:s,buildNumber:i,options:r}){let n=await Jo("PlugIns/*.appex/Info.plist",{cwd:t,absolute:!0});for(let a of n)await Hi(a,r,c=>{let u=c.CFBundleIdentifier,m={...c,CFBundleVersion:i,CFBundleShortVersionString:s};return typeof u=="string"&&(m.CFBundleIdentifier=u.replace(o,e)),m})}async function Hi(t,o,e){let{spawnAsync:s}=o;await s("plutil",["-convert","xml1",t]);let i=await po.default.readFile(t,"utf8"),r=await Dn.default.parse(i),n=e(r),a=Dn.default.build(n);await po.default.writeFile(t,a),await s("plutil",["-convert","binary1",t])}async function ah(t){let{logger:o,projectRoot:e,workingDirectory:s}=t,i=ao.default.join(s,"Image.xcassets"),r=await ci(e,t),n=(await Jo("**/*.xcassets",{cwd:r,absolute:!0}))[0],a=await Jo("**/*.xcassets",{cwd:e,absolute:!0});if(a.length===0)return await po.default.cp(n,i,{recursive:!0,force:!0}),i;a.length>1&&o.warn("Multiple .xcassets directories found. Trying to use the first one."),await po.default.cp(a[0],i,{recursive:!0,force:!0});let c=["AppIcon.appiconset"];for(let u of c)await po.default.rm(ao.default.join(i,u),{recursive:!0,force:!0}),await po.default.cp(ao.default.join(n,u),ao.default.join(i,u),{recursive:!0,force:!0});return i}async function ch(t,o){let{spawnAsync:e}=o,{stdout:s}=await e("assetutil",["--info",t],{cwd:o.projectRoot,stdio:"pipe"}),i=JSON.parse(s),r=i[0],n=i.slice(1);return{metadata:r,items:n}}async function vg(t){let o=await Qe(t),{workingDirectory:e,logger:s}=o,i=o.jsBundleOnly??!1;await pt.default.mkdir(e,{recursive:!0}),Ki(o.projectRoot,o.env);let{exp:r}=ri(o.projectRoot,{isPublicConfig:!0,skipSDKVersionRequirement:!0});s.time(`Extracting artifact from ${o.sourceAppPath}`);let n=await j_(o);s.timeEnd(`Extracting artifact from ${o.sourceAppPath}`);let a=Uo.default.join(n,"Info.plist"),{appId:c,executableName:u}=await kg(a,o),m=i?n:await R_({config:r,appWorkingDirectory:n,executableName:u}),x=si(o.projectRoot);if(await ai({appWorkingDirectory:m,options:o})){s.time("Generating bundle");let{assetRoot:f,bundleOutputPath:k}=await ni(r,o);if(s.timeEnd("Generating bundle"),s.time("Adding bundled resources"),await bg({appWorkingDirectory:m,assetRoot:f,bundleOutputPath:k}),s.timeEnd("Adding bundled resources"),x){s.time("Generating 'app.manifest' for expo-updates");let v=await ei(o),W=Uo.default.join(m,"EXUpdates.bundle");(0,or.default)(await nt(W),"Expected EXUpdates.bundle directory to exist"),await pt.default.copyFile(v,Uo.default.join(W,Uo.default.basename(v))),s.timeEnd("Generating 'app.manifest' for expo-updates")}}i||await uh({appWorkingDirectory:m,exp:r,logger:s,options:o,originalAppId:c,useExpoUpdates:x}),s.time("Creating updated artifact");let d;if(o.outputPath.endsWith(".app")?d=await J_(o,m):d=await B_(o,m),s.timeEnd("Creating updated artifact"),o.iosSigningOptions&&((0,or.default)(d.endsWith(".ipa"),"Signing is only supported for .ipa files"),s.time(`Resigning the IPA at ${d}`),await lh(d,o.iosSigningOptions,o),s.timeEnd(`Resigning the IPA at ${d}`)),await pt.default.rename(d,o.outputPath),!o.skipWorkingDirCleanup)try{await pt.default.rm(e,{recursive:!0})}catch{}return o.outputPath}async function lh(t,o,e){let s=await Qe(e),{spawnAsync:i}=s,r=Uo.default.join(s.workingDirectory,"fastlane");await pt.default.mkdir(r,{recursive:!0});let n=D_("resign_ipa",t,o);await pt.default.writeFile(Uo.default.join(r,"Fastfile"),n),await i("fastlane",["resign_ipa"],{cwd:r,env:s.env})}async function uh({appWorkingDirectory:t,exp:o,logger:e,options:s,originalAppId:i,useExpoUpdates:r}){(0,or.default)(o.ios?.bundleIdentifier,"Expected app ID (`ios.bundleIdentifier`) to be defined in app.json");let n=r?await ii(s,o):null;r&&e.info(pg.default.dim(`Resolved runtime version: ${n}`));let a=Uo.default.join(t,"Info.plist");await Kg(t,s,o),e.time("Updating Info.plist");let c=o.ios?.version||o.version||"1.0.0",u=o.ios?.buildNumber||"1";await fg({config:o,infoPlistPath:a,originalAppId:i,version:c,buildNumber:u,options:s}),await Gg({appWorkingDirectory:t,originalAppId:i,bundleIdentifier:o.ios.bundleIdentifier,version:c,buildNumber:u,options:s}),e.timeEnd("Updating Info.plist"),await Ft(Uo.default.join(t,"Expo.plist"))&&(e.time("Updating Expo.plist"),await zg(o,Uo.default.join(t,"Expo.plist"),n,s),e.timeEnd("Updating Expo.plist")),e.time("Generating app.config");let m=await ti(s,o);await pt.default.copyFile(m,Uo.default.join(t,"EXConstants.bundle","app.config")),e.timeEnd("Generating app.config")}0&&(module.exports={ConsoleLogger,repackAppAndroidAsync,repackAppIosAsync});
45
+ `.replace(/^\s*[\r\n]/gm,"")}var Dn=P(hg());var $i=P(require("node:assert")),po=P(require("node:fs/promises")),ao=P(require("node:path"));async function fg({config:t,infoPlistPath:o,originalAppId:e,version:s,buildNumber:i,options:r}){let n=t.ios?.bundleIdentifier;(0,$i.default)(n,"The `bundleIdentifier` must be specified in the `ios` config.");let a=Array.isArray(t.scheme)?t.scheme[0]:t.scheme;await Hi(o,r,c=>{let u=c.CFBundleURLTypes.slice();for(let g of u)if(Array.isArray(g.CFBundleURLSchemes)){let d=g.CFBundleURLSchemes.map(f=>{let k=f.replace(e,n).replace(/^exp\+.+$/g,`exp+${Ae(t.slug)}`);return a&&(k=f.replace(/^myapp$/g,a)),k});g.CFBundleURLSchemes=d}let m={...c,CFBundleDisplayName:t.name,CFBundleName:t.name,CFBundleExecutable:Gi(t.name),CFBundleIdentifier:n,CFBundleVersion:i,CFBundleShortVersionString:s},x=c.NSUserActivityTypes?.map(g=>g.replace(e,n));return x&&(m.NSUserActivityTypes=x),m})}async function zg(t,o,e,s){await Hi(o,s,i=>{let r=t.updates?.enabled??!0,n={...i,EXUpdatesEnabled:r};e&&(n.EXUpdatesRuntimeVersion=e);let a=t.updates?.url;return a&&(n.EXUpdatesURL=a),n})}async function kg(t,o){let e,s;return await Hi(t,o,i=>(e=i.CFBundleIdentifier,s=i.CFBundleExecutable,i)),(0,$i.default)(e,"Expected `CFBundleIdentifier` to be present in Info.plist"),(0,$i.default)(s,"Expected `CFBundleExecutable` to be present in Info.plist"),{appId:e,executableName:s}}async function bg({appWorkingDirectory:t,assetRoot:o,bundleOutputPath:e}){await Promise.all([po.default.rm(ao.default.join(t,"main.jsbundle"),{force:!0}),po.default.rm(ao.default.join(t,"assets"),{recursive:!0,force:!0})]),await po.default.copyFile(e,ao.default.join(t,"main.jsbundle")),await nt(o)&&await ee(o,t)}async function Kg(t,o,e){let{spawnAsync:s}=o,i=await ah(o),{metadata:r}=await ch(ao.default.join(t,"Assets.car"),o),n=r.PlatformVersion||"15.1",a=ao.default.join(o.workingDirectory,"actool-temp");await po.default.mkdir(a,{recursive:!0});let c=null;typeof e.ios?.icon=="string"&&ao.default.extname(e.ios.icon)===".icon"&&(c=ao.default.resolve(o.projectRoot,e.ios.icon));let u=[i,c,"--compile",a,"--output-format","human-readable-text","--notices","--warnings","--app-icon","AppIcon","--compress-pngs","--enable-on-demand-resources","YES","--target-device","iphone","--target-device","ipad","--minimum-deployment-target",n,"--platform","iphonesimulator","--output-partial-info-plist",ao.default.join(a,"partial.plist"),"--development-region","en","--generate-swift-asset-symbol-extensions","NO"].filter(Boolean);return await s("actool",u),await po.default.rm(ao.default.join(t,"Assets.car"),{force:!0}),await po.default.cp(ao.default.join(a,"Assets.car"),ao.default.join(t,"Assets.car")),ao.default.join(a,"Assets.car")}async function Gg({appWorkingDirectory:t,originalAppId:o,bundleIdentifier:e,version:s,buildNumber:i,options:r}){let n=await Jo("PlugIns/*.appex/Info.plist",{cwd:t,absolute:!0});for(let a of n)await Hi(a,r,c=>{let u=c.CFBundleIdentifier,m={...c,CFBundleVersion:i,CFBundleShortVersionString:s};return typeof u=="string"&&(m.CFBundleIdentifier=u.replace(o,e)),m})}async function Hi(t,o,e){let{spawnAsync:s}=o;await s("plutil",["-convert","xml1",t]);let i=await po.default.readFile(t,"utf8"),r=await Dn.default.parse(i),n=e(r),a=Dn.default.build(n);await po.default.writeFile(t,a),await s("plutil",["-convert","binary1",t])}async function ah(t){let{logger:o,projectRoot:e,workingDirectory:s}=t,i=ao.default.join(s,"Image.xcassets"),r=await ci(e,t),n=(await Jo("**/*.xcassets",{cwd:r,absolute:!0}))[0],a=await Jo("**/*.xcassets",{cwd:e,absolute:!0});if(a.length===0)return await po.default.cp(n,i,{recursive:!0,force:!0}),i;a.length>1&&o.warn("Multiple .xcassets directories found. Trying to use the first one."),await po.default.cp(a[0],i,{recursive:!0,force:!0});let c=["AppIcon.appiconset"];for(let u of c)await po.default.rm(ao.default.join(i,u),{recursive:!0,force:!0}),await po.default.cp(ao.default.join(n,u),ao.default.join(i,u),{recursive:!0,force:!0});return i}async function ch(t,o){let{spawnAsync:e}=o,{stdout:s}=await e("assetutil",["--info",t],{cwd:o.projectRoot,stdio:"pipe"}),i=JSON.parse(s),r=i[0],n=i.slice(1);return{metadata:r,items:n}}async function vg(t){let o=await Qe(t),{workingDirectory:e,logger:s}=o,i=o.jsBundleOnly??!1;process.chdir(o.projectRoot),await pt.default.mkdir(e,{recursive:!0}),Ki(o.projectRoot,o.env);let{exp:r}=ri(o.projectRoot,{isPublicConfig:!0,skipPlugins:!0,skipSDKVersionRequirement:!0});s.time(`Extracting artifact from ${o.sourceAppPath}`);let n=await j_(o);s.timeEnd(`Extracting artifact from ${o.sourceAppPath}`);let a=Uo.default.join(n,"Info.plist"),{appId:c,executableName:u}=await kg(a,o),m=i?n:await R_({config:r,appWorkingDirectory:n,executableName:u}),x=si(o.projectRoot);if(await ai({appWorkingDirectory:m,options:o})){s.time("Generating bundle");let{assetRoot:f,bundleOutputPath:k}=await ni(r,o);if(s.timeEnd("Generating bundle"),s.time("Adding bundled resources"),await bg({appWorkingDirectory:m,assetRoot:f,bundleOutputPath:k}),s.timeEnd("Adding bundled resources"),x){s.time("Generating 'app.manifest' for expo-updates");let v=await ei(o),W=Uo.default.join(m,"EXUpdates.bundle");(0,or.default)(await nt(W),"Expected EXUpdates.bundle directory to exist"),await pt.default.copyFile(v,Uo.default.join(W,Uo.default.basename(v))),s.timeEnd("Generating 'app.manifest' for expo-updates")}}i||await uh({appWorkingDirectory:m,exp:r,logger:s,options:o,originalAppId:c,useExpoUpdates:x}),s.time("Creating updated artifact");let d;if(o.outputPath.endsWith(".app")?d=await J_(o,m):d=await B_(o,m),s.timeEnd("Creating updated artifact"),o.iosSigningOptions&&((0,or.default)(d.endsWith(".ipa"),"Signing is only supported for .ipa files"),s.time(`Resigning the IPA at ${d}`),await lh(d,o.iosSigningOptions,o),s.timeEnd(`Resigning the IPA at ${d}`)),await pt.default.rename(d,o.outputPath),!o.skipWorkingDirCleanup)try{await pt.default.rm(e,{recursive:!0})}catch{}return o.outputPath}async function lh(t,o,e){let s=await Qe(e),{spawnAsync:i}=s,r=Uo.default.join(s.workingDirectory,"fastlane");await pt.default.mkdir(r,{recursive:!0});let n=D_("resign_ipa",t,o);await pt.default.writeFile(Uo.default.join(r,"Fastfile"),n),await i("fastlane",["resign_ipa"],{cwd:r,env:s.env})}async function uh({appWorkingDirectory:t,exp:o,logger:e,options:s,originalAppId:i,useExpoUpdates:r}){(0,or.default)(o.ios?.bundleIdentifier,"Expected app ID (`ios.bundleIdentifier`) to be defined in app.json");let n=r?await ii(s,o):null;r&&e.info(pg.default.dim(`Resolved runtime version: ${n}`));let a=Uo.default.join(t,"Info.plist");await Kg(t,s,o),e.time("Updating Info.plist");let c=o.ios?.version||o.version||"1.0.0",u=o.ios?.buildNumber||"1";await fg({config:o,infoPlistPath:a,originalAppId:i,version:c,buildNumber:u,options:s}),await Gg({appWorkingDirectory:t,originalAppId:i,bundleIdentifier:o.ios.bundleIdentifier,version:c,buildNumber:u,options:s}),e.timeEnd("Updating Info.plist"),await Ft(Uo.default.join(t,"Expo.plist"))&&(e.time("Updating Expo.plist"),await zg(o,Uo.default.join(t,"Expo.plist"),n,s),e.timeEnd("Updating Expo.plist")),e.time("Generating app.config");let m=await ti(s,o);await pt.default.copyFile(m,Uo.default.join(t,"EXConstants.bundle","app.config")),e.timeEnd("Generating app.config")}0&&(module.exports={ConsoleLogger,repackAppAndroidAsync,repackAppIosAsync});
46
46
  /*! Bundled license information:
47
47
 
48
48
  sax/lib/sax.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/repack-app",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Repacking tool for Expo apps",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -12,10 +12,10 @@
12
12
  "clean": "rm -rf build dist",
13
13
  "lint": "eslint src",
14
14
  "prepare": "bun run clean && bun run build:all",
15
- "test": "bun test src",
16
- "test:e2e": "bun test e2e --timeout 120000",
17
- "test:e2e:android": "bun test e2e --timeout 120000 --test-name-pattern Android",
18
- "test:e2e:ios": "bun test e2e --timeout 120000 --test-name-pattern iOS",
15
+ "test": "vitest run src",
16
+ "test:e2e": "vitest run e2e",
17
+ "test:e2e:android": "vitest run e2e -t Android",
18
+ "test:e2e:ios": "vitest run e2e -t iOS",
19
19
  "typecheck": "tsc --noEmit"
20
20
  },
21
21
  "bin": {
@@ -50,6 +50,7 @@
50
50
  "slugify": "^1.6.6",
51
51
  "temp-dir": "^2.0.0",
52
52
  "typescript": "^5.9.3",
53
+ "vitest": "^4.1.0",
53
54
  "xml2js": "^0.6.2"
54
55
  }
55
56
  }