@hanzlaa/rcode 4.10.5 → 4.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/AGENTS.md +1 -1
  2. package/CLAUDE.md +1 -1
  3. package/CONTRIBUTING.md +3 -0
  4. package/cli/install.js +272 -1
  5. package/dist/rcode.js +259 -236
  6. package/package.json +1 -1
  7. package/rcode/agents/rcode-project-researcher.md +1 -1
  8. package/rcode/agents/rcode-ux-designer.md +1 -0
  9. package/rcode/agents/rcode-verifier.md +2 -2
  10. package/rcode/agents/rules/planner/common-patterns.md +2 -1
  11. package/rcode/agents/rules/planner/goal-backward-thinking.md +33 -0
  12. package/rcode/agents/rules/planner/sprint-verification.md +1 -0
  13. package/rcode/agents/rules/planner/task-templates.md +20 -1
  14. package/rcode/agents/rules/project-researcher/detailed-guide.md +10 -0
  15. package/rcode/agents/rules/sprint-checker/dimensions.md +74 -0
  16. package/rcode/agents/rules/sprint-checker/process.md +12 -0
  17. package/rcode/agents/rules/verifier/behavioral-spot-checks.md +5 -1
  18. package/rcode/agents/rules/verifier/gap-output.md +5 -0
  19. package/rcode/agents/rules/verifier/reachability-check.md +69 -0
  20. package/rcode/bin/rcode-tools.cjs +39 -3
  21. package/rcode/commands/ui-phase.md +1 -1
  22. package/rcode/references/design-library/LICENSE +21 -0
  23. package/rcode/references/design-library/README.md +37 -0
  24. package/rcode/references/design-library/charts.csv +26 -0
  25. package/rcode/references/design-library/colors.csv +97 -0
  26. package/rcode/references/design-library/icons.csv +101 -0
  27. package/rcode/references/design-library/styles.csv +68 -0
  28. package/rcode/references/design-library/typography.csv +58 -0
  29. package/rcode/references/design-library/ui-reasoning.csv +101 -0
  30. package/rcode/references/design-library/ux-guidelines.csv +100 -0
  31. package/rcode/references/design-library/web-interface.csv +31 -0
  32. package/rcode/references/domain-probes.md +8 -0
  33. package/rcode/references/project-types.yaml +29 -0
  34. package/rcode/references/questioning.md +3 -0
  35. package/rcode/references/roadmapper-playbook.md +90 -0
  36. package/rcode/references/sprint-checker-playbook.md +14 -0
  37. package/rcode/references/verifier-playbook.md +20 -7
  38. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/SKILL.md +10 -1
  39. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/templates/wave-prompt.md +2 -0
  40. package/rcode/workflows/autonomous.md +26 -3
  41. package/rcode/workflows/complete-milestone.md +1 -1
  42. package/rcode/workflows/council.md +51 -6
  43. package/rcode/workflows/discuss-phase.md +9 -2
  44. package/rcode/workflows/execute-sprint.md +35 -7
  45. package/rcode/workflows/execute-waves.md +2 -2
  46. package/rcode/workflows/execute.md +21 -6
  47. package/rcode/workflows/help.md +1 -1
  48. package/rcode/workflows/plan-research-validation.md +1 -1
  49. package/rcode/workflows/plan.md +31 -0
  50. package/rcode/workflows/ship.md +22 -0
  51. package/rcode/workflows/ui-phase.md +104 -22
  52. package/rcode/workflows/ui-review.md +9 -1
  53. package/rcode/workflows/verify-work.md +1 -1
  54. package/server/dashboard.js +18 -1
  55. package/server/lib/scanner.js +25 -4
package/dist/rcode.js CHANGED
@@ -1,125 +1,126 @@
1
1
  #!/usr/bin/env node
2
2
  /* rcode — built with esbuild. Source: github.com/hanzlahabib/rihal-code */
3
- var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Jt=v((WF,Pc)=>{var my=require("crypto"),ot=require("fs"),fn=require("path");function Rc(t,e,r={}){let{encoding:n="utf8",mode:s}=r,i=fn.dirname(t);ot.mkdirSync(i,{recursive:!0});let o=fn.join(i,`.${fn.basename(t)}.tmp-${process.pid}-${my.randomBytes(8).toString("hex")}`),a;try{a=ot.openSync(o,"wx",s??420),ot.writeSync(a,e,0,n),ot.fsyncSync(a),ot.closeSync(a),a=null,ot.renameSync(o,t)}catch(u){if(a!=null)try{ot.closeSync(a)}catch{}try{ot.unlinkSync(o)}catch{}throw u}}function gy(t,e,r={}){let n=JSON.stringify(e,null,2)+`
4
- `;Rc(t,n,r)}function Dy(t,e){let r;try{r=ot.lstatSync(t)}catch(o){return o.code==="ENOENT"?{ok:!0,reason:"missing"}:{ok:!1,reason:`lstat: ${o.message}`}}if(r.isSymbolicLink())try{return ot.unlinkSync(t),{ok:!0,reason:"symlink-unlinked"}}catch(o){return{ok:!1,reason:`unlink: ${o.message}`}}let n;try{n=ot.realpathSync(e)}catch{n=fn.resolve(e)}let s;try{s=ot.realpathSync(t)}catch(o){return{ok:!1,reason:`realpath: ${o.message}`}}let i=fn.relative(n,s);if(i.startsWith("..")||fn.isAbsolute(i))return{ok:!1,reason:"outside-root"};try{return ot.rmSync(s,{recursive:!0,force:!0}),{ok:!0}}catch(o){return{ok:!1,reason:`rmSync: ${o.message}`}}}Pc.exports={writeFileAtomic:Rc,writeJsonAtomic:gy,safeRmSync:Dy}});var lr=v((HF,Oc)=>{"use strict";var yy=require("os");function vy(){return process.env.HOME||yy.homedir()}Oc.exports={homedir:vy}});var Pn=v((ZF,ei)=>{var Ss=process||{},Nc=Ss.argv||[],bs=Ss.env||{},_y=!(bs.NO_COLOR||Nc.includes("--no-color"))&&(!!bs.FORCE_COLOR||Nc.includes("--color")||Ss.platform==="win32"||(Ss.stdout||{}).isTTY&&bs.TERM!=="dumb"||!!bs.CI),Ey=(t,e,r=t)=>n=>{let s=""+n,i=s.indexOf(e,t.length);return~i?t+by(s,e,r,i)+e:t+s+e},by=(t,e,r,n)=>{let s="",i=0;do s+=t.substring(i,n)+r,i=n+e.length,n=t.indexOf(e,i);while(~n);return s+t.substring(i)},Lc=(t=_y)=>{let e=t?Ey:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};ei.exports=Lc();ei.exports.createColors=Lc});var qc=v(dr=>{"use strict";var Bc=dr&&dr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(dr,"__esModule",{value:!0});dr.symbols=dr.isTTY=void 0;var Sy=Bc(require("node:tty")),Nt=Bc(require("node:process")),Cy=Nt.default.env.CI||Nt.default.env.WT_SESSION||Nt.default.env.ConEmuTask==="{cmd::Cmder}"||Nt.default.env.TERM_PROGRAM==="vscode"||Nt.default.env.TERM==="xterm-256color"||Nt.default.env.TERM==="alacritty",Mc=Sy.default.isatty(1)&&Nt.default.env.TERM!=="dumb"&&!("CI"in Nt.default.env);dr.isTTY=Mc;var On=Nt.default.platform!=="win32"?Nt.default.env.TERM!=="linux":Cy,wy={frames:Mc?On?["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]:["-","\\","|","/"]:["-"],tick:On?"\u2714":"\u221A",cross:On?"\u2716":"\xD7",warn:On?"\u26A0":"!!",info:On?"\u2139":"i"};dr.symbols=wy});var Hc=v(Nn=>{"use strict";var xy=Nn&&Nn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.createSpinner=ky;var Wc=xy(Pn()),Lt=qc();function $y(t="",e=80){return t.replace(/\u001b[^m]*?m/g,"").split(`
5
- `).reduce((r,n)=>r+=Math.max(1,Math.ceil(n.length/e)),0)}function ky(t="",e={}){let r=0,n=e.interval||50,s=e.stream||process.stderr,i=e.frames&&e.frames.length?e.frames:Lt.symbols.frames,o=e.color||"yellow",a=!1,u=0,c,l=(C={})=>typeof C=="string"?C:C.text||t,d=(C={})=>typeof C=="string"?!1:!!C.update,f=(C={})=>typeof C=="string"||!C.color?o:C.color,g=(C={},A)=>typeof C=="string"||!C.mark?A:C.mark,m=()=>{process.on("SIGINT",w),process.on("SIGTERM",w)},D=()=>{process.off("SIGINT",w),process.off("SIGTERM",w)},h={reset(){return r=0,u=0,a=!1,clearTimeout(c),c=void 0,h},clear(){h.write("\x1B[1G");for(let C=0;C<u;C++)C>0&&h.write("\x1B[1A"),h.write("\x1B[2K\x1B[1G");return u=0,h},write(C,A=!1){return A&&Lt.isTTY&&h.clear(),s.write(C),h},render(){let C=`${Wc.default[o](i[r])} ${t}`;return Lt.isTTY?h.write("\x1B[?25l"):C+=`
6
- `,h.write(C,!0),Lt.isTTY&&(u=$y(C,s.columns)),h},spin(){return h.render(),r=++r%i.length,h},update(C){return typeof C=="string"?t=C:(t=C.text||t,i=C.frames&&C.frames.length?C.frames:i,n=C.interval||n,o=C.color||o),i.length-1<r&&(r=0),h},loop(){return Lt.isTTY&&(c=setTimeout(()=>h.loop(),n)),h.spin()},start(C={}){return c&&h.reset(),a=!0,m(),h.update({text:l(C),color:f(C)}).loop()},stop(C){a=!1,clearTimeout(c),c=void 0,D();let A=d(C),T=Wc.default[f(C)](g(C,i[r])),G=l(C);return h.write(C?`${T} ${G}${A?"":`
7
- `}`:"",!0),Lt.isTTY&&!A?h.write("\x1B[?25h"):h},success(C={}){return h.stop({text:l(C),mark:g(C,Lt.symbols.tick),color:"green",update:d(C)})},error(C={}){return h.stop({text:l(C),mark:g(C,Lt.symbols.cross),color:"red",update:d(C)})},warn(C={}){return h.stop({text:l(C),mark:g(C,Lt.symbols.warn),color:"yellow",update:d(C)})},info(C={}){return h.stop({text:l(C),mark:g(C,Lt.symbols.info),color:"blue",update:d(C)})},isSpinning(){return a}};function w(C){a&&h.stop(),process.exit(C==="SIGINT"?130:C==="SIGTERM"?143:1)}return h}});var Zc=v(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.splitWhen=hn.flatten=void 0;function Ay(t){return t.reduce((e,r)=>[].concat(e,r),[])}hn.flatten=Ay;function Fy(t,e){let r=[[]],n=0;for(let s of t)e(s)?(n++,r[n]=[]):r[n].push(s);return r}hn.splitWhen=Fy});var Uc=v(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.isEnoentCodeError=void 0;function jy(t){return t.code==="ENOENT"}Cs.isEnoentCodeError=jy});var Vc=v(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.createDirentFromStats=void 0;var ti=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Iy(t,e){return new ti(t,e)}ws.createDirentFromStats=Iy});var Xc=v(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.convertPosixPathToPattern=je.convertWindowsPathToPattern=je.convertPathToPattern=je.escapePosixPath=je.escapeWindowsPath=je.escape=je.removeLeadingDotSegment=je.makeAbsolute=je.unixify=void 0;var Ty=require("os"),Ry=require("path"),Gc=Ty.platform()==="win32",Py=2,Oy=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,Ny=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,Ly=/^\\\\([.?])/,By=/\\(?![!()+@[\]{}])/g;function My(t){return t.replace(/\\/g,"/")}je.unixify=My;function qy(t,e){return Ry.resolve(t,e)}je.makeAbsolute=qy;function Wy(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(Py)}return t}je.removeLeadingDotSegment=Wy;je.escape=Gc?ri:ni;function ri(t){return t.replace(Ny,"\\$2")}je.escapeWindowsPath=ri;function ni(t){return t.replace(Oy,"\\$2")}je.escapePosixPath=ni;je.convertPathToPattern=Gc?zc:Yc;function zc(t){return ri(t).replace(Ly,"//$1").replace(By,"/")}je.convertWindowsPathToPattern=zc;function Yc(t){return ni(t)}je.convertPosixPathToPattern=Yc});var Kc=v((JF,Jc)=>{Jc.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var tl=v((KF,el)=>{var Hy=Kc(),Qc={"{":"}","(":")","[":"]"},Zy=function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,s=-2,i=-2,o=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||n!==-1&&t[e]==="["&&t[e+1]!=="]"&&(n<e&&(n=t.indexOf("]",e)),n>e&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||i!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(i=t.indexOf(")",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(r<e&&(r=t.indexOf("|",e)),r!==-1&&t[r+1]!==")"&&(i=t.indexOf(")",r),i>r&&(o=t.indexOf("\\",r),o===-1||o>i))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var u=Qc[a];if(u){var c=t.indexOf(u,e);c!==-1&&(e=c+1)}if(t[e]==="!")return!0}else e++}return!1},Uy=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var r=t[e+1];e+=2;var n=Qc[r];if(n){var s=t.indexOf(n,e);s!==-1&&(e=s+1)}if(t[e]==="!")return!0}else e++}return!1};el.exports=function(e,r){if(typeof e!="string"||e==="")return!1;if(Hy(e))return!0;var n=Zy;return r&&r.strict===!1&&(n=Uy),n(e)}});var nl=v((QF,rl)=>{"use strict";var Vy=tl(),Gy=require("path").posix.dirname,zy=require("os").platform()==="win32",si="/",Yy=/\\/g,Xy=/[\{\[].*[\}\]]$/,Jy=/(^|[^\\])([\{\[]|\([^\)]+$)/,Ky=/\\([\!\*\?\|\[\]\(\)\{\}])/g;rl.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&zy&&e.indexOf(si)<0&&(e=e.replace(Yy,si)),Xy.test(e)&&(e+=si),e+="a";do e=Gy(e);while(Vy(e)||Jy.test(e));return e.replace(Ky,"$1")}});var xs=v(lt=>{"use strict";lt.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;lt.find=(t,e)=>t.nodes.find(r=>r.type===e);lt.exceedsLimit=(t,e,r=1,n)=>n===!1||!lt.isInteger(t)||!lt.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;lt.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};lt.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;lt.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;lt.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;lt.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);lt.flatten=(...t)=>{let e=[],r=n=>{for(let s=0;s<n.length;s++){let i=n[s];if(Array.isArray(i)){r(i);continue}i!==void 0&&e.push(i)}return e};return r(t),e}});var $s=v((tj,ol)=>{"use strict";var sl=xs();ol.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&sl.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(i||o)&&sl.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let u of n.nodes)a+=r(u);return a};return r(t)}});var al=v((rj,il)=>{"use strict";il.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var gl=v((nj,ml)=>{"use strict";var ul=al(),Pr=(t,e,r)=>{if(ul(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(ul(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),i=String(n.shorthand),o=String(n.capture),a=String(n.wrap),u=t+":"+e+"="+s+i+o+a;if(Pr.cache.hasOwnProperty(u))return Pr.cache[u].result;let c=Math.min(t,e),l=Math.max(t,e);if(Math.abs(c-l)===1){let D=t+"|"+e;return n.capture?`(${D})`:n.wrap===!1?D:`(?:${D})`}let d=pl(t)||pl(e),f={min:t,max:e,a:c,b:l},g=[],m=[];if(d&&(f.isPadded=d,f.maxLen=String(f.max).length),c<0){let D=l<0?Math.abs(l):1;m=cl(D,Math.abs(c),f,n),c=f.a=0}return l>=0&&(g=cl(c,l,f,n)),f.negatives=m,f.positives=g,f.result=Qy(m,g,n),n.capture===!0?f.result=`(${f.result})`:n.wrap!==!1&&g.length+m.length>1&&(f.result=`(?:${f.result})`),Pr.cache[u]=f,f.result};function Qy(t,e,r){let n=oi(t,e,"-",!1,r)||[],s=oi(e,t,"",!1,r)||[],i=oi(t,e,"-?",!0,r)||[];return n.concat(i).concat(s).join("|")}function ev(t,e){let r=1,n=1,s=dl(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=dl(t,r);for(s=fl(e+1,n)-1;t<s&&s<=e;)i.add(s),n+=1,s=fl(e+1,n)-1;return i=[...i],i.sort(nv),i}function tv(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=rv(t,e),s=n.length,i="",o=0;for(let a=0;a<s;a++){let[u,c]=n[a];u===c?i+=u:u!=="0"||c!=="9"?i+=sv(u,c,r):o++}return o&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function cl(t,e,r,n){let s=ev(t,e),i=[],o=t,a;for(let u=0;u<s.length;u++){let c=s[u],l=tv(String(o),String(c),n),d="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+hl(a.count),o=c+1;continue}r.isPadded&&(d=ov(c,r,n)),l.string=d+l.pattern+hl(l.count),i.push(l),o=c+1,a=l}return i}function oi(t,e,r,n,s){let i=[];for(let o of t){let{string:a}=o;!n&&!ll(e,"string",a)&&i.push(r+a),n&&ll(e,"string",a)&&i.push(r+a)}return i}function rv(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function nv(t,e){return t>e?1:e>t?-1:0}function ll(t,e,r){return t.some(n=>n[e]===r)}function dl(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function fl(t,e){return t-t%Math.pow(10,e)}function hl(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function sv(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function pl(t){return/^-?(0+)\d/.test(t)}function ov(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),s=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}Pr.cache={};Pr.clearCache=()=>Pr.cache={};ml.exports=Pr});var ui=v((sj,Sl)=>{"use strict";var iv=require("util"),yl=gl(),Dl=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),av=t=>e=>t===!0?Number(e):String(e),ii=t=>typeof t=="number"||typeof t=="string"&&t!=="",Ln=t=>Number.isInteger(+t),ai=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},uv=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,cv=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return r===!1?String(t):t},As=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},lv=(t,e,r)=>{t.negatives.sort((a,u)=>a<u?-1:a>u?1:0),t.positives.sort((a,u)=>a<u?-1:a>u?1:0);let n=e.capture?"":"?:",s="",i="",o;return t.positives.length&&(s=t.positives.map(a=>As(String(a),r)).join("|")),t.negatives.length&&(i=`-(${n}${t.negatives.map(a=>As(String(a),r)).join("|")})`),s&&i?o=`${s}|${i}`:o=s||i,e.wrap?`(${n}${o})`:o},vl=(t,e,r,n)=>{if(r)return yl(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return`[${s}-${i}]`},_l=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return yl(t,e,r)},El=(...t)=>new RangeError("Invalid range arguments: "+iv.inspect(...t)),bl=(t,e,r)=>{if(r.strictRanges===!0)throw El([t,e]);return[]},dv=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},fv=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw El([t,e]);return[]}s===0&&(s=0),i===0&&(i=0);let o=s>i,a=String(t),u=String(e),c=String(r);r=Math.max(Math.abs(r),1);let l=ai(a)||ai(u)||ai(c),d=l?Math.max(a.length,u.length,c.length):0,f=l===!1&&uv(t,e,n)===!1,g=n.transform||av(f);if(n.toRegex&&r===1)return vl(As(t,d),As(e,d),!0,n);let m={negatives:[],positives:[]},D=C=>m[C<0?"negatives":"positives"].push(Math.abs(C)),h=[],w=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?D(s):h.push(cv(g(s,w),d,f)),s=o?s-r:s+r,w++;return n.toRegex===!0?r>1?lv(m,n,d):_l(h,null,{wrap:!1,...n}):h},hv=(t,e,r=1,n={})=>{if(!Ln(t)&&t.length>1||!Ln(e)&&e.length>1)return bl(t,e,n);let s=n.transform||(f=>String.fromCharCode(f)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=i>o,u=Math.min(i,o),c=Math.max(i,o);if(n.toRegex&&r===1)return vl(u,c,!1,n);let l=[],d=0;for(;a?i>=o:i<=o;)l.push(s(i,d)),i=a?i-r:i+r,d++;return n.toRegex===!0?_l(l,null,{wrap:!1,options:n}):l},ks=(t,e,r,n={})=>{if(e==null&&ii(t))return[t];if(!ii(t)||!ii(e))return bl(t,e,n);if(typeof r=="function")return ks(t,e,1,{transform:r});if(Dl(r))return ks(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,Ln(r)?Ln(t)&&Ln(e)?fv(t,e,r,s):hv(t,e,Math.max(Math.abs(r),1),s):r!=null&&!Dl(r)?dv(r,s):ks(t,e,1,r)};Sl.exports=ks});var xl=v((oj,wl)=>{"use strict";var pv=ui(),Cl=xs(),mv=(t,e={})=>{let r=(n,s={})=>{let i=Cl.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a=i===!0||o===!0,u=e.escapeInvalid===!0?"\\":"",c="";if(n.isOpen===!0)return u+n.value;if(n.isClose===!0)return console.log("node.isClose",u,n.value),u+n.value;if(n.type==="open")return a?u+n.value:"(";if(n.type==="close")return a?u+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=Cl.reduce(n.nodes),d=pv(...l,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(d.length!==0)return l.length>1&&d.length>1?`(${d})`:d}if(n.nodes)for(let l of n.nodes)c+=r(l,n);return c};return r(t)};wl.exports=mv});var Al=v((ij,kl)=>{"use strict";var gv=ui(),$l=$s(),pn=xs(),Or=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?pn.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(Or(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Or(s,i,r):s+i);return pn.flatten(n)},Dv=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,a=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(s.invalid||s.dollar){a.push(Or(a.pop(),$l(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){a.push(Or(a.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let d=pn.reduce(s.nodes);if(pn.exceedsLimit(...d,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let f=gv(...d,e);f.length===0&&(f=$l(s,e)),a.push(Or(a.pop(),f)),s.nodes=[];return}let u=pn.encloseBrace(s),c=s.queue,l=s;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,c=l.queue;for(let d=0;d<s.nodes.length;d++){let f=s.nodes[d];if(f.type==="comma"&&s.type==="brace"){d===1&&c.push(""),c.push("");continue}if(f.type==="close"){a.push(Or(a.pop(),c,u));continue}if(f.value&&f.type!=="open"){c.push(Or(c.pop(),f.value));continue}f.nodes&&n(f,s)}return c};return pn.flatten(n(t))};kl.exports=Dv});var jl=v((aj,Fl)=>{"use strict";Fl.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
8
- `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Ol=v((uj,Pl)=>{"use strict";var yv=$s(),{MAX_LENGTH:Il,CHAR_BACKSLASH:ci,CHAR_BACKTICK:vv,CHAR_COMMA:_v,CHAR_DOT:Ev,CHAR_LEFT_PARENTHESES:bv,CHAR_RIGHT_PARENTHESES:Sv,CHAR_LEFT_CURLY_BRACE:Cv,CHAR_RIGHT_CURLY_BRACE:wv,CHAR_LEFT_SQUARE_BRACKET:Tl,CHAR_RIGHT_SQUARE_BRACKET:Rl,CHAR_DOUBLE_QUOTE:xv,CHAR_SINGLE_QUOTE:$v,CHAR_NO_BREAK_SPACE:kv,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Av}=jl(),Fv=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(Il,r.maxLength):Il;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let s={type:"root",input:t,nodes:[]},i=[s],o=s,a=s,u=0,c=t.length,l=0,d=0,f,g=()=>t[l++],m=D=>{if(D.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&D.type==="text"){a.value+=D.value;return}return o.nodes.push(D),D.parent=o,D.prev=a,a=D,D};for(m({type:"bos"});l<c;)if(o=i[i.length-1],f=g(),!(f===Av||f===kv)){if(f===ci){m({type:"text",value:(e.keepEscaping?f:"")+g()});continue}if(f===Rl){m({type:"text",value:"\\"+f});continue}if(f===Tl){u++;let D;for(;l<c&&(D=g());){if(f+=D,D===Tl){u++;continue}if(D===ci){f+=g();continue}if(D===Rl&&(u--,u===0))break}m({type:"text",value:f});continue}if(f===bv){o=m({type:"paren",nodes:[]}),i.push(o),m({type:"text",value:f});continue}if(f===Sv){if(o.type!=="paren"){m({type:"text",value:f});continue}o=i.pop(),m({type:"text",value:f}),o=i[i.length-1];continue}if(f===xv||f===$v||f===vv){let D=f,h;for(e.keepQuotes!==!0&&(f="");l<c&&(h=g());){if(h===ci){f+=h+g();continue}if(h===D){e.keepQuotes===!0&&(f+=h);break}f+=h}m({type:"text",value:f});continue}if(f===Cv){d++;let h={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};o=m(h),i.push(o),m({type:"open",value:f});continue}if(f===wv){if(o.type!=="brace"){m({type:"text",value:f});continue}let D="close";o=i.pop(),o.close=!0,m({type:D,value:f}),d--,o=i[i.length-1];continue}if(f===_v&&d>0){if(o.ranges>0){o.ranges=0;let D=o.nodes.shift();o.nodes=[D,{type:"text",value:yv(o)}]}m({type:"comma",value:f}),o.commas++;continue}if(f===Ev&&d>0&&o.commas===0){let D=o.nodes;if(d===0||D.length===0){m({type:"text",value:f});continue}if(a.type==="dot"){if(o.range=[],a.value+=f,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){D.pop();let h=D[D.length-1];h.value+=a.value+f,a=h,o.ranges--;continue}m({type:"dot",value:f});continue}m({type:"text",value:f})}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(w=>{w.nodes||(w.type==="open"&&(w.isOpen=!0),w.type==="close"&&(w.isClose=!0),w.nodes||(w.type="text"),w.invalid=!0)});let D=i[i.length-1],h=D.nodes.indexOf(o);D.nodes.splice(h,1,...o.nodes)}while(i.length>0);return m({type:"eos"}),s};Pl.exports=Fv});var Bl=v((cj,Ll)=>{"use strict";var Nl=$s(),jv=xl(),Iv=Al(),Tv=Ol(),it=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=it.create(n,e);Array.isArray(s)?r.push(...s):r.push(s)}else r=[].concat(it.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};it.parse=(t,e={})=>Tv(t,e);it.stringify=(t,e={})=>Nl(typeof t=="string"?it.parse(t,e):t,e);it.compile=(t,e={})=>(typeof t=="string"&&(t=it.parse(t,e)),jv(t,e));it.expand=(t,e={})=>{typeof t=="string"&&(t=it.parse(t,e));let r=Iv(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};it.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?it.compile(t,e):it.expand(t,e);Ll.exports=it});var Bn=v((lj,Zl)=>{"use strict";var Rv=require("path"),Bt="\\\\/",Ml=`[^${Bt}]`,Pv=0,Kt="\\.",Ov="\\+",Nv="\\?",Fs="\\/",Lv="(?=.)",ql="[^/]",li=`(?:${Fs}|$)`,Wl=`(?:^|${Fs})`,di=`${Kt}{1,2}${li}`,Bv=`(?!${Kt})`,Mv=`(?!${Wl}${di})`,qv=`(?!${Kt}{0,1}${li})`,Wv=`(?!${di})`,Hv=`[^.${Fs}]`,Zv=`${ql}*?`,Hl={DOT_LITERAL:Kt,PLUS_LITERAL:Ov,QMARK_LITERAL:Nv,SLASH_LITERAL:Fs,ONE_CHAR:Lv,QMARK:ql,END_ANCHOR:li,DOTS_SLASH:di,NO_DOT:Bv,NO_DOTS:Mv,NO_DOT_SLASH:qv,NO_DOTS_SLASH:Wv,QMARK_NO_DOT:Hv,STAR:Zv,START_ANCHOR:Wl},Uv={...Hl,SLASH_LITERAL:`[${Bt}]`,QMARK:Ml,STAR:`${Ml}*?`,DOTS_SLASH:`${Kt}{1,2}(?:[${Bt}]|$)`,NO_DOT:`(?!${Kt})`,NO_DOTS:`(?!(?:^|[${Bt}])${Kt}{1,2}(?:[${Bt}]|$))`,NO_DOT_SLASH:`(?!${Kt}{0,1}(?:[${Bt}]|$))`,NO_DOTS_SLASH:`(?!${Kt}{1,2}(?:[${Bt}]|$))`,QMARK_NO_DOT:`[^.${Bt}]`,START_ANCHOR:`(?:^|[${Bt}])`,END_ANCHOR:`(?:[${Bt}]|$)`},Vv={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Zl.exports={DEFAULT_MAX_EXTGLOB_RECURSION:Pv,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Vv,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Rv.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Uv:Hl}}});var Mn=v(Je=>{"use strict";var Gv=require("path"),zv=process.platform==="win32",{REGEX_BACKSLASH:Yv,REGEX_REMOVE_BACKSLASH:Xv,REGEX_SPECIAL_CHARS:Jv,REGEX_SPECIAL_CHARS_GLOBAL:Kv}=Bn();Je.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Je.hasRegexChars=t=>Jv.test(t);Je.isRegexChar=t=>t.length===1&&Je.hasRegexChars(t);Je.escapeRegex=t=>t.replace(Kv,"\\$1");Je.toPosixSlashes=t=>t.replace(Yv,"/");Je.removeBackslashes=t=>t.replace(Xv,e=>e==="\\"?"":e);Je.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Je.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:zv===!0||Gv.sep==="\\";Je.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Je.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Je.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Je.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var Kl=v((fj,Jl)=>{"use strict";var Ul=Mn(),{CHAR_ASTERISK:fi,CHAR_AT:Qv,CHAR_BACKWARD_SLASH:qn,CHAR_COMMA:e0,CHAR_DOT:hi,CHAR_EXCLAMATION_MARK:pi,CHAR_FORWARD_SLASH:Xl,CHAR_LEFT_CURLY_BRACE:mi,CHAR_LEFT_PARENTHESES:gi,CHAR_LEFT_SQUARE_BRACKET:t0,CHAR_PLUS:r0,CHAR_QUESTION_MARK:Vl,CHAR_RIGHT_CURLY_BRACE:n0,CHAR_RIGHT_PARENTHESES:Gl,CHAR_RIGHT_SQUARE_BRACKET:s0}=Bn(),zl=t=>t===Xl||t===qn,Yl=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},o0=(t,e)=>{let r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],o=[],a=[],u=t,c=-1,l=0,d=0,f=!1,g=!1,m=!1,D=!1,h=!1,w=!1,C=!1,A=!1,T=!1,G=!1,I=0,Z,F,W={value:"",depth:0,isGlob:!1},P=()=>c>=n,E=()=>u.charCodeAt(c+1),Q=()=>(Z=F,u.charCodeAt(++c));for(;c<n;){F=Q();let he;if(F===qn){C=W.backslashes=!0,F=Q(),F===mi&&(w=!0);continue}if(w===!0||F===mi){for(I++;P()!==!0&&(F=Q());){if(F===qn){C=W.backslashes=!0,Q();continue}if(F===mi){I++;continue}if(w!==!0&&F===hi&&(F=Q())===hi){if(f=W.isBrace=!0,m=W.isGlob=!0,G=!0,s===!0)continue;break}if(w!==!0&&F===e0){if(f=W.isBrace=!0,m=W.isGlob=!0,G=!0,s===!0)continue;break}if(F===n0&&(I--,I===0)){w=!1,f=W.isBrace=!0,G=!0;break}}if(s===!0)continue;break}if(F===Xl){if(i.push(c),o.push(W),W={value:"",depth:0,isGlob:!1},G===!0)continue;if(Z===hi&&c===l+1){l+=2;continue}d=c+1;continue}if(r.noext!==!0&&(F===r0||F===Qv||F===fi||F===Vl||F===pi)===!0&&E()===gi){if(m=W.isGlob=!0,D=W.isExtglob=!0,G=!0,F===pi&&c===l&&(T=!0),s===!0){for(;P()!==!0&&(F=Q());){if(F===qn){C=W.backslashes=!0,F=Q();continue}if(F===Gl){m=W.isGlob=!0,G=!0;break}}continue}break}if(F===fi){if(Z===fi&&(h=W.isGlobstar=!0),m=W.isGlob=!0,G=!0,s===!0)continue;break}if(F===Vl){if(m=W.isGlob=!0,G=!0,s===!0)continue;break}if(F===t0){for(;P()!==!0&&(he=Q());){if(he===qn){C=W.backslashes=!0,Q();continue}if(he===s0){g=W.isBracket=!0,m=W.isGlob=!0,G=!0;break}}if(s===!0)continue;break}if(r.nonegate!==!0&&F===pi&&c===l){A=W.negated=!0,l++;continue}if(r.noparen!==!0&&F===gi){if(m=W.isGlob=!0,s===!0){for(;P()!==!0&&(F=Q());){if(F===gi){C=W.backslashes=!0,F=Q();continue}if(F===Gl){G=!0;break}}continue}break}if(m===!0){if(G=!0,s===!0)continue;break}}r.noext===!0&&(D=!1,m=!1);let re=u,le="",$="";l>0&&(le=u.slice(0,l),u=u.slice(l),d-=l),re&&m===!0&&d>0?(re=u.slice(0,d),$=u.slice(d)):m===!0?(re="",$=u):re=u,re&&re!==""&&re!=="/"&&re!==u&&zl(re.charCodeAt(re.length-1))&&(re=re.slice(0,-1)),r.unescape===!0&&($&&($=Ul.removeBackslashes($)),re&&C===!0&&(re=Ul.removeBackslashes(re)));let k={prefix:le,input:t,start:l,base:re,glob:$,isBrace:f,isBracket:g,isGlob:m,isExtglob:D,isGlobstar:h,negated:A,negatedExtglob:T};if(r.tokens===!0&&(k.maxDepth=0,zl(F)||o.push(W),k.tokens=o),r.parts===!0||r.tokens===!0){let he;for(let J=0;J<i.length;J++){let xe=he?he+1:l,st=i[J],Fe=t.slice(xe,st);r.tokens&&(J===0&&l!==0?(o[J].isPrefix=!0,o[J].value=le):o[J].value=Fe,Yl(o[J]),k.maxDepth+=o[J].depth),(J!==0||Fe!=="")&&a.push(Fe),he=st}if(he&&he+1<t.length){let J=t.slice(he+1);a.push(J),r.tokens&&(o[o.length-1].value=J,Yl(o[o.length-1]),k.maxDepth+=o[o.length-1].depth)}k.slashes=i,k.parts=a}return k};Jl.exports=o0});var nd=v((hj,rd)=>{"use strict";var Wn=Bn(),Pe=Mn(),{MAX_LENGTH:js,POSIX_REGEX_SOURCE:i0,REGEX_NON_SPECIAL_CHARS:a0,REGEX_SPECIAL_CHARS_BACKREF:u0,REPLACEMENTS:Ql}=Wn,c0=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(s=>Pe.escapeRegex(s)).join("..")}return r},mn=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,ed=t=>{let e=[],r=0,n=0,s=0,i="",o=!1;for(let a of t){if(o===!0){i+=a,o=!1;continue}if(a==="\\"){i+=a,o=!0;continue}if(a==='"'){s=s===1?0:1,i+=a;continue}if(s===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(i),i="";continue}}}i+=a}return e.push(i),e},l0=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},td=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(l0(e))return e.replace(/\\(.)/g,"$1")},d0=t=>{let e=t.map(td).filter(Boolean);for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++){let s=e[r],i=e[n],o=s[0];if(!(!o||s!==o.repeat(s.length)||i!==o.repeat(i.length))&&(s===i||s.startsWith(i)||i.startsWith(s)))return!0}return!1},Di=(t,e=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,s=0,i=!1;for(let o=1;o<t.length;o++){let a=t[o];if(i===!0){i=!1;continue}if(a==="\\"){i=!0;continue}if(a==='"'){s=s===1?0:1;continue}if(s!==1){if(a==="["){r++;continue}if(a==="]"&&r>0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==t.length-1?void 0:{type:t[0],body:t.slice(2,o),end:o}}}}},f0=t=>{let e=0,r=[];for(;e<t.length;){let s=Di(t.slice(e),!1);if(!s||s.type!=="*")return;let i=ed(s.body).map(a=>a.trim());if(i.length!==1)return;let o=td(i[0]);if(!o||o.length!==1)return;r.push(o),e+=s.end+1}return r.length<1?void 0:`${r.length===1?Pe.escapeRegex(r[0]):`[${r.map(s=>Pe.escapeRegex(s)).join("")}]`}*`},h0=t=>{let e=0,r=t.trim(),n=Di(r);for(;n;)e++,r=n.body.trim(),n=Di(r);return e},p0=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Wn.DEFAULT_MAX_EXTGLOB_RECURSION,n=ed(t).map(s=>s.trim());if(n.length>1&&(n.some(s=>s==="")||n.some(s=>/^[*?]+$/.test(s))||d0(n)))return{risky:!0};for(let s of n){let i=f0(s);if(i)return{risky:!0,safeOutput:i};if(h0(s)>r)return{risky:!0}}return{risky:!1}},yi=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Ql[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(js,r.maxLength):js,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},o=[i],a=r.capture?"":"?:",u=Pe.isWindows(e),c=Wn.globChars(u),l=Wn.extglobChars(c),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:D,NO_DOT:h,NO_DOT_SLASH:w,NO_DOTS_SLASH:C,QMARK:A,QMARK_NO_DOT:T,STAR:G,START_ANCHOR:I}=c,Z=M=>`(${a}(?:(?!${I}${M.dot?D:d}).)*?)`,F=r.dot?"":h,W=r.dot?A:T,P=r.bash===!0?Z(r):G;r.capture&&(P=`(${P})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let E={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=Pe.removePrefix(t,E),s=t.length;let Q=[],re=[],le=[],$=i,k,he=()=>E.index===s-1,J=E.peek=(M=1)=>t[E.index+M],xe=E.advance=()=>t[++E.index]||"",st=()=>t.slice(E.index+1),Fe=(M="",ve=0)=>{E.consumed+=M,E.index+=ve},Ir=M=>{E.output+=M.output!=null?M.output:M.value,Fe(M.value)},_s=()=>{let M=1;for(;J()==="!"&&(J(2)!=="("||J(3)==="?");)xe(),E.start++,M++;return M%2===0?!1:(E.negated=!0,E.start++,!0)},bt=M=>{E[M]++,le.push(M)},Ze=M=>{E[M]--,le.pop()},ce=M=>{if($.type==="globstar"){let ve=E.braces>0&&(M.type==="comma"||M.type==="brace"),B=M.extglob===!0||Q.length&&(M.type==="pipe"||M.type==="paren");M.type!=="slash"&&M.type!=="paren"&&!ve&&!B&&(E.output=E.output.slice(0,-$.output.length),$.type="star",$.value="*",$.output=P,E.output+=$.output)}if(Q.length&&M.type!=="paren"&&(Q[Q.length-1].inner+=M.value),(M.value||M.output)&&Ir(M),$&&$.type==="text"&&M.type==="text"){$.value+=M.value,$.output=($.output||"")+M.value;return}M.prev=$,o.push(M),$=M},Tr=(M,ve)=>{let B={...l[ve],conditions:1,inner:""};B.prev=$,B.parens=E.parens,B.output=E.output,B.startIndex=E.index,B.tokensIndex=o.length;let x=(r.capture?"(":"")+B.open;bt("parens"),ce({type:M,value:ve,output:E.output?"":m}),ce({type:"paren",extglob:!0,value:xe(),output:x}),Q.push(B)},Rr=M=>{let ve=t.slice(M.startIndex,E.index+1),B=t.slice(M.startIndex+2,E.index),x=p0(B,r);if((M.type==="plus"||M.type==="star")&&x.risky){let N=x.safeOutput?(M.output?"":m)+(r.capture?`(${x.safeOutput})`:x.safeOutput):void 0,ee=o[M.tokensIndex];ee.type="text",ee.value=ve,ee.output=N||Pe.escapeRegex(ve);for(let de=M.tokensIndex+1;de<o.length;de++)o[de].value="",o[de].output="",delete o[de].suffix;E.output=M.output+ee.output,E.backtrack=!0,ce({type:"paren",extglob:!0,value:k,output:""}),Ze("parens");return}let j=M.close+(r.capture?")":""),R;if(M.type==="negate"){let N=P;if(M.inner&&M.inner.length>1&&M.inner.includes("/")&&(N=Z(r)),(N!==P||he()||/^\)+$/.test(st()))&&(j=M.close=`)$))${N}`),M.inner.includes("*")&&(R=st())&&/^\.[^\\/.]+$/.test(R)){let ee=yi(R,{...e,fastpaths:!1}).output;j=M.close=`)${ee})${N})`}M.prev.type==="bos"&&(E.negatedExtglob=!0)}ce({type:"paren",extglob:!0,value:k,output:j}),Ze("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let M=!1,ve=t.replace(u0,(B,x,j,R,N,ee)=>R==="\\"?(M=!0,B):R==="?"?x?x+R+(N?A.repeat(N.length):""):ee===0?W+(N?A.repeat(N.length):""):A.repeat(j.length):R==="."?d.repeat(j.length):R==="*"?x?x+R+(N?P:""):P:x?B:`\\${B}`);return M===!0&&(r.unescape===!0?ve=ve.replace(/\\/g,""):ve=ve.replace(/\\+/g,B=>B.length%2===0?"\\\\":B?"\\":"")),ve===t&&r.contains===!0?(E.output=t,E):(E.output=Pe.wrapOutput(ve,E,e),E)}for(;!he();){if(k=xe(),k==="\0")continue;if(k==="\\"){let B=J();if(B==="/"&&r.bash!==!0||B==="."||B===";")continue;if(!B){k+="\\",ce({type:"text",value:k});continue}let x=/^\\+/.exec(st()),j=0;if(x&&x[0].length>2&&(j=x[0].length,E.index+=j,j%2!==0&&(k+="\\")),r.unescape===!0?k=xe():k+=xe(),E.brackets===0){ce({type:"text",value:k});continue}}if(E.brackets>0&&(k!=="]"||$.value==="["||$.value==="[^")){if(r.posix!==!1&&k===":"){let B=$.value.slice(1);if(B.includes("[")&&($.posix=!0,B.includes(":"))){let x=$.value.lastIndexOf("["),j=$.value.slice(0,x),R=$.value.slice(x+2),N=i0[R];if(N){$.value=j+N,E.backtrack=!0,xe(),!i.output&&o.indexOf($)===1&&(i.output=m);continue}}}(k==="["&&J()!==":"||k==="-"&&J()==="]")&&(k=`\\${k}`),k==="]"&&($.value==="["||$.value==="[^")&&(k=`\\${k}`),r.posix===!0&&k==="!"&&$.value==="["&&(k="^"),$.value+=k,Ir({value:k});continue}if(E.quotes===1&&k!=='"'){k=Pe.escapeRegex(k),$.value+=k,Ir({value:k});continue}if(k==='"'){E.quotes=E.quotes===1?0:1,r.keepQuotes===!0&&ce({type:"text",value:k});continue}if(k==="("){bt("parens"),ce({type:"paren",value:k});continue}if(k===")"){if(E.parens===0&&r.strictBrackets===!0)throw new SyntaxError(mn("opening","("));let B=Q[Q.length-1];if(B&&E.parens===B.parens+1){Rr(Q.pop());continue}ce({type:"paren",value:k,output:E.parens?")":"\\)"}),Ze("parens");continue}if(k==="["){if(r.nobracket===!0||!st().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(mn("closing","]"));k=`\\${k}`}else bt("brackets");ce({type:"bracket",value:k});continue}if(k==="]"){if(r.nobracket===!0||$&&$.type==="bracket"&&$.value.length===1){ce({type:"text",value:k,output:`\\${k}`});continue}if(E.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(mn("opening","["));ce({type:"text",value:k,output:`\\${k}`});continue}Ze("brackets");let B=$.value.slice(1);if($.posix!==!0&&B[0]==="^"&&!B.includes("/")&&(k=`/${k}`),$.value+=k,Ir({value:k}),r.literalBrackets===!1||Pe.hasRegexChars(B))continue;let x=Pe.escapeRegex($.value);if(E.output=E.output.slice(0,-$.value.length),r.literalBrackets===!0){E.output+=x,$.value=x;continue}$.value=`(${a}${x}|${$.value})`,E.output+=$.value;continue}if(k==="{"&&r.nobrace!==!0){bt("braces");let B={type:"brace",value:k,output:"(",outputIndex:E.output.length,tokensIndex:E.tokens.length};re.push(B),ce(B);continue}if(k==="}"){let B=re[re.length-1];if(r.nobrace===!0||!B){ce({type:"text",value:k,output:k});continue}let x=")";if(B.dots===!0){let j=o.slice(),R=[];for(let N=j.length-1;N>=0&&(o.pop(),j[N].type!=="brace");N--)j[N].type!=="dots"&&R.unshift(j[N].value);x=c0(R,r),E.backtrack=!0}if(B.comma!==!0&&B.dots!==!0){let j=E.output.slice(0,B.outputIndex),R=E.tokens.slice(B.tokensIndex);B.value=B.output="\\{",k=x="\\}",E.output=j;for(let N of R)E.output+=N.output||N.value}ce({type:"brace",value:k,output:x}),Ze("braces"),re.pop();continue}if(k==="|"){Q.length>0&&Q[Q.length-1].conditions++,ce({type:"text",value:k});continue}if(k===","){let B=k,x=re[re.length-1];x&&le[le.length-1]==="braces"&&(x.comma=!0,B="|"),ce({type:"comma",value:k,output:B});continue}if(k==="/"){if($.type==="dot"&&E.index===E.start+1){E.start=E.index+1,E.consumed="",E.output="",o.pop(),$=i;continue}ce({type:"slash",value:k,output:g});continue}if(k==="."){if(E.braces>0&&$.type==="dot"){$.value==="."&&($.output=d);let B=re[re.length-1];$.type="dots",$.output+=k,$.value+=k,B.dots=!0;continue}if(E.braces+E.parens===0&&$.type!=="bos"&&$.type!=="slash"){ce({type:"text",value:k,output:d});continue}ce({type:"dot",value:k,output:d});continue}if(k==="?"){if(!($&&$.value==="(")&&r.noextglob!==!0&&J()==="("&&J(2)!=="?"){Tr("qmark",k);continue}if($&&$.type==="paren"){let x=J(),j=k;if(x==="<"&&!Pe.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");($.value==="("&&!/[!=<:]/.test(x)||x==="<"&&!/<([!=]|\w+>)/.test(st()))&&(j=`\\${k}`),ce({type:"text",value:k,output:j});continue}if(r.dot!==!0&&($.type==="slash"||$.type==="bos")){ce({type:"qmark",value:k,output:T});continue}ce({type:"qmark",value:k,output:A});continue}if(k==="!"){if(r.noextglob!==!0&&J()==="("&&(J(2)!=="?"||!/[!=<:]/.test(J(3)))){Tr("negate",k);continue}if(r.nonegate!==!0&&E.index===0){_s();continue}}if(k==="+"){if(r.noextglob!==!0&&J()==="("&&J(2)!=="?"){Tr("plus",k);continue}if($&&$.value==="("||r.regex===!1){ce({type:"plus",value:k,output:f});continue}if($&&($.type==="bracket"||$.type==="paren"||$.type==="brace")||E.parens>0){ce({type:"plus",value:k});continue}ce({type:"plus",value:f});continue}if(k==="@"){if(r.noextglob!==!0&&J()==="("&&J(2)!=="?"){ce({type:"at",extglob:!0,value:k,output:""});continue}ce({type:"text",value:k});continue}if(k!=="*"){(k==="$"||k==="^")&&(k=`\\${k}`);let B=a0.exec(st());B&&(k+=B[0],E.index+=B[0].length),ce({type:"text",value:k});continue}if($&&($.type==="globstar"||$.star===!0)){$.type="star",$.star=!0,$.value+=k,$.output=P,E.backtrack=!0,E.globstar=!0,Fe(k);continue}let M=st();if(r.noextglob!==!0&&/^\([^?]/.test(M)){Tr("star",k);continue}if($.type==="star"){if(r.noglobstar===!0){Fe(k);continue}let B=$.prev,x=B.prev,j=B.type==="slash"||B.type==="bos",R=x&&(x.type==="star"||x.type==="globstar");if(r.bash===!0&&(!j||M[0]&&M[0]!=="/")){ce({type:"star",value:k,output:""});continue}let N=E.braces>0&&(B.type==="comma"||B.type==="brace"),ee=Q.length&&(B.type==="pipe"||B.type==="paren");if(!j&&B.type!=="paren"&&!N&&!ee){ce({type:"star",value:k,output:""});continue}for(;M.slice(0,3)==="/**";){let de=t[E.index+4];if(de&&de!=="/")break;M=M.slice(3),Fe("/**",3)}if(B.type==="bos"&&he()){$.type="globstar",$.value+=k,$.output=Z(r),E.output=$.output,E.globstar=!0,Fe(k);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&!R&&he()){E.output=E.output.slice(0,-(B.output+$.output).length),B.output=`(?:${B.output}`,$.type="globstar",$.output=Z(r)+(r.strictSlashes?")":"|$)"),$.value+=k,E.globstar=!0,E.output+=B.output+$.output,Fe(k);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&M[0]==="/"){let de=M[1]!==void 0?"|$":"";E.output=E.output.slice(0,-(B.output+$.output).length),B.output=`(?:${B.output}`,$.type="globstar",$.output=`${Z(r)}${g}|${g}${de})`,$.value+=k,E.output+=B.output+$.output,E.globstar=!0,Fe(k+xe()),ce({type:"slash",value:"/",output:""});continue}if(B.type==="bos"&&M[0]==="/"){$.type="globstar",$.value+=k,$.output=`(?:^|${g}|${Z(r)}${g})`,E.output=$.output,E.globstar=!0,Fe(k+xe()),ce({type:"slash",value:"/",output:""});continue}E.output=E.output.slice(0,-$.output.length),$.type="globstar",$.output=Z(r),$.value+=k,E.output+=$.output,E.globstar=!0,Fe(k);continue}let ve={type:"star",value:k,output:P};if(r.bash===!0){ve.output=".*?",($.type==="bos"||$.type==="slash")&&(ve.output=F+ve.output),ce(ve);continue}if($&&($.type==="bracket"||$.type==="paren")&&r.regex===!0){ve.output=k,ce(ve);continue}(E.index===E.start||$.type==="slash"||$.type==="dot")&&($.type==="dot"?(E.output+=w,$.output+=w):r.dot===!0?(E.output+=C,$.output+=C):(E.output+=F,$.output+=F),J()!=="*"&&(E.output+=m,$.output+=m)),ce(ve)}for(;E.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(mn("closing","]"));E.output=Pe.escapeLast(E.output,"["),Ze("brackets")}for(;E.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(mn("closing",")"));E.output=Pe.escapeLast(E.output,"("),Ze("parens")}for(;E.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(mn("closing","}"));E.output=Pe.escapeLast(E.output,"{"),Ze("braces")}if(r.strictSlashes!==!0&&($.type==="star"||$.type==="bracket")&&ce({type:"maybe_slash",value:"",output:`${g}?`}),E.backtrack===!0){E.output="";for(let M of E.tokens)E.output+=M.output!=null?M.output:M.value,M.suffix&&(E.output+=M.suffix)}return E};yi.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(js,r.maxLength):js,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=Ql[t]||t;let i=Pe.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:g,START_ANCHOR:m}=Wn.globChars(i),D=r.dot?d:l,h=r.dot?f:l,w=r.capture?"":"?:",C={negated:!1,prefix:""},A=r.bash===!0?".*?":g;r.capture&&(A=`(${A})`);let T=F=>F.noglobstar===!0?A:`(${w}(?:(?!${m}${F.dot?c:o}).)*?)`,G=F=>{switch(F){case"*":return`${D}${u}${A}`;case".*":return`${o}${u}${A}`;case"*.*":return`${D}${A}${o}${u}${A}`;case"*/*":return`${D}${A}${a}${u}${h}${A}`;case"**":return D+T(r);case"**/*":return`(?:${D}${T(r)}${a})?${h}${u}${A}`;case"**/*.*":return`(?:${D}${T(r)}${a})?${h}${A}${o}${u}${A}`;case"**/.*":return`(?:${D}${T(r)}${a})?${o}${u}${A}`;default:{let W=/^(.*?)\.(\w+)$/.exec(F);if(!W)return;let P=G(W[1]);return P?P+o+W[2]:void 0}}},I=Pe.removePrefix(t,C),Z=G(I);return Z&&r.strictSlashes!==!0&&(Z+=`${a}?`),Z};rd.exports=yi});var od=v((pj,sd)=>{"use strict";var m0=require("path"),g0=Kl(),vi=nd(),_i=Mn(),D0=Bn(),y0=t=>t&&typeof t=="object"&&!Array.isArray(t),ke=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(f=>ke(f,e,r));return f=>{for(let g of l){let m=g(f);if(m)return m}return!1}}let n=y0(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},i=_i.isWindows(e),o=n?ke.compileRe(t,e):ke.makeRe(t,e,!1,!0),a=o.state;delete o.state;let u=()=>!1;if(s.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};u=ke(s.ignore,l,r)}let c=(l,d=!1)=>{let{isMatch:f,match:g,output:m}=ke.test(l,o,e,{glob:t,posix:i}),D={glob:t,state:a,regex:o,posix:i,input:l,output:m,match:g,isMatch:f};return typeof s.onResult=="function"&&s.onResult(D),f===!1?(D.isMatch=!1,d?D:!1):u(l)?(typeof s.onIgnore=="function"&&s.onIgnore(D),D.isMatch=!1,d?D:!1):(typeof s.onMatch=="function"&&s.onMatch(D),d?D:!0)};return r&&(c.state=a),c};ke.test=(t,e,r,{glob:n,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let i=r||{},o=i.format||(s?_i.toPosixSlashes:null),a=t===n,u=a&&o?o(t):t;return a===!1&&(u=o?o(t):t,a=u===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=ke.matchBase(t,e,r,s):a=e.exec(u)),{isMatch:!!a,match:a,output:u}};ke.matchBase=(t,e,r,n=_i.isWindows(r))=>(e instanceof RegExp?e:ke.makeRe(e,r)).test(m0.basename(t));ke.isMatch=(t,e,r)=>ke(e,r)(t);ke.parse=(t,e)=>Array.isArray(t)?t.map(r=>ke.parse(r,e)):vi(t,{...e,fastpaths:!1});ke.scan=(t,e)=>g0(t,e);ke.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",a=`${i}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let u=ke.toRegex(a,e);return n===!0&&(u.state=t),u};ke.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=vi.fastpaths(t,e)),s.output||(s=vi(t,e)),ke.compileRe(s,e,r,n)};ke.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};ke.constants=D0;sd.exports=ke});var ad=v((mj,id)=>{"use strict";id.exports=od()});var hd=v((gj,fd)=>{"use strict";var cd=require("util"),ld=Bl(),Mt=ad(),Ei=Mn(),ud=t=>t===""||t==="./",dd=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Se=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,s=new Set,i=new Set,o=0,a=l=>{i.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<e.length;l++){let d=Mt(String(e[l]),{...r,onResult:a},!0),f=d.state.negated||d.state.negatedExtglob;f&&o++;for(let g of t){let m=d(g,!0);(f?!m.isMatch:m.isMatch)&&(f?n.add(m.output):(n.delete(m.output),s.add(m.output)))}}let c=(o===e.length?[...i]:[...s]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(l=>l.replace(/\\/g,"")):e}return c};Se.match=Se;Se.matcher=(t,e)=>Mt(t,e);Se.isMatch=(t,e,r)=>Mt(e,r)(t);Se.any=Se.isMatch;Se.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,s=[],i=a=>{r.onResult&&r.onResult(a),s.push(a.output)},o=new Set(Se(t,e,{...r,onResult:i}));for(let a of s)o.has(a)||n.add(a);return[...n]};Se.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${cd.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>Se.contains(t,n,r));if(typeof e=="string"){if(ud(t)||ud(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Se.isMatch(t,e,{...r,contains:!0})};Se.matchKeys=(t,e,r)=>{if(!Ei.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=Se(Object.keys(t),e,r),s={};for(let i of n)s[i]=t[i];return s};Se.some=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let i=Mt(String(s),r);if(n.some(o=>i(o)))return!0}return!1};Se.every=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let i=Mt(String(s),r);if(!n.every(o=>i(o)))return!1}return!0};Se.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${cd.inspect(t)}"`);return[].concat(e).every(n=>Mt(n,r)(t))};Se.capture=(t,e,r)=>{let n=Ei.isWindows(r),i=Mt.makeRe(String(t),{...r,capture:!0}).exec(n?Ei.toPosixSlashes(e):e);if(i)return i.slice(1).map(o=>o===void 0?"":o)};Se.makeRe=(...t)=>Mt.makeRe(...t);Se.scan=(...t)=>Mt.scan(...t);Se.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let s of ld(String(n),e))r.push(Mt.parse(s,e));return r};Se.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!dd(t)?[t]:ld(t,e)};Se.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Se.braces(t,{...e,expand:!0})};Se.hasBraces=dd;fd.exports=Se});var Sd=v(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.isAbsolute=ne.partitionAbsoluteAndRelative=ne.removeDuplicateSlashes=ne.matchAny=ne.convertPatternsToRe=ne.makeRe=ne.getPatternParts=ne.expandBraceExpansion=ne.expandPatternsWithBraceExpansion=ne.isAffectDepthOfReadingPattern=ne.endsWithSlashGlobStar=ne.hasGlobStar=ne.getBaseDirectory=ne.isPatternRelatedToParentDirectory=ne.getPatternsOutsideCurrentDirectory=ne.getPatternsInsideCurrentDirectory=ne.getPositivePatterns=ne.getNegativePatterns=ne.isPositivePattern=ne.isNegativePattern=ne.convertToNegativePattern=ne.convertToPositivePattern=ne.isDynamicPattern=ne.isStaticPattern=void 0;var pd=require("path"),v0=nl(),bi=hd(),md="**",_0="\\",E0=/[*?]|^!/,b0=/\[[^[]*]/,S0=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,C0=/[!*+?@]\([^(]*\)/,w0=/,|\.\./,x0=/(?!^)\/{2,}/g;function gd(t,e={}){return!Dd(t,e)}ne.isStaticPattern=gd;function Dd(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(_0)||E0.test(t)||b0.test(t)||S0.test(t)||e.extglob!==!1&&C0.test(t)||e.braceExpansion!==!1&&$0(t))}ne.isDynamicPattern=Dd;function $0(t){let e=t.indexOf("{");if(e===-1)return!1;let r=t.indexOf("}",e+1);if(r===-1)return!1;let n=t.slice(e,r);return w0.test(n)}function k0(t){return Is(t)?t.slice(1):t}ne.convertToPositivePattern=k0;function A0(t){return"!"+t}ne.convertToNegativePattern=A0;function Is(t){return t.startsWith("!")&&t[1]!=="("}ne.isNegativePattern=Is;function yd(t){return!Is(t)}ne.isPositivePattern=yd;function F0(t){return t.filter(Is)}ne.getNegativePatterns=F0;function j0(t){return t.filter(yd)}ne.getPositivePatterns=j0;function I0(t){return t.filter(e=>!Si(e))}ne.getPatternsInsideCurrentDirectory=I0;function T0(t){return t.filter(Si)}ne.getPatternsOutsideCurrentDirectory=T0;function Si(t){return t.startsWith("..")||t.startsWith("./..")}ne.isPatternRelatedToParentDirectory=Si;function R0(t){return v0(t,{flipBackslashes:!1})}ne.getBaseDirectory=R0;function P0(t){return t.includes(md)}ne.hasGlobStar=P0;function vd(t){return t.endsWith("/"+md)}ne.endsWithSlashGlobStar=vd;function O0(t){let e=pd.basename(t);return vd(t)||gd(e)}ne.isAffectDepthOfReadingPattern=O0;function N0(t){return t.reduce((e,r)=>e.concat(_d(r)),[])}ne.expandPatternsWithBraceExpansion=N0;function _d(t){let e=bi.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}ne.expandBraceExpansion=_d;function L0(t,e){let{parts:r}=bi.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}ne.getPatternParts=L0;function Ed(t,e){return bi.makeRe(t,e)}ne.makeRe=Ed;function B0(t,e){return t.map(r=>Ed(r,e))}ne.convertPatternsToRe=B0;function M0(t,e){return e.some(r=>r.test(t))}ne.matchAny=M0;function q0(t){return t.replace(x0,"/")}ne.removeDuplicateSlashes=q0;function W0(t){let e=[],r=[];for(let n of t)bd(n)?e.push(n):r.push(n);return[e,r]}ne.partitionAbsoluteAndRelative=W0;function bd(t){return pd.isAbsolute(t)}ne.isAbsolute=bd});var $d=v((yj,xd)=>{"use strict";var H0=require("stream"),Cd=H0.PassThrough,Z0=Array.prototype.slice;xd.exports=U0;function U0(){let t=[],e=Z0.call(arguments),r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};let s=n.end!==!1,i=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let o=Cd(n);function a(){for(let l=0,d=arguments.length;l<d;l++)t.push(wd(arguments[l],n));return u(),this}function u(){if(r)return;r=!0;let l=t.shift();if(!l){process.nextTick(c);return}Array.isArray(l)||(l=[l]);let d=l.length+1;function f(){--d>0||(r=!1,u())}function g(m){function D(){m.removeListener("merge2UnpipeEnd",D),m.removeListener("end",D),i&&m.removeListener("error",h),f()}function h(w){o.emit("error",w)}if(m._readableState.endEmitted)return f();m.on("merge2UnpipeEnd",D),m.on("end",D),i&&m.on("error",h),m.pipe(o,{end:!1}),m.resume()}for(let m=0;m<l.length;m++)g(l[m]);f()}function c(){r=!1,o.emit("queueDrain"),s&&o.end()}return o.setMaxListeners(0),o.add=a,o.on("unpipe",function(l){l.emit("merge2UnpipeEnd")}),e.length&&a.apply(null,e),o}function wd(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=wd(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(Cd(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var Ad=v(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.merge=void 0;var V0=$d();function G0(t){let e=V0(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>kd(t)),e.once("end",()=>kd(t)),e}Ts.merge=G0;function kd(t){t.forEach(e=>e.emit("close"))}});var Fd=v(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.isEmpty=gn.isString=void 0;function z0(t){return typeof t=="string"}gn.isString=z0;function Y0(t){return t===""}gn.isEmpty=Y0});var Qt=v(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.string=Oe.stream=Oe.pattern=Oe.path=Oe.fs=Oe.errno=Oe.array=void 0;var X0=Zc();Oe.array=X0;var J0=Uc();Oe.errno=J0;var K0=Vc();Oe.fs=K0;var Q0=Xc();Oe.path=Q0;var e_=Sd();Oe.pattern=e_;var t_=Ad();Oe.stream=t_;var r_=Fd();Oe.string=r_});var Rd=v(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.convertPatternGroupToTask=Ne.convertPatternGroupsToTasks=Ne.groupPatternsByBaseDirectory=Ne.getNegativePatternsAsPositive=Ne.getPositivePatterns=Ne.convertPatternsToTasks=Ne.generate=void 0;var Ct=Qt();function n_(t,e){let r=jd(t,e),n=jd(e.ignore,e),s=Id(r),i=Td(r,n),o=s.filter(l=>Ct.pattern.isStaticPattern(l,e)),a=s.filter(l=>Ct.pattern.isDynamicPattern(l,e)),u=Ci(o,i,!1),c=Ci(a,i,!0);return u.concat(c)}Ne.generate=n_;function jd(t,e){let r=t;return e.braceExpansion&&(r=Ct.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Ct.pattern.removeDuplicateSlashes(n))}function Ci(t,e,r){let n=[],s=Ct.pattern.getPatternsOutsideCurrentDirectory(t),i=Ct.pattern.getPatternsInsideCurrentDirectory(t),o=wi(s),a=wi(i);return n.push(...xi(o,e,r)),"."in a?n.push($i(".",i,e,r)):n.push(...xi(a,e,r)),n}Ne.convertPatternsToTasks=Ci;function Id(t){return Ct.pattern.getPositivePatterns(t)}Ne.getPositivePatterns=Id;function Td(t,e){return Ct.pattern.getNegativePatterns(t).concat(e).map(Ct.pattern.convertToPositivePattern)}Ne.getNegativePatternsAsPositive=Td;function wi(t){let e={};return t.reduce((r,n)=>{let s=Ct.pattern.getBaseDirectory(n);return s in r?r[s].push(n):r[s]=[n],r},e)}Ne.groupPatternsByBaseDirectory=wi;function xi(t,e,r){return Object.keys(t).map(n=>$i(n,t[n],e,r))}Ne.convertPatternGroupsToTasks=xi;function $i(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(Ct.pattern.convertToNegativePattern))}}Ne.convertPatternGroupToTask=$i});var Od=v(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.read=void 0;function s_(t,e,r){e.fs.lstat(t,(n,s)=>{if(n!==null){Pd(r,n);return}if(!s.isSymbolicLink()||!e.followSymbolicLink){ki(r,s);return}e.fs.stat(t,(i,o)=>{if(i!==null){if(e.throwErrorOnBrokenSymbolicLink){Pd(r,i);return}ki(r,s);return}e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),ki(r,o)})})}Rs.read=s_;function Pd(t,e){t(e)}function ki(t,e){t(null,e)}});var Nd=v(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.read=void 0;function o_(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw n}}Ps.read=o_});var Ld=v(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.createFileSystemAdapter=fr.FILE_SYSTEM_ADAPTER=void 0;var Os=require("fs");fr.FILE_SYSTEM_ADAPTER={lstat:Os.lstat,stat:Os.stat,lstatSync:Os.lstatSync,statSync:Os.statSync};function i_(t){return t===void 0?fr.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},fr.FILE_SYSTEM_ADAPTER),t)}fr.createFileSystemAdapter=i_});var Bd=v(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});var a_=Ld(),Ai=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=a_.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};Fi.default=Ai});var Nr=v(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.statSync=hr.stat=hr.Settings=void 0;var Md=Od(),u_=Nd(),ji=Bd();hr.Settings=ji.default;function c_(t,e,r){if(typeof e=="function"){Md.read(t,Ii(),e);return}Md.read(t,Ii(e),r)}hr.stat=c_;function l_(t,e){let r=Ii(e);return u_.read(t,r)}hr.statSync=l_;function Ii(t={}){return t instanceof ji.default?t:new ji.default(t)}});var Hd=v((kj,Wd)=>{var qd;Wd.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(qd||(qd=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var Ud=v((Aj,Zd)=>{Zd.exports=f_;var d_=Hd();function f_(t,e){let r,n,s,i=!0;Array.isArray(t)?(r=[],n=t.length):(s=Object.keys(t),r={},n=s.length);function o(u){function c(){e&&e(u,r),e=null}i?d_(c):c()}function a(u,c,l){r[u]=l,(--n===0||c)&&o(c)}n?s?s.forEach(function(u){t[u](function(c,l){a(u,c,l)})}):t.forEach(function(u,c){u(function(l,d){a(c,l,d)})}):o(null),i=!1}});var Ti=v(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var Ns=process.versions.node.split(".");if(Ns[0]===void 0||Ns[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var Vd=Number.parseInt(Ns[0],10),h_=Number.parseInt(Ns[1],10),Gd=10,p_=10,m_=Vd>Gd,g_=Vd===Gd&&h_>=p_;Ls.IS_SUPPORT_READDIR_WITH_FILE_TYPES=m_||g_});var zd=v(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.createDirentFromStats=void 0;var Ri=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function D_(t,e){return new Ri(t,e)}Bs.createDirentFromStats=D_});var Pi=v(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.fs=void 0;var y_=zd();Ms.fs=y_});var Oi=v(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.joinPathSegments=void 0;function v_(t,e,r){return t.endsWith(r)?t+e:t+r+e}qs.joinPathSegments=v_});var ef=v(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.readdir=pr.readdirWithFileTypes=pr.read=void 0;var __=Nr(),Yd=Ud(),E_=Ti(),Xd=Pi(),Jd=Oi();function b_(t,e,r){if(!e.stats&&E_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){Kd(t,e,r);return}Qd(t,e,r)}pr.read=b_;function Kd(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,s)=>{if(n!==null){Ws(r,n);return}let i=s.map(a=>({dirent:a,name:a.name,path:Jd.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){Ni(r,i);return}let o=i.map(a=>S_(a,e));Yd(o,(a,u)=>{if(a!==null){Ws(r,a);return}Ni(r,u)})})}pr.readdirWithFileTypes=Kd;function S_(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(n,s)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,t);return}t.dirent=Xd.fs.createDirentFromStats(t.name,s),r(null,t)})}}function Qd(t,e,r){e.fs.readdir(t,(n,s)=>{if(n!==null){Ws(r,n);return}let i=s.map(o=>{let a=Jd.joinPathSegments(t,o,e.pathSegmentSeparator);return u=>{__.stat(a,e.fsStatSettings,(c,l)=>{if(c!==null){u(c);return}let d={name:o,path:a,dirent:Xd.fs.createDirentFromStats(o,l)};e.stats&&(d.stats=l),u(null,d)})}});Yd(i,(o,a)=>{if(o!==null){Ws(r,o);return}Ni(r,a)})})}pr.readdir=Qd;function Ws(t,e){t(e)}function Ni(t,e){t(null,e)}});var of=v(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.readdir=mr.readdirWithFileTypes=mr.read=void 0;var C_=Nr(),w_=Ti(),tf=Pi(),rf=Oi();function x_(t,e){return!e.stats&&w_.IS_SUPPORT_READDIR_WITH_FILE_TYPES?nf(t,e):sf(t,e)}mr.read=x_;function nf(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let s={dirent:n,name:n.name,path:rf.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(s.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let i=e.fs.statSync(s.path);s.dirent=tf.fs.createDirentFromStats(s.name,i)}catch(i){if(e.throwErrorOnBrokenSymbolicLink)throw i}return s})}mr.readdirWithFileTypes=nf;function sf(t,e){return e.fs.readdirSync(t).map(n=>{let s=rf.joinPathSegments(t,n,e.pathSegmentSeparator),i=C_.statSync(s,e.fsStatSettings),o={name:n,path:s,dirent:tf.fs.createDirentFromStats(n,i)};return e.stats&&(o.stats=i),o})}mr.readdir=sf});var af=v(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.createFileSystemAdapter=gr.FILE_SYSTEM_ADAPTER=void 0;var Dn=require("fs");gr.FILE_SYSTEM_ADAPTER={lstat:Dn.lstat,stat:Dn.stat,lstatSync:Dn.lstatSync,statSync:Dn.statSync,readdir:Dn.readdir,readdirSync:Dn.readdirSync};function $_(t){return t===void 0?gr.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},gr.FILE_SYSTEM_ADAPTER),t)}gr.createFileSystemAdapter=$_});var uf=v(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});var k_=require("path"),A_=Nr(),F_=af(),Li=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=F_.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,k_.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new A_.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};Bi.default=Li});var Hs=v(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.Settings=Dr.scandirSync=Dr.scandir=void 0;var cf=ef(),j_=of(),Mi=uf();Dr.Settings=Mi.default;function I_(t,e,r){if(typeof e=="function"){cf.read(t,qi(),e);return}cf.read(t,qi(e),r)}Dr.scandir=I_;function T_(t,e){let r=qi(e);return j_.read(t,r)}Dr.scandirSync=T_;function qi(t={}){return t instanceof Mi.default?t:new Mi.default(t)}});var df=v((Bj,lf)=>{"use strict";function R_(t){var e=new t,r=e;function n(){var i=e;return i.next?e=i.next:(e=new t,r=e),i.next=null,i}function s(i){r.next=i,r=i}return{get:n,release:s}}lf.exports=R_});var hf=v((Mj,Wi)=>{"use strict";var P_=df();function ff(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=P_(O_),s=null,i=null,o=0,a=null,u={push:D,drain:Ke,saturated:Ke,pause:l,paused:!1,get concurrency(){return r},set concurrency(I){if(!(I>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=I,!u.paused)for(;s&&o<r;)o++,w()},running:c,resume:g,idle:m,length:d,getQueue:f,unshift:h,empty:Ke,kill:C,killAndDrain:A,error:G,abort:T};return u;function c(){return o}function l(){u.paused=!0}function d(){for(var I=s,Z=0;I;)I=I.next,Z++;return Z}function f(){for(var I=s,Z=[];I;)Z.push(I.value),I=I.next;return Z}function g(){if(u.paused){if(u.paused=!1,s===null){o++,w();return}for(;s&&o<r;)o++,w()}}function m(){return o===0&&u.length()===0}function D(I,Z){var F=n.get();F.context=t,F.release=w,F.value=I,F.callback=Z||Ke,F.errorHandler=a,o>=r||u.paused?i?(i.next=F,i=F):(s=F,i=F,u.saturated()):(o++,e.call(t,F.value,F.worked))}function h(I,Z){var F=n.get();F.context=t,F.release=w,F.value=I,F.callback=Z||Ke,F.errorHandler=a,o>=r||u.paused?s?(F.next=s,s=F):(s=F,i=F,u.saturated()):(o++,e.call(t,F.value,F.worked))}function w(I){I&&n.release(I);var Z=s;Z&&o<=r?u.paused?o--:(i===s&&(i=null),s=Z.next,Z.next=null,e.call(t,Z.value,Z.worked),i===null&&u.empty()):--o===0&&u.drain()}function C(){s=null,i=null,u.drain=Ke}function A(){s=null,i=null,u.drain(),u.drain=Ke}function T(){var I=s;for(s=null,i=null;I;){var Z=I.next,F=I.callback,W=I.errorHandler,P=I.value,E=I.context;I.value=null,I.callback=Ke,I.errorHandler=null,W&&W(new Error("abort"),P),F.call(E,new Error("abort")),I.release(I),I=Z}u.drain=Ke}function G(I){a=I}}function Ke(){}function O_(){this.value=null,this.callback=Ke,this.next=null,this.release=Ke,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var s=t.callback,i=t.errorHandler,o=t.value;t.value=null,t.callback=Ke,t.errorHandler&&i(r,o),s.call(t.context,r,n),t.release(t)}}function N_(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(l,d){e.call(this,l).then(function(f){d(null,f)},d)}var s=ff(t,n,r),i=s.push,o=s.unshift;return s.push=a,s.unshift=u,s.drained=c,s;function a(l){var d=new Promise(function(f,g){i(l,function(m,D){if(m){g(m);return}f(D)})});return d.catch(Ke),d}function u(l){var d=new Promise(function(f,g){o(l,function(m,D){if(m){g(m);return}f(D)})});return d.catch(Ke),d}function c(){var l=new Promise(function(d){process.nextTick(function(){if(s.idle())d();else{var f=s.drain;s.drain=function(){typeof f=="function"&&f(),d(),s.drain=f}}})});return l}}Wi.exports=ff;Wi.exports.promise=N_});var Zs=v(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.joinPathSegments=qt.replacePathSegmentSeparator=qt.isAppliedFilter=qt.isFatalError=void 0;function L_(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}qt.isFatalError=L_;function B_(t,e){return t===null||t(e)}qt.isAppliedFilter=B_;function M_(t,e){return t.split(/[/\\]/).join(e)}qt.replacePathSegmentSeparator=M_;function q_(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}qt.joinPathSegments=q_});var Ui=v(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});var W_=Zs(),Hi=class{constructor(e,r){this._root=e,this._settings=r,this._root=W_.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};Zi.default=Hi});var zi=v(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});var H_=require("events"),Z_=Hs(),U_=hf(),Us=Zs(),V_=Ui(),Vi=class extends V_.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=Z_.scandir,this._emitter=new H_.EventEmitter,this._queue=U_(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let n={directory:e,base:r};this._queue.push(n,s=>{s!==null&&this._handleError(s)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(n,s)=>{if(n!==null){r(n,void 0);return}for(let i of s)this._handleEntry(i,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!Us.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let n=e.path;r!==void 0&&(e.path=Us.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Us.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&Us.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};Gi.default=Vi});var pf=v(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});var G_=zi(),Yi=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new G_.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{z_(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{Y_(e,this._storage)}),this._reader.read()}};Xi.default=Yi;function z_(t,e){t(e)}function Y_(t,e){t(null,e)}});var mf=v(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});var X_=require("stream"),J_=zi(),Ji=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new J_.default(this._root,this._settings),this._stream=new X_.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};Ki.default=Ji});var gf=v(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});var K_=Hs(),Vs=Zs(),Q_=Ui(),Qi=class extends Q_.default{constructor(){super(...arguments),this._scandir=K_.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let s of n)this._handleEntry(s,r)}catch(n){this._handleError(n)}}_handleError(e){if(Vs.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=Vs.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Vs.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&Vs.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};ea.default=Qi});var Df=v(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var eE=gf(),ta=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new eE.default(this._root,this._settings)}read(){return this._reader.read()}};ra.default=ta});var yf=v(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});var tE=require("path"),rE=Hs(),na=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,tE.sep),this.fsScandirSettings=new rE.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};sa.default=na});var zs=v(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.Settings=Wt.walkStream=Wt.walkSync=Wt.walk=void 0;var vf=pf(),nE=mf(),sE=Df(),oa=yf();Wt.Settings=oa.default;function oE(t,e,r){if(typeof e=="function"){new vf.default(t,Gs()).read(e);return}new vf.default(t,Gs(e)).read(r)}Wt.walk=oE;function iE(t,e){let r=Gs(e);return new sE.default(t,r).read()}Wt.walkSync=iE;function aE(t,e){let r=Gs(e);return new nE.default(t,r).read()}Wt.walkStream=aE;function Gs(t={}){return t instanceof oa.default?t:new oa.default(t)}});var Ys=v(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});var uE=require("path"),cE=Nr(),_f=Qt(),ia=class{constructor(e){this._settings=e,this._fsStatSettings=new cE.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return uE.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:_f.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!_f.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};aa.default=ia});var la=v(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});var lE=require("stream"),dE=Nr(),fE=zs(),hE=Ys(),ua=class extends hE.default{constructor(){super(...arguments),this._walkStream=fE.walkStream,this._stat=dE.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),s=new lE.PassThrough({objectMode:!0});s._write=(i,o,a)=>this._getEntry(n[i],e[i],r).then(u=>{u!==null&&r.entryFilter(u)&&s.push(u),i===n.length-1&&s.end(),a()}).catch(a);for(let i=0;i<n.length;i++)s.write(i);return s}_getEntry(e,r,n){return this._getStat(e).then(s=>this._makeEntry(s,r)).catch(s=>{if(n.errorFilter(s))return null;throw s})}_getStat(e){return new Promise((r,n)=>{this._stat(e,this._fsStatSettings,(s,i)=>s===null?r(i):n(s))})}};ca.default=ua});var Ef=v(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var pE=zs(),mE=Ys(),gE=la(),da=class extends mE.default{constructor(){super(...arguments),this._walkAsync=pE.walk,this._readerStream=new gE.default(this._settings)}dynamic(e,r){return new Promise((n,s)=>{this._walkAsync(e,r,(i,o)=>{i===null?n(o):s(i)})})}async static(e,r){let n=[],s=this._readerStream.static(e,r);return new Promise((i,o)=>{s.once("error",o),s.on("data",a=>n.push(a)),s.once("end",()=>i(n))})}};fa.default=da});var bf=v(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var Hn=Qt(),ha=class{constructor(e,r,n){this._patterns=e,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:e,segments:r,sections:n})}}_getPatternSegments(e){return Hn.pattern.getPatternParts(e,this._micromatchOptions).map(n=>Hn.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Hn.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return Hn.array.splitWhen(e,r=>r.dynamic&&Hn.pattern.hasGlobStar(r.pattern))}};pa.default=ha});var Sf=v(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var DE=bf(),ma=class extends DE.default{match(e){let r=e.split("/"),n=r.length,s=this._storage.filter(i=>!i.complete||i.segments.length>n);for(let i of s){let o=i.sections[0];if(!i.complete&&n>o.length||r.every((u,c)=>{let l=i.segments[c];return!!(l.dynamic&&l.patternRe.test(u)||!l.dynamic&&l.pattern===u)}))return!0}return!1}};ga.default=ma});var Cf=v(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});var Xs=Qt(),yE=Sf(),Da=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){let s=this._getMatcher(r),i=this._getNegativePatternsRe(n);return o=>this._filter(e,o,s,i)}_getMatcher(e){return new yE.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(Xs.pattern.isAffectDepthOfReadingPattern);return Xs.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,s){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=Xs.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(i,n)?!1:this._isSkippedByNegativePatterns(i,s)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let n=r.split("/").length;if(e==="")return n;let s=e.split("/").length;return n-s}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!Xs.pattern.matchAny(e,r)}};ya.default=Da});var wf=v(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var yr=Qt(),va=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,s]=yr.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:yr.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:yr.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:yr.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return o=>this._filter(o,i)}_filter(e,r){let n=yr.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let s=this._isMatchToPatternsSet(n,r,e.dirent.isDirectory());return this._settings.unique&&s&&this._createIndexRecord(n),s}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,r,n){return!(!this._isMatchToPatterns(e,r.positive.all,n)||this._isMatchToPatterns(e,r.negative.relative,n)||this._isMatchToAbsoluteNegative(e,r.negative.absolute,n))}_isMatchToAbsoluteNegative(e,r,n){if(r.length===0)return!1;let s=yr.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(s,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let s=yr.pattern.matchAny(e,r);return!s&&n?yr.pattern.matchAny(e+"/",r):s}};_a.default=va});var xf=v(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var vE=Qt(),Ea=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return vE.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};ba.default=Ea});var kf=v(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});var $f=Qt(),Sa=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=$f.path.makeAbsolute(this._settings.cwd,r),r=$f.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};Ca.default=Sa});var Js=v(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});var _E=require("path"),EE=Cf(),bE=wf(),SE=xf(),CE=kf(),wa=class{constructor(e){this._settings=e,this.errorFilter=new SE.default(this._settings),this.entryFilter=new bE.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new EE.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new CE.default(this._settings)}_getRootDirectory(e){return _E.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};xa.default=wa});var Af=v(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var wE=Ef(),xE=Js(),$a=class extends xE.default{constructor(){super(...arguments),this._reader=new wE.default(this._settings)}async read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(i=>n.transform(i))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};ka.default=$a});var Ff=v(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});var $E=require("stream"),kE=la(),AE=Js(),Aa=class extends AE.default{constructor(){super(...arguments),this._reader=new kE.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),s=this.api(r,e,n),i=new $E.Readable({objectMode:!0,read:()=>{}});return s.once("error",o=>i.emit("error",o)).on("data",o=>i.emit("data",n.transform(o))).once("end",()=>i.emit("end")),i.once("close",()=>s.destroy()),i}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};Fa.default=Aa});var jf=v(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var FE=Nr(),jE=zs(),IE=Ys(),ja=class extends IE.default{constructor(){super(...arguments),this._walkSync=jE.walkSync,this._statSync=FE.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let n=[];for(let s of e){let i=this._getFullEntryPath(s),o=this._getEntry(i,s,r);o===null||!r.entryFilter(o)||n.push(o)}return n}_getEntry(e,r,n){try{let s=this._getStat(e);return this._makeEntry(s,r)}catch(s){if(n.errorFilter(s))return null;throw s}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};Ia.default=ja});var If=v(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var TE=jf(),RE=Js(),Ta=class extends RE.default{constructor(){super(...arguments),this._reader=new TE.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(r,e,n).map(n.transform)}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};Ra.default=Ta});var Tf=v(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var yn=require("fs"),PE=require("os"),OE=Math.max(PE.cpus().length,1);vn.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:yn.lstat,lstatSync:yn.lstatSync,stat:yn.stat,statSync:yn.statSync,readdir:yn.readdir,readdirSync:yn.readdirSync};var Pa=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,OE),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},vn.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};vn.default=Pa});var Of=v((d2,Pf)=>{"use strict";var Rf=Rd(),NE=Af(),LE=Ff(),BE=If(),Oa=Tf(),dt=Qt();async function Na(t,e){wt(t);let r=La(t,NE.default,e),n=await Promise.all(r);return dt.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(c,l){wt(c);let d=La(c,BE.default,l);return dt.array.flatten(d)}t.sync=e;function r(c,l){wt(c);let d=La(c,LE.default,l);return dt.stream.merge(d)}t.stream=r;function n(c,l){wt(c);let d=[].concat(c),f=new Oa.default(l);return Rf.generate(d,f)}t.generateTasks=n;function s(c,l){wt(c);let d=new Oa.default(l);return dt.pattern.isDynamicPattern(c,d)}t.isDynamicPattern=s;function i(c){return wt(c),dt.path.escape(c)}t.escapePath=i;function o(c){return wt(c),dt.path.convertPathToPattern(c)}t.convertPathToPattern=o;let a;(function(c){function l(f){return wt(f),dt.path.escapePosixPath(f)}c.escapePath=l;function d(f){return wt(f),dt.path.convertPosixPathToPattern(f)}c.convertPathToPattern=d})(a=t.posix||(t.posix={}));let u;(function(c){function l(f){return wt(f),dt.path.escapeWindowsPath(f)}c.escapePath=l;function d(f){return wt(f),dt.path.convertWindowsPathToPattern(f)}c.convertPathToPattern=d})(u=t.win32||(t.win32={}))})(Na||(Na={}));function La(t,e,r){let n=[].concat(t),s=new Oa.default(r),i=Rf.generate(n,s),o=new e(s);return i.map(o.read,o)}function wt(t){if(![].concat(t).every(n=>dt.string.isString(n)&&!dt.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}Pf.exports=Na});var Zn=v(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.getParsedType=_e.ZodParsedType=_e.objectUtil=_e.util=void 0;var Ba;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let i={};for(let o of s)i[o]=o;return i},t.getValidEnumValues=s=>{let i=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(let a of i)o[a]=s[a];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(let o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Ba||(_e.util=Ba={}));var Nf;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Nf||(_e.objectUtil=Nf={}));_e.ZodParsedType=Ba.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var ME=t=>{switch(typeof t){case"undefined":return _e.ZodParsedType.undefined;case"string":return _e.ZodParsedType.string;case"number":return Number.isNaN(t)?_e.ZodParsedType.nan:_e.ZodParsedType.number;case"boolean":return _e.ZodParsedType.boolean;case"function":return _e.ZodParsedType.function;case"bigint":return _e.ZodParsedType.bigint;case"symbol":return _e.ZodParsedType.symbol;case"object":return Array.isArray(t)?_e.ZodParsedType.array:t===null?_e.ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?_e.ZodParsedType.promise:typeof Map<"u"&&t instanceof Map?_e.ZodParsedType.map:typeof Set<"u"&&t instanceof Set?_e.ZodParsedType.set:typeof Date<"u"&&t instanceof Date?_e.ZodParsedType.date:_e.ZodParsedType.object;default:return _e.ZodParsedType.unknown}};_e.getParsedType=ME});var Ks=v(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.ZodError=vr.quotelessJson=vr.ZodIssueCode=void 0;var Lf=Zn();vr.ZodIssueCode=Lf.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var qE=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");vr.quotelessJson=qE;var Un=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(i){return i.message},n={_errors:[]},s=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return s(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Lf.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)if(s.path.length>0){let i=s.path[0];r[i]=r[i]||[],r[i].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};vr.ZodError=Un;Un.create=t=>new Un(t)});var qa=v(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});var Le=Ks(),Lr=Zn(),WE=(t,e)=>{let r;switch(t.code){case Le.ZodIssueCode.invalid_type:t.received===Lr.ZodParsedType.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Le.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Lr.util.jsonStringifyReplacer)}`;break;case Le.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${Lr.util.joinValues(t.keys,", ")}`;break;case Le.ZodIssueCode.invalid_union:r="Invalid input";break;case Le.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Lr.util.joinValues(t.options)}`;break;case Le.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${Lr.util.joinValues(t.options)}, received '${t.received}'`;break;case Le.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case Le.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case Le.ZodIssueCode.invalid_date:r="Invalid date";break;case Le.ZodIssueCode.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Lr.util.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Le.ZodIssueCode.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Le.ZodIssueCode.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Le.ZodIssueCode.custom:r="Invalid input";break;case Le.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case Le.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Le.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=e.defaultError,Lr.util.assertNever(t)}return{message:r}};Ma.default=WE});var Qs=v(_r=>{"use strict";var HE=_r&&_r.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_r,"__esModule",{value:!0});_r.defaultErrorMap=void 0;_r.setErrorMap=ZE;_r.getErrorMap=UE;var Bf=HE(qa());_r.defaultErrorMap=Bf.default;var Mf=Bf.default;function ZE(t){Mf=t}function UE(){return Mf}});var Ha=v(ge=>{"use strict";var VE=ge&&ge.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ge,"__esModule",{value:!0});ge.isAsync=ge.isValid=ge.isDirty=ge.isAborted=ge.OK=ge.DIRTY=ge.INVALID=ge.ParseStatus=ge.EMPTY_PATH=ge.makeIssue=void 0;ge.addIssueToContext=YE;var GE=Qs(),qf=VE(qa()),zE=t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,i=[...r,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}};ge.makeIssue=zE;ge.EMPTY_PATH=[];function YE(t,e){let r=(0,GE.getErrorMap)(),n=(0,ge.makeIssue)({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===qf.default?void 0:qf.default].filter(s=>!!s)});t.common.issues.push(n)}var Wa=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return ge.INVALID;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let i=await s.key,o=await s.value;n.push({key:i,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return ge.INVALID;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}};ge.ParseStatus=Wa;ge.INVALID=Object.freeze({status:"aborted"});var XE=t=>({status:"dirty",value:t});ge.DIRTY=XE;var JE=t=>({status:"valid",value:t});ge.OK=JE;var KE=t=>t.status==="aborted";ge.isAborted=KE;var QE=t=>t.status==="dirty";ge.isDirty=QE;var eb=t=>t.status==="valid";ge.isValid=eb;var tb=t=>typeof Promise<"u"&&t instanceof Promise;ge.isAsync=tb});var Hf=v(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0})});var Uf=v(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.errorUtil=void 0;var Zf;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Zf||(eo.errorUtil=Zf={}))});var nh=v(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.discriminatedUnion=b.date=b.boolean=b.bigint=b.array=b.any=b.coerce=b.ZodFirstPartyTypeKind=b.late=b.ZodSchema=b.Schema=b.ZodReadonly=b.ZodPipeline=b.ZodBranded=b.BRAND=b.ZodNaN=b.ZodCatch=b.ZodDefault=b.ZodNullable=b.ZodOptional=b.ZodTransformer=b.ZodEffects=b.ZodPromise=b.ZodNativeEnum=b.ZodEnum=b.ZodLiteral=b.ZodLazy=b.ZodFunction=b.ZodSet=b.ZodMap=b.ZodRecord=b.ZodTuple=b.ZodIntersection=b.ZodDiscriminatedUnion=b.ZodUnion=b.ZodObject=b.ZodArray=b.ZodVoid=b.ZodNever=b.ZodUnknown=b.ZodAny=b.ZodNull=b.ZodUndefined=b.ZodSymbol=b.ZodDate=b.ZodBoolean=b.ZodBigInt=b.ZodNumber=b.ZodString=b.ZodType=void 0;b.NEVER=b.void=b.unknown=b.union=b.undefined=b.tuple=b.transformer=b.symbol=b.string=b.strictObject=b.set=b.record=b.promise=b.preprocess=b.pipeline=b.ostring=b.optional=b.onumber=b.oboolean=b.object=b.number=b.nullable=b.null=b.never=b.nativeEnum=b.nan=b.map=b.literal=b.lazy=b.intersection=b.instanceof=b.function=b.enum=b.effect=void 0;b.datetimeRegex=Xf;b.custom=Kf;var O=Ks(),to=Qs(),K=Uf(),S=Ha(),L=Zn(),ht=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Vf=(t,e)=>{if((0,S.isValid)(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new O.ZodError(t.common.issues);return this._error=r,this._error}}};function ie(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{let{message:u}=t;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:u??r??a.defaultError}},description:s}}var ae=class{get description(){return this._def.description}_getType(e){return(0,L.getParsedType)(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:(0,L.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,L.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if((0,S.isAsync)(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,L.getParsedType)(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Vf(n,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,L.getParsedType)(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return(0,S.isValid)(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>(0,S.isValid)(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,L.getParsedType)(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await((0,S.isAsync)(s)?s:Promise.resolve(s));return Vf(n,i)}refine(e,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{let o=e(s),a=()=>i.addIssue({code:O.ZodIssueCode.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new at({schema:this,typeName:se.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ft.create(this,this._def)}nullable(){return Zt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rr.create(this)}promise(){return Sr.create(this,this._def)}or(e){return Ur.create([this,e],this._def)}and(e){return Vr.create(this,e,this._def)}transform(e){return new at({...ie(this._def),schema:this,typeName:se.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Jr({...ie(this._def),innerType:this,defaultValue:r,typeName:se.ZodDefault})}brand(){return new Vn({typeName:se.ZodBranded,type:this,...ie(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Kr({...ie(this._def),innerType:this,catchValue:r,typeName:se.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Gn.create(this,e)}readonly(){return Qr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};b.ZodType=ae;b.Schema=ae;b.ZodSchema=ae;var rb=/^c[^\s-]{8,}$/i,nb=/^[0-9a-z]+$/,sb=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ob=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ib=/^[a-z0-9_-]{21}$/i,ab=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ub=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Za,db=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,fb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,hb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,pb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,gb=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zf="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Db=new RegExp(`^${zf}$`);function Yf(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function yb(t){return new RegExp(`^${Yf(t)}$`)}function Xf(t){let e=`${zf}T${Yf(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function vb(t,e){return!!((e==="v4"||!e)&&db.test(t)||(e==="v6"||!e)&&hb.test(t))}function _b(t,e){if(!ab.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function Eb(t,e){return!!((e==="v4"||!e)&&fb.test(t)||(e==="v6"||!e)&&pb.test(t))}var Er=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==L.ZodParsedType.string){let i=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.string,received:i.parsedType}),S.INVALID}let n=new S.ParseStatus,s;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=e.data.length>i.value,a=e.data.length<i.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")cb.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"email",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Za||(Za=new RegExp(lb,"u")),Za.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"emoji",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")ob.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"uuid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")ib.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"nanoid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")rb.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"cuid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")nb.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"cuid2",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")sb.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"ulid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"url",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"regex",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Xf(i).test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?Db.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?yb(i).test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?ub.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"duration",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?vb(e.data,i.version)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"ip",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?_b(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"jwt",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?Eb(e.data,i.version)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"cidr",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?mb.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"base64",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?gb.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"base64url",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):L.util.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:O.ZodIssueCode.invalid_string,...K.errorUtil.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...K.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...K.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...K.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...K.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...K.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...K.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...K.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...K.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...K.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...K.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...K.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...K.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...K.errorUtil.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...K.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...K.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...K.errorUtil.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...K.errorUtil.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...K.errorUtil.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...K.errorUtil.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...K.errorUtil.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...K.errorUtil.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...K.errorUtil.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...K.errorUtil.errToObj(r)})}nonempty(e){return this.min(1,K.errorUtil.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};b.ZodString=Er;Er.create=t=>new Er({checks:[],typeName:se.ZodString,coerce:t?.coerce??!1,...ie(t)});function bb(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}var Br=class t extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==L.ZodParsedType.number){let i=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.number,received:i.parsedType}),S.INVALID}let n,s=new S.ParseStatus;for(let i of this._def.checks)i.kind==="int"?L.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?bb(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.not_finite,message:i.message}),s.dirty()):L.util.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,K.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.errorUtil.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:K.errorUtil.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:K.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:K.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:K.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:K.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:K.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.errorUtil.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:K.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:K.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:K.errorUtil.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&L.util.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};b.ZodNumber=Br;Br.create=t=>new Br({checks:[],typeName:se.ZodNumber,coerce:t?.coerce||!1,...ie(t)});var Mr=class t extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==L.ZodParsedType.bigint)return this._getInvalidInput(e);let n,s=new S.ParseStatus;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):L.util.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.bigint,received:r.parsedType}),S.INVALID}gte(e,r){return this.setLimit("min",e,!0,K.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.errorUtil.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:K.errorUtil.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:K.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:K.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:K.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:K.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.errorUtil.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};b.ZodBigInt=Mr;Mr.create=t=>new Mr({checks:[],typeName:se.ZodBigInt,coerce:t?.coerce??!1,...ie(t)});var qr=class extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==L.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.boolean,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};b.ZodBoolean=qr;qr.create=t=>new qr({typeName:se.ZodBoolean,coerce:t?.coerce||!1,...ie(t)});var Wr=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==L.ZodParsedType.date){let i=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.date,received:i.parsedType}),S.INVALID}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_date}),S.INVALID}let n=new S.ParseStatus,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{code:O.ZodIssueCode.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):L.util.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:K.errorUtil.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:K.errorUtil.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};b.ZodDate=Wr;Wr.create=t=>new Wr({checks:[],coerce:t?.coerce||!1,typeName:se.ZodDate,...ie(t)});var En=class extends ae{_parse(e){if(this._getType(e)!==L.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.symbol,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};b.ZodSymbol=En;En.create=t=>new En({typeName:se.ZodSymbol,...ie(t)});var Hr=class extends ae{_parse(e){if(this._getType(e)!==L.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.undefined,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};b.ZodUndefined=Hr;Hr.create=t=>new Hr({typeName:se.ZodUndefined,...ie(t)});var Zr=class extends ae{_parse(e){if(this._getType(e)!==L.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.null,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};b.ZodNull=Zr;Zr.create=t=>new Zr({typeName:se.ZodNull,...ie(t)});var br=class extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,S.OK)(e.data)}};b.ZodAny=br;br.create=t=>new br({typeName:se.ZodAny,...ie(t)});var tr=class extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,S.OK)(e.data)}};b.ZodUnknown=tr;tr.create=t=>new tr({typeName:se.ZodUnknown,...ie(t)});var xt=class extends ae{_parse(e){let r=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.never,received:r.parsedType}),S.INVALID}};b.ZodNever=xt;xt.create=t=>new xt({typeName:se.ZodNever,...ie(t)});var bn=class extends ae{_parse(e){if(this._getType(e)!==L.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.void,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};b.ZodVoid=bn;bn.create=t=>new bn({typeName:se.ZodVoid,...ie(t)});var rr=class t extends ae{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==L.ZodParsedType.array)return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.array,received:r.parsedType}),S.INVALID;if(s.exactLength!==null){let o=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(o||a)&&((0,S.addIssueToContext)(r,{code:o?O.ZodIssueCode.too_big:O.ZodIssueCode.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&((0,S.addIssueToContext)(r,{code:O.ZodIssueCode.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&((0,S.addIssueToContext)(r,{code:O.ZodIssueCode.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>s.type._parseAsync(new ht(r,o,r.path,a)))).then(o=>S.ParseStatus.mergeArray(n,o));let i=[...r.data].map((o,a)=>s.type._parseSync(new ht(r,o,r.path,a)));return S.ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:K.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:K.errorUtil.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:K.errorUtil.toString(r)}})}nonempty(e){return this.min(1,e)}};b.ZodArray=rr;rr.create=(t,e)=>new rr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:se.ZodArray,...ie(e)});function _n(t){if(t instanceof Qe){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ft.create(_n(n))}return new Qe({...t._def,shape:()=>e})}else return t instanceof rr?new rr({...t._def,type:_n(t.element)}):t instanceof ft?ft.create(_n(t.unwrap())):t instanceof Zt?Zt.create(_n(t.unwrap())):t instanceof Ht?Ht.create(t.items.map(e=>_n(e))):t}var Qe=class t extends ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=L.util.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==L.ZodParsedType.object){let c=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(c,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.object,received:c.parsedType}),S.INVALID}let{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof xt&&this._def.unknownKeys==="strip"))for(let c in s.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let l=i[c],d=s.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new ht(s,d,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof xt){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)u.push({key:{status:"valid",value:l},value:{status:"valid",value:s.data[l]}});else if(c==="strict")a.length>0&&((0,S.addIssueToContext)(s,{code:O.ZodIssueCode.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let d=s.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new ht(s,d,s.path,l)),alwaysSet:l in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of u){let d=await l.key,f=await l.value;c.push({key:d,value:f,alwaysSet:l.alwaysSet})}return c}).then(c=>S.ParseStatus.mergeObjectSync(n,c)):S.ParseStatus.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return K.errorUtil.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:K.errorUtil.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:se.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of L.util.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of L.util.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return _n(this)}partial(e){let r={};for(let n of L.util.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of L.util.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ft;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return Jf(L.util.objectKeys(this.shape))}};b.ZodObject=Qe;Qe.create=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strip",catchall:xt.create(),typeName:se.ZodObject,...ie(e)});Qe.strictCreate=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strict",catchall:xt.create(),typeName:se.ZodObject,...ie(e)});Qe.lazycreate=(t,e)=>new Qe({shape:t,unknownKeys:"strip",catchall:xt.create(),typeName:se.ZodObject,...ie(e)});var Ur=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(a=>new O.ZodError(a.ctx.common.issues));return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_union,unionErrors:o}),S.INVALID}if(r.common.async)return Promise.all(n.map(async i=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i,o=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},l=u._parseSync({data:r.data,path:r.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!i&&(i={result:l,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(u=>new O.ZodError(u));return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_union,unionErrors:a}),S.INVALID}}get options(){return this._def.options}};b.ZodUnion=Ur;Ur.create=(t,e)=>new Ur({options:t,typeName:se.ZodUnion,...ie(e)});var er=t=>t instanceof Gr?er(t.schema):t instanceof at?er(t.innerType()):t instanceof zr?[t.value]:t instanceof Yr?t.options:t instanceof Xr?L.util.objectValues(t.enum):t instanceof Jr?er(t._def.innerType):t instanceof Hr?[void 0]:t instanceof Zr?[null]:t instanceof ft?[void 0,...er(t.unwrap())]:t instanceof Zt?[null,...er(t.unwrap())]:t instanceof Vn||t instanceof Qr?er(t.unwrap()):t instanceof Kr?er(t._def.innerType):[],ro=class t extends ae{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.ZodParsedType.object)return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.object,received:r.parsedType}),S.INVALID;let n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):((0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),S.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let i of r){let o=er(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,i)}}return new t({typeName:se.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...ie(n)})}};b.ZodDiscriminatedUnion=ro;function Ua(t,e){let r=(0,L.getParsedType)(t),n=(0,L.getParsedType)(e);if(t===e)return{valid:!0,data:t};if(r===L.ZodParsedType.object&&n===L.ZodParsedType.object){let s=L.util.objectKeys(e),i=L.util.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(let a of i){let u=Ua(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===L.ZodParsedType.array&&n===L.ZodParsedType.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let i=0;i<t.length;i++){let o=t[i],a=e[i],u=Ua(o,a);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return r===L.ZodParsedType.date&&n===L.ZodParsedType.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Vr=class extends ae{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=(i,o)=>{if((0,S.isAborted)(i)||(0,S.isAborted)(o))return S.INVALID;let a=Ua(i.value,o.value);return a.valid?(((0,S.isDirty)(i)||(0,S.isDirty)(o))&&r.dirty(),{status:r.value,value:a.data}):((0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_intersection_types}),S.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};b.ZodIntersection=Vr;Vr.create=(t,e,r)=>new Vr({left:t,right:e,typeName:se.ZodIntersection,...ie(r)});var Ht=class t extends ae{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.ZodParsedType.array)return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.array,received:n.parsedType}),S.INVALID;if(n.data.length<this._def.items.length)return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new ht(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>S.ParseStatus.mergeArray(r,o)):S.ParseStatus.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};b.ZodTuple=Ht;Ht.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ht({items:t,typeName:se.ZodTuple,rest:null,...ie(e)})};var no=class t extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.ZodParsedType.object)return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.object,received:n.parsedType}),S.INVALID;let s=[],i=this._def.keyType,o=this._def.valueType;for(let a in n.data)s.push({key:i._parse(new ht(n,a,n.path,a)),value:o._parse(new ht(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?S.ParseStatus.mergeObjectAsync(r,s):S.ParseStatus.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ae?new t({keyType:e,valueType:r,typeName:se.ZodRecord,...ie(n)}):new t({keyType:Er.create(),valueType:e,typeName:se.ZodRecord,...ie(r)})}};b.ZodRecord=no;var Sn=class extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.ZodParsedType.map)return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.map,received:n.parsedType}),S.INVALID;let s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,u],c)=>({key:s._parse(new ht(n,a,n.path,[c,"key"])),value:i._parse(new ht(n,u,n.path,[c,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return S.INVALID;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of o){let c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return S.INVALID;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};b.ZodMap=Sn;Sn.create=(t,e,r)=>new Sn({valueType:e,keyType:t,typeName:se.ZodMap,...ie(r)});var Cn=class t extends ae{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.ZodParsedType.set)return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.set,received:n.parsedType}),S.INVALID;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&((0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&((0,S.addIssueToContext)(n,{code:O.ZodIssueCode.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function o(u){let c=new Set;for(let l of u){if(l.status==="aborted")return S.INVALID;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let a=[...n.data.values()].map((u,c)=>i._parse(new ht(n,u,n.path,c)));return n.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:K.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:K.errorUtil.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};b.ZodSet=Cn;Cn.create=(t,e)=>new Cn({valueType:t,minSize:null,maxSize:null,typeName:se.ZodSet,...ie(e)});var so=class t extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.ZodParsedType.function)return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.function,received:r.parsedType}),S.INVALID;function n(a,u){return(0,S.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,to.getErrorMap)(),to.defaultErrorMap].filter(c=>!!c),issueData:{code:O.ZodIssueCode.invalid_arguments,argumentsError:u}})}function s(a,u){return(0,S.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,to.getErrorMap)(),to.defaultErrorMap].filter(c=>!!c),issueData:{code:O.ZodIssueCode.invalid_return_type,returnTypeError:u}})}let i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Sr){let a=this;return(0,S.OK)(async function(...u){let c=new O.ZodError([]),l=await a._def.args.parseAsync(u,i).catch(g=>{throw c.addIssue(n(u,g)),c}),d=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(d,i).catch(g=>{throw c.addIssue(s(d,g)),c})})}else{let a=this;return(0,S.OK)(function(...u){let c=a._def.args.safeParse(u,i);if(!c.success)throw new O.ZodError([n(u,c.error)]);let l=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(l,i);if(!d.success)throw new O.ZodError([s(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ht.create(e).rest(tr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Ht.create([]).rest(tr.create()),returns:r||tr.create(),typeName:se.ZodFunction,...ie(n)})}};b.ZodFunction=so;var Gr=class extends ae{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};b.ZodLazy=Gr;Gr.create=(t,e)=>new Gr({getter:t,typeName:se.ZodLazy,...ie(e)});var zr=class extends ae{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(r,{received:r.data,code:O.ZodIssueCode.invalid_literal,expected:this._def.value}),S.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}};b.ZodLiteral=zr;zr.create=(t,e)=>new zr({value:t,typeName:se.ZodLiteral,...ie(e)});function Jf(t,e){return new Yr({values:t,typeName:se.ZodEnum,...ie(e)})}var Yr=class t extends ae{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,S.addIssueToContext)(r,{expected:L.util.joinValues(n),received:r.parsedType,code:O.ZodIssueCode.invalid_type}),S.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,S.addIssueToContext)(r,{received:r.data,code:O.ZodIssueCode.invalid_enum_value,options:n}),S.INVALID}return(0,S.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};b.ZodEnum=Yr;Yr.create=Jf;var Xr=class extends ae{_parse(e){let r=L.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==L.ZodParsedType.string&&n.parsedType!==L.ZodParsedType.number){let s=L.util.objectValues(r);return(0,S.addIssueToContext)(n,{expected:L.util.joinValues(s),received:n.parsedType,code:O.ZodIssueCode.invalid_type}),S.INVALID}if(this._cache||(this._cache=new Set(L.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=L.util.objectValues(r);return(0,S.addIssueToContext)(n,{received:n.data,code:O.ZodIssueCode.invalid_enum_value,options:s}),S.INVALID}return(0,S.OK)(e.data)}get enum(){return this._def.values}};b.ZodNativeEnum=Xr;Xr.create=(t,e)=>new Xr({values:t,typeName:se.ZodNativeEnum,...ie(e)});var Sr=class extends ae{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.ZodParsedType.promise&&r.common.async===!1)return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.promise,received:r.parsedType}),S.INVALID;let n=r.parsedType===L.ZodParsedType.promise?r.data:Promise.resolve(r.data);return(0,S.OK)(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};b.ZodPromise=Sr;Sr.create=(t,e)=>new Sr({type:t,typeName:se.ZodPromise,...ie(e)});var at=class extends ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{(0,S.addIssueToContext)(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return S.INVALID;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?S.INVALID:u.status==="dirty"||r.value==="dirty"?(0,S.DIRTY)(u.value):u});{if(r.value==="aborted")return S.INVALID;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?S.INVALID:a.status==="dirty"||r.value==="dirty"?(0,S.DIRTY)(a.value):a}}if(s.type==="refinement"){let o=a=>{let u=s.refinement(a,i);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?S.INVALID:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?S.INVALID:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,S.isValid)(o))return S.INVALID;let a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>(0,S.isValid)(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):S.INVALID);L.util.assertNever(s)}};b.ZodEffects=at;b.ZodTransformer=at;at.create=(t,e,r)=>new at({schema:t,typeName:se.ZodEffects,effect:e,...ie(r)});at.createWithPreprocess=(t,e,r)=>new at({schema:e,effect:{type:"preprocess",transform:t},typeName:se.ZodEffects,...ie(r)});var ft=class extends ae{_parse(e){return this._getType(e)===L.ZodParsedType.undefined?(0,S.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};b.ZodOptional=ft;ft.create=(t,e)=>new ft({innerType:t,typeName:se.ZodOptional,...ie(e)});var Zt=class extends ae{_parse(e){return this._getType(e)===L.ZodParsedType.null?(0,S.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};b.ZodNullable=Zt;Zt.create=(t,e)=>new Zt({innerType:t,typeName:se.ZodNullable,...ie(e)});var Jr=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===L.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};b.ZodDefault=Jr;Jr.create=(t,e)=>new Jr({innerType:t,typeName:se.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ie(e)});var Kr=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,S.isAsync)(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new O.ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new O.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};b.ZodCatch=Kr;Kr.create=(t,e)=>new Kr({innerType:t,typeName:se.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ie(e)});var wn=class extends ae{_parse(e){if(this._getType(e)!==L.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:L.ZodParsedType.nan,received:n.parsedType}),S.INVALID}return{status:"valid",value:e.data}}};b.ZodNaN=wn;wn.create=t=>new wn({typeName:se.ZodNaN,...ie(t)});b.BRAND=Symbol("zod_brand");var Vn=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};b.ZodBranded=Vn;var Gn=class t extends ae{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?S.INVALID:i.status==="dirty"?(r.dirty(),(0,S.DIRTY)(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?S.INVALID:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:se.ZodPipeline})}};b.ZodPipeline=Gn;var Qr=class extends ae{_parse(e){let r=this._def.innerType._parse(e),n=s=>((0,S.isValid)(s)&&(s.value=Object.freeze(s.value)),s);return(0,S.isAsync)(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};b.ZodReadonly=Qr;Qr.create=(t,e)=>new Qr({innerType:t,typeName:se.ZodReadonly,...ie(e)});function Gf(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Kf(t,e={},r){return t?br.create().superRefine((n,s)=>{let i=t(n);if(i instanceof Promise)return i.then(o=>{if(!o){let a=Gf(e,n),u=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:u})}});if(!i){let o=Gf(e,n),a=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:a})}}):br.create()}b.late={object:Qe.lazycreate};var se;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(se||(b.ZodFirstPartyTypeKind=se={}));var Sb=(t,e={message:`Input not instance of ${t.name}`})=>Kf(r=>r instanceof t,e);b.instanceof=Sb;var Qf=Er.create;b.string=Qf;var eh=Br.create;b.number=eh;var Cb=wn.create;b.nan=Cb;var wb=Mr.create;b.bigint=wb;var th=qr.create;b.boolean=th;var xb=Wr.create;b.date=xb;var $b=En.create;b.symbol=$b;var kb=Hr.create;b.undefined=kb;var Ab=Zr.create;b.null=Ab;var Fb=br.create;b.any=Fb;var jb=tr.create;b.unknown=jb;var Ib=xt.create;b.never=Ib;var Tb=bn.create;b.void=Tb;var Rb=rr.create;b.array=Rb;var Pb=Qe.create;b.object=Pb;var Ob=Qe.strictCreate;b.strictObject=Ob;var Nb=Ur.create;b.union=Nb;var Lb=ro.create;b.discriminatedUnion=Lb;var Bb=Vr.create;b.intersection=Bb;var Mb=Ht.create;b.tuple=Mb;var qb=no.create;b.record=qb;var Wb=Sn.create;b.map=Wb;var Hb=Cn.create;b.set=Hb;var Zb=so.create;b.function=Zb;var Ub=Gr.create;b.lazy=Ub;var Vb=zr.create;b.literal=Vb;var Gb=Yr.create;b.enum=Gb;var zb=Xr.create;b.nativeEnum=zb;var Yb=Sr.create;b.promise=Yb;var rh=at.create;b.effect=rh;b.transformer=rh;var Xb=ft.create;b.optional=Xb;var Jb=Zt.create;b.nullable=Jb;var Kb=at.createWithPreprocess;b.preprocess=Kb;var Qb=Gn.create;b.pipeline=Qb;var eS=()=>Qf().optional();b.ostring=eS;var tS=()=>eh().optional();b.onumber=tS;var rS=()=>th().optional();b.oboolean=rS;b.coerce={string:(t=>Er.create({...t,coerce:!0})),number:(t=>Br.create({...t,coerce:!0})),boolean:(t=>qr.create({...t,coerce:!0})),bigint:(t=>Mr.create({...t,coerce:!0})),date:(t=>Wr.create({...t,coerce:!0}))};b.NEVER=S.INVALID});var Va=v(pt=>{"use strict";var nS=pt&&pt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xn=pt&&pt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nS(e,t,r)};Object.defineProperty(pt,"__esModule",{value:!0});xn(Qs(),pt);xn(Ha(),pt);xn(Hf(),pt);xn(Zn(),pt);xn(nh(),pt);xn(Ks(),pt)});var Ga=v(et=>{"use strict";var sh=et&&et.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sS=et&&et.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oS=et&&et.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&sh(e,t,r);return sS(e,t),e},iS=et&&et.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sh(e,t,r)};Object.defineProperty(et,"__esModule",{value:!0});et.z=void 0;var oh=oS(Va());et.z=oh;iS(Va(),et);et.default=oh});var zn=v((b2,ih)=>{"use strict";var aS="2.0.0",uS=Number.MAX_SAFE_INTEGER||9007199254740991,cS=16,lS=250,dS=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ih.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:cS,MAX_SAFE_BUILD_LENGTH:lS,MAX_SAFE_INTEGER:uS,RELEASE_TYPES:dS,SEMVER_SPEC_VERSION:aS,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Yn=v((S2,ah)=>{"use strict";var fS=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};ah.exports=fS});var $n=v((Ut,uh)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:za,MAX_SAFE_BUILD_LENGTH:hS,MAX_LENGTH:pS}=zn(),mS=Yn();Ut=uh.exports={};var gS=Ut.re=[],DS=Ut.safeRe=[],U=Ut.src=[],yS=Ut.safeSrc=[],V=Ut.t={},vS=0,Ya="[a-zA-Z0-9-]",_S=[["\\s",1],["\\d",pS],[Ya,hS]],ES=t=>{for(let[e,r]of _S)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},oe=(t,e,r)=>{let n=ES(e),s=vS++;mS(t,s,e),V[t]=s,U[s]=e,yS[s]=n,gS[s]=new RegExp(e,r?"g":void 0),DS[s]=new RegExp(n,r?"g":void 0)};oe("NUMERICIDENTIFIER","0|[1-9]\\d*");oe("NUMERICIDENTIFIERLOOSE","\\d+");oe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ya}*`);oe("MAINVERSION",`(${U[V.NUMERICIDENTIFIER]})\\.(${U[V.NUMERICIDENTIFIER]})\\.(${U[V.NUMERICIDENTIFIER]})`);oe("MAINVERSIONLOOSE",`(${U[V.NUMERICIDENTIFIERLOOSE]})\\.(${U[V.NUMERICIDENTIFIERLOOSE]})\\.(${U[V.NUMERICIDENTIFIERLOOSE]})`);oe("PRERELEASEIDENTIFIER",`(?:${U[V.NONNUMERICIDENTIFIER]}|${U[V.NUMERICIDENTIFIER]})`);oe("PRERELEASEIDENTIFIERLOOSE",`(?:${U[V.NONNUMERICIDENTIFIER]}|${U[V.NUMERICIDENTIFIERLOOSE]})`);oe("PRERELEASE",`(?:-(${U[V.PRERELEASEIDENTIFIER]}(?:\\.${U[V.PRERELEASEIDENTIFIER]})*))`);oe("PRERELEASELOOSE",`(?:-?(${U[V.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${U[V.PRERELEASEIDENTIFIERLOOSE]})*))`);oe("BUILDIDENTIFIER",`${Ya}+`);oe("BUILD",`(?:\\+(${U[V.BUILDIDENTIFIER]}(?:\\.${U[V.BUILDIDENTIFIER]})*))`);oe("FULLPLAIN",`v?${U[V.MAINVERSION]}${U[V.PRERELEASE]}?${U[V.BUILD]}?`);oe("FULL",`^${U[V.FULLPLAIN]}$`);oe("LOOSEPLAIN",`[v=\\s]*${U[V.MAINVERSIONLOOSE]}${U[V.PRERELEASELOOSE]}?${U[V.BUILD]}?`);oe("LOOSE",`^${U[V.LOOSEPLAIN]}$`);oe("GTLT","((?:<|>)?=?)");oe("XRANGEIDENTIFIERLOOSE",`${U[V.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);oe("XRANGEIDENTIFIER",`${U[V.NUMERICIDENTIFIER]}|x|X|\\*`);oe("XRANGEPLAIN",`[v=\\s]*(${U[V.XRANGEIDENTIFIER]})(?:\\.(${U[V.XRANGEIDENTIFIER]})(?:\\.(${U[V.XRANGEIDENTIFIER]})(?:${U[V.PRERELEASE]})?${U[V.BUILD]}?)?)?`);oe("XRANGEPLAINLOOSE",`[v=\\s]*(${U[V.XRANGEIDENTIFIERLOOSE]})(?:\\.(${U[V.XRANGEIDENTIFIERLOOSE]})(?:\\.(${U[V.XRANGEIDENTIFIERLOOSE]})(?:${U[V.PRERELEASELOOSE]})?${U[V.BUILD]}?)?)?`);oe("XRANGE",`^${U[V.GTLT]}\\s*${U[V.XRANGEPLAIN]}$`);oe("XRANGELOOSE",`^${U[V.GTLT]}\\s*${U[V.XRANGEPLAINLOOSE]}$`);oe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${za}})(?:\\.(\\d{1,${za}}))?(?:\\.(\\d{1,${za}}))?`);oe("COERCE",`${U[V.COERCEPLAIN]}(?:$|[^\\d])`);oe("COERCEFULL",U[V.COERCEPLAIN]+`(?:${U[V.PRERELEASE]})?(?:${U[V.BUILD]})?(?:$|[^\\d])`);oe("COERCERTL",U[V.COERCE],!0);oe("COERCERTLFULL",U[V.COERCEFULL],!0);oe("LONETILDE","(?:~>?)");oe("TILDETRIM",`(\\s*)${U[V.LONETILDE]}\\s+`,!0);Ut.tildeTrimReplace="$1~";oe("TILDE",`^${U[V.LONETILDE]}${U[V.XRANGEPLAIN]}$`);oe("TILDELOOSE",`^${U[V.LONETILDE]}${U[V.XRANGEPLAINLOOSE]}$`);oe("LONECARET","(?:\\^)");oe("CARETTRIM",`(\\s*)${U[V.LONECARET]}\\s+`,!0);Ut.caretTrimReplace="$1^";oe("CARET",`^${U[V.LONECARET]}${U[V.XRANGEPLAIN]}$`);oe("CARETLOOSE",`^${U[V.LONECARET]}${U[V.XRANGEPLAINLOOSE]}$`);oe("COMPARATORLOOSE",`^${U[V.GTLT]}\\s*(${U[V.LOOSEPLAIN]})$|^$`);oe("COMPARATOR",`^${U[V.GTLT]}\\s*(${U[V.FULLPLAIN]})$|^$`);oe("COMPARATORTRIM",`(\\s*)${U[V.GTLT]}\\s*(${U[V.LOOSEPLAIN]}|${U[V.XRANGEPLAIN]})`,!0);Ut.comparatorTrimReplace="$1$2$3";oe("HYPHENRANGE",`^\\s*(${U[V.XRANGEPLAIN]})\\s+-\\s+(${U[V.XRANGEPLAIN]})\\s*$`);oe("HYPHENRANGELOOSE",`^\\s*(${U[V.XRANGEPLAINLOOSE]})\\s+-\\s+(${U[V.XRANGEPLAINLOOSE]})\\s*$`);oe("STAR","(<|>)?=?\\s*\\*");oe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");oe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var oo=v((C2,ch)=>{"use strict";var bS=Object.freeze({loose:!0}),SS=Object.freeze({}),CS=t=>t?typeof t!="object"?bS:t:SS;ch.exports=CS});var Xa=v((w2,fh)=>{"use strict";var lh=/^[0-9]+$/,dh=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=lh.test(t),n=lh.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},wS=(t,e)=>dh(e,t);fh.exports={compareIdentifiers:dh,rcompareIdentifiers:wS}});var Be=v((x2,ph)=>{"use strict";var io=Yn(),{MAX_LENGTH:hh,MAX_SAFE_INTEGER:ao}=zn(),{safeRe:uo,t:co}=$n(),xS=oo(),{compareIdentifiers:Ja}=Xa(),Ka=class t{constructor(e,r){if(r=xS(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>hh)throw new TypeError(`version is longer than ${hh} characters`);io("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?uo[co.LOOSE]:uo[co.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ao||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ao||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ao||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let i=+s;if(i>=0&&i<ao)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(io("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=e.prerelease[r];if(io("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Ja(n,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],s=e.build[r];if(io("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Ja(n,s)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?uo[co.PRERELEASELOOSE]:uo[co.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),Ja(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};ph.exports=Ka});var en=v(($2,gh)=>{"use strict";var mh=Be(),$S=(t,e,r=!1)=>{if(t instanceof mh)return t;try{return new mh(t,e)}catch(n){if(!r)return null;throw n}};gh.exports=$S});var yh=v((k2,Dh)=>{"use strict";var kS=en(),AS=(t,e)=>{let r=kS(t,e);return r?r.version:null};Dh.exports=AS});var _h=v((A2,vh)=>{"use strict";var FS=en(),jS=(t,e)=>{let r=FS(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};vh.exports=jS});var Sh=v((F2,bh)=>{"use strict";var Eh=Be(),IS=(t,e,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Eh(t instanceof Eh?t.version:t,r).inc(e,n,s).version}catch{return null}};bh.exports=IS});var xh=v((j2,wh)=>{"use strict";var Ch=en(),TS=(t,e)=>{let r=Ch(t,null,!0),n=Ch(e,null,!0),s=r.compare(n);if(s===0)return null;let i=s>0,o=i?r:n,a=i?n:r,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};wh.exports=TS});var kh=v((I2,$h)=>{"use strict";var RS=Be(),PS=(t,e)=>new RS(t,e).major;$h.exports=PS});var Fh=v((T2,Ah)=>{"use strict";var OS=Be(),NS=(t,e)=>new OS(t,e).minor;Ah.exports=NS});var Ih=v((R2,jh)=>{"use strict";var LS=Be(),BS=(t,e)=>new LS(t,e).patch;jh.exports=BS});var Rh=v((P2,Th)=>{"use strict";var MS=en(),qS=(t,e)=>{let r=MS(t,e);return r&&r.prerelease.length?r.prerelease:null};Th.exports=qS});var mt=v((O2,Oh)=>{"use strict";var Ph=Be(),WS=(t,e,r)=>new Ph(t,r).compare(new Ph(e,r));Oh.exports=WS});var Lh=v((N2,Nh)=>{"use strict";var HS=mt(),ZS=(t,e,r)=>HS(e,t,r);Nh.exports=ZS});var Mh=v((L2,Bh)=>{"use strict";var US=mt(),VS=(t,e)=>US(t,e,!0);Bh.exports=VS});var lo=v((B2,Wh)=>{"use strict";var qh=Be(),GS=(t,e,r)=>{let n=new qh(t,r),s=new qh(e,r);return n.compare(s)||n.compareBuild(s)};Wh.exports=GS});var Zh=v((M2,Hh)=>{"use strict";var zS=lo(),YS=(t,e)=>t.sort((r,n)=>zS(r,n,e));Hh.exports=YS});var Vh=v((q2,Uh)=>{"use strict";var XS=lo(),JS=(t,e)=>t.sort((r,n)=>XS(n,r,e));Uh.exports=JS});var Xn=v((W2,Gh)=>{"use strict";var KS=mt(),QS=(t,e,r)=>KS(t,e,r)>0;Gh.exports=QS});var fo=v((H2,zh)=>{"use strict";var eC=mt(),tC=(t,e,r)=>eC(t,e,r)<0;zh.exports=tC});var Qa=v((Z2,Yh)=>{"use strict";var rC=mt(),nC=(t,e,r)=>rC(t,e,r)===0;Yh.exports=nC});var eu=v((U2,Xh)=>{"use strict";var sC=mt(),oC=(t,e,r)=>sC(t,e,r)!==0;Xh.exports=oC});var ho=v((V2,Jh)=>{"use strict";var iC=mt(),aC=(t,e,r)=>iC(t,e,r)>=0;Jh.exports=aC});var po=v((G2,Kh)=>{"use strict";var uC=mt(),cC=(t,e,r)=>uC(t,e,r)<=0;Kh.exports=cC});var tu=v((z2,Qh)=>{"use strict";var lC=Qa(),dC=eu(),fC=Xn(),hC=ho(),pC=fo(),mC=po(),gC=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return lC(t,r,n);case"!=":return dC(t,r,n);case">":return fC(t,r,n);case">=":return hC(t,r,n);case"<":return pC(t,r,n);case"<=":return mC(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Qh.exports=gC});var tp=v((Y2,ep)=>{"use strict";var DC=Be(),yC=en(),{safeRe:mo,t:go}=$n(),vC=(t,e)=>{if(t instanceof DC)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?mo[go.COERCEFULL]:mo[go.COERCE]);else{let u=e.includePrerelease?mo[go.COERCERTLFULL]:mo[go.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",i=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return yC(`${n}.${s}.${i}${o}${a}`,e)};ep.exports=vC});var np=v((X2,rp)=>{"use strict";var ru=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,r)}return this}};rp.exports=ru});var gt=v((J2,ap)=>{"use strict";var _C=/\s+/g,nu=class t{constructor(e,r){if(r=bC(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof su)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(_C," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!op(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&AC(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&$C)|(this.options.loose&&kC))+":"+e,s=sp.get(n);if(s)return s;let i=this.options.loose,o=i?Ue[Me.HYPHENRANGELOOSE]:Ue[Me.HYPHENRANGE];e=e.replace(o,BC(this.options.includePrerelease)),Ce("hyphen replace",e),e=e.replace(Ue[Me.COMPARATORTRIM],CC),Ce("comparator trim",e),e=e.replace(Ue[Me.TILDETRIM],wC),Ce("tilde trim",e),e=e.replace(Ue[Me.CARETTRIM],xC),Ce("caret trim",e);let a=e.split(" ").map(d=>FC(d,this.options)).join(" ").split(/\s+/).map(d=>LC(d,this.options));i&&(a=a.filter(d=>(Ce("loose invalid filter",d,this.options),!!d.match(Ue[Me.COMPARATORLOOSE])))),Ce("range list",a);let u=new Map,c=a.map(d=>new su(d,this.options));for(let d of c){if(op(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return sp.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>ip(n,r)&&e.set.some(s=>ip(s,r)&&n.every(i=>s.every(o=>i.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new SC(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(MC(this.set[r],e,this.options))return!0;return!1}};ap.exports=nu;var EC=np(),sp=new EC,bC=oo(),su=Jn(),Ce=Yn(),SC=Be(),{safeRe:Ue,t:Me,comparatorTrimReplace:CC,tildeTrimReplace:wC,caretTrimReplace:xC}=$n(),{FLAG_INCLUDE_PRERELEASE:$C,FLAG_LOOSE:kC}=zn(),op=t=>t.value==="<0.0.0-0",AC=t=>t.value==="",ip=(t,e)=>{let r=!0,n=t.slice(),s=n.pop();for(;r&&n.length;)r=n.every(i=>s.intersects(i,e)),s=n.pop();return r},FC=(t,e)=>(t=t.replace(Ue[Me.BUILD],""),Ce("comp",t,e),t=TC(t,e),Ce("caret",t),t=jC(t,e),Ce("tildes",t),t=PC(t,e),Ce("xrange",t),t=NC(t,e),Ce("stars",t),t),Ve=t=>!t||t.toLowerCase()==="x"||t==="*",jC=(t,e)=>t.trim().split(/\s+/).map(r=>IC(r,e)).join(" "),IC=(t,e)=>{let r=e.loose?Ue[Me.TILDELOOSE]:Ue[Me.TILDE];return t.replace(r,(n,s,i,o,a)=>{Ce("tilde",t,n,s,i,o,a);let u;return Ve(s)?u="":Ve(i)?u=`>=${s}.0.0 <${+s+1}.0.0-0`:Ve(o)?u=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:a?(Ce("replaceTilde pr",a),u=`>=${s}.${i}.${o}-${a} <${s}.${+i+1}.0-0`):u=`>=${s}.${i}.${o} <${s}.${+i+1}.0-0`,Ce("tilde return",u),u})},TC=(t,e)=>t.trim().split(/\s+/).map(r=>RC(r,e)).join(" "),RC=(t,e)=>{Ce("caret",t,e);let r=e.loose?Ue[Me.CARETLOOSE]:Ue[Me.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(s,i,o,a,u)=>{Ce("caret",t,s,i,o,a,u);let c;return Ve(i)?c="":Ve(o)?c=`>=${i}.0.0${n} <${+i+1}.0.0-0`:Ve(a)?i==="0"?c=`>=${i}.${o}.0${n} <${i}.${+o+1}.0-0`:c=`>=${i}.${o}.0${n} <${+i+1}.0.0-0`:u?(Ce("replaceCaret pr",u),i==="0"?o==="0"?c=`>=${i}.${o}.${a}-${u} <${i}.${o}.${+a+1}-0`:c=`>=${i}.${o}.${a}-${u} <${i}.${+o+1}.0-0`:c=`>=${i}.${o}.${a}-${u} <${+i+1}.0.0-0`):(Ce("no pr"),i==="0"?o==="0"?c=`>=${i}.${o}.${a}${n} <${i}.${o}.${+a+1}-0`:c=`>=${i}.${o}.${a}${n} <${i}.${+o+1}.0-0`:c=`>=${i}.${o}.${a} <${+i+1}.0.0-0`),Ce("caret return",c),c})},PC=(t,e)=>(Ce("replaceXRanges",t,e),t.split(/\s+/).map(r=>OC(r,e)).join(" ")),OC=(t,e)=>{t=t.trim();let r=e.loose?Ue[Me.XRANGELOOSE]:Ue[Me.XRANGE];return t.replace(r,(n,s,i,o,a,u)=>{Ce("xRange",t,n,s,i,o,a,u);let c=Ve(i),l=c||Ve(o),d=l||Ve(a),f=d;return s==="="&&f&&(s=""),u=e.includePrerelease?"-0":"",c?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&f?(l&&(o=0),a=0,s===">"?(s=">=",l?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):s==="<="&&(s="<",l?i=+i+1:o=+o+1),s==="<"&&(u="-0"),n=`${s+i}.${o}.${a}${u}`):l?n=`>=${i}.0.0${u} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${o}.0${u} <${i}.${+o+1}.0-0`),Ce("xRange return",n),n})},NC=(t,e)=>(Ce("replaceStars",t,e),t.trim().replace(Ue[Me.STAR],"")),LC=(t,e)=>(Ce("replaceGTE0",t,e),t.trim().replace(Ue[e.includePrerelease?Me.GTE0PRE:Me.GTE0],"")),BC=t=>(e,r,n,s,i,o,a,u,c,l,d,f)=>(Ve(n)?r="":Ve(s)?r=`>=${n}.0.0${t?"-0":""}`:Ve(i)?r=`>=${n}.${s}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ve(c)?u="":Ve(l)?u=`<${+c+1}.0.0-0`:Ve(d)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${d}-${f}`:t?u=`<${c}.${l}.${+d+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),MC=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Ce(t[n].semver),t[n].semver!==su.ANY&&t[n].semver.prerelease.length>0){let s=t[n].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var Jn=v((K2,hp)=>{"use strict";var Kn=Symbol("SemVer ANY"),au=class t{static get ANY(){return Kn}constructor(e,r){if(r=up(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),iu("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Kn?this.value="":this.value=this.operator+this.semver.version,iu("comp",this)}parse(e){let r=this.options.loose?cp[lp.COMPARATORLOOSE]:cp[lp.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new dp(n[2],this.options.loose):this.semver=Kn}toString(){return this.value}test(e){if(iu("Comparator.test",e,this.options.loose),this.semver===Kn||e===Kn)return!0;if(typeof e=="string")try{e=new dp(e,this.options)}catch{return!1}return ou(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new fp(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new fp(this.value,r).test(e.semver):(r=up(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||ou(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||ou(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};hp.exports=au;var up=oo(),{safeRe:cp,t:lp}=$n(),ou=tu(),iu=Yn(),dp=Be(),fp=gt()});var Qn=v((Q2,pp)=>{"use strict";var qC=gt(),WC=(t,e,r)=>{try{e=new qC(e,r)}catch{return!1}return e.test(t)};pp.exports=WC});var gp=v((eI,mp)=>{"use strict";var HC=gt(),ZC=(t,e)=>new HC(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));mp.exports=ZC});var yp=v((tI,Dp)=>{"use strict";var UC=Be(),VC=gt(),GC=(t,e,r)=>{let n=null,s=null,i=null;try{i=new VC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new UC(n,r))}),n};Dp.exports=GC});var _p=v((rI,vp)=>{"use strict";var zC=Be(),YC=gt(),XC=(t,e,r)=>{let n=null,s=null,i=null;try{i=new YC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new zC(n,r))}),n};vp.exports=XC});var Sp=v((nI,bp)=>{"use strict";var uu=Be(),JC=gt(),Ep=Xn(),KC=(t,e)=>{t=new JC(t,e);let r=new uu("0.0.0");if(t.test(r)||(r=new uu("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let s=t.set[n],i=null;s.forEach(o=>{let a=new uu(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||Ep(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||Ep(r,i))&&(r=i)}return r&&t.test(r)?r:null};bp.exports=KC});var wp=v((sI,Cp)=>{"use strict";var QC=gt(),ew=(t,e)=>{try{return new QC(t,e).range||"*"}catch{return null}};Cp.exports=ew});var Do=v((oI,Ap)=>{"use strict";var tw=Be(),kp=Jn(),{ANY:rw}=kp,nw=gt(),sw=Qn(),xp=Xn(),$p=fo(),ow=po(),iw=ho(),aw=(t,e,r,n)=>{t=new tw(t,n),e=new nw(e,n);let s,i,o,a,u;switch(r){case">":s=xp,i=ow,o=$p,a=">",u=">=";break;case"<":s=$p,i=iw,o=xp,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(sw(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],d=null,f=null;if(l.forEach(g=>{g.semver===rw&&(g=new kp(">=0.0.0")),d=d||g,f=f||g,s(g.semver,d.semver,n)?d=g:o(g.semver,f.semver,n)&&(f=g)}),d.operator===a||d.operator===u||(!f.operator||f.operator===a)&&i(t,f.semver))return!1;if(f.operator===u&&o(t,f.semver))return!1}return!0};Ap.exports=aw});var jp=v((iI,Fp)=>{"use strict";var uw=Do(),cw=(t,e,r)=>uw(t,e,">",r);Fp.exports=cw});var Tp=v((aI,Ip)=>{"use strict";var lw=Do(),dw=(t,e,r)=>lw(t,e,"<",r);Ip.exports=dw});var Op=v((uI,Pp)=>{"use strict";var Rp=gt(),fw=(t,e,r)=>(t=new Rp(t,r),e=new Rp(e,r),t.intersects(e,r));Pp.exports=fw});var Lp=v((cI,Np)=>{"use strict";var hw=Qn(),pw=mt();Np.exports=(t,e,r)=>{let n=[],s=null,i=null,o=t.sort((l,d)=>pw(l,d,r));for(let l of o)hw(l,e,r)?(i=l,s||(s=l)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);let a=[];for(let[l,d]of n)l===d?a.push(l):!d&&l===o[0]?a.push("*"):d?l===o[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var Zp=v((lI,Hp)=>{"use strict";var Bp=gt(),lu=Jn(),{ANY:cu}=lu,es=Qn(),du=mt(),mw=(t,e,r={})=>{if(t===e)return!0;t=new Bp(t,r),e=new Bp(e,r);let n=!1;e:for(let s of t.set){for(let i of e.set){let o=Dw(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},gw=[new lu(">=0.0.0-0")],Mp=[new lu(">=0.0.0")],Dw=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===cu){if(e.length===1&&e[0].semver===cu)return!0;r.includePrerelease?t=gw:t=Mp}if(e.length===1&&e[0].semver===cu){if(r.includePrerelease)return!0;e=Mp}let n=new Set,s,i;for(let g of t)g.operator===">"||g.operator===">="?s=qp(s,g,r):g.operator==="<"||g.operator==="<="?i=Wp(i,g,r):n.add(g.semver);if(n.size>1)return null;let o;if(s&&i){if(o=du(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let g of n){if(s&&!es(g,String(s),r)||i&&!es(g,String(i),r))return null;for(let m of e)if(!es(g,String(m),r))return!1;return!0}let a,u,c,l,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;d&&d.prerelease.length===1&&i.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let g of e){if(l=l||g.operator===">"||g.operator===">=",c=c||g.operator==="<"||g.operator==="<=",s){if(f&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===f.major&&g.semver.minor===f.minor&&g.semver.patch===f.patch&&(f=!1),g.operator===">"||g.operator===">="){if(a=qp(s,g,r),a===g&&a!==s)return!1}else if(s.operator===">="&&!es(s.semver,String(g),r))return!1}if(i){if(d&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===d.major&&g.semver.minor===d.minor&&g.semver.patch===d.patch&&(d=!1),g.operator==="<"||g.operator==="<="){if(u=Wp(i,g,r),u===g&&u!==i)return!1}else if(i.operator==="<="&&!es(i.semver,String(g),r))return!1}if(!g.operator&&(i||s)&&o!==0)return!1}return!(s&&c&&!i&&o!==0||i&&l&&!s&&o!==0||f||d)},qp=(t,e,r)=>{if(!t)return e;let n=du(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Wp=(t,e,r)=>{if(!t)return e;let n=du(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Hp.exports=mw});var zp=v((dI,Gp)=>{"use strict";var fu=$n(),Up=zn(),yw=Be(),Vp=Xa(),vw=en(),_w=yh(),Ew=_h(),bw=Sh(),Sw=xh(),Cw=kh(),ww=Fh(),xw=Ih(),$w=Rh(),kw=mt(),Aw=Lh(),Fw=Mh(),jw=lo(),Iw=Zh(),Tw=Vh(),Rw=Xn(),Pw=fo(),Ow=Qa(),Nw=eu(),Lw=ho(),Bw=po(),Mw=tu(),qw=tp(),Ww=Jn(),Hw=gt(),Zw=Qn(),Uw=gp(),Vw=yp(),Gw=_p(),zw=Sp(),Yw=wp(),Xw=Do(),Jw=jp(),Kw=Tp(),Qw=Op(),ex=Lp(),tx=Zp();Gp.exports={parse:vw,valid:_w,clean:Ew,inc:bw,diff:Sw,major:Cw,minor:ww,patch:xw,prerelease:$w,compare:kw,rcompare:Aw,compareLoose:Fw,compareBuild:jw,sort:Iw,rsort:Tw,gt:Rw,lt:Pw,eq:Ow,neq:Nw,gte:Lw,lte:Bw,cmp:Mw,coerce:qw,Comparator:Ww,Range:Hw,satisfies:Zw,toComparators:Uw,maxSatisfying:Vw,minSatisfying:Gw,minVersion:zw,validRange:Yw,outside:Xw,gtr:Jw,ltr:Kw,intersects:Qw,simplifyRange:ex,subset:tx,SemVer:yw,re:fu.re,src:fu.src,tokens:fu.t,SEMVER_SPEC_VERSION:Up.SEMVER_SPEC_VERSION,RELEASE_TYPES:Up.RELEASE_TYPES,compareIdentifiers:Vp.compareIdentifiers,rcompareIdentifiers:Vp.rcompareIdentifiers}});var nr=v(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});var rx=(function(){function t(){}return t.prototype.diff=function(e,r,n){n===void 0&&(n={});var s;typeof n=="function"?(s=n,n={}):"callback"in n&&(s=n.callback);var i=this.castInput(e,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(i,n)),u=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,u,n,s)},t.prototype.diffWithOptionsObj=function(e,r,n,s){var i=this,o,a=function(T){if(T=i.postProcess(T,n),s){setTimeout(function(){s(T)},0);return}else return T},u=r.length,c=e.length,l=1,d=u+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));var f=(o=n.timeout)!==null&&o!==void 0?o:1/0,g=Date.now()+f,m=[{oldPos:-1,lastComponent:void 0}],D=this.extractCommon(m[0],r,e,0,n);if(m[0].oldPos+1>=c&&D+1>=u)return a(this.buildValues(m[0].lastComponent,r,e));var h=-1/0,w=1/0,C=function(){for(var T=Math.max(h,-l);T<=Math.min(w,l);T+=2){var G=void 0,I=m[T-1],Z=m[T+1];I&&(m[T-1]=void 0);var F=!1;if(Z){var W=Z.oldPos-T;F=Z&&0<=W&&W<u}var P=I&&I.oldPos+1<c;if(!F&&!P){m[T]=void 0;continue}if(!P||F&&I.oldPos<Z.oldPos?G=i.addToPath(Z,!0,!1,0,n):G=i.addToPath(I,!1,!0,1,n),D=i.extractCommon(G,r,e,T,n),G.oldPos+1>=c&&D+1>=u)return a(i.buildValues(G.lastComponent,r,e))||!0;m[T]=G,G.oldPos+1>=c&&(w=Math.min(w,T-1)),D+1>=u&&(h=Math.max(h,T+1))}l++};if(s)(function T(){setTimeout(function(){if(l>d||Date.now()>g)return s(void 0);C()||T()},0)})();else for(;l<=d&&Date.now()<=g;){var A=C();if(A)return A}},t.prototype.addToPath=function(e,r,n,s,i){var o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:e.oldPos+s,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}},t.prototype.extractCommon=function(e,r,n,s,i){for(var o=r.length,a=n.length,u=e.oldPos,c=u-s,l=0;c+1<o&&u+1<a&&this.equals(n[u+1],r[c+1],i);)c++,u++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=u,c},t.prototype.equals=function(e,r,n){return n.comparator?n.comparator(e,r):e===r||!!n.ignoreCase&&e.toLowerCase()===r.toLowerCase()},t.prototype.removeEmpty=function(e){for(var r=[],n=0;n<e.length;n++)e[n]&&r.push(e[n]);return r},t.prototype.castInput=function(e,r){return e},t.prototype.tokenize=function(e,r){return Array.from(e)},t.prototype.join=function(e){return e.join("")},t.prototype.postProcess=function(e,r){return e},Object.defineProperty(t.prototype,"useLongestToken",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.buildValues=function(e,r,n){for(var s=[],i;e;)s.push(e),i=e.previousComponent,delete e.previousComponent,e=i;s.reverse();for(var o=s.length,a=0,u=0,c=0;a<o;a++){var l=s[a];if(l.removed)l.value=this.join(n.slice(c,c+l.count)),c+=l.count;else{if(!l.added&&this.useLongestToken){var d=r.slice(u,u+l.count);d=d.map(function(f,g){var m=n[c+g];return m.length>f.length?m:f}),l.value=this.join(d)}else l.value=this.join(r.slice(u,u+l.count));u+=l.count,l.added||(c+=l.count)}}return s},t})();hu.default=rx});var Yp=v(Cr=>{"use strict";var nx=Cr&&Cr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Cr,"__esModule",{value:!0});Cr.characterDiff=void 0;Cr.diffChars=ix;var sx=nr(),ox=(function(t){nx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(sx.default);Cr.characterDiff=new ox;function ix(t,e,r){return Cr.characterDiff.diff(t,e,r)}});var mu=v(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.longestCommonPrefix=ax;Ge.longestCommonSuffix=ux;Ge.replacePrefix=Xp;Ge.replaceSuffix=Jp;Ge.removePrefix=cx;Ge.removeSuffix=lx;Ge.maximumOverlap=dx;Ge.hasOnlyWinLineEndings=hx;Ge.hasOnlyUnixLineEndings=px;Ge.segment=Kp;Ge.trailingWs=Qp;Ge.leadingWs=em;Ge.leadingAndTrailingWs=pu;function ax(t,e){var r;for(r=0;r<t.length&&r<e.length;r++)if(t[r]!=e[r])return t.slice(0,r);return t.slice(0,r)}function ux(t,e){var r;if(!t||!e||t[t.length-1]!=e[e.length-1])return"";for(r=0;r<t.length&&r<e.length;r++)if(t[t.length-(r+1)]!=e[e.length-(r+1)])return t.slice(-r);return t.slice(-r)}function Xp(t,e,r){if(t.slice(0,e.length)!=e)throw Error("string ".concat(JSON.stringify(t)," doesn't start with prefix ").concat(JSON.stringify(e),"; this is a bug"));return r+t.slice(e.length)}function Jp(t,e,r){if(!e)return t+r;if(t.slice(-e.length)!=e)throw Error("string ".concat(JSON.stringify(t)," doesn't end with suffix ").concat(JSON.stringify(e),"; this is a bug"));return t.slice(0,-e.length)+r}function cx(t,e){return Xp(t,e,"")}function lx(t,e){return Jp(t,e,"")}function dx(t,e){return e.slice(0,fx(t,e))}function fx(t,e){var r=0;t.length>e.length&&(r=t.length-e.length);var n=e.length;t.length<e.length&&(n=t.length);var s=Array(n),i=0;s[0]=0;for(var o=1;o<n;o++){for(e[o]==e[i]?s[o]=s[i]:s[o]=i;i>0&&e[o]!=e[i];)i=s[i];e[o]==e[i]&&i++}i=0;for(var a=r;a<t.length;a++){for(;i>0&&t[a]!=e[i];)i=s[i];t[a]==e[i]&&i++}return i}function hx(t){return t.includes(`\r
3
+ var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Qt=v((zF,Nu)=>{var yy=require("crypto"),at=require("fs"),pn=require("path");function Ou(t,e,r={}){let{encoding:n="utf8",mode:s}=r,i=pn.dirname(t);at.mkdirSync(i,{recursive:!0});let o=pn.join(i,`.${pn.basename(t)}.tmp-${process.pid}-${yy.randomBytes(8).toString("hex")}`),a;try{a=at.openSync(o,"wx",s??420),at.writeSync(a,e,0,n),at.fsyncSync(a),at.closeSync(a),a=null,at.renameSync(o,t)}catch(c){if(a!=null)try{at.closeSync(a)}catch{}try{at.unlinkSync(o)}catch{}throw c}}function vy(t,e,r={}){let n=JSON.stringify(e,null,2)+`
4
+ `;Ou(t,n,r)}function _y(t,e){let r;try{r=at.lstatSync(t)}catch(o){return o.code==="ENOENT"?{ok:!0,reason:"missing"}:{ok:!1,reason:`lstat: ${o.message}`}}if(r.isSymbolicLink())try{return at.unlinkSync(t),{ok:!0,reason:"symlink-unlinked"}}catch(o){return{ok:!1,reason:`unlink: ${o.message}`}}let n;try{n=at.realpathSync(e)}catch{n=pn.resolve(e)}let s;try{s=at.realpathSync(t)}catch(o){return{ok:!1,reason:`realpath: ${o.message}`}}let i=pn.relative(n,s);if(i.startsWith("..")||pn.isAbsolute(i))return{ok:!1,reason:"outside-root"};try{return at.rmSync(s,{recursive:!0,force:!0}),{ok:!0}}catch(o){return{ok:!1,reason:`rmSync: ${o.message}`}}}Nu.exports={writeFileAtomic:Ou,writeJsonAtomic:vy,safeRmSync:_y}});var hr=v((YF,Lu)=>{"use strict";var by=require("os");function Sy(){return process.env.HOME||by.homedir()}Lu.exports={homedir:Sy}});var Nn=v((JF,ri)=>{var ws=process||{},Bu=ws.argv||[],Cs=ws.env||{},Ey=!(Cs.NO_COLOR||Bu.includes("--no-color"))&&(!!Cs.FORCE_COLOR||Bu.includes("--color")||ws.platform==="win32"||(ws.stdout||{}).isTTY&&Cs.TERM!=="dumb"||!!Cs.CI),Cy=(t,e,r=t)=>n=>{let s=""+n,i=s.indexOf(e,t.length);return~i?t+wy(s,e,r,i)+e:t+s+e},wy=(t,e,r,n)=>{let s="",i=0;do s+=t.substring(i,n)+r,i=n+e.length,n=t.indexOf(e,i);while(~n);return s+t.substring(i)},Mu=(t=Ey)=>{let e=t?Cy:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};ri.exports=Mu();ri.exports.createColors=Mu});var Hu=v(pr=>{"use strict";var qu=pr&&pr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pr,"__esModule",{value:!0});pr.symbols=pr.isTTY=void 0;var xy=qu(require("node:tty")),Bt=qu(require("node:process")),ky=Bt.default.env.CI||Bt.default.env.WT_SESSION||Bt.default.env.ConEmuTask==="{cmd::Cmder}"||Bt.default.env.TERM_PROGRAM==="vscode"||Bt.default.env.TERM==="xterm-256color"||Bt.default.env.TERM==="alacritty",Wu=xy.default.isatty(1)&&Bt.default.env.TERM!=="dumb"&&!("CI"in Bt.default.env);pr.isTTY=Wu;var Ln=Bt.default.platform!=="win32"?Bt.default.env.TERM!=="linux":ky,$y={frames:Wu?Ln?["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]:["-","\\","|","/"]:["-"],tick:Ln?"\u2714":"\u221A",cross:Ln?"\u2716":"\xD7",warn:Ln?"\u26A0":"!!",info:Ln?"\u2139":"i"};pr.symbols=$y});var Uu=v(Bn=>{"use strict";var Ay=Bn&&Bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.createSpinner=jy;var Zu=Ay(Nn()),Mt=Hu();function Fy(t="",e=80){return t.replace(/\u001b[^m]*?m/g,"").split(`
5
+ `).reduce((r,n)=>r+=Math.max(1,Math.ceil(n.length/e)),0)}function jy(t="",e={}){let r=0,n=e.interval||50,s=e.stream||process.stderr,i=e.frames&&e.frames.length?e.frames:Mt.symbols.frames,o=e.color||"yellow",a=!1,c=0,u,l=(C={})=>typeof C=="string"?C:C.text||t,d=(C={})=>typeof C=="string"?!1:!!C.update,f=(C={})=>typeof C=="string"||!C.color?o:C.color,g=(C={},A)=>typeof C=="string"||!C.mark?A:C.mark,m=()=>{process.on("SIGINT",w),process.on("SIGTERM",w)},y=()=>{process.off("SIGINT",w),process.off("SIGTERM",w)},h={reset(){return r=0,c=0,a=!1,clearTimeout(u),u=void 0,h},clear(){h.write("\x1B[1G");for(let C=0;C<c;C++)C>0&&h.write("\x1B[1A"),h.write("\x1B[2K\x1B[1G");return c=0,h},write(C,A=!1){return A&&Mt.isTTY&&h.clear(),s.write(C),h},render(){let C=`${Zu.default[o](i[r])} ${t}`;return Mt.isTTY?h.write("\x1B[?25l"):C+=`
6
+ `,h.write(C,!0),Mt.isTTY&&(c=Fy(C,s.columns)),h},spin(){return h.render(),r=++r%i.length,h},update(C){return typeof C=="string"?t=C:(t=C.text||t,i=C.frames&&C.frames.length?C.frames:i,n=C.interval||n,o=C.color||o),i.length-1<r&&(r=0),h},loop(){return Mt.isTTY&&(u=setTimeout(()=>h.loop(),n)),h.spin()},start(C={}){return u&&h.reset(),a=!0,m(),h.update({text:l(C),color:f(C)}).loop()},stop(C){a=!1,clearTimeout(u),u=void 0,y();let A=d(C),T=Zu.default[f(C)](g(C,i[r])),G=l(C);return h.write(C?`${T} ${G}${A?"":`
7
+ `}`:"",!0),Mt.isTTY&&!A?h.write("\x1B[?25h"):h},success(C={}){return h.stop({text:l(C),mark:g(C,Mt.symbols.tick),color:"green",update:d(C)})},error(C={}){return h.stop({text:l(C),mark:g(C,Mt.symbols.cross),color:"red",update:d(C)})},warn(C={}){return h.stop({text:l(C),mark:g(C,Mt.symbols.warn),color:"yellow",update:d(C)})},info(C={}){return h.stop({text:l(C),mark:g(C,Mt.symbols.info),color:"blue",update:d(C)})},isSpinning(){return a}};function w(C){a&&h.stop(),process.exit(C==="SIGINT"?130:C==="SIGTERM"?143:1)}return h}});var Vu=v(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.splitWhen=mn.flatten=void 0;function Iy(t){return t.reduce((e,r)=>[].concat(e,r),[])}mn.flatten=Iy;function Ty(t,e){let r=[[]],n=0;for(let s of t)e(s)?(n++,r[n]=[]):r[n].push(s);return r}mn.splitWhen=Ty});var Gu=v(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.isEnoentCodeError=void 0;function Ry(t){return t.code==="ENOENT"}xs.isEnoentCodeError=Ry});var zu=v(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.createDirentFromStats=void 0;var ni=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Py(t,e){return new ni(t,e)}ks.createDirentFromStats=Py});var Ku=v(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.convertPosixPathToPattern=Ie.convertWindowsPathToPattern=Ie.convertPathToPattern=Ie.escapePosixPath=Ie.escapeWindowsPath=Ie.escape=Ie.removeLeadingDotSegment=Ie.makeAbsolute=Ie.unixify=void 0;var Oy=require("os"),Ny=require("path"),Yu=Oy.platform()==="win32",Ly=2,By=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,My=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,qy=/^\\\\([.?])/,Wy=/\\(?![!()+@[\]{}])/g;function Hy(t){return t.replace(/\\/g,"/")}Ie.unixify=Hy;function Zy(t,e){return Ny.resolve(t,e)}Ie.makeAbsolute=Zy;function Uy(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(Ly)}return t}Ie.removeLeadingDotSegment=Uy;Ie.escape=Yu?si:oi;function si(t){return t.replace(My,"\\$2")}Ie.escapeWindowsPath=si;function oi(t){return t.replace(By,"\\$2")}Ie.escapePosixPath=oi;Ie.convertPathToPattern=Yu?Ju:Xu;function Ju(t){return si(t).replace(qy,"//$1").replace(Wy,"/")}Ie.convertWindowsPathToPattern=Ju;function Xu(t){return oi(t)}Ie.convertPosixPathToPattern=Xu});var el=v((nj,Qu)=>{Qu.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var nl=v((sj,rl)=>{var Vy=el(),tl={"{":"}","(":")","[":"]"},Gy=function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,s=-2,i=-2,o=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||n!==-1&&t[e]==="["&&t[e+1]!=="]"&&(n<e&&(n=t.indexOf("]",e)),n>e&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||i!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(i=t.indexOf(")",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(r<e&&(r=t.indexOf("|",e)),r!==-1&&t[r+1]!==")"&&(i=t.indexOf(")",r),i>r&&(o=t.indexOf("\\",r),o===-1||o>i))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var c=tl[a];if(c){var u=t.indexOf(c,e);u!==-1&&(e=u+1)}if(t[e]==="!")return!0}else e++}return!1},zy=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var r=t[e+1];e+=2;var n=tl[r];if(n){var s=t.indexOf(n,e);s!==-1&&(e=s+1)}if(t[e]==="!")return!0}else e++}return!1};rl.exports=function(e,r){if(typeof e!="string"||e==="")return!1;if(Vy(e))return!0;var n=Gy;return r&&r.strict===!1&&(n=zy),n(e)}});var ol=v((oj,sl)=>{"use strict";var Yy=nl(),Jy=require("path").posix.dirname,Xy=require("os").platform()==="win32",ii="/",Ky=/\\/g,Qy=/[\{\[].*[\}\]]$/,ev=/(^|[^\\])([\{\[]|\([^\)]+$)/,tv=/\\([\!\*\?\|\[\]\(\)\{\}])/g;sl.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Xy&&e.indexOf(ii)<0&&(e=e.replace(Ky,ii)),Qy.test(e)&&(e+=ii),e+="a";do e=Jy(e);while(Yy(e)||ev.test(e));return e.replace(tv,"$1")}});var $s=v(ht=>{"use strict";ht.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;ht.find=(t,e)=>t.nodes.find(r=>r.type===e);ht.exceedsLimit=(t,e,r=1,n)=>n===!1||!ht.isInteger(t)||!ht.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;ht.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};ht.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;ht.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;ht.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;ht.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);ht.flatten=(...t)=>{let e=[],r=n=>{for(let s=0;s<n.length;s++){let i=n[s];if(Array.isArray(i)){r(i);continue}i!==void 0&&e.push(i)}return e};return r(t),e}});var As=v((aj,al)=>{"use strict";var il=$s();al.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&il.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(i||o)&&il.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=r(c);return a};return r(t)}});var ul=v((cj,cl)=>{"use strict";cl.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var yl=v((uj,Dl)=>{"use strict";var ll=ul(),Nr=(t,e,r)=>{if(ll(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(ll(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),i=String(n.shorthand),o=String(n.capture),a=String(n.wrap),c=t+":"+e+"="+s+i+o+a;if(Nr.cache.hasOwnProperty(c))return Nr.cache[c].result;let u=Math.min(t,e),l=Math.max(t,e);if(Math.abs(u-l)===1){let y=t+"|"+e;return n.capture?`(${y})`:n.wrap===!1?y:`(?:${y})`}let d=gl(t)||gl(e),f={min:t,max:e,a:u,b:l},g=[],m=[];if(d&&(f.isPadded=d,f.maxLen=String(f.max).length),u<0){let y=l<0?Math.abs(l):1;m=dl(y,Math.abs(u),f,n),u=f.a=0}return l>=0&&(g=dl(u,l,f,n)),f.negatives=m,f.positives=g,f.result=rv(m,g,n),n.capture===!0?f.result=`(${f.result})`:n.wrap!==!1&&g.length+m.length>1&&(f.result=`(?:${f.result})`),Nr.cache[c]=f,f.result};function rv(t,e,r){let n=ai(t,e,"-",!1,r)||[],s=ai(e,t,"",!1,r)||[],i=ai(t,e,"-?",!0,r)||[];return n.concat(i).concat(s).join("|")}function nv(t,e){let r=1,n=1,s=hl(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=hl(t,r);for(s=pl(e+1,n)-1;t<s&&s<=e;)i.add(s),n+=1,s=pl(e+1,n)-1;return i=[...i],i.sort(iv),i}function sv(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=ov(t,e),s=n.length,i="",o=0;for(let a=0;a<s;a++){let[c,u]=n[a];c===u?i+=c:c!=="0"||u!=="9"?i+=av(c,u,r):o++}return o&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function dl(t,e,r,n){let s=nv(t,e),i=[],o=t,a;for(let c=0;c<s.length;c++){let u=s[c],l=sv(String(o),String(u),n),d="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+ml(a.count),o=u+1;continue}r.isPadded&&(d=cv(u,r,n)),l.string=d+l.pattern+ml(l.count),i.push(l),o=u+1,a=l}return i}function ai(t,e,r,n,s){let i=[];for(let o of t){let{string:a}=o;!n&&!fl(e,"string",a)&&i.push(r+a),n&&fl(e,"string",a)&&i.push(r+a)}return i}function ov(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function iv(t,e){return t>e?1:e>t?-1:0}function fl(t,e,r){return t.some(n=>n[e]===r)}function hl(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function pl(t,e){return t-t%Math.pow(10,e)}function ml(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function av(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function gl(t){return/^-?(0+)\d/.test(t)}function cv(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),s=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}Nr.cache={};Nr.clearCache=()=>Nr.cache={};Dl.exports=Nr});var li=v((lj,wl)=>{"use strict";var uv=require("util"),_l=yl(),vl=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),lv=t=>e=>t===!0?Number(e):String(e),ci=t=>typeof t=="number"||typeof t=="string"&&t!=="",Mn=t=>Number.isInteger(+t),ui=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},dv=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,fv=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return r===!1?String(t):t},js=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},hv=(t,e,r)=>{t.negatives.sort((a,c)=>a<c?-1:a>c?1:0),t.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=e.capture?"":"?:",s="",i="",o;return t.positives.length&&(s=t.positives.map(a=>js(String(a),r)).join("|")),t.negatives.length&&(i=`-(${n}${t.negatives.map(a=>js(String(a),r)).join("|")})`),s&&i?o=`${s}|${i}`:o=s||i,e.wrap?`(${n}${o})`:o},bl=(t,e,r,n)=>{if(r)return _l(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return`[${s}-${i}]`},Sl=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return _l(t,e,r)},El=(...t)=>new RangeError("Invalid range arguments: "+uv.inspect(...t)),Cl=(t,e,r)=>{if(r.strictRanges===!0)throw El([t,e]);return[]},pv=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},mv=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw El([t,e]);return[]}s===0&&(s=0),i===0&&(i=0);let o=s>i,a=String(t),c=String(e),u=String(r);r=Math.max(Math.abs(r),1);let l=ui(a)||ui(c)||ui(u),d=l?Math.max(a.length,c.length,u.length):0,f=l===!1&&dv(t,e,n)===!1,g=n.transform||lv(f);if(n.toRegex&&r===1)return bl(js(t,d),js(e,d),!0,n);let m={negatives:[],positives:[]},y=C=>m[C<0?"negatives":"positives"].push(Math.abs(C)),h=[],w=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?y(s):h.push(fv(g(s,w),d,f)),s=o?s-r:s+r,w++;return n.toRegex===!0?r>1?hv(m,n,d):Sl(h,null,{wrap:!1,...n}):h},gv=(t,e,r=1,n={})=>{if(!Mn(t)&&t.length>1||!Mn(e)&&e.length>1)return Cl(t,e,n);let s=n.transform||(f=>String.fromCharCode(f)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=i>o,c=Math.min(i,o),u=Math.max(i,o);if(n.toRegex&&r===1)return bl(c,u,!1,n);let l=[],d=0;for(;a?i>=o:i<=o;)l.push(s(i,d)),i=a?i-r:i+r,d++;return n.toRegex===!0?Sl(l,null,{wrap:!1,options:n}):l},Fs=(t,e,r,n={})=>{if(e==null&&ci(t))return[t];if(!ci(t)||!ci(e))return Cl(t,e,n);if(typeof r=="function")return Fs(t,e,1,{transform:r});if(vl(r))return Fs(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,Mn(r)?Mn(t)&&Mn(e)?mv(t,e,r,s):gv(t,e,Math.max(Math.abs(r),1),s):r!=null&&!vl(r)?pv(r,s):Fs(t,e,1,r)};wl.exports=Fs});var $l=v((dj,kl)=>{"use strict";var Dv=li(),xl=$s(),yv=(t,e={})=>{let r=(n,s={})=>{let i=xl.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a=i===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",u="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=xl.reduce(n.nodes),d=Dv(...l,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(d.length!==0)return l.length>1&&d.length>1?`(${d})`:d}if(n.nodes)for(let l of n.nodes)u+=r(l,n);return u};return r(t)};kl.exports=yv});var jl=v((fj,Fl)=>{"use strict";var vv=li(),Al=As(),gn=$s(),Lr=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?gn.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(Lr(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Lr(s,i,r):s+i);return gn.flatten(n)},_v=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,a=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(s.invalid||s.dollar){a.push(Lr(a.pop(),Al(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){a.push(Lr(a.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let d=gn.reduce(s.nodes);if(gn.exceedsLimit(...d,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let f=vv(...d,e);f.length===0&&(f=Al(s,e)),a.push(Lr(a.pop(),f)),s.nodes=[];return}let c=gn.encloseBrace(s),u=s.queue,l=s;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,u=l.queue;for(let d=0;d<s.nodes.length;d++){let f=s.nodes[d];if(f.type==="comma"&&s.type==="brace"){d===1&&u.push(""),u.push("");continue}if(f.type==="close"){a.push(Lr(a.pop(),u,c));continue}if(f.value&&f.type!=="open"){u.push(Lr(u.pop(),f.value));continue}f.nodes&&n(f,s)}return u};return gn.flatten(n(t))};Fl.exports=_v});var Tl=v((hj,Il)=>{"use strict";Il.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
8
+ `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Ll=v((pj,Nl)=>{"use strict";var bv=As(),{MAX_LENGTH:Rl,CHAR_BACKSLASH:di,CHAR_BACKTICK:Sv,CHAR_COMMA:Ev,CHAR_DOT:Cv,CHAR_LEFT_PARENTHESES:wv,CHAR_RIGHT_PARENTHESES:xv,CHAR_LEFT_CURLY_BRACE:kv,CHAR_RIGHT_CURLY_BRACE:$v,CHAR_LEFT_SQUARE_BRACKET:Pl,CHAR_RIGHT_SQUARE_BRACKET:Ol,CHAR_DOUBLE_QUOTE:Av,CHAR_SINGLE_QUOTE:Fv,CHAR_NO_BREAK_SPACE:jv,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Iv}=Tl(),Tv=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(Rl,r.maxLength):Rl;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let s={type:"root",input:t,nodes:[]},i=[s],o=s,a=s,c=0,u=t.length,l=0,d=0,f,g=()=>t[l++],m=y=>{if(y.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&y.type==="text"){a.value+=y.value;return}return o.nodes.push(y),y.parent=o,y.prev=a,a=y,y};for(m({type:"bos"});l<u;)if(o=i[i.length-1],f=g(),!(f===Iv||f===jv)){if(f===di){m({type:"text",value:(e.keepEscaping?f:"")+g()});continue}if(f===Ol){m({type:"text",value:"\\"+f});continue}if(f===Pl){c++;let y;for(;l<u&&(y=g());){if(f+=y,y===Pl){c++;continue}if(y===di){f+=g();continue}if(y===Ol&&(c--,c===0))break}m({type:"text",value:f});continue}if(f===wv){o=m({type:"paren",nodes:[]}),i.push(o),m({type:"text",value:f});continue}if(f===xv){if(o.type!=="paren"){m({type:"text",value:f});continue}o=i.pop(),m({type:"text",value:f}),o=i[i.length-1];continue}if(f===Av||f===Fv||f===Sv){let y=f,h;for(e.keepQuotes!==!0&&(f="");l<u&&(h=g());){if(h===di){f+=h+g();continue}if(h===y){e.keepQuotes===!0&&(f+=h);break}f+=h}m({type:"text",value:f});continue}if(f===kv){d++;let h={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};o=m(h),i.push(o),m({type:"open",value:f});continue}if(f===$v){if(o.type!=="brace"){m({type:"text",value:f});continue}let y="close";o=i.pop(),o.close=!0,m({type:y,value:f}),d--,o=i[i.length-1];continue}if(f===Ev&&d>0){if(o.ranges>0){o.ranges=0;let y=o.nodes.shift();o.nodes=[y,{type:"text",value:bv(o)}]}m({type:"comma",value:f}),o.commas++;continue}if(f===Cv&&d>0&&o.commas===0){let y=o.nodes;if(d===0||y.length===0){m({type:"text",value:f});continue}if(a.type==="dot"){if(o.range=[],a.value+=f,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){y.pop();let h=y[y.length-1];h.value+=a.value+f,a=h,o.ranges--;continue}m({type:"dot",value:f});continue}m({type:"text",value:f})}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(w=>{w.nodes||(w.type==="open"&&(w.isOpen=!0),w.type==="close"&&(w.isClose=!0),w.nodes||(w.type="text"),w.invalid=!0)});let y=i[i.length-1],h=y.nodes.indexOf(o);y.nodes.splice(h,1,...o.nodes)}while(i.length>0);return m({type:"eos"}),s};Nl.exports=Tv});var ql=v((mj,Ml)=>{"use strict";var Bl=As(),Rv=$l(),Pv=jl(),Ov=Ll(),ct=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=ct.create(n,e);Array.isArray(s)?r.push(...s):r.push(s)}else r=[].concat(ct.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};ct.parse=(t,e={})=>Ov(t,e);ct.stringify=(t,e={})=>Bl(typeof t=="string"?ct.parse(t,e):t,e);ct.compile=(t,e={})=>(typeof t=="string"&&(t=ct.parse(t,e)),Rv(t,e));ct.expand=(t,e={})=>{typeof t=="string"&&(t=ct.parse(t,e));let r=Pv(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};ct.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?ct.compile(t,e):ct.expand(t,e);Ml.exports=ct});var qn=v((gj,Vl)=>{"use strict";var Nv=require("path"),qt="\\\\/",Wl=`[^${qt}]`,Lv=0,er="\\.",Bv="\\+",Mv="\\?",Is="\\/",qv="(?=.)",Hl="[^/]",fi=`(?:${Is}|$)`,Zl=`(?:^|${Is})`,hi=`${er}{1,2}${fi}`,Wv=`(?!${er})`,Hv=`(?!${Zl}${hi})`,Zv=`(?!${er}{0,1}${fi})`,Uv=`(?!${hi})`,Vv=`[^.${Is}]`,Gv=`${Hl}*?`,Ul={DOT_LITERAL:er,PLUS_LITERAL:Bv,QMARK_LITERAL:Mv,SLASH_LITERAL:Is,ONE_CHAR:qv,QMARK:Hl,END_ANCHOR:fi,DOTS_SLASH:hi,NO_DOT:Wv,NO_DOTS:Hv,NO_DOT_SLASH:Zv,NO_DOTS_SLASH:Uv,QMARK_NO_DOT:Vv,STAR:Gv,START_ANCHOR:Zl},zv={...Ul,SLASH_LITERAL:`[${qt}]`,QMARK:Wl,STAR:`${Wl}*?`,DOTS_SLASH:`${er}{1,2}(?:[${qt}]|$)`,NO_DOT:`(?!${er})`,NO_DOTS:`(?!(?:^|[${qt}])${er}{1,2}(?:[${qt}]|$))`,NO_DOT_SLASH:`(?!${er}{0,1}(?:[${qt}]|$))`,NO_DOTS_SLASH:`(?!${er}{1,2}(?:[${qt}]|$))`,QMARK_NO_DOT:`[^.${qt}]`,START_ANCHOR:`(?:^|[${qt}])`,END_ANCHOR:`(?:[${qt}]|$)`},Yv={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Vl.exports={DEFAULT_MAX_EXTGLOB_RECURSION:Lv,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Yv,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Nv.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?zv:Ul}}});var Wn=v(tt=>{"use strict";var Jv=require("path"),Xv=process.platform==="win32",{REGEX_BACKSLASH:Kv,REGEX_REMOVE_BACKSLASH:Qv,REGEX_SPECIAL_CHARS:e0,REGEX_SPECIAL_CHARS_GLOBAL:t0}=qn();tt.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);tt.hasRegexChars=t=>e0.test(t);tt.isRegexChar=t=>t.length===1&&tt.hasRegexChars(t);tt.escapeRegex=t=>t.replace(t0,"\\$1");tt.toPosixSlashes=t=>t.replace(Kv,"/");tt.removeBackslashes=t=>t.replace(Qv,e=>e==="\\"?"":e);tt.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};tt.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:Xv===!0||Jv.sep==="\\";tt.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?tt.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};tt.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};tt.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var ed=v((yj,Ql)=>{"use strict";var Gl=Wn(),{CHAR_ASTERISK:pi,CHAR_AT:r0,CHAR_BACKWARD_SLASH:Hn,CHAR_COMMA:n0,CHAR_DOT:mi,CHAR_EXCLAMATION_MARK:gi,CHAR_FORWARD_SLASH:Kl,CHAR_LEFT_CURLY_BRACE:Di,CHAR_LEFT_PARENTHESES:yi,CHAR_LEFT_SQUARE_BRACKET:s0,CHAR_PLUS:o0,CHAR_QUESTION_MARK:zl,CHAR_RIGHT_CURLY_BRACE:i0,CHAR_RIGHT_PARENTHESES:Yl,CHAR_RIGHT_SQUARE_BRACKET:a0}=qn(),Jl=t=>t===Kl||t===Hn,Xl=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},c0=(t,e)=>{let r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],o=[],a=[],c=t,u=-1,l=0,d=0,f=!1,g=!1,m=!1,y=!1,h=!1,w=!1,C=!1,A=!1,T=!1,G=!1,I=0,Z,F,W={value:"",depth:0,isGlob:!1},R=()=>u>=n,b=()=>c.charCodeAt(u+1),Q=()=>(Z=F,c.charCodeAt(++u));for(;u<n;){F=Q();let he;if(F===Hn){C=W.backslashes=!0,F=Q(),F===Di&&(w=!0);continue}if(w===!0||F===Di){for(I++;R()!==!0&&(F=Q());){if(F===Hn){C=W.backslashes=!0,Q();continue}if(F===Di){I++;continue}if(w!==!0&&F===mi&&(F=Q())===mi){if(f=W.isBrace=!0,m=W.isGlob=!0,G=!0,s===!0)continue;break}if(w!==!0&&F===n0){if(f=W.isBrace=!0,m=W.isGlob=!0,G=!0,s===!0)continue;break}if(F===i0&&(I--,I===0)){w=!1,f=W.isBrace=!0,G=!0;break}}if(s===!0)continue;break}if(F===Kl){if(i.push(u),o.push(W),W={value:"",depth:0,isGlob:!1},G===!0)continue;if(Z===mi&&u===l+1){l+=2;continue}d=u+1;continue}if(r.noext!==!0&&(F===o0||F===r0||F===pi||F===zl||F===gi)===!0&&b()===yi){if(m=W.isGlob=!0,y=W.isExtglob=!0,G=!0,F===gi&&u===l&&(T=!0),s===!0){for(;R()!==!0&&(F=Q());){if(F===Hn){C=W.backslashes=!0,F=Q();continue}if(F===Yl){m=W.isGlob=!0,G=!0;break}}continue}break}if(F===pi){if(Z===pi&&(h=W.isGlobstar=!0),m=W.isGlob=!0,G=!0,s===!0)continue;break}if(F===zl){if(m=W.isGlob=!0,G=!0,s===!0)continue;break}if(F===s0){for(;R()!==!0&&(he=Q());){if(he===Hn){C=W.backslashes=!0,Q();continue}if(he===a0){g=W.isBracket=!0,m=W.isGlob=!0,G=!0;break}}if(s===!0)continue;break}if(r.nonegate!==!0&&F===gi&&u===l){A=W.negated=!0,l++;continue}if(r.noparen!==!0&&F===yi){if(m=W.isGlob=!0,s===!0){for(;R()!==!0&&(F=Q());){if(F===yi){C=W.backslashes=!0,F=Q();continue}if(F===Yl){G=!0;break}}continue}break}if(m===!0){if(G=!0,s===!0)continue;break}}r.noext===!0&&(y=!1,m=!1);let te=c,de="",x="";l>0&&(de=c.slice(0,l),c=c.slice(l),d-=l),te&&m===!0&&d>0?(te=c.slice(0,d),x=c.slice(d)):m===!0?(te="",x=c):te=c,te&&te!==""&&te!=="/"&&te!==c&&Jl(te.charCodeAt(te.length-1))&&(te=te.slice(0,-1)),r.unescape===!0&&(x&&(x=Gl.removeBackslashes(x)),te&&C===!0&&(te=Gl.removeBackslashes(te)));let k={prefix:de,input:t,start:l,base:te,glob:x,isBrace:f,isBracket:g,isGlob:m,isExtglob:y,isGlobstar:h,negated:A,negatedExtglob:T};if(r.tokens===!0&&(k.maxDepth=0,Jl(F)||o.push(W),k.tokens=o),r.parts===!0||r.tokens===!0){let he;for(let X=0;X<i.length;X++){let xe=he?he+1:l,ze=i[X],Le=t.slice(xe,ze);r.tokens&&(X===0&&l!==0?(o[X].isPrefix=!0,o[X].value=de):o[X].value=Le,Xl(o[X]),k.maxDepth+=o[X].depth),(X!==0||Le!=="")&&a.push(Le),he=ze}if(he&&he+1<t.length){let X=t.slice(he+1);a.push(X),r.tokens&&(o[o.length-1].value=X,Xl(o[o.length-1]),k.maxDepth+=o[o.length-1].depth)}k.slashes=i,k.parts=a}return k};Ql.exports=c0});var od=v((vj,sd)=>{"use strict";var Zn=qn(),Be=Wn(),{MAX_LENGTH:Ts,POSIX_REGEX_SOURCE:u0,REGEX_NON_SPECIAL_CHARS:l0,REGEX_SPECIAL_CHARS_BACKREF:d0,REPLACEMENTS:td}=Zn,f0=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(s=>Be.escapeRegex(s)).join("..")}return r},Dn=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,rd=t=>{let e=[],r=0,n=0,s=0,i="",o=!1;for(let a of t){if(o===!0){i+=a,o=!1;continue}if(a==="\\"){i+=a,o=!0;continue}if(a==='"'){s=s===1?0:1,i+=a;continue}if(s===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(i),i="";continue}}}i+=a}return e.push(i),e},h0=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},nd=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(h0(e))return e.replace(/\\(.)/g,"$1")},p0=t=>{let e=t.map(nd).filter(Boolean);for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++){let s=e[r],i=e[n],o=s[0];if(!(!o||s!==o.repeat(s.length)||i!==o.repeat(i.length))&&(s===i||s.startsWith(i)||i.startsWith(s)))return!0}return!1},vi=(t,e=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,s=0,i=!1;for(let o=1;o<t.length;o++){let a=t[o];if(i===!0){i=!1;continue}if(a==="\\"){i=!0;continue}if(a==='"'){s=s===1?0:1;continue}if(s!==1){if(a==="["){r++;continue}if(a==="]"&&r>0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==t.length-1?void 0:{type:t[0],body:t.slice(2,o),end:o}}}}},m0=t=>{let e=0,r=[];for(;e<t.length;){let s=vi(t.slice(e),!1);if(!s||s.type!=="*")return;let i=rd(s.body).map(a=>a.trim());if(i.length!==1)return;let o=nd(i[0]);if(!o||o.length!==1)return;r.push(o),e+=s.end+1}return r.length<1?void 0:`${r.length===1?Be.escapeRegex(r[0]):`[${r.map(s=>Be.escapeRegex(s)).join("")}]`}*`},g0=t=>{let e=0,r=t.trim(),n=vi(r);for(;n;)e++,r=n.body.trim(),n=vi(r);return e},D0=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Zn.DEFAULT_MAX_EXTGLOB_RECURSION,n=rd(t).map(s=>s.trim());if(n.length>1&&(n.some(s=>s==="")||n.some(s=>/^[*?]+$/.test(s))||p0(n)))return{risky:!0};for(let s of n){let i=m0(s);if(i)return{risky:!0,safeOutput:i};if(g0(s)>r)return{risky:!0}}return{risky:!1}},_i=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=td[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Ts,r.maxLength):Ts,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},o=[i],a=r.capture?"":"?:",c=Be.isWindows(e),u=Zn.globChars(c),l=Zn.extglobChars(u),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:y,NO_DOT:h,NO_DOT_SLASH:w,NO_DOTS_SLASH:C,QMARK:A,QMARK_NO_DOT:T,STAR:G,START_ANCHOR:I}=u,Z=B=>`(${a}(?:(?!${I}${B.dot?y:d}).)*?)`,F=r.dot?"":h,W=r.dot?A:T,R=r.bash===!0?Z(r):G;r.capture&&(R=`(${R})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let b={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=Be.removePrefix(t,b),s=t.length;let Q=[],te=[],de=[],x=i,k,he=()=>b.index===s-1,X=b.peek=(B=1)=>t[b.index+B],xe=b.advance=()=>t[++b.index]||"",ze=()=>t.slice(b.index+1),Le=(B="",me=0)=>{b.consumed+=B,b.index+=me},Pr=B=>{b.output+=B.output!=null?B.output:B.value,Le(B.value)},lr=()=>{let B=1;for(;X()==="!"&&(X(2)!=="("||X(3)==="?");)xe(),b.start++,B++;return B%2===0?!1:(b.negated=!0,b.start++,!0)},Or=B=>{b[B]++,de.push(B)},Ct=B=>{b[B]--,de.pop()},oe=B=>{if(x.type==="globstar"){let me=b.braces>0&&(B.type==="comma"||B.type==="brace"),L=B.extglob===!0||Q.length&&(B.type==="pipe"||B.type==="paren");B.type!=="slash"&&B.type!=="paren"&&!me&&!L&&(b.output=b.output.slice(0,-x.output.length),x.type="star",x.value="*",x.output=R,b.output+=x.output)}if(Q.length&&B.type!=="paren"&&(Q[Q.length-1].inner+=B.value),(B.value||B.output)&&Pr(B),x&&x.type==="text"&&B.type==="text"){x.value+=B.value,x.output=(x.output||"")+B.value;return}B.prev=x,o.push(B),x=B},wt=(B,me)=>{let L={...l[me],conditions:1,inner:""};L.prev=x,L.parens=b.parens,L.output=b.output,L.startIndex=b.index,L.tokensIndex=o.length;let le=(r.capture?"(":"")+L.open;Or("parens"),oe({type:B,value:me,output:b.output?"":m}),oe({type:"paren",extglob:!0,value:xe(),output:le}),Q.push(L)},Ss=B=>{let me=t.slice(B.startIndex,b.index+1),L=t.slice(B.startIndex+2,b.index),le=D0(L,r);if((B.type==="plus"||B.type==="star")&&le.risky){let j=le.safeOutput?(B.output?"":m)+(r.capture?`(${le.safeOutput})`:le.safeOutput):void 0,O=o[B.tokensIndex];O.type="text",O.value=me,O.output=j||Be.escapeRegex(me);for(let q=B.tokensIndex+1;q<o.length;q++)o[q].value="",o[q].output="",delete o[q].suffix;b.output=B.output+O.output,b.backtrack=!0,oe({type:"paren",extglob:!0,value:k,output:""}),Ct("parens");return}let _e=B.close+(r.capture?")":""),$;if(B.type==="negate"){let j=R;if(B.inner&&B.inner.length>1&&B.inner.includes("/")&&(j=Z(r)),(j!==R||he()||/^\)+$/.test(ze()))&&(_e=B.close=`)$))${j}`),B.inner.includes("*")&&($=ze())&&/^\.[^\\/.]+$/.test($)){let O=_i($,{...e,fastpaths:!1}).output;_e=B.close=`)${O})${j})`}B.prev.type==="bos"&&(b.negatedExtglob=!0)}oe({type:"paren",extglob:!0,value:k,output:_e}),Ct("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let B=!1,me=t.replace(d0,(L,le,_e,$,j,O)=>$==="\\"?(B=!0,L):$==="?"?le?le+$+(j?A.repeat(j.length):""):O===0?W+(j?A.repeat(j.length):""):A.repeat(_e.length):$==="."?d.repeat(_e.length):$==="*"?le?le+$+(j?R:""):R:le?L:`\\${L}`);return B===!0&&(r.unescape===!0?me=me.replace(/\\/g,""):me=me.replace(/\\+/g,L=>L.length%2===0?"\\\\":L?"\\":"")),me===t&&r.contains===!0?(b.output=t,b):(b.output=Be.wrapOutput(me,b,e),b)}for(;!he();){if(k=xe(),k==="\0")continue;if(k==="\\"){let L=X();if(L==="/"&&r.bash!==!0||L==="."||L===";")continue;if(!L){k+="\\",oe({type:"text",value:k});continue}let le=/^\\+/.exec(ze()),_e=0;if(le&&le[0].length>2&&(_e=le[0].length,b.index+=_e,_e%2!==0&&(k+="\\")),r.unescape===!0?k=xe():k+=xe(),b.brackets===0){oe({type:"text",value:k});continue}}if(b.brackets>0&&(k!=="]"||x.value==="["||x.value==="[^")){if(r.posix!==!1&&k===":"){let L=x.value.slice(1);if(L.includes("[")&&(x.posix=!0,L.includes(":"))){let le=x.value.lastIndexOf("["),_e=x.value.slice(0,le),$=x.value.slice(le+2),j=u0[$];if(j){x.value=_e+j,b.backtrack=!0,xe(),!i.output&&o.indexOf(x)===1&&(i.output=m);continue}}}(k==="["&&X()!==":"||k==="-"&&X()==="]")&&(k=`\\${k}`),k==="]"&&(x.value==="["||x.value==="[^")&&(k=`\\${k}`),r.posix===!0&&k==="!"&&x.value==="["&&(k="^"),x.value+=k,Pr({value:k});continue}if(b.quotes===1&&k!=='"'){k=Be.escapeRegex(k),x.value+=k,Pr({value:k});continue}if(k==='"'){b.quotes=b.quotes===1?0:1,r.keepQuotes===!0&&oe({type:"text",value:k});continue}if(k==="("){Or("parens"),oe({type:"paren",value:k});continue}if(k===")"){if(b.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Dn("opening","("));let L=Q[Q.length-1];if(L&&b.parens===L.parens+1){Ss(Q.pop());continue}oe({type:"paren",value:k,output:b.parens?")":"\\)"}),Ct("parens");continue}if(k==="["){if(r.nobracket===!0||!ze().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Dn("closing","]"));k=`\\${k}`}else Or("brackets");oe({type:"bracket",value:k});continue}if(k==="]"){if(r.nobracket===!0||x&&x.type==="bracket"&&x.value.length===1){oe({type:"text",value:k,output:`\\${k}`});continue}if(b.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Dn("opening","["));oe({type:"text",value:k,output:`\\${k}`});continue}Ct("brackets");let L=x.value.slice(1);if(x.posix!==!0&&L[0]==="^"&&!L.includes("/")&&(k=`/${k}`),x.value+=k,Pr({value:k}),r.literalBrackets===!1||Be.hasRegexChars(L))continue;let le=Be.escapeRegex(x.value);if(b.output=b.output.slice(0,-x.value.length),r.literalBrackets===!0){b.output+=le,x.value=le;continue}x.value=`(${a}${le}|${x.value})`,b.output+=x.value;continue}if(k==="{"&&r.nobrace!==!0){Or("braces");let L={type:"brace",value:k,output:"(",outputIndex:b.output.length,tokensIndex:b.tokens.length};te.push(L),oe(L);continue}if(k==="}"){let L=te[te.length-1];if(r.nobrace===!0||!L){oe({type:"text",value:k,output:k});continue}let le=")";if(L.dots===!0){let _e=o.slice(),$=[];for(let j=_e.length-1;j>=0&&(o.pop(),_e[j].type!=="brace");j--)_e[j].type!=="dots"&&$.unshift(_e[j].value);le=f0($,r),b.backtrack=!0}if(L.comma!==!0&&L.dots!==!0){let _e=b.output.slice(0,L.outputIndex),$=b.tokens.slice(L.tokensIndex);L.value=L.output="\\{",k=le="\\}",b.output=_e;for(let j of $)b.output+=j.output||j.value}oe({type:"brace",value:k,output:le}),Ct("braces"),te.pop();continue}if(k==="|"){Q.length>0&&Q[Q.length-1].conditions++,oe({type:"text",value:k});continue}if(k===","){let L=k,le=te[te.length-1];le&&de[de.length-1]==="braces"&&(le.comma=!0,L="|"),oe({type:"comma",value:k,output:L});continue}if(k==="/"){if(x.type==="dot"&&b.index===b.start+1){b.start=b.index+1,b.consumed="",b.output="",o.pop(),x=i;continue}oe({type:"slash",value:k,output:g});continue}if(k==="."){if(b.braces>0&&x.type==="dot"){x.value==="."&&(x.output=d);let L=te[te.length-1];x.type="dots",x.output+=k,x.value+=k,L.dots=!0;continue}if(b.braces+b.parens===0&&x.type!=="bos"&&x.type!=="slash"){oe({type:"text",value:k,output:d});continue}oe({type:"dot",value:k,output:d});continue}if(k==="?"){if(!(x&&x.value==="(")&&r.noextglob!==!0&&X()==="("&&X(2)!=="?"){wt("qmark",k);continue}if(x&&x.type==="paren"){let le=X(),_e=k;if(le==="<"&&!Be.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(x.value==="("&&!/[!=<:]/.test(le)||le==="<"&&!/<([!=]|\w+>)/.test(ze()))&&(_e=`\\${k}`),oe({type:"text",value:k,output:_e});continue}if(r.dot!==!0&&(x.type==="slash"||x.type==="bos")){oe({type:"qmark",value:k,output:T});continue}oe({type:"qmark",value:k,output:A});continue}if(k==="!"){if(r.noextglob!==!0&&X()==="("&&(X(2)!=="?"||!/[!=<:]/.test(X(3)))){wt("negate",k);continue}if(r.nonegate!==!0&&b.index===0){lr();continue}}if(k==="+"){if(r.noextglob!==!0&&X()==="("&&X(2)!=="?"){wt("plus",k);continue}if(x&&x.value==="("||r.regex===!1){oe({type:"plus",value:k,output:f});continue}if(x&&(x.type==="bracket"||x.type==="paren"||x.type==="brace")||b.parens>0){oe({type:"plus",value:k});continue}oe({type:"plus",value:f});continue}if(k==="@"){if(r.noextglob!==!0&&X()==="("&&X(2)!=="?"){oe({type:"at",extglob:!0,value:k,output:""});continue}oe({type:"text",value:k});continue}if(k!=="*"){(k==="$"||k==="^")&&(k=`\\${k}`);let L=l0.exec(ze());L&&(k+=L[0],b.index+=L[0].length),oe({type:"text",value:k});continue}if(x&&(x.type==="globstar"||x.star===!0)){x.type="star",x.star=!0,x.value+=k,x.output=R,b.backtrack=!0,b.globstar=!0,Le(k);continue}let B=ze();if(r.noextglob!==!0&&/^\([^?]/.test(B)){wt("star",k);continue}if(x.type==="star"){if(r.noglobstar===!0){Le(k);continue}let L=x.prev,le=L.prev,_e=L.type==="slash"||L.type==="bos",$=le&&(le.type==="star"||le.type==="globstar");if(r.bash===!0&&(!_e||B[0]&&B[0]!=="/")){oe({type:"star",value:k,output:""});continue}let j=b.braces>0&&(L.type==="comma"||L.type==="brace"),O=Q.length&&(L.type==="pipe"||L.type==="paren");if(!_e&&L.type!=="paren"&&!j&&!O){oe({type:"star",value:k,output:""});continue}for(;B.slice(0,3)==="/**";){let q=t[b.index+4];if(q&&q!=="/")break;B=B.slice(3),Le("/**",3)}if(L.type==="bos"&&he()){x.type="globstar",x.value+=k,x.output=Z(r),b.output=x.output,b.globstar=!0,Le(k);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&!$&&he()){b.output=b.output.slice(0,-(L.output+x.output).length),L.output=`(?:${L.output}`,x.type="globstar",x.output=Z(r)+(r.strictSlashes?")":"|$)"),x.value+=k,b.globstar=!0,b.output+=L.output+x.output,Le(k);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&B[0]==="/"){let q=B[1]!==void 0?"|$":"";b.output=b.output.slice(0,-(L.output+x.output).length),L.output=`(?:${L.output}`,x.type="globstar",x.output=`${Z(r)}${g}|${g}${q})`,x.value+=k,b.output+=L.output+x.output,b.globstar=!0,Le(k+xe()),oe({type:"slash",value:"/",output:""});continue}if(L.type==="bos"&&B[0]==="/"){x.type="globstar",x.value+=k,x.output=`(?:^|${g}|${Z(r)}${g})`,b.output=x.output,b.globstar=!0,Le(k+xe()),oe({type:"slash",value:"/",output:""});continue}b.output=b.output.slice(0,-x.output.length),x.type="globstar",x.output=Z(r),x.value+=k,b.output+=x.output,b.globstar=!0,Le(k);continue}let me={type:"star",value:k,output:R};if(r.bash===!0){me.output=".*?",(x.type==="bos"||x.type==="slash")&&(me.output=F+me.output),oe(me);continue}if(x&&(x.type==="bracket"||x.type==="paren")&&r.regex===!0){me.output=k,oe(me);continue}(b.index===b.start||x.type==="slash"||x.type==="dot")&&(x.type==="dot"?(b.output+=w,x.output+=w):r.dot===!0?(b.output+=C,x.output+=C):(b.output+=F,x.output+=F),X()!=="*"&&(b.output+=m,x.output+=m)),oe(me)}for(;b.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Dn("closing","]"));b.output=Be.escapeLast(b.output,"["),Ct("brackets")}for(;b.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Dn("closing",")"));b.output=Be.escapeLast(b.output,"("),Ct("parens")}for(;b.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Dn("closing","}"));b.output=Be.escapeLast(b.output,"{"),Ct("braces")}if(r.strictSlashes!==!0&&(x.type==="star"||x.type==="bracket")&&oe({type:"maybe_slash",value:"",output:`${g}?`}),b.backtrack===!0){b.output="";for(let B of b.tokens)b.output+=B.output!=null?B.output:B.value,B.suffix&&(b.output+=B.suffix)}return b};_i.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Ts,r.maxLength):Ts,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=td[t]||t;let i=Be.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:l,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:g,START_ANCHOR:m}=Zn.globChars(i),y=r.dot?d:l,h=r.dot?f:l,w=r.capture?"":"?:",C={negated:!1,prefix:""},A=r.bash===!0?".*?":g;r.capture&&(A=`(${A})`);let T=F=>F.noglobstar===!0?A:`(${w}(?:(?!${m}${F.dot?u:o}).)*?)`,G=F=>{switch(F){case"*":return`${y}${c}${A}`;case".*":return`${o}${c}${A}`;case"*.*":return`${y}${A}${o}${c}${A}`;case"*/*":return`${y}${A}${a}${c}${h}${A}`;case"**":return y+T(r);case"**/*":return`(?:${y}${T(r)}${a})?${h}${c}${A}`;case"**/*.*":return`(?:${y}${T(r)}${a})?${h}${A}${o}${c}${A}`;case"**/.*":return`(?:${y}${T(r)}${a})?${o}${c}${A}`;default:{let W=/^(.*?)\.(\w+)$/.exec(F);if(!W)return;let R=G(W[1]);return R?R+o+W[2]:void 0}}},I=Be.removePrefix(t,C),Z=G(I);return Z&&r.strictSlashes!==!0&&(Z+=`${a}?`),Z};sd.exports=_i});var ad=v((_j,id)=>{"use strict";var y0=require("path"),v0=ed(),bi=od(),Si=Wn(),_0=qn(),b0=t=>t&&typeof t=="object"&&!Array.isArray(t),Fe=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(f=>Fe(f,e,r));return f=>{for(let g of l){let m=g(f);if(m)return m}return!1}}let n=b0(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},i=Si.isWindows(e),o=n?Fe.compileRe(t,e):Fe.makeRe(t,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(s.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};c=Fe(s.ignore,l,r)}let u=(l,d=!1)=>{let{isMatch:f,match:g,output:m}=Fe.test(l,o,e,{glob:t,posix:i}),y={glob:t,state:a,regex:o,posix:i,input:l,output:m,match:g,isMatch:f};return typeof s.onResult=="function"&&s.onResult(y),f===!1?(y.isMatch=!1,d?y:!1):c(l)?(typeof s.onIgnore=="function"&&s.onIgnore(y),y.isMatch=!1,d?y:!1):(typeof s.onMatch=="function"&&s.onMatch(y),d?y:!0)};return r&&(u.state=a),u};Fe.test=(t,e,r,{glob:n,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let i=r||{},o=i.format||(s?Si.toPosixSlashes:null),a=t===n,c=a&&o?o(t):t;return a===!1&&(c=o?o(t):t,a=c===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=Fe.matchBase(t,e,r,s):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Fe.matchBase=(t,e,r,n=Si.isWindows(r))=>(e instanceof RegExp?e:Fe.makeRe(e,r)).test(y0.basename(t));Fe.isMatch=(t,e,r)=>Fe(e,r)(t);Fe.parse=(t,e)=>Array.isArray(t)?t.map(r=>Fe.parse(r,e)):bi(t,{...e,fastpaths:!1});Fe.scan=(t,e)=>v0(t,e);Fe.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",a=`${i}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Fe.toRegex(a,e);return n===!0&&(c.state=t),c};Fe.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=bi.fastpaths(t,e)),s.output||(s=bi(t,e)),Fe.compileRe(s,e,r,n)};Fe.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Fe.constants=_0;id.exports=Fe});var ud=v((bj,cd)=>{"use strict";cd.exports=ad()});var md=v((Sj,pd)=>{"use strict";var dd=require("util"),fd=ql(),Wt=ud(),Ei=Wn(),ld=t=>t===""||t==="./",hd=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Ce=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,s=new Set,i=new Set,o=0,a=l=>{i.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<e.length;l++){let d=Wt(String(e[l]),{...r,onResult:a},!0),f=d.state.negated||d.state.negatedExtglob;f&&o++;for(let g of t){let m=d(g,!0);(f?!m.isMatch:m.isMatch)&&(f?n.add(m.output):(n.delete(m.output),s.add(m.output)))}}let u=(o===e.length?[...i]:[...s]).filter(l=>!n.has(l));if(r&&u.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(l=>l.replace(/\\/g,"")):e}return u};Ce.match=Ce;Ce.matcher=(t,e)=>Wt(t,e);Ce.isMatch=(t,e,r)=>Wt(e,r)(t);Ce.any=Ce.isMatch;Ce.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,s=[],i=a=>{r.onResult&&r.onResult(a),s.push(a.output)},o=new Set(Ce(t,e,{...r,onResult:i}));for(let a of s)o.has(a)||n.add(a);return[...n]};Ce.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${dd.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>Ce.contains(t,n,r));if(typeof e=="string"){if(ld(t)||ld(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Ce.isMatch(t,e,{...r,contains:!0})};Ce.matchKeys=(t,e,r)=>{if(!Ei.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=Ce(Object.keys(t),e,r),s={};for(let i of n)s[i]=t[i];return s};Ce.some=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let i=Wt(String(s),r);if(n.some(o=>i(o)))return!0}return!1};Ce.every=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let i=Wt(String(s),r);if(!n.every(o=>i(o)))return!1}return!0};Ce.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${dd.inspect(t)}"`);return[].concat(e).every(n=>Wt(n,r)(t))};Ce.capture=(t,e,r)=>{let n=Ei.isWindows(r),i=Wt.makeRe(String(t),{...r,capture:!0}).exec(n?Ei.toPosixSlashes(e):e);if(i)return i.slice(1).map(o=>o===void 0?"":o)};Ce.makeRe=(...t)=>Wt.makeRe(...t);Ce.scan=(...t)=>Wt.scan(...t);Ce.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let s of fd(String(n),e))r.push(Wt.parse(s,e));return r};Ce.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!hd(t)?[t]:fd(t,e)};Ce.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Ce.braces(t,{...e,expand:!0})};Ce.hasBraces=hd;pd.exports=Ce});var wd=v(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.isAbsolute=re.partitionAbsoluteAndRelative=re.removeDuplicateSlashes=re.matchAny=re.convertPatternsToRe=re.makeRe=re.getPatternParts=re.expandBraceExpansion=re.expandPatternsWithBraceExpansion=re.isAffectDepthOfReadingPattern=re.endsWithSlashGlobStar=re.hasGlobStar=re.getBaseDirectory=re.isPatternRelatedToParentDirectory=re.getPatternsOutsideCurrentDirectory=re.getPatternsInsideCurrentDirectory=re.getPositivePatterns=re.getNegativePatterns=re.isPositivePattern=re.isNegativePattern=re.convertToNegativePattern=re.convertToPositivePattern=re.isDynamicPattern=re.isStaticPattern=void 0;var gd=require("path"),S0=ol(),Ci=md(),Dd="**",E0="\\",C0=/[*?]|^!/,w0=/\[[^[]*]/,x0=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,k0=/[!*+?@]\([^(]*\)/,$0=/,|\.\./,A0=/(?!^)\/{2,}/g;function yd(t,e={}){return!vd(t,e)}re.isStaticPattern=yd;function vd(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(E0)||C0.test(t)||w0.test(t)||x0.test(t)||e.extglob!==!1&&k0.test(t)||e.braceExpansion!==!1&&F0(t))}re.isDynamicPattern=vd;function F0(t){let e=t.indexOf("{");if(e===-1)return!1;let r=t.indexOf("}",e+1);if(r===-1)return!1;let n=t.slice(e,r);return $0.test(n)}function j0(t){return Rs(t)?t.slice(1):t}re.convertToPositivePattern=j0;function I0(t){return"!"+t}re.convertToNegativePattern=I0;function Rs(t){return t.startsWith("!")&&t[1]!=="("}re.isNegativePattern=Rs;function _d(t){return!Rs(t)}re.isPositivePattern=_d;function T0(t){return t.filter(Rs)}re.getNegativePatterns=T0;function R0(t){return t.filter(_d)}re.getPositivePatterns=R0;function P0(t){return t.filter(e=>!wi(e))}re.getPatternsInsideCurrentDirectory=P0;function O0(t){return t.filter(wi)}re.getPatternsOutsideCurrentDirectory=O0;function wi(t){return t.startsWith("..")||t.startsWith("./..")}re.isPatternRelatedToParentDirectory=wi;function N0(t){return S0(t,{flipBackslashes:!1})}re.getBaseDirectory=N0;function L0(t){return t.includes(Dd)}re.hasGlobStar=L0;function bd(t){return t.endsWith("/"+Dd)}re.endsWithSlashGlobStar=bd;function B0(t){let e=gd.basename(t);return bd(t)||yd(e)}re.isAffectDepthOfReadingPattern=B0;function M0(t){return t.reduce((e,r)=>e.concat(Sd(r)),[])}re.expandPatternsWithBraceExpansion=M0;function Sd(t){let e=Ci.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}re.expandBraceExpansion=Sd;function q0(t,e){let{parts:r}=Ci.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}re.getPatternParts=q0;function Ed(t,e){return Ci.makeRe(t,e)}re.makeRe=Ed;function W0(t,e){return t.map(r=>Ed(r,e))}re.convertPatternsToRe=W0;function H0(t,e){return e.some(r=>r.test(t))}re.matchAny=H0;function Z0(t){return t.replace(A0,"/")}re.removeDuplicateSlashes=Z0;function U0(t){let e=[],r=[];for(let n of t)Cd(n)?e.push(n):r.push(n);return[e,r]}re.partitionAbsoluteAndRelative=U0;function Cd(t){return gd.isAbsolute(t)}re.isAbsolute=Cd});var Ad=v((Cj,$d)=>{"use strict";var V0=require("stream"),xd=V0.PassThrough,G0=Array.prototype.slice;$d.exports=z0;function z0(){let t=[],e=G0.call(arguments),r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};let s=n.end!==!1,i=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let o=xd(n);function a(){for(let l=0,d=arguments.length;l<d;l++)t.push(kd(arguments[l],n));return c(),this}function c(){if(r)return;r=!0;let l=t.shift();if(!l){process.nextTick(u);return}Array.isArray(l)||(l=[l]);let d=l.length+1;function f(){--d>0||(r=!1,c())}function g(m){function y(){m.removeListener("merge2UnpipeEnd",y),m.removeListener("end",y),i&&m.removeListener("error",h),f()}function h(w){o.emit("error",w)}if(m._readableState.endEmitted)return f();m.on("merge2UnpipeEnd",y),m.on("end",y),i&&m.on("error",h),m.pipe(o,{end:!1}),m.resume()}for(let m=0;m<l.length;m++)g(l[m]);f()}function u(){r=!1,o.emit("queueDrain"),s&&o.end()}return o.setMaxListeners(0),o.add=a,o.on("unpipe",function(l){l.emit("merge2UnpipeEnd")}),e.length&&a.apply(null,e),o}function kd(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=kd(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(xd(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var jd=v(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.merge=void 0;var Y0=Ad();function J0(t){let e=Y0(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>Fd(t)),e.once("end",()=>Fd(t)),e}Ps.merge=J0;function Fd(t){t.forEach(e=>e.emit("close"))}});var Id=v(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.isEmpty=yn.isString=void 0;function X0(t){return typeof t=="string"}yn.isString=X0;function K0(t){return t===""}yn.isEmpty=K0});var tr=v(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.string=Me.stream=Me.pattern=Me.path=Me.fs=Me.errno=Me.array=void 0;var Q0=Vu();Me.array=Q0;var e_=Gu();Me.errno=e_;var t_=zu();Me.fs=t_;var r_=Ku();Me.path=r_;var n_=wd();Me.pattern=n_;var s_=jd();Me.stream=s_;var o_=Id();Me.string=o_});var Od=v(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.convertPatternGroupToTask=qe.convertPatternGroupsToTasks=qe.groupPatternsByBaseDirectory=qe.getNegativePatternsAsPositive=qe.getPositivePatterns=qe.convertPatternsToTasks=qe.generate=void 0;var kt=tr();function i_(t,e){let r=Td(t,e),n=Td(e.ignore,e),s=Rd(r),i=Pd(r,n),o=s.filter(l=>kt.pattern.isStaticPattern(l,e)),a=s.filter(l=>kt.pattern.isDynamicPattern(l,e)),c=xi(o,i,!1),u=xi(a,i,!0);return c.concat(u)}qe.generate=i_;function Td(t,e){let r=t;return e.braceExpansion&&(r=kt.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>kt.pattern.removeDuplicateSlashes(n))}function xi(t,e,r){let n=[],s=kt.pattern.getPatternsOutsideCurrentDirectory(t),i=kt.pattern.getPatternsInsideCurrentDirectory(t),o=ki(s),a=ki(i);return n.push(...$i(o,e,r)),"."in a?n.push(Ai(".",i,e,r)):n.push(...$i(a,e,r)),n}qe.convertPatternsToTasks=xi;function Rd(t){return kt.pattern.getPositivePatterns(t)}qe.getPositivePatterns=Rd;function Pd(t,e){return kt.pattern.getNegativePatterns(t).concat(e).map(kt.pattern.convertToPositivePattern)}qe.getNegativePatternsAsPositive=Pd;function ki(t){let e={};return t.reduce((r,n)=>{let s=kt.pattern.getBaseDirectory(n);return s in r?r[s].push(n):r[s]=[n],r},e)}qe.groupPatternsByBaseDirectory=ki;function $i(t,e,r){return Object.keys(t).map(n=>Ai(n,t[n],e,r))}qe.convertPatternGroupsToTasks=$i;function Ai(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(kt.pattern.convertToNegativePattern))}}qe.convertPatternGroupToTask=Ai});var Ld=v(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.read=void 0;function a_(t,e,r){e.fs.lstat(t,(n,s)=>{if(n!==null){Nd(r,n);return}if(!s.isSymbolicLink()||!e.followSymbolicLink){Fi(r,s);return}e.fs.stat(t,(i,o)=>{if(i!==null){if(e.throwErrorOnBrokenSymbolicLink){Nd(r,i);return}Fi(r,s);return}e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),Fi(r,o)})})}Os.read=a_;function Nd(t,e){t(e)}function Fi(t,e){t(null,e)}});var Bd=v(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.read=void 0;function c_(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw n}}Ns.read=c_});var Md=v(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.createFileSystemAdapter=mr.FILE_SYSTEM_ADAPTER=void 0;var Ls=require("fs");mr.FILE_SYSTEM_ADAPTER={lstat:Ls.lstat,stat:Ls.stat,lstatSync:Ls.lstatSync,statSync:Ls.statSync};function u_(t){return t===void 0?mr.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},mr.FILE_SYSTEM_ADAPTER),t)}mr.createFileSystemAdapter=u_});var qd=v(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});var l_=Md(),ji=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=l_.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};Ii.default=ji});var Br=v(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.statSync=gr.stat=gr.Settings=void 0;var Wd=Ld(),d_=Bd(),Ti=qd();gr.Settings=Ti.default;function f_(t,e,r){if(typeof e=="function"){Wd.read(t,Ri(),e);return}Wd.read(t,Ri(e),r)}gr.stat=f_;function h_(t,e){let r=Ri(e);return d_.read(t,r)}gr.statSync=h_;function Ri(t={}){return t instanceof Ti.default?t:new Ti.default(t)}});var Ud=v((Rj,Zd)=>{var Hd;Zd.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(Hd||(Hd=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var Gd=v((Pj,Vd)=>{Vd.exports=m_;var p_=Ud();function m_(t,e){let r,n,s,i=!0;Array.isArray(t)?(r=[],n=t.length):(s=Object.keys(t),r={},n=s.length);function o(c){function u(){e&&e(c,r),e=null}i?p_(u):u()}function a(c,u,l){r[c]=l,(--n===0||u)&&o(u)}n?s?s.forEach(function(c){t[c](function(u,l){a(c,u,l)})}):t.forEach(function(c,u){c(function(l,d){a(u,l,d)})}):o(null),i=!1}});var Pi=v(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var Bs=process.versions.node.split(".");if(Bs[0]===void 0||Bs[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var zd=Number.parseInt(Bs[0],10),g_=Number.parseInt(Bs[1],10),Yd=10,D_=10,y_=zd>Yd,v_=zd===Yd&&g_>=D_;Ms.IS_SUPPORT_READDIR_WITH_FILE_TYPES=y_||v_});var Jd=v(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.createDirentFromStats=void 0;var Oi=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function __(t,e){return new Oi(t,e)}qs.createDirentFromStats=__});var Ni=v(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.fs=void 0;var b_=Jd();Ws.fs=b_});var Li=v(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.joinPathSegments=void 0;function S_(t,e,r){return t.endsWith(r)?t+e:t+r+e}Hs.joinPathSegments=S_});var rf=v(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.readdir=Dr.readdirWithFileTypes=Dr.read=void 0;var E_=Br(),Xd=Gd(),C_=Pi(),Kd=Ni(),Qd=Li();function w_(t,e,r){if(!e.stats&&C_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){ef(t,e,r);return}tf(t,e,r)}Dr.read=w_;function ef(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,s)=>{if(n!==null){Zs(r,n);return}let i=s.map(a=>({dirent:a,name:a.name,path:Qd.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){Bi(r,i);return}let o=i.map(a=>x_(a,e));Xd(o,(a,c)=>{if(a!==null){Zs(r,a);return}Bi(r,c)})})}Dr.readdirWithFileTypes=ef;function x_(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(n,s)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,t);return}t.dirent=Kd.fs.createDirentFromStats(t.name,s),r(null,t)})}}function tf(t,e,r){e.fs.readdir(t,(n,s)=>{if(n!==null){Zs(r,n);return}let i=s.map(o=>{let a=Qd.joinPathSegments(t,o,e.pathSegmentSeparator);return c=>{E_.stat(a,e.fsStatSettings,(u,l)=>{if(u!==null){c(u);return}let d={name:o,path:a,dirent:Kd.fs.createDirentFromStats(o,l)};e.stats&&(d.stats=l),c(null,d)})}});Xd(i,(o,a)=>{if(o!==null){Zs(r,o);return}Bi(r,a)})})}Dr.readdir=tf;function Zs(t,e){t(e)}function Bi(t,e){t(null,e)}});var cf=v(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.readdir=yr.readdirWithFileTypes=yr.read=void 0;var k_=Br(),$_=Pi(),nf=Ni(),sf=Li();function A_(t,e){return!e.stats&&$_.IS_SUPPORT_READDIR_WITH_FILE_TYPES?of(t,e):af(t,e)}yr.read=A_;function of(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let s={dirent:n,name:n.name,path:sf.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(s.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let i=e.fs.statSync(s.path);s.dirent=nf.fs.createDirentFromStats(s.name,i)}catch(i){if(e.throwErrorOnBrokenSymbolicLink)throw i}return s})}yr.readdirWithFileTypes=of;function af(t,e){return e.fs.readdirSync(t).map(n=>{let s=sf.joinPathSegments(t,n,e.pathSegmentSeparator),i=k_.statSync(s,e.fsStatSettings),o={name:n,path:s,dirent:nf.fs.createDirentFromStats(n,i)};return e.stats&&(o.stats=i),o})}yr.readdir=af});var uf=v(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.createFileSystemAdapter=vr.FILE_SYSTEM_ADAPTER=void 0;var vn=require("fs");vr.FILE_SYSTEM_ADAPTER={lstat:vn.lstat,stat:vn.stat,lstatSync:vn.lstatSync,statSync:vn.statSync,readdir:vn.readdir,readdirSync:vn.readdirSync};function F_(t){return t===void 0?vr.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},vr.FILE_SYSTEM_ADAPTER),t)}vr.createFileSystemAdapter=F_});var lf=v(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});var j_=require("path"),I_=Br(),T_=uf(),Mi=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=T_.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,j_.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new I_.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};qi.default=Mi});var Us=v(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.Settings=_r.scandirSync=_r.scandir=void 0;var df=rf(),R_=cf(),Wi=lf();_r.Settings=Wi.default;function P_(t,e,r){if(typeof e=="function"){df.read(t,Hi(),e);return}df.read(t,Hi(e),r)}_r.scandir=P_;function O_(t,e){let r=Hi(e);return R_.read(t,r)}_r.scandirSync=O_;function Hi(t={}){return t instanceof Wi.default?t:new Wi.default(t)}});var hf=v((Uj,ff)=>{"use strict";function N_(t){var e=new t,r=e;function n(){var i=e;return i.next?e=i.next:(e=new t,r=e),i.next=null,i}function s(i){r.next=i,r=i}return{get:n,release:s}}ff.exports=N_});var mf=v((Vj,Zi)=>{"use strict";var L_=hf();function pf(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=L_(B_),s=null,i=null,o=0,a=null,c={push:y,drain:rt,saturated:rt,pause:l,paused:!1,get concurrency(){return r},set concurrency(I){if(!(I>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=I,!c.paused)for(;s&&o<r;)o++,w()},running:u,resume:g,idle:m,length:d,getQueue:f,unshift:h,empty:rt,kill:C,killAndDrain:A,error:G,abort:T};return c;function u(){return o}function l(){c.paused=!0}function d(){for(var I=s,Z=0;I;)I=I.next,Z++;return Z}function f(){for(var I=s,Z=[];I;)Z.push(I.value),I=I.next;return Z}function g(){if(c.paused){if(c.paused=!1,s===null){o++,w();return}for(;s&&o<r;)o++,w()}}function m(){return o===0&&c.length()===0}function y(I,Z){var F=n.get();F.context=t,F.release=w,F.value=I,F.callback=Z||rt,F.errorHandler=a,o>=r||c.paused?i?(i.next=F,i=F):(s=F,i=F,c.saturated()):(o++,e.call(t,F.value,F.worked))}function h(I,Z){var F=n.get();F.context=t,F.release=w,F.value=I,F.callback=Z||rt,F.errorHandler=a,o>=r||c.paused?s?(F.next=s,s=F):(s=F,i=F,c.saturated()):(o++,e.call(t,F.value,F.worked))}function w(I){I&&n.release(I);var Z=s;Z&&o<=r?c.paused?o--:(i===s&&(i=null),s=Z.next,Z.next=null,e.call(t,Z.value,Z.worked),i===null&&c.empty()):--o===0&&c.drain()}function C(){s=null,i=null,c.drain=rt}function A(){s=null,i=null,c.drain(),c.drain=rt}function T(){var I=s;for(s=null,i=null;I;){var Z=I.next,F=I.callback,W=I.errorHandler,R=I.value,b=I.context;I.value=null,I.callback=rt,I.errorHandler=null,W&&W(new Error("abort"),R),F.call(b,new Error("abort")),I.release(I),I=Z}c.drain=rt}function G(I){a=I}}function rt(){}function B_(){this.value=null,this.callback=rt,this.next=null,this.release=rt,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var s=t.callback,i=t.errorHandler,o=t.value;t.value=null,t.callback=rt,t.errorHandler&&i(r,o),s.call(t.context,r,n),t.release(t)}}function M_(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(l,d){e.call(this,l).then(function(f){d(null,f)},d)}var s=pf(t,n,r),i=s.push,o=s.unshift;return s.push=a,s.unshift=c,s.drained=u,s;function a(l){var d=new Promise(function(f,g){i(l,function(m,y){if(m){g(m);return}f(y)})});return d.catch(rt),d}function c(l){var d=new Promise(function(f,g){o(l,function(m,y){if(m){g(m);return}f(y)})});return d.catch(rt),d}function u(){var l=new Promise(function(d){process.nextTick(function(){if(s.idle())d();else{var f=s.drain;s.drain=function(){typeof f=="function"&&f(),d(),s.drain=f}}})});return l}}Zi.exports=pf;Zi.exports.promise=M_});var Vs=v(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.joinPathSegments=Ht.replacePathSegmentSeparator=Ht.isAppliedFilter=Ht.isFatalError=void 0;function q_(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}Ht.isFatalError=q_;function W_(t,e){return t===null||t(e)}Ht.isAppliedFilter=W_;function H_(t,e){return t.split(/[/\\]/).join(e)}Ht.replacePathSegmentSeparator=H_;function Z_(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}Ht.joinPathSegments=Z_});var Gi=v(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});var U_=Vs(),Ui=class{constructor(e,r){this._root=e,this._settings=r,this._root=U_.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};Vi.default=Ui});var Ji=v(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});var V_=require("events"),G_=Us(),z_=mf(),Gs=Vs(),Y_=Gi(),zi=class extends Y_.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=G_.scandir,this._emitter=new V_.EventEmitter,this._queue=z_(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let n={directory:e,base:r};this._queue.push(n,s=>{s!==null&&this._handleError(s)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(n,s)=>{if(n!==null){r(n,void 0);return}for(let i of s)this._handleEntry(i,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!Gs.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let n=e.path;r!==void 0&&(e.path=Gs.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Gs.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&Gs.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};Yi.default=zi});var gf=v(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});var J_=Ji(),Xi=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new J_.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{X_(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{K_(e,this._storage)}),this._reader.read()}};Ki.default=Xi;function X_(t,e){t(e)}function K_(t,e){t(null,e)}});var Df=v(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});var Q_=require("stream"),eb=Ji(),Qi=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new eb.default(this._root,this._settings),this._stream=new Q_.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};ea.default=Qi});var yf=v(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var tb=Us(),zs=Vs(),rb=Gi(),ta=class extends rb.default{constructor(){super(...arguments),this._scandir=tb.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let s of n)this._handleEntry(s,r)}catch(n){this._handleError(n)}}_handleError(e){if(zs.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=zs.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),zs.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&zs.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};ra.default=ta});var vf=v(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});var nb=yf(),na=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new nb.default(this._root,this._settings)}read(){return this._reader.read()}};sa.default=na});var _f=v(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});var sb=require("path"),ob=Us(),oa=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,sb.sep),this.fsScandirSettings=new ob.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};ia.default=oa});var Js=v(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.Settings=Zt.walkStream=Zt.walkSync=Zt.walk=void 0;var bf=gf(),ib=Df(),ab=vf(),aa=_f();Zt.Settings=aa.default;function cb(t,e,r){if(typeof e=="function"){new bf.default(t,Ys()).read(e);return}new bf.default(t,Ys(e)).read(r)}Zt.walk=cb;function ub(t,e){let r=Ys(e);return new ab.default(t,r).read()}Zt.walkSync=ub;function lb(t,e){let r=Ys(e);return new ib.default(t,r).read()}Zt.walkStream=lb;function Ys(t={}){return t instanceof aa.default?t:new aa.default(t)}});var Xs=v(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var db=require("path"),fb=Br(),Sf=tr(),ca=class{constructor(e){this._settings=e,this._fsStatSettings=new fb.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return db.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:Sf.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!Sf.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};ua.default=ca});var fa=v(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});var hb=require("stream"),pb=Br(),mb=Js(),gb=Xs(),la=class extends gb.default{constructor(){super(...arguments),this._walkStream=mb.walkStream,this._stat=pb.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),s=new hb.PassThrough({objectMode:!0});s._write=(i,o,a)=>this._getEntry(n[i],e[i],r).then(c=>{c!==null&&r.entryFilter(c)&&s.push(c),i===n.length-1&&s.end(),a()}).catch(a);for(let i=0;i<n.length;i++)s.write(i);return s}_getEntry(e,r,n){return this._getStat(e).then(s=>this._makeEntry(s,r)).catch(s=>{if(n.errorFilter(s))return null;throw s})}_getStat(e){return new Promise((r,n)=>{this._stat(e,this._fsStatSettings,(s,i)=>s===null?r(i):n(s))})}};da.default=la});var Ef=v(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var Db=Js(),yb=Xs(),vb=fa(),ha=class extends yb.default{constructor(){super(...arguments),this._walkAsync=Db.walk,this._readerStream=new vb.default(this._settings)}dynamic(e,r){return new Promise((n,s)=>{this._walkAsync(e,r,(i,o)=>{i===null?n(o):s(i)})})}async static(e,r){let n=[],s=this._readerStream.static(e,r);return new Promise((i,o)=>{s.once("error",o),s.on("data",a=>n.push(a)),s.once("end",()=>i(n))})}};pa.default=ha});var Cf=v(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var Un=tr(),ma=class{constructor(e,r,n){this._patterns=e,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:e,segments:r,sections:n})}}_getPatternSegments(e){return Un.pattern.getPatternParts(e,this._micromatchOptions).map(n=>Un.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Un.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return Un.array.splitWhen(e,r=>r.dynamic&&Un.pattern.hasGlobStar(r.pattern))}};ga.default=ma});var wf=v(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});var _b=Cf(),Da=class extends _b.default{match(e){let r=e.split("/"),n=r.length,s=this._storage.filter(i=>!i.complete||i.segments.length>n);for(let i of s){let o=i.sections[0];if(!i.complete&&n>o.length||r.every((c,u)=>{let l=i.segments[u];return!!(l.dynamic&&l.patternRe.test(c)||!l.dynamic&&l.pattern===c)}))return!0}return!1}};ya.default=Da});var xf=v(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var Ks=tr(),bb=wf(),va=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){let s=this._getMatcher(r),i=this._getNegativePatternsRe(n);return o=>this._filter(e,o,s,i)}_getMatcher(e){return new bb.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(Ks.pattern.isAffectDepthOfReadingPattern);return Ks.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,s){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=Ks.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(i,n)?!1:this._isSkippedByNegativePatterns(i,s)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let n=r.split("/").length;if(e==="")return n;let s=e.split("/").length;return n-s}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!Ks.pattern.matchAny(e,r)}};_a.default=va});var kf=v(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});var br=tr(),ba=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,s]=br.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:br.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:br.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:br.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return o=>this._filter(o,i)}_filter(e,r){let n=br.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let s=this._isMatchToPatternsSet(n,r,e.dirent.isDirectory());return this._settings.unique&&s&&this._createIndexRecord(n),s}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,r,n){return!(!this._isMatchToPatterns(e,r.positive.all,n)||this._isMatchToPatterns(e,r.negative.relative,n)||this._isMatchToAbsoluteNegative(e,r.negative.absolute,n))}_isMatchToAbsoluteNegative(e,r,n){if(r.length===0)return!1;let s=br.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(s,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let s=br.pattern.matchAny(e,r);return!s&&n?br.pattern.matchAny(e+"/",r):s}};Sa.default=ba});var $f=v(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});var Sb=tr(),Ea=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return Sb.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};Ca.default=Ea});var Ff=v(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});var Af=tr(),wa=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=Af.path.makeAbsolute(this._settings.cwd,r),r=Af.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};xa.default=wa});var Qs=v($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});var Eb=require("path"),Cb=xf(),wb=kf(),xb=$f(),kb=Ff(),ka=class{constructor(e){this._settings=e,this.errorFilter=new xb.default(this._settings),this.entryFilter=new wb.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new Cb.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new kb.default(this._settings)}_getRootDirectory(e){return Eb.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};$a.default=ka});var jf=v(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});var $b=Ef(),Ab=Qs(),Aa=class extends Ab.default{constructor(){super(...arguments),this._reader=new $b.default(this._settings)}async read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(i=>n.transform(i))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};Fa.default=Aa});var If=v(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var Fb=require("stream"),jb=fa(),Ib=Qs(),ja=class extends Ib.default{constructor(){super(...arguments),this._reader=new jb.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),s=this.api(r,e,n),i=new Fb.Readable({objectMode:!0,read:()=>{}});return s.once("error",o=>i.emit("error",o)).on("data",o=>i.emit("data",n.transform(o))).once("end",()=>i.emit("end")),i.once("close",()=>s.destroy()),i}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};Ia.default=ja});var Tf=v(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var Tb=Br(),Rb=Js(),Pb=Xs(),Ta=class extends Pb.default{constructor(){super(...arguments),this._walkSync=Rb.walkSync,this._statSync=Tb.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let n=[];for(let s of e){let i=this._getFullEntryPath(s),o=this._getEntry(i,s,r);o===null||!r.entryFilter(o)||n.push(o)}return n}_getEntry(e,r,n){try{let s=this._getStat(e);return this._makeEntry(s,r)}catch(s){if(n.errorFilter(s))return null;throw s}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};Ra.default=Ta});var Rf=v(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});var Ob=Tf(),Nb=Qs(),Pa=class extends Nb.default{constructor(){super(...arguments),this._reader=new Ob.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(r,e,n).map(n.transform)}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};Oa.default=Pa});var Pf=v(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var _n=require("fs"),Lb=require("os"),Bb=Math.max(Lb.cpus().length,1);bn.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:_n.lstat,lstatSync:_n.lstatSync,stat:_n.stat,statSync:_n.statSync,readdir:_n.readdir,readdirSync:_n.readdirSync};var Na=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,Bb),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},bn.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};bn.default=Na});var Lf=v((D2,Nf)=>{"use strict";var Of=Od(),Mb=jf(),qb=If(),Wb=Rf(),La=Pf(),pt=tr();async function Ba(t,e){$t(t);let r=Ma(t,Mb.default,e),n=await Promise.all(r);return pt.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(u,l){$t(u);let d=Ma(u,Wb.default,l);return pt.array.flatten(d)}t.sync=e;function r(u,l){$t(u);let d=Ma(u,qb.default,l);return pt.stream.merge(d)}t.stream=r;function n(u,l){$t(u);let d=[].concat(u),f=new La.default(l);return Of.generate(d,f)}t.generateTasks=n;function s(u,l){$t(u);let d=new La.default(l);return pt.pattern.isDynamicPattern(u,d)}t.isDynamicPattern=s;function i(u){return $t(u),pt.path.escape(u)}t.escapePath=i;function o(u){return $t(u),pt.path.convertPathToPattern(u)}t.convertPathToPattern=o;let a;(function(u){function l(f){return $t(f),pt.path.escapePosixPath(f)}u.escapePath=l;function d(f){return $t(f),pt.path.convertPosixPathToPattern(f)}u.convertPathToPattern=d})(a=t.posix||(t.posix={}));let c;(function(u){function l(f){return $t(f),pt.path.escapeWindowsPath(f)}u.escapePath=l;function d(f){return $t(f),pt.path.convertWindowsPathToPattern(f)}u.convertPathToPattern=d})(c=t.win32||(t.win32={}))})(Ba||(Ba={}));function Ma(t,e,r){let n=[].concat(t),s=new La.default(r),i=Of.generate(n,s),o=new e(s);return i.map(o.read,o)}function $t(t){if(![].concat(t).every(n=>pt.string.isString(n)&&!pt.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}Nf.exports=Ba});var Vn=v(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.getParsedType=be.ZodParsedType=be.objectUtil=be.util=void 0;var qa;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let i={};for(let o of s)i[o]=o;return i},t.getValidEnumValues=s=>{let i=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(let a of i)o[a]=s[a];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(let o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(qa||(be.util=qa={}));var Bf;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Bf||(be.objectUtil=Bf={}));be.ZodParsedType=qa.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var Hb=t=>{switch(typeof t){case"undefined":return be.ZodParsedType.undefined;case"string":return be.ZodParsedType.string;case"number":return Number.isNaN(t)?be.ZodParsedType.nan:be.ZodParsedType.number;case"boolean":return be.ZodParsedType.boolean;case"function":return be.ZodParsedType.function;case"bigint":return be.ZodParsedType.bigint;case"symbol":return be.ZodParsedType.symbol;case"object":return Array.isArray(t)?be.ZodParsedType.array:t===null?be.ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?be.ZodParsedType.promise:typeof Map<"u"&&t instanceof Map?be.ZodParsedType.map:typeof Set<"u"&&t instanceof Set?be.ZodParsedType.set:typeof Date<"u"&&t instanceof Date?be.ZodParsedType.date:be.ZodParsedType.object;default:return be.ZodParsedType.unknown}};be.getParsedType=Hb});var eo=v(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.ZodError=Sr.quotelessJson=Sr.ZodIssueCode=void 0;var Mf=Vn();Sr.ZodIssueCode=Mf.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var Zb=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");Sr.quotelessJson=Zb;var Gn=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(i){return i.message},n={_errors:[]},s=i=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,c=0;for(;c<o.path.length;){let u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return s(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Mf.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)if(s.path.length>0){let i=s.path[0];r[i]=r[i]||[],r[i].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Sr.ZodError=Gn;Gn.create=t=>new Gn(t)});var Ha=v(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});var We=eo(),Mr=Vn(),Ub=(t,e)=>{let r;switch(t.code){case We.ZodIssueCode.invalid_type:t.received===Mr.ZodParsedType.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case We.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Mr.util.jsonStringifyReplacer)}`;break;case We.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${Mr.util.joinValues(t.keys,", ")}`;break;case We.ZodIssueCode.invalid_union:r="Invalid input";break;case We.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Mr.util.joinValues(t.options)}`;break;case We.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${Mr.util.joinValues(t.options)}, received '${t.received}'`;break;case We.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case We.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case We.ZodIssueCode.invalid_date:r="Invalid date";break;case We.ZodIssueCode.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Mr.util.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case We.ZodIssueCode.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case We.ZodIssueCode.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case We.ZodIssueCode.custom:r="Invalid input";break;case We.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case We.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case We.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=e.defaultError,Mr.util.assertNever(t)}return{message:r}};Wa.default=Ub});var to=v(Er=>{"use strict";var Vb=Er&&Er.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Er,"__esModule",{value:!0});Er.defaultErrorMap=void 0;Er.setErrorMap=Gb;Er.getErrorMap=zb;var qf=Vb(Ha());Er.defaultErrorMap=qf.default;var Wf=qf.default;function Gb(t){Wf=t}function zb(){return Wf}});var Ua=v(De=>{"use strict";var Yb=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(De,"__esModule",{value:!0});De.isAsync=De.isValid=De.isDirty=De.isAborted=De.OK=De.DIRTY=De.INVALID=De.ParseStatus=De.EMPTY_PATH=De.makeIssue=void 0;De.addIssueToContext=Kb;var Jb=to(),Hf=Yb(Ha()),Xb=t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,i=[...r,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}};De.makeIssue=Xb;De.EMPTY_PATH=[];function Kb(t,e){let r=(0,Jb.getErrorMap)(),n=(0,De.makeIssue)({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Hf.default?void 0:Hf.default].filter(s=>!!s)});t.common.issues.push(n)}var Za=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return De.INVALID;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let i=await s.key,o=await s.value;n.push({key:i,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return De.INVALID;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}};De.ParseStatus=Za;De.INVALID=Object.freeze({status:"aborted"});var Qb=t=>({status:"dirty",value:t});De.DIRTY=Qb;var eS=t=>({status:"valid",value:t});De.OK=eS;var tS=t=>t.status==="aborted";De.isAborted=tS;var rS=t=>t.status==="dirty";De.isDirty=rS;var nS=t=>t.status==="valid";De.isValid=nS;var sS=t=>typeof Promise<"u"&&t instanceof Promise;De.isAsync=sS});var Uf=v(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0})});var Gf=v(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.errorUtil=void 0;var Vf;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Vf||(ro.errorUtil=Vf={}))});var oh=v(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.discriminatedUnion=S.date=S.boolean=S.bigint=S.array=S.any=S.coerce=S.ZodFirstPartyTypeKind=S.late=S.ZodSchema=S.Schema=S.ZodReadonly=S.ZodPipeline=S.ZodBranded=S.BRAND=S.ZodNaN=S.ZodCatch=S.ZodDefault=S.ZodNullable=S.ZodOptional=S.ZodTransformer=S.ZodEffects=S.ZodPromise=S.ZodNativeEnum=S.ZodEnum=S.ZodLiteral=S.ZodLazy=S.ZodFunction=S.ZodSet=S.ZodMap=S.ZodRecord=S.ZodTuple=S.ZodIntersection=S.ZodDiscriminatedUnion=S.ZodUnion=S.ZodObject=S.ZodArray=S.ZodVoid=S.ZodNever=S.ZodUnknown=S.ZodAny=S.ZodNull=S.ZodUndefined=S.ZodSymbol=S.ZodDate=S.ZodBoolean=S.ZodBigInt=S.ZodNumber=S.ZodString=S.ZodType=void 0;S.NEVER=S.void=S.unknown=S.union=S.undefined=S.tuple=S.transformer=S.symbol=S.string=S.strictObject=S.set=S.record=S.promise=S.preprocess=S.pipeline=S.ostring=S.optional=S.onumber=S.oboolean=S.object=S.number=S.nullable=S.null=S.never=S.nativeEnum=S.nan=S.map=S.literal=S.lazy=S.intersection=S.instanceof=S.function=S.enum=S.effect=void 0;S.datetimeRegex=Kf;S.custom=eh;var P=eo(),no=to(),K=Gf(),E=Ua(),N=Vn(),gt=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},zf=(t,e)=>{if((0,E.isValid)(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new P.ZodError(t.common.issues);return this._error=r,this._error}}};function ae(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{let{message:c}=t;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:s}}var ce=class{get description(){return this._def.description}_getType(e){return(0,N.getParsedType)(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:(0,N.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new E.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,N.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if((0,E.isAsync)(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,N.getParsedType)(e)},s=this._parseSync({data:e,path:n.path,parent:n});return zf(n,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,N.getParsedType)(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return(0,E.isValid)(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>(0,E.isValid)(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,N.getParsedType)(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await((0,E.isAsync)(s)?s:Promise.resolve(s));return zf(n,i)}refine(e,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{let o=e(s),a=()=>i.addIssue({code:P.ZodIssueCode.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new ut({schema:this,typeName:ne.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return mt.create(this,this._def)}nullable(){return Vt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sr.create(this)}promise(){return xr.create(this,this._def)}or(e){return Gr.create([this,e],this._def)}and(e){return zr.create(this,e,this._def)}transform(e){return new ut({...ae(this._def),schema:this,typeName:ne.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Qr({...ae(this._def),innerType:this,defaultValue:r,typeName:ne.ZodDefault})}brand(){return new zn({typeName:ne.ZodBranded,type:this,...ae(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new en({...ae(this._def),innerType:this,catchValue:r,typeName:ne.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Yn.create(this,e)}readonly(){return tn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};S.ZodType=ce;S.Schema=ce;S.ZodSchema=ce;var oS=/^c[^\s-]{8,}$/i,iS=/^[0-9a-z]+$/,aS=/^[0-9A-HJKMNP-TV-Z]{26}$/i,cS=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,uS=/^[a-z0-9_-]{21}$/i,lS=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dS=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fS=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Va,pS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,gS=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,DS=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yS=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vS=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jf="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",_S=new RegExp(`^${Jf}$`);function Xf(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function bS(t){return new RegExp(`^${Xf(t)}$`)}function Kf(t){let e=`${Jf}T${Xf(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function SS(t,e){return!!((e==="v4"||!e)&&pS.test(t)||(e==="v6"||!e)&&gS.test(t))}function ES(t,e){if(!lS.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function CS(t,e){return!!((e==="v4"||!e)&&mS.test(t)||(e==="v6"||!e)&&DS.test(t))}var Cr=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==N.ZodParsedType.string){let i=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(i,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.string,received:i.parsedType}),E.INVALID}let n=new E.ParseStatus,s;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:P.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:P.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let o=e.data.length>i.value,a=e.data.length<i.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?(0,E.addIssueToContext)(s,{code:P.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&(0,E.addIssueToContext)(s,{code:P.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")fS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"email",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Va||(Va=new RegExp(hS,"u")),Va.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"emoji",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")cS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"uuid",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")uS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"nanoid",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")oS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"cuid",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")iS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"cuid2",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")aS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"ulid",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"url",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"regex",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Kf(i).test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?_S.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?bS(i).test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:P.ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?dS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"duration",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?SS(e.data,i.version)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"ip",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?ES(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"jwt",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?CS(e.data,i.version)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"cidr",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?yS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"base64",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?vS.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{validation:"base64url",code:P.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):N.util.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:P.ZodIssueCode.invalid_string,...K.errorUtil.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...K.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...K.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...K.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...K.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...K.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...K.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...K.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...K.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...K.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...K.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...K.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...K.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...K.errorUtil.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...K.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...K.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...K.errorUtil.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...K.errorUtil.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...K.errorUtil.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...K.errorUtil.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...K.errorUtil.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...K.errorUtil.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...K.errorUtil.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...K.errorUtil.errToObj(r)})}nonempty(e){return this.min(1,K.errorUtil.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};S.ZodString=Cr;Cr.create=t=>new Cr({checks:[],typeName:ne.ZodString,coerce:t?.coerce??!1,...ae(t)});function wS(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}var qr=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==N.ZodParsedType.number){let i=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(i,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.number,received:i.parsedType}),E.INVALID}let n,s=new E.ParseStatus;for(let i of this._def.checks)i.kind==="int"?N.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?wS(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.not_finite,message:i.message}),s.dirty()):N.util.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,K.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.errorUtil.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:K.errorUtil.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:K.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:K.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:K.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:K.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:K.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.errorUtil.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:K.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:K.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:K.errorUtil.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&N.util.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};S.ZodNumber=qr;qr.create=t=>new qr({checks:[],typeName:ne.ZodNumber,coerce:t?.coerce||!1,...ae(t)});var Wr=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==N.ZodParsedType.bigint)return this._getInvalidInput(e);let n,s=new E.ParseStatus;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):N.util.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.bigint,received:r.parsedType}),E.INVALID}gte(e,r){return this.setLimit("min",e,!0,K.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.errorUtil.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:K.errorUtil.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:K.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:K.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:K.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:K.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.errorUtil.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};S.ZodBigInt=Wr;Wr.create=t=>new Wr({checks:[],typeName:ne.ZodBigInt,coerce:t?.coerce??!1,...ae(t)});var Hr=class extends ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==N.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.boolean,received:n.parsedType}),E.INVALID}return(0,E.OK)(e.data)}};S.ZodBoolean=Hr;Hr.create=t=>new Hr({typeName:ne.ZodBoolean,coerce:t?.coerce||!1,...ae(t)});var Zr=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==N.ZodParsedType.date){let i=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(i,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.date,received:i.parsedType}),E.INVALID}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(i,{code:P.ZodIssueCode.invalid_date}),E.INVALID}let n=new E.ParseStatus,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:P.ZodIssueCode.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),(0,E.addIssueToContext)(s,{code:P.ZodIssueCode.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):N.util.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:K.errorUtil.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:K.errorUtil.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};S.ZodDate=Zr;Zr.create=t=>new Zr({checks:[],coerce:t?.coerce||!1,typeName:ne.ZodDate,...ae(t)});var En=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.symbol,received:n.parsedType}),E.INVALID}return(0,E.OK)(e.data)}};S.ZodSymbol=En;En.create=t=>new En({typeName:ne.ZodSymbol,...ae(t)});var Ur=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.undefined,received:n.parsedType}),E.INVALID}return(0,E.OK)(e.data)}};S.ZodUndefined=Ur;Ur.create=t=>new Ur({typeName:ne.ZodUndefined,...ae(t)});var Vr=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.null,received:n.parsedType}),E.INVALID}return(0,E.OK)(e.data)}};S.ZodNull=Vr;Vr.create=t=>new Vr({typeName:ne.ZodNull,...ae(t)});var wr=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,E.OK)(e.data)}};S.ZodAny=wr;wr.create=t=>new wr({typeName:ne.ZodAny,...ae(t)});var nr=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,E.OK)(e.data)}};S.ZodUnknown=nr;nr.create=t=>new nr({typeName:ne.ZodUnknown,...ae(t)});var At=class extends ce{_parse(e){let r=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.never,received:r.parsedType}),E.INVALID}};S.ZodNever=At;At.create=t=>new At({typeName:ne.ZodNever,...ae(t)});var Cn=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.void,received:n.parsedType}),E.INVALID}return(0,E.OK)(e.data)}};S.ZodVoid=Cn;Cn.create=t=>new Cn({typeName:ne.ZodVoid,...ae(t)});var sr=class t extends ce{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==N.ZodParsedType.array)return(0,E.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.array,received:r.parsedType}),E.INVALID;if(s.exactLength!==null){let o=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(o||a)&&((0,E.addIssueToContext)(r,{code:o?P.ZodIssueCode.too_big:P.ZodIssueCode.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&((0,E.addIssueToContext)(r,{code:P.ZodIssueCode.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&((0,E.addIssueToContext)(r,{code:P.ZodIssueCode.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>s.type._parseAsync(new gt(r,o,r.path,a)))).then(o=>E.ParseStatus.mergeArray(n,o));let i=[...r.data].map((o,a)=>s.type._parseSync(new gt(r,o,r.path,a)));return E.ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:K.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:K.errorUtil.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:K.errorUtil.toString(r)}})}nonempty(e){return this.min(1,e)}};S.ZodArray=sr;sr.create=(t,e)=>new sr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ne.ZodArray,...ae(e)});function Sn(t){if(t instanceof nt){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=mt.create(Sn(n))}return new nt({...t._def,shape:()=>e})}else return t instanceof sr?new sr({...t._def,type:Sn(t.element)}):t instanceof mt?mt.create(Sn(t.unwrap())):t instanceof Vt?Vt.create(Sn(t.unwrap())):t instanceof Ut?Ut.create(t.items.map(e=>Sn(e))):t}var nt=class t extends ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=N.util.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==N.ZodParsedType.object){let u=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(u,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.object,received:u.parsedType}),E.INVALID}let{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof At&&this._def.unknownKeys==="strip"))for(let u in s.data)o.includes(u)||a.push(u);let c=[];for(let u of o){let l=i[u],d=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new gt(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof At){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:s.data[l]}});else if(u==="strict")a.length>0&&((0,E.addIssueToContext)(s,{code:P.ZodIssueCode.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new gt(s,d,s.path,l)),alwaysSet:l in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,f=await l.value;u.push({key:d,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>E.ParseStatus.mergeObjectSync(n,u)):E.ParseStatus.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return K.errorUtil.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:K.errorUtil.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ne.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of N.util.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of N.util.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Sn(this)}partial(e){let r={};for(let n of N.util.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of N.util.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof mt;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return Qf(N.util.objectKeys(this.shape))}};S.ZodObject=nt;nt.create=(t,e)=>new nt({shape:()=>t,unknownKeys:"strip",catchall:At.create(),typeName:ne.ZodObject,...ae(e)});nt.strictCreate=(t,e)=>new nt({shape:()=>t,unknownKeys:"strict",catchall:At.create(),typeName:ne.ZodObject,...ae(e)});nt.lazycreate=(t,e)=>new nt({shape:t,unknownKeys:"strip",catchall:At.create(),typeName:ne.ZodObject,...ae(e)});var Gr=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(a=>new P.ZodError(a.ctx.common.issues));return(0,E.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_union,unionErrors:o}),E.INVALID}if(r.common.async)return Promise.all(n.map(async i=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i,o=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!i&&(i={result:l,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(c=>new P.ZodError(c));return(0,E.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_union,unionErrors:a}),E.INVALID}}get options(){return this._def.options}};S.ZodUnion=Gr;Gr.create=(t,e)=>new Gr({options:t,typeName:ne.ZodUnion,...ae(e)});var rr=t=>t instanceof Yr?rr(t.schema):t instanceof ut?rr(t.innerType()):t instanceof Jr?[t.value]:t instanceof Xr?t.options:t instanceof Kr?N.util.objectValues(t.enum):t instanceof Qr?rr(t._def.innerType):t instanceof Ur?[void 0]:t instanceof Vr?[null]:t instanceof mt?[void 0,...rr(t.unwrap())]:t instanceof Vt?[null,...rr(t.unwrap())]:t instanceof zn||t instanceof tn?rr(t.unwrap()):t instanceof en?rr(t._def.innerType):[],so=class t extends ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==N.ZodParsedType.object)return(0,E.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.object,received:r.parsedType}),E.INVALID;let n=this.discriminator,s=r.data[n],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):((0,E.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),E.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let i of r){let o=rr(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,i)}}return new t({typeName:ne.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...ae(n)})}};S.ZodDiscriminatedUnion=so;function Ga(t,e){let r=(0,N.getParsedType)(t),n=(0,N.getParsedType)(e);if(t===e)return{valid:!0,data:t};if(r===N.ZodParsedType.object&&n===N.ZodParsedType.object){let s=N.util.objectKeys(e),i=N.util.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(let a of i){let c=Ga(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(r===N.ZodParsedType.array&&n===N.ZodParsedType.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let i=0;i<t.length;i++){let o=t[i],a=e[i],c=Ga(o,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===N.ZodParsedType.date&&n===N.ZodParsedType.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var zr=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=(i,o)=>{if((0,E.isAborted)(i)||(0,E.isAborted)(o))return E.INVALID;let a=Ga(i.value,o.value);return a.valid?(((0,E.isDirty)(i)||(0,E.isDirty)(o))&&r.dirty(),{status:r.value,value:a.data}):((0,E.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_intersection_types}),E.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};S.ZodIntersection=zr;zr.create=(t,e,r)=>new zr({left:t,right:e,typeName:ne.ZodIntersection,...ae(r)});var Ut=class t extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==N.ZodParsedType.array)return(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.array,received:n.parsedType}),E.INVALID;if(n.data.length<this._def.items.length)return(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),E.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,E.addIssueToContext)(n,{code:P.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new gt(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>E.ParseStatus.mergeArray(r,o)):E.ParseStatus.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};S.ZodTuple=Ut;Ut.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ut({items:t,typeName:ne.ZodTuple,rest:null,...ae(e)})};var oo=class t extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==N.ZodParsedType.object)return(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.object,received:n.parsedType}),E.INVALID;let s=[],i=this._def.keyType,o=this._def.valueType;for(let a in n.data)s.push({key:i._parse(new gt(n,a,n.path,a)),value:o._parse(new gt(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?E.ParseStatus.mergeObjectAsync(r,s):E.ParseStatus.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ce?new t({keyType:e,valueType:r,typeName:ne.ZodRecord,...ae(n)}):new t({keyType:Cr.create(),valueType:e,typeName:ne.ZodRecord,...ae(r)})}};S.ZodRecord=oo;var wn=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==N.ZodParsedType.map)return(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.map,received:n.parsedType}),E.INVALID;let s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,c],u)=>({key:s._parse(new gt(n,a,n.path,[u,"key"])),value:i._parse(new gt(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return E.INVALID;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of o){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return E.INVALID;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};S.ZodMap=wn;wn.create=(t,e,r)=>new wn({valueType:e,keyType:t,typeName:ne.ZodMap,...ae(r)});var xn=class t extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==N.ZodParsedType.set)return(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.set,received:n.parsedType}),E.INVALID;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&((0,E.addIssueToContext)(n,{code:P.ZodIssueCode.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&((0,E.addIssueToContext)(n,{code:P.ZodIssueCode.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function o(c){let u=new Set;for(let l of c){if(l.status==="aborted")return E.INVALID;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>i._parse(new gt(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:K.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:K.errorUtil.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};S.ZodSet=xn;xn.create=(t,e)=>new xn({valueType:t,minSize:null,maxSize:null,typeName:ne.ZodSet,...ae(e)});var io=class t extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==N.ZodParsedType.function)return(0,E.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.function,received:r.parsedType}),E.INVALID;function n(a,c){return(0,E.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,no.getErrorMap)(),no.defaultErrorMap].filter(u=>!!u),issueData:{code:P.ZodIssueCode.invalid_arguments,argumentsError:c}})}function s(a,c){return(0,E.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,no.getErrorMap)(),no.defaultErrorMap].filter(u=>!!u),issueData:{code:P.ZodIssueCode.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof xr){let a=this;return(0,E.OK)(async function(...c){let u=new P.ZodError([]),l=await a._def.args.parseAsync(c,i).catch(g=>{throw u.addIssue(n(c,g)),u}),d=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(d,i).catch(g=>{throw u.addIssue(s(d,g)),u})})}else{let a=this;return(0,E.OK)(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new P.ZodError([n(c,u.error)]);let l=Reflect.apply(o,this,u.data),d=a._def.returns.safeParse(l,i);if(!d.success)throw new P.ZodError([s(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ut.create(e).rest(nr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Ut.create([]).rest(nr.create()),returns:r||nr.create(),typeName:ne.ZodFunction,...ae(n)})}};S.ZodFunction=io;var Yr=class extends ce{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};S.ZodLazy=Yr;Yr.create=(t,e)=>new Yr({getter:t,typeName:ne.ZodLazy,...ae(e)});var Jr=class extends ce{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(r,{received:r.data,code:P.ZodIssueCode.invalid_literal,expected:this._def.value}),E.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}};S.ZodLiteral=Jr;Jr.create=(t,e)=>new Jr({value:t,typeName:ne.ZodLiteral,...ae(e)});function Qf(t,e){return new Xr({values:t,typeName:ne.ZodEnum,...ae(e)})}var Xr=class t extends ce{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,E.addIssueToContext)(r,{expected:N.util.joinValues(n),received:r.parsedType,code:P.ZodIssueCode.invalid_type}),E.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,E.addIssueToContext)(r,{received:r.data,code:P.ZodIssueCode.invalid_enum_value,options:n}),E.INVALID}return(0,E.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};S.ZodEnum=Xr;Xr.create=Qf;var Kr=class extends ce{_parse(e){let r=N.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==N.ZodParsedType.string&&n.parsedType!==N.ZodParsedType.number){let s=N.util.objectValues(r);return(0,E.addIssueToContext)(n,{expected:N.util.joinValues(s),received:n.parsedType,code:P.ZodIssueCode.invalid_type}),E.INVALID}if(this._cache||(this._cache=new Set(N.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=N.util.objectValues(r);return(0,E.addIssueToContext)(n,{received:n.data,code:P.ZodIssueCode.invalid_enum_value,options:s}),E.INVALID}return(0,E.OK)(e.data)}get enum(){return this._def.values}};S.ZodNativeEnum=Kr;Kr.create=(t,e)=>new Kr({values:t,typeName:ne.ZodNativeEnum,...ae(e)});var xr=class extends ce{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==N.ZodParsedType.promise&&r.common.async===!1)return(0,E.addIssueToContext)(r,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.promise,received:r.parsedType}),E.INVALID;let n=r.parsedType===N.ZodParsedType.promise?r.data:Promise.resolve(r.data);return(0,E.OK)(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};S.ZodPromise=xr;xr.create=(t,e)=>new xr({type:t,typeName:ne.ZodPromise,...ae(e)});var ut=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ne.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{(0,E.addIssueToContext)(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return E.INVALID;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?E.INVALID:c.status==="dirty"||r.value==="dirty"?(0,E.DIRTY)(c.value):c});{if(r.value==="aborted")return E.INVALID;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?E.INVALID:a.status==="dirty"||r.value==="dirty"?(0,E.DIRTY)(a.value):a}}if(s.type==="refinement"){let o=a=>{let c=s.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?E.INVALID:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?E.INVALID:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,E.isValid)(o))return E.INVALID;let a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>(0,E.isValid)(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):E.INVALID);N.util.assertNever(s)}};S.ZodEffects=ut;S.ZodTransformer=ut;ut.create=(t,e,r)=>new ut({schema:t,typeName:ne.ZodEffects,effect:e,...ae(r)});ut.createWithPreprocess=(t,e,r)=>new ut({schema:e,effect:{type:"preprocess",transform:t},typeName:ne.ZodEffects,...ae(r)});var mt=class extends ce{_parse(e){return this._getType(e)===N.ZodParsedType.undefined?(0,E.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};S.ZodOptional=mt;mt.create=(t,e)=>new mt({innerType:t,typeName:ne.ZodOptional,...ae(e)});var Vt=class extends ce{_parse(e){return this._getType(e)===N.ZodParsedType.null?(0,E.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};S.ZodNullable=Vt;Vt.create=(t,e)=>new Vt({innerType:t,typeName:ne.ZodNullable,...ae(e)});var Qr=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===N.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};S.ZodDefault=Qr;Qr.create=(t,e)=>new Qr({innerType:t,typeName:ne.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ae(e)});var en=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,E.isAsync)(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new P.ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new P.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};S.ZodCatch=en;en.create=(t,e)=>new en({innerType:t,typeName:ne.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ae(e)});var kn=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return(0,E.addIssueToContext)(n,{code:P.ZodIssueCode.invalid_type,expected:N.ZodParsedType.nan,received:n.parsedType}),E.INVALID}return{status:"valid",value:e.data}}};S.ZodNaN=kn;kn.create=t=>new kn({typeName:ne.ZodNaN,...ae(t)});S.BRAND=Symbol("zod_brand");var zn=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};S.ZodBranded=zn;var Yn=class t extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?E.INVALID:i.status==="dirty"?(r.dirty(),(0,E.DIRTY)(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?E.INVALID:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:ne.ZodPipeline})}};S.ZodPipeline=Yn;var tn=class extends ce{_parse(e){let r=this._def.innerType._parse(e),n=s=>((0,E.isValid)(s)&&(s.value=Object.freeze(s.value)),s);return(0,E.isAsync)(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};S.ZodReadonly=tn;tn.create=(t,e)=>new tn({innerType:t,typeName:ne.ZodReadonly,...ae(e)});function Yf(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function eh(t,e={},r){return t?wr.create().superRefine((n,s)=>{let i=t(n);if(i instanceof Promise)return i.then(o=>{if(!o){let a=Yf(e,n),c=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:c})}});if(!i){let o=Yf(e,n),a=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:a})}}):wr.create()}S.late={object:nt.lazycreate};var ne;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ne||(S.ZodFirstPartyTypeKind=ne={}));var xS=(t,e={message:`Input not instance of ${t.name}`})=>eh(r=>r instanceof t,e);S.instanceof=xS;var th=Cr.create;S.string=th;var rh=qr.create;S.number=rh;var kS=kn.create;S.nan=kS;var $S=Wr.create;S.bigint=$S;var nh=Hr.create;S.boolean=nh;var AS=Zr.create;S.date=AS;var FS=En.create;S.symbol=FS;var jS=Ur.create;S.undefined=jS;var IS=Vr.create;S.null=IS;var TS=wr.create;S.any=TS;var RS=nr.create;S.unknown=RS;var PS=At.create;S.never=PS;var OS=Cn.create;S.void=OS;var NS=sr.create;S.array=NS;var LS=nt.create;S.object=LS;var BS=nt.strictCreate;S.strictObject=BS;var MS=Gr.create;S.union=MS;var qS=so.create;S.discriminatedUnion=qS;var WS=zr.create;S.intersection=WS;var HS=Ut.create;S.tuple=HS;var ZS=oo.create;S.record=ZS;var US=wn.create;S.map=US;var VS=xn.create;S.set=VS;var GS=io.create;S.function=GS;var zS=Yr.create;S.lazy=zS;var YS=Jr.create;S.literal=YS;var JS=Xr.create;S.enum=JS;var XS=Kr.create;S.nativeEnum=XS;var KS=xr.create;S.promise=KS;var sh=ut.create;S.effect=sh;S.transformer=sh;var QS=mt.create;S.optional=QS;var eE=Vt.create;S.nullable=eE;var tE=ut.createWithPreprocess;S.preprocess=tE;var rE=Yn.create;S.pipeline=rE;var nE=()=>th().optional();S.ostring=nE;var sE=()=>rh().optional();S.onumber=sE;var oE=()=>nh().optional();S.oboolean=oE;S.coerce={string:(t=>Cr.create({...t,coerce:!0})),number:(t=>qr.create({...t,coerce:!0})),boolean:(t=>Hr.create({...t,coerce:!0})),bigint:(t=>Wr.create({...t,coerce:!0})),date:(t=>Zr.create({...t,coerce:!0}))};S.NEVER=E.INVALID});var za=v(Dt=>{"use strict";var iE=Dt&&Dt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$n=Dt&&Dt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iE(e,t,r)};Object.defineProperty(Dt,"__esModule",{value:!0});$n(to(),Dt);$n(Ua(),Dt);$n(Uf(),Dt);$n(Vn(),Dt);$n(oh(),Dt);$n(eo(),Dt)});var Ya=v(st=>{"use strict";var ih=st&&st.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aE=st&&st.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cE=st&&st.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ih(e,t,r);return aE(e,t),e},uE=st&&st.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ih(e,t,r)};Object.defineProperty(st,"__esModule",{value:!0});st.z=void 0;var ah=cE(za());st.z=ah;uE(za(),st);st.default=ah});var Jn=v(($2,ch)=>{"use strict";var lE="2.0.0",dE=Number.MAX_SAFE_INTEGER||9007199254740991,fE=16,hE=250,pE=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ch.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:fE,MAX_SAFE_BUILD_LENGTH:hE,MAX_SAFE_INTEGER:dE,RELEASE_TYPES:pE,SEMVER_SPEC_VERSION:lE,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Xn=v((A2,uh)=>{"use strict";var mE=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};uh.exports=mE});var An=v((Gt,lh)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Ja,MAX_SAFE_BUILD_LENGTH:gE,MAX_LENGTH:DE}=Jn(),yE=Xn();Gt=lh.exports={};var vE=Gt.re=[],_E=Gt.safeRe=[],U=Gt.src=[],bE=Gt.safeSrc=[],V=Gt.t={},SE=0,Xa="[a-zA-Z0-9-]",EE=[["\\s",1],["\\d",DE],[Xa,gE]],CE=t=>{for(let[e,r]of EE)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ie=(t,e,r)=>{let n=CE(e),s=SE++;yE(t,s,e),V[t]=s,U[s]=e,bE[s]=n,vE[s]=new RegExp(e,r?"g":void 0),_E[s]=new RegExp(n,r?"g":void 0)};ie("NUMERICIDENTIFIER","0|[1-9]\\d*");ie("NUMERICIDENTIFIERLOOSE","\\d+");ie("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Xa}*`);ie("MAINVERSION",`(${U[V.NUMERICIDENTIFIER]})\\.(${U[V.NUMERICIDENTIFIER]})\\.(${U[V.NUMERICIDENTIFIER]})`);ie("MAINVERSIONLOOSE",`(${U[V.NUMERICIDENTIFIERLOOSE]})\\.(${U[V.NUMERICIDENTIFIERLOOSE]})\\.(${U[V.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASEIDENTIFIER",`(?:${U[V.NONNUMERICIDENTIFIER]}|${U[V.NUMERICIDENTIFIER]})`);ie("PRERELEASEIDENTIFIERLOOSE",`(?:${U[V.NONNUMERICIDENTIFIER]}|${U[V.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASE",`(?:-(${U[V.PRERELEASEIDENTIFIER]}(?:\\.${U[V.PRERELEASEIDENTIFIER]})*))`);ie("PRERELEASELOOSE",`(?:-?(${U[V.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${U[V.PRERELEASEIDENTIFIERLOOSE]})*))`);ie("BUILDIDENTIFIER",`${Xa}+`);ie("BUILD",`(?:\\+(${U[V.BUILDIDENTIFIER]}(?:\\.${U[V.BUILDIDENTIFIER]})*))`);ie("FULLPLAIN",`v?${U[V.MAINVERSION]}${U[V.PRERELEASE]}?${U[V.BUILD]}?`);ie("FULL",`^${U[V.FULLPLAIN]}$`);ie("LOOSEPLAIN",`[v=\\s]*${U[V.MAINVERSIONLOOSE]}${U[V.PRERELEASELOOSE]}?${U[V.BUILD]}?`);ie("LOOSE",`^${U[V.LOOSEPLAIN]}$`);ie("GTLT","((?:<|>)?=?)");ie("XRANGEIDENTIFIERLOOSE",`${U[V.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ie("XRANGEIDENTIFIER",`${U[V.NUMERICIDENTIFIER]}|x|X|\\*`);ie("XRANGEPLAIN",`[v=\\s]*(${U[V.XRANGEIDENTIFIER]})(?:\\.(${U[V.XRANGEIDENTIFIER]})(?:\\.(${U[V.XRANGEIDENTIFIER]})(?:${U[V.PRERELEASE]})?${U[V.BUILD]}?)?)?`);ie("XRANGEPLAINLOOSE",`[v=\\s]*(${U[V.XRANGEIDENTIFIERLOOSE]})(?:\\.(${U[V.XRANGEIDENTIFIERLOOSE]})(?:\\.(${U[V.XRANGEIDENTIFIERLOOSE]})(?:${U[V.PRERELEASELOOSE]})?${U[V.BUILD]}?)?)?`);ie("XRANGE",`^${U[V.GTLT]}\\s*${U[V.XRANGEPLAIN]}$`);ie("XRANGELOOSE",`^${U[V.GTLT]}\\s*${U[V.XRANGEPLAINLOOSE]}$`);ie("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ja}})(?:\\.(\\d{1,${Ja}}))?(?:\\.(\\d{1,${Ja}}))?`);ie("COERCE",`${U[V.COERCEPLAIN]}(?:$|[^\\d])`);ie("COERCEFULL",U[V.COERCEPLAIN]+`(?:${U[V.PRERELEASE]})?(?:${U[V.BUILD]})?(?:$|[^\\d])`);ie("COERCERTL",U[V.COERCE],!0);ie("COERCERTLFULL",U[V.COERCEFULL],!0);ie("LONETILDE","(?:~>?)");ie("TILDETRIM",`(\\s*)${U[V.LONETILDE]}\\s+`,!0);Gt.tildeTrimReplace="$1~";ie("TILDE",`^${U[V.LONETILDE]}${U[V.XRANGEPLAIN]}$`);ie("TILDELOOSE",`^${U[V.LONETILDE]}${U[V.XRANGEPLAINLOOSE]}$`);ie("LONECARET","(?:\\^)");ie("CARETTRIM",`(\\s*)${U[V.LONECARET]}\\s+`,!0);Gt.caretTrimReplace="$1^";ie("CARET",`^${U[V.LONECARET]}${U[V.XRANGEPLAIN]}$`);ie("CARETLOOSE",`^${U[V.LONECARET]}${U[V.XRANGEPLAINLOOSE]}$`);ie("COMPARATORLOOSE",`^${U[V.GTLT]}\\s*(${U[V.LOOSEPLAIN]})$|^$`);ie("COMPARATOR",`^${U[V.GTLT]}\\s*(${U[V.FULLPLAIN]})$|^$`);ie("COMPARATORTRIM",`(\\s*)${U[V.GTLT]}\\s*(${U[V.LOOSEPLAIN]}|${U[V.XRANGEPLAIN]})`,!0);Gt.comparatorTrimReplace="$1$2$3";ie("HYPHENRANGE",`^\\s*(${U[V.XRANGEPLAIN]})\\s+-\\s+(${U[V.XRANGEPLAIN]})\\s*$`);ie("HYPHENRANGELOOSE",`^\\s*(${U[V.XRANGEPLAINLOOSE]})\\s+-\\s+(${U[V.XRANGEPLAINLOOSE]})\\s*$`);ie("STAR","(<|>)?=?\\s*\\*");ie("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ie("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ao=v((F2,dh)=>{"use strict";var wE=Object.freeze({loose:!0}),xE=Object.freeze({}),kE=t=>t?typeof t!="object"?wE:t:xE;dh.exports=kE});var Ka=v((j2,ph)=>{"use strict";var fh=/^[0-9]+$/,hh=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=fh.test(t),n=fh.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},$E=(t,e)=>hh(e,t);ph.exports={compareIdentifiers:hh,rcompareIdentifiers:$E}});var He=v((I2,gh)=>{"use strict";var co=Xn(),{MAX_LENGTH:mh,MAX_SAFE_INTEGER:uo}=Jn(),{safeRe:lo,t:fo}=An(),AE=ao(),{compareIdentifiers:Qa}=Ka(),ec=class t{constructor(e,r){if(r=AE(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>mh)throw new TypeError(`version is longer than ${mh} characters`);co("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?lo[fo.LOOSE]:lo[fo.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>uo||this.major<0)throw new TypeError("Invalid major version");if(this.minor>uo||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>uo||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let i=+s;if(i>=0&&i<uo)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(co("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=e.prerelease[r];if(co("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Qa(n,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],s=e.build[r];if(co("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Qa(n,s)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?lo[fo.PRERELEASELOOSE]:lo[fo.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),Qa(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};gh.exports=ec});var rn=v((T2,yh)=>{"use strict";var Dh=He(),FE=(t,e,r=!1)=>{if(t instanceof Dh)return t;try{return new Dh(t,e)}catch(n){if(!r)return null;throw n}};yh.exports=FE});var _h=v((R2,vh)=>{"use strict";var jE=rn(),IE=(t,e)=>{let r=jE(t,e);return r?r.version:null};vh.exports=IE});var Sh=v((P2,bh)=>{"use strict";var TE=rn(),RE=(t,e)=>{let r=TE(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};bh.exports=RE});var wh=v((O2,Ch)=>{"use strict";var Eh=He(),PE=(t,e,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Eh(t instanceof Eh?t.version:t,r).inc(e,n,s).version}catch{return null}};Ch.exports=PE});var $h=v((N2,kh)=>{"use strict";var xh=rn(),OE=(t,e)=>{let r=xh(t,null,!0),n=xh(e,null,!0),s=r.compare(n);if(s===0)return null;let i=s>0,o=i?r:n,a=i?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};kh.exports=OE});var Fh=v((L2,Ah)=>{"use strict";var NE=He(),LE=(t,e)=>new NE(t,e).major;Ah.exports=LE});var Ih=v((B2,jh)=>{"use strict";var BE=He(),ME=(t,e)=>new BE(t,e).minor;jh.exports=ME});var Rh=v((M2,Th)=>{"use strict";var qE=He(),WE=(t,e)=>new qE(t,e).patch;Th.exports=WE});var Oh=v((q2,Ph)=>{"use strict";var HE=rn(),ZE=(t,e)=>{let r=HE(t,e);return r&&r.prerelease.length?r.prerelease:null};Ph.exports=ZE});var yt=v((W2,Lh)=>{"use strict";var Nh=He(),UE=(t,e,r)=>new Nh(t,r).compare(new Nh(e,r));Lh.exports=UE});var Mh=v((H2,Bh)=>{"use strict";var VE=yt(),GE=(t,e,r)=>VE(e,t,r);Bh.exports=GE});var Wh=v((Z2,qh)=>{"use strict";var zE=yt(),YE=(t,e)=>zE(t,e,!0);qh.exports=YE});var ho=v((U2,Zh)=>{"use strict";var Hh=He(),JE=(t,e,r)=>{let n=new Hh(t,r),s=new Hh(e,r);return n.compare(s)||n.compareBuild(s)};Zh.exports=JE});var Vh=v((V2,Uh)=>{"use strict";var XE=ho(),KE=(t,e)=>t.sort((r,n)=>XE(r,n,e));Uh.exports=KE});var zh=v((G2,Gh)=>{"use strict";var QE=ho(),eC=(t,e)=>t.sort((r,n)=>QE(n,r,e));Gh.exports=eC});var Kn=v((z2,Yh)=>{"use strict";var tC=yt(),rC=(t,e,r)=>tC(t,e,r)>0;Yh.exports=rC});var po=v((Y2,Jh)=>{"use strict";var nC=yt(),sC=(t,e,r)=>nC(t,e,r)<0;Jh.exports=sC});var tc=v((J2,Xh)=>{"use strict";var oC=yt(),iC=(t,e,r)=>oC(t,e,r)===0;Xh.exports=iC});var rc=v((X2,Kh)=>{"use strict";var aC=yt(),cC=(t,e,r)=>aC(t,e,r)!==0;Kh.exports=cC});var mo=v((K2,Qh)=>{"use strict";var uC=yt(),lC=(t,e,r)=>uC(t,e,r)>=0;Qh.exports=lC});var go=v((Q2,ep)=>{"use strict";var dC=yt(),fC=(t,e,r)=>dC(t,e,r)<=0;ep.exports=fC});var nc=v((eI,tp)=>{"use strict";var hC=tc(),pC=rc(),mC=Kn(),gC=mo(),DC=po(),yC=go(),vC=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return hC(t,r,n);case"!=":return pC(t,r,n);case">":return mC(t,r,n);case">=":return gC(t,r,n);case"<":return DC(t,r,n);case"<=":return yC(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};tp.exports=vC});var np=v((tI,rp)=>{"use strict";var _C=He(),bC=rn(),{safeRe:Do,t:yo}=An(),SC=(t,e)=>{if(t instanceof _C)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Do[yo.COERCEFULL]:Do[yo.COERCE]);else{let c=e.includePrerelease?Do[yo.COERCERTLFULL]:Do[yo.COERCERTL],u;for(;(u=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",i=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return bC(`${n}.${s}.${i}${o}${a}`,e)};rp.exports=SC});var op=v((rI,sp)=>{"use strict";var sc=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,r)}return this}};sp.exports=sc});var vt=v((nI,up)=>{"use strict";var EC=/\s+/g,oc=class t{constructor(e,r){if(r=wC(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof ic)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(EC," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!ap(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&IC(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&FC)|(this.options.loose&&jC))+":"+e,s=ip.get(n);if(s)return s;let i=this.options.loose,o=i?Ye[Ze.HYPHENRANGELOOSE]:Ye[Ze.HYPHENRANGE];e=e.replace(o,WC(this.options.includePrerelease)),we("hyphen replace",e),e=e.replace(Ye[Ze.COMPARATORTRIM],kC),we("comparator trim",e),e=e.replace(Ye[Ze.TILDETRIM],$C),we("tilde trim",e),e=e.replace(Ye[Ze.CARETTRIM],AC),we("caret trim",e);let a=e.split(" ").map(d=>TC(d,this.options)).join(" ").split(/\s+/).map(d=>qC(d,this.options));i&&(a=a.filter(d=>(we("loose invalid filter",d,this.options),!!d.match(Ye[Ze.COMPARATORLOOSE])))),we("range list",a);let c=new Map,u=a.map(d=>new ic(d,this.options));for(let d of u){if(ap(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return ip.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>cp(n,r)&&e.set.some(s=>cp(s,r)&&n.every(i=>s.every(o=>i.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new xC(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(HC(this.set[r],e,this.options))return!0;return!1}};up.exports=oc;var CC=op(),ip=new CC,wC=ao(),ic=Qn(),we=Xn(),xC=He(),{safeRe:Ye,t:Ze,comparatorTrimReplace:kC,tildeTrimReplace:$C,caretTrimReplace:AC}=An(),{FLAG_INCLUDE_PRERELEASE:FC,FLAG_LOOSE:jC}=Jn(),ap=t=>t.value==="<0.0.0-0",IC=t=>t.value==="",cp=(t,e)=>{let r=!0,n=t.slice(),s=n.pop();for(;r&&n.length;)r=n.every(i=>s.intersects(i,e)),s=n.pop();return r},TC=(t,e)=>(t=t.replace(Ye[Ze.BUILD],""),we("comp",t,e),t=OC(t,e),we("caret",t),t=RC(t,e),we("tildes",t),t=LC(t,e),we("xrange",t),t=MC(t,e),we("stars",t),t),Je=t=>!t||t.toLowerCase()==="x"||t==="*",RC=(t,e)=>t.trim().split(/\s+/).map(r=>PC(r,e)).join(" "),PC=(t,e)=>{let r=e.loose?Ye[Ze.TILDELOOSE]:Ye[Ze.TILDE];return t.replace(r,(n,s,i,o,a)=>{we("tilde",t,n,s,i,o,a);let c;return Je(s)?c="":Je(i)?c=`>=${s}.0.0 <${+s+1}.0.0-0`:Je(o)?c=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:a?(we("replaceTilde pr",a),c=`>=${s}.${i}.${o}-${a} <${s}.${+i+1}.0-0`):c=`>=${s}.${i}.${o} <${s}.${+i+1}.0-0`,we("tilde return",c),c})},OC=(t,e)=>t.trim().split(/\s+/).map(r=>NC(r,e)).join(" "),NC=(t,e)=>{we("caret",t,e);let r=e.loose?Ye[Ze.CARETLOOSE]:Ye[Ze.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(s,i,o,a,c)=>{we("caret",t,s,i,o,a,c);let u;return Je(i)?u="":Je(o)?u=`>=${i}.0.0${n} <${+i+1}.0.0-0`:Je(a)?i==="0"?u=`>=${i}.${o}.0${n} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.0${n} <${+i+1}.0.0-0`:c?(we("replaceCaret pr",c),i==="0"?o==="0"?u=`>=${i}.${o}.${a}-${c} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}-${c} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a}-${c} <${+i+1}.0.0-0`):(we("no pr"),i==="0"?o==="0"?u=`>=${i}.${o}.${a}${n} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}${n} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a} <${+i+1}.0.0-0`),we("caret return",u),u})},LC=(t,e)=>(we("replaceXRanges",t,e),t.split(/\s+/).map(r=>BC(r,e)).join(" ")),BC=(t,e)=>{t=t.trim();let r=e.loose?Ye[Ze.XRANGELOOSE]:Ye[Ze.XRANGE];return t.replace(r,(n,s,i,o,a,c)=>{we("xRange",t,n,s,i,o,a,c);let u=Je(i),l=u||Je(o),d=l||Je(a),f=d;return s==="="&&f&&(s=""),c=e.includePrerelease?"-0":"",u?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&f?(l&&(o=0),a=0,s===">"?(s=">=",l?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):s==="<="&&(s="<",l?i=+i+1:o=+o+1),s==="<"&&(c="-0"),n=`${s+i}.${o}.${a}${c}`):l?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),we("xRange return",n),n})},MC=(t,e)=>(we("replaceStars",t,e),t.trim().replace(Ye[Ze.STAR],"")),qC=(t,e)=>(we("replaceGTE0",t,e),t.trim().replace(Ye[e.includePrerelease?Ze.GTE0PRE:Ze.GTE0],"")),WC=t=>(e,r,n,s,i,o,a,c,u,l,d,f)=>(Je(n)?r="":Je(s)?r=`>=${n}.0.0${t?"-0":""}`:Je(i)?r=`>=${n}.${s}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Je(u)?c="":Je(l)?c=`<${+u+1}.0.0-0`:Je(d)?c=`<${u}.${+l+1}.0-0`:f?c=`<=${u}.${l}.${d}-${f}`:t?c=`<${u}.${l}.${+d+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),HC=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(we(t[n].semver),t[n].semver!==ic.ANY&&t[n].semver.prerelease.length>0){let s=t[n].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var Qn=v((sI,mp)=>{"use strict";var es=Symbol("SemVer ANY"),uc=class t{static get ANY(){return es}constructor(e,r){if(r=lp(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),cc("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===es?this.value="":this.value=this.operator+this.semver.version,cc("comp",this)}parse(e){let r=this.options.loose?dp[fp.COMPARATORLOOSE]:dp[fp.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new hp(n[2],this.options.loose):this.semver=es}toString(){return this.value}test(e){if(cc("Comparator.test",e,this.options.loose),this.semver===es||e===es)return!0;if(typeof e=="string")try{e=new hp(e,this.options)}catch{return!1}return ac(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new pp(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new pp(this.value,r).test(e.semver):(r=lp(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||ac(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||ac(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};mp.exports=uc;var lp=ao(),{safeRe:dp,t:fp}=An(),ac=nc(),cc=Xn(),hp=He(),pp=vt()});var ts=v((oI,gp)=>{"use strict";var ZC=vt(),UC=(t,e,r)=>{try{e=new ZC(e,r)}catch{return!1}return e.test(t)};gp.exports=UC});var yp=v((iI,Dp)=>{"use strict";var VC=vt(),GC=(t,e)=>new VC(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Dp.exports=GC});var _p=v((aI,vp)=>{"use strict";var zC=He(),YC=vt(),JC=(t,e,r)=>{let n=null,s=null,i=null;try{i=new YC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new zC(n,r))}),n};vp.exports=JC});var Sp=v((cI,bp)=>{"use strict";var XC=He(),KC=vt(),QC=(t,e,r)=>{let n=null,s=null,i=null;try{i=new KC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new XC(n,r))}),n};bp.exports=QC});var wp=v((uI,Cp)=>{"use strict";var lc=He(),ew=vt(),Ep=Kn(),tw=(t,e)=>{t=new ew(t,e);let r=new lc("0.0.0");if(t.test(r)||(r=new lc("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let s=t.set[n],i=null;s.forEach(o=>{let a=new lc(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||Ep(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||Ep(r,i))&&(r=i)}return r&&t.test(r)?r:null};Cp.exports=tw});var kp=v((lI,xp)=>{"use strict";var rw=vt(),nw=(t,e)=>{try{return new rw(t,e).range||"*"}catch{return null}};xp.exports=nw});var vo=v((dI,jp)=>{"use strict";var sw=He(),Fp=Qn(),{ANY:ow}=Fp,iw=vt(),aw=ts(),$p=Kn(),Ap=po(),cw=go(),uw=mo(),lw=(t,e,r,n)=>{t=new sw(t,n),e=new iw(e,n);let s,i,o,a,c;switch(r){case">":s=$p,i=cw,o=Ap,a=">",c=">=";break;case"<":s=Ap,i=uw,o=$p,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(aw(t,e,n))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],d=null,f=null;if(l.forEach(g=>{g.semver===ow&&(g=new Fp(">=0.0.0")),d=d||g,f=f||g,s(g.semver,d.semver,n)?d=g:o(g.semver,f.semver,n)&&(f=g)}),d.operator===a||d.operator===c||(!f.operator||f.operator===a)&&i(t,f.semver))return!1;if(f.operator===c&&o(t,f.semver))return!1}return!0};jp.exports=lw});var Tp=v((fI,Ip)=>{"use strict";var dw=vo(),fw=(t,e,r)=>dw(t,e,">",r);Ip.exports=fw});var Pp=v((hI,Rp)=>{"use strict";var hw=vo(),pw=(t,e,r)=>hw(t,e,"<",r);Rp.exports=pw});var Lp=v((pI,Np)=>{"use strict";var Op=vt(),mw=(t,e,r)=>(t=new Op(t,r),e=new Op(e,r),t.intersects(e,r));Np.exports=mw});var Mp=v((mI,Bp)=>{"use strict";var gw=ts(),Dw=yt();Bp.exports=(t,e,r)=>{let n=[],s=null,i=null,o=t.sort((l,d)=>Dw(l,d,r));for(let l of o)gw(l,e,r)?(i=l,s||(s=l)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);let a=[];for(let[l,d]of n)l===d?a.push(l):!d&&l===o[0]?a.push("*"):d?l===o[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e}});var Vp=v((gI,Up)=>{"use strict";var qp=vt(),fc=Qn(),{ANY:dc}=fc,rs=ts(),hc=yt(),yw=(t,e,r={})=>{if(t===e)return!0;t=new qp(t,r),e=new qp(e,r);let n=!1;e:for(let s of t.set){for(let i of e.set){let o=_w(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},vw=[new fc(">=0.0.0-0")],Wp=[new fc(">=0.0.0")],_w=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===dc){if(e.length===1&&e[0].semver===dc)return!0;r.includePrerelease?t=vw:t=Wp}if(e.length===1&&e[0].semver===dc){if(r.includePrerelease)return!0;e=Wp}let n=new Set,s,i;for(let g of t)g.operator===">"||g.operator===">="?s=Hp(s,g,r):g.operator==="<"||g.operator==="<="?i=Zp(i,g,r):n.add(g.semver);if(n.size>1)return null;let o;if(s&&i){if(o=hc(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let g of n){if(s&&!rs(g,String(s),r)||i&&!rs(g,String(i),r))return null;for(let m of e)if(!rs(g,String(m),r))return!1;return!0}let a,c,u,l,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;d&&d.prerelease.length===1&&i.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let g of e){if(l=l||g.operator===">"||g.operator===">=",u=u||g.operator==="<"||g.operator==="<=",s){if(f&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===f.major&&g.semver.minor===f.minor&&g.semver.patch===f.patch&&(f=!1),g.operator===">"||g.operator===">="){if(a=Hp(s,g,r),a===g&&a!==s)return!1}else if(s.operator===">="&&!rs(s.semver,String(g),r))return!1}if(i){if(d&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===d.major&&g.semver.minor===d.minor&&g.semver.patch===d.patch&&(d=!1),g.operator==="<"||g.operator==="<="){if(c=Zp(i,g,r),c===g&&c!==i)return!1}else if(i.operator==="<="&&!rs(i.semver,String(g),r))return!1}if(!g.operator&&(i||s)&&o!==0)return!1}return!(s&&u&&!i&&o!==0||i&&l&&!s&&o!==0||f||d)},Hp=(t,e,r)=>{if(!t)return e;let n=hc(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Zp=(t,e,r)=>{if(!t)return e;let n=hc(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};Up.exports=yw});var Jp=v((DI,Yp)=>{"use strict";var pc=An(),Gp=Jn(),bw=He(),zp=Ka(),Sw=rn(),Ew=_h(),Cw=Sh(),ww=wh(),xw=$h(),kw=Fh(),$w=Ih(),Aw=Rh(),Fw=Oh(),jw=yt(),Iw=Mh(),Tw=Wh(),Rw=ho(),Pw=Vh(),Ow=zh(),Nw=Kn(),Lw=po(),Bw=tc(),Mw=rc(),qw=mo(),Ww=go(),Hw=nc(),Zw=np(),Uw=Qn(),Vw=vt(),Gw=ts(),zw=yp(),Yw=_p(),Jw=Sp(),Xw=wp(),Kw=kp(),Qw=vo(),ex=Tp(),tx=Pp(),rx=Lp(),nx=Mp(),sx=Vp();Yp.exports={parse:Sw,valid:Ew,clean:Cw,inc:ww,diff:xw,major:kw,minor:$w,patch:Aw,prerelease:Fw,compare:jw,rcompare:Iw,compareLoose:Tw,compareBuild:Rw,sort:Pw,rsort:Ow,gt:Nw,lt:Lw,eq:Bw,neq:Mw,gte:qw,lte:Ww,cmp:Hw,coerce:Zw,Comparator:Uw,Range:Vw,satisfies:Gw,toComparators:zw,maxSatisfying:Yw,minSatisfying:Jw,minVersion:Xw,validRange:Kw,outside:Qw,gtr:ex,ltr:tx,intersects:rx,simplifyRange:nx,subset:sx,SemVer:bw,re:pc.re,src:pc.src,tokens:pc.t,SEMVER_SPEC_VERSION:Gp.SEMVER_SPEC_VERSION,RELEASE_TYPES:Gp.RELEASE_TYPES,compareIdentifiers:zp.compareIdentifiers,rcompareIdentifiers:zp.rcompareIdentifiers}});var or=v(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});var ox=(function(){function t(){}return t.prototype.diff=function(e,r,n){n===void 0&&(n={});var s;typeof n=="function"?(s=n,n={}):"callback"in n&&(s=n.callback);var i=this.castInput(e,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(i,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,c,n,s)},t.prototype.diffWithOptionsObj=function(e,r,n,s){var i=this,o,a=function(T){if(T=i.postProcess(T,n),s){setTimeout(function(){s(T)},0);return}else return T},c=r.length,u=e.length,l=1,d=c+u;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));var f=(o=n.timeout)!==null&&o!==void 0?o:1/0,g=Date.now()+f,m=[{oldPos:-1,lastComponent:void 0}],y=this.extractCommon(m[0],r,e,0,n);if(m[0].oldPos+1>=u&&y+1>=c)return a(this.buildValues(m[0].lastComponent,r,e));var h=-1/0,w=1/0,C=function(){for(var T=Math.max(h,-l);T<=Math.min(w,l);T+=2){var G=void 0,I=m[T-1],Z=m[T+1];I&&(m[T-1]=void 0);var F=!1;if(Z){var W=Z.oldPos-T;F=Z&&0<=W&&W<c}var R=I&&I.oldPos+1<u;if(!F&&!R){m[T]=void 0;continue}if(!R||F&&I.oldPos<Z.oldPos?G=i.addToPath(Z,!0,!1,0,n):G=i.addToPath(I,!1,!0,1,n),y=i.extractCommon(G,r,e,T,n),G.oldPos+1>=u&&y+1>=c)return a(i.buildValues(G.lastComponent,r,e))||!0;m[T]=G,G.oldPos+1>=u&&(w=Math.min(w,T-1)),y+1>=c&&(h=Math.max(h,T+1))}l++};if(s)(function T(){setTimeout(function(){if(l>d||Date.now()>g)return s(void 0);C()||T()},0)})();else for(;l<=d&&Date.now()<=g;){var A=C();if(A)return A}},t.prototype.addToPath=function(e,r,n,s,i){var o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:e.oldPos+s,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}},t.prototype.extractCommon=function(e,r,n,s,i){for(var o=r.length,a=n.length,c=e.oldPos,u=c-s,l=0;u+1<o&&c+1<a&&this.equals(n[c+1],r[u+1],i);)u++,c++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,u},t.prototype.equals=function(e,r,n){return n.comparator?n.comparator(e,r):e===r||!!n.ignoreCase&&e.toLowerCase()===r.toLowerCase()},t.prototype.removeEmpty=function(e){for(var r=[],n=0;n<e.length;n++)e[n]&&r.push(e[n]);return r},t.prototype.castInput=function(e,r){return e},t.prototype.tokenize=function(e,r){return Array.from(e)},t.prototype.join=function(e){return e.join("")},t.prototype.postProcess=function(e,r){return e},Object.defineProperty(t.prototype,"useLongestToken",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.buildValues=function(e,r,n){for(var s=[],i;e;)s.push(e),i=e.previousComponent,delete e.previousComponent,e=i;s.reverse();for(var o=s.length,a=0,c=0,u=0;a<o;a++){var l=s[a];if(l.removed)l.value=this.join(n.slice(u,u+l.count)),u+=l.count;else{if(!l.added&&this.useLongestToken){var d=r.slice(c,c+l.count);d=d.map(function(f,g){var m=n[u+g];return m.length>f.length?m:f}),l.value=this.join(d)}else l.value=this.join(r.slice(c,c+l.count));c+=l.count,l.added||(u+=l.count)}}return s},t})();mc.default=ox});var Xp=v(kr=>{"use strict";var ix=kr&&kr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(kr,"__esModule",{value:!0});kr.characterDiff=void 0;kr.diffChars=ux;var ax=or(),cx=(function(t){ix(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(ax.default);kr.characterDiff=new cx;function ux(t,e,r){return kr.characterDiff.diff(t,e,r)}});var Dc=v(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.longestCommonPrefix=lx;Xe.longestCommonSuffix=dx;Xe.replacePrefix=Kp;Xe.replaceSuffix=Qp;Xe.removePrefix=fx;Xe.removeSuffix=hx;Xe.maximumOverlap=px;Xe.hasOnlyWinLineEndings=gx;Xe.hasOnlyUnixLineEndings=Dx;Xe.segment=em;Xe.trailingWs=tm;Xe.leadingWs=rm;Xe.leadingAndTrailingWs=gc;function lx(t,e){var r;for(r=0;r<t.length&&r<e.length;r++)if(t[r]!=e[r])return t.slice(0,r);return t.slice(0,r)}function dx(t,e){var r;if(!t||!e||t[t.length-1]!=e[e.length-1])return"";for(r=0;r<t.length&&r<e.length;r++)if(t[t.length-(r+1)]!=e[e.length-(r+1)])return t.slice(-r);return t.slice(-r)}function Kp(t,e,r){if(t.slice(0,e.length)!=e)throw Error("string ".concat(JSON.stringify(t)," doesn't start with prefix ").concat(JSON.stringify(e),"; this is a bug"));return r+t.slice(e.length)}function Qp(t,e,r){if(!e)return t+r;if(t.slice(-e.length)!=e)throw Error("string ".concat(JSON.stringify(t)," doesn't end with suffix ").concat(JSON.stringify(e),"; this is a bug"));return t.slice(0,-e.length)+r}function fx(t,e){return Kp(t,e,"")}function hx(t,e){return Qp(t,e,"")}function px(t,e){return e.slice(0,mx(t,e))}function mx(t,e){var r=0;t.length>e.length&&(r=t.length-e.length);var n=e.length;t.length<e.length&&(n=t.length);var s=Array(n),i=0;s[0]=0;for(var o=1;o<n;o++){for(e[o]==e[i]?s[o]=s[i]:s[o]=i;i>0&&e[o]!=e[i];)i=s[i];e[o]==e[i]&&i++}i=0;for(var a=r;a<t.length;a++){for(;i>0&&t[a]!=e[i];)i=s[i];t[a]==e[i]&&i++}return i}function gx(t){return t.includes(`\r
9
9
  `)&&!t.startsWith(`
10
- `)&&!t.match(/[^\r]\n/)}function px(t){return!t.includes(`\r
10
+ `)&&!t.match(/[^\r]\n/)}function Dx(t){return!t.includes(`\r
11
11
  `)&&t.includes(`
12
- `)}function Kp(t,e){for(var r=[],n=0,s=Array.from(e.segment(t));n<s.length;n++){var i=s[n],o=i.segment;r.length&&/\s/.test(r[r.length-1])&&/\s/.test(o)?r[r.length-1]+=o:r.push(o)}return r}function Qp(t,e){if(e)return pu(t,e)[1];var r;for(r=t.length-1;r>=0&&t[r].match(/\s/);r--);return t.substring(r+1)}function em(t,e){if(e)return pu(t,e)[0];var r=t.match(/^\s*/);return r?r[0]:""}function pu(t,e){if(!e)return[em(t),Qp(t)];if(e.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');var r=Kp(t,e),n=r[0],s=r[r.length-1],i=/\s/.test(n)?n:"",o=/\s/.test(s)?s:"";return[i,o]}});var om=v(Dt=>{"use strict";var rm=Dt&&Dt.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Dt,"__esModule",{value:!0});Dt.wordsWithSpaceDiff=Dt.wordDiff=void 0;Dt.diffWords=Dx;Dt.diffWordsWithSpace=sm;var nm=nr(),me=mu(),yo="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",mx=new RegExp("[".concat(yo,"]+|\\s+|[^").concat(yo,"]"),"ug"),gx=(function(t){rm(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.equals=function(r,n,s){return s.ignoreCase&&(r=r.toLowerCase(),n=n.toLowerCase()),r.trim()===n.trim()},e.prototype.tokenize=function(r,n){n===void 0&&(n={});var s;if(n.intlSegmenter){var i=n.intlSegmenter;if(i.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');s=(0,me.segment)(r,i)}else s=r.match(mx)||[];var o=[],a=null;return s.forEach(function(u){/\s/.test(u)?a==null?o.push(u):o.push(o.pop()+u):a!=null&&/\s/.test(a)?o[o.length-1]==a?o.push(o.pop()+u):o.push(a+u):o.push(u),a=u}),o},e.prototype.join=function(r){return r.map(function(n,s){return s==0?n:n.replace(/^\s+/,"")}).join("")},e.prototype.postProcess=function(r,n){if(!r||n.oneChangePerToken)return r;var s=null,i=null,o=null;return r.forEach(function(a){a.added?i=a:a.removed?o=a:((i||o)&&tm(s,o,i,a,n.intlSegmenter),s=a,i=null,o=null)}),(i||o)&&tm(s,o,i,null,n.intlSegmenter),r},e})(nm.default);Dt.wordDiff=new gx;function Dx(t,e,r){return r?.ignoreWhitespace!=null&&!r.ignoreWhitespace?sm(t,e,r):Dt.wordDiff.diff(t,e,r)}function tm(t,e,r,n,s){if(e&&r){var i=(0,me.leadingAndTrailingWs)(e.value,s),o=i[0],a=i[1],u=(0,me.leadingAndTrailingWs)(r.value,s),c=u[0],l=u[1];if(t){var d=(0,me.longestCommonPrefix)(o,c);t.value=(0,me.replaceSuffix)(t.value,c,d),e.value=(0,me.removePrefix)(e.value,d),r.value=(0,me.removePrefix)(r.value,d)}if(n){var f=(0,me.longestCommonSuffix)(a,l);n.value=(0,me.replacePrefix)(n.value,l,f),e.value=(0,me.removeSuffix)(e.value,f),r.value=(0,me.removeSuffix)(r.value,f)}}else if(r){if(t){var g=(0,me.leadingWs)(r.value,s);r.value=r.value.substring(g.length)}if(n){var g=(0,me.leadingWs)(n.value,s);n.value=n.value.substring(g.length)}}else if(t&&n){var m=(0,me.leadingWs)(n.value,s),D=(0,me.leadingAndTrailingWs)(e.value,s),h=D[0],w=D[1],C=(0,me.longestCommonPrefix)(m,h);e.value=(0,me.removePrefix)(e.value,C);var A=(0,me.longestCommonSuffix)((0,me.removePrefix)(m,C),w);e.value=(0,me.removeSuffix)(e.value,A),n.value=(0,me.replacePrefix)(n.value,m,A),t.value=(0,me.replaceSuffix)(t.value,m,m.slice(0,m.length-A.length))}else if(n){var T=(0,me.leadingWs)(n.value,s),G=(0,me.trailingWs)(e.value,s),I=(0,me.maximumOverlap)(G,T);e.value=(0,me.removeSuffix)(e.value,I)}else if(t){var Z=(0,me.trailingWs)(t.value,s),F=(0,me.leadingWs)(e.value,s),I=(0,me.maximumOverlap)(Z,F);e.value=(0,me.removePrefix)(e.value,I)}}var yx=(function(t){rm(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){var n=new RegExp("(\\r?\\n)|[".concat(yo,"]+|[^\\S\\n\\r]+|[^").concat(yo,"]"),"ug");return r.match(n)||[]},e})(nm.default);Dt.wordsWithSpaceDiff=new yx;function sm(t,e,r){return Dt.wordsWithSpaceDiff.diff(t,e,r)}});var im=v(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.generateOptions=vx;function vx(t,e){if(typeof t=="function")e.callback=t;else if(t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}});var vo=v($t=>{"use strict";var _x=$t&&$t.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty($t,"__esModule",{value:!0});$t.lineDiff=void 0;$t.diffLines=Cx;$t.diffTrimmedLines=wx;$t.tokenize=am;var Ex=nr(),bx=im(),Sx=(function(t){_x(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.tokenize=am,r}return e.prototype.equals=function(r,n,s){return s.ignoreWhitespace?((!s.newlineIsToken||!r.includes(`
12
+ `)}function em(t,e){for(var r=[],n=0,s=Array.from(e.segment(t));n<s.length;n++){var i=s[n],o=i.segment;r.length&&/\s/.test(r[r.length-1])&&/\s/.test(o)?r[r.length-1]+=o:r.push(o)}return r}function tm(t,e){if(e)return gc(t,e)[1];var r;for(r=t.length-1;r>=0&&t[r].match(/\s/);r--);return t.substring(r+1)}function rm(t,e){if(e)return gc(t,e)[0];var r=t.match(/^\s*/);return r?r[0]:""}function gc(t,e){if(!e)return[rm(t),tm(t)];if(e.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');var r=em(t,e),n=r[0],s=r[r.length-1],i=/\s/.test(n)?n:"",o=/\s/.test(s)?s:"";return[i,o]}});var am=v(_t=>{"use strict";var sm=_t&&_t.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(_t,"__esModule",{value:!0});_t.wordsWithSpaceDiff=_t.wordDiff=void 0;_t.diffWords=_x;_t.diffWordsWithSpace=im;var om=or(),ge=Dc(),_o="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",yx=new RegExp("[".concat(_o,"]+|\\s+|[^").concat(_o,"]"),"ug"),vx=(function(t){sm(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.equals=function(r,n,s){return s.ignoreCase&&(r=r.toLowerCase(),n=n.toLowerCase()),r.trim()===n.trim()},e.prototype.tokenize=function(r,n){n===void 0&&(n={});var s;if(n.intlSegmenter){var i=n.intlSegmenter;if(i.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');s=(0,ge.segment)(r,i)}else s=r.match(yx)||[];var o=[],a=null;return s.forEach(function(c){/\s/.test(c)?a==null?o.push(c):o.push(o.pop()+c):a!=null&&/\s/.test(a)?o[o.length-1]==a?o.push(o.pop()+c):o.push(a+c):o.push(c),a=c}),o},e.prototype.join=function(r){return r.map(function(n,s){return s==0?n:n.replace(/^\s+/,"")}).join("")},e.prototype.postProcess=function(r,n){if(!r||n.oneChangePerToken)return r;var s=null,i=null,o=null;return r.forEach(function(a){a.added?i=a:a.removed?o=a:((i||o)&&nm(s,o,i,a,n.intlSegmenter),s=a,i=null,o=null)}),(i||o)&&nm(s,o,i,null,n.intlSegmenter),r},e})(om.default);_t.wordDiff=new vx;function _x(t,e,r){return r?.ignoreWhitespace!=null&&!r.ignoreWhitespace?im(t,e,r):_t.wordDiff.diff(t,e,r)}function nm(t,e,r,n,s){if(e&&r){var i=(0,ge.leadingAndTrailingWs)(e.value,s),o=i[0],a=i[1],c=(0,ge.leadingAndTrailingWs)(r.value,s),u=c[0],l=c[1];if(t){var d=(0,ge.longestCommonPrefix)(o,u);t.value=(0,ge.replaceSuffix)(t.value,u,d),e.value=(0,ge.removePrefix)(e.value,d),r.value=(0,ge.removePrefix)(r.value,d)}if(n){var f=(0,ge.longestCommonSuffix)(a,l);n.value=(0,ge.replacePrefix)(n.value,l,f),e.value=(0,ge.removeSuffix)(e.value,f),r.value=(0,ge.removeSuffix)(r.value,f)}}else if(r){if(t){var g=(0,ge.leadingWs)(r.value,s);r.value=r.value.substring(g.length)}if(n){var g=(0,ge.leadingWs)(n.value,s);n.value=n.value.substring(g.length)}}else if(t&&n){var m=(0,ge.leadingWs)(n.value,s),y=(0,ge.leadingAndTrailingWs)(e.value,s),h=y[0],w=y[1],C=(0,ge.longestCommonPrefix)(m,h);e.value=(0,ge.removePrefix)(e.value,C);var A=(0,ge.longestCommonSuffix)((0,ge.removePrefix)(m,C),w);e.value=(0,ge.removeSuffix)(e.value,A),n.value=(0,ge.replacePrefix)(n.value,m,A),t.value=(0,ge.replaceSuffix)(t.value,m,m.slice(0,m.length-A.length))}else if(n){var T=(0,ge.leadingWs)(n.value,s),G=(0,ge.trailingWs)(e.value,s),I=(0,ge.maximumOverlap)(G,T);e.value=(0,ge.removeSuffix)(e.value,I)}else if(t){var Z=(0,ge.trailingWs)(t.value,s),F=(0,ge.leadingWs)(e.value,s),I=(0,ge.maximumOverlap)(Z,F);e.value=(0,ge.removePrefix)(e.value,I)}}var bx=(function(t){sm(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){var n=new RegExp("(\\r?\\n)|[".concat(_o,"]+|[^\\S\\n\\r]+|[^").concat(_o,"]"),"ug");return r.match(n)||[]},e})(om.default);_t.wordsWithSpaceDiff=new bx;function im(t,e,r){return _t.wordsWithSpaceDiff.diff(t,e,r)}});var cm=v(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.generateOptions=Sx;function Sx(t,e){if(typeof t=="function")e.callback=t;else if(t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}});var bo=v(Ft=>{"use strict";var Ex=Ft&&Ft.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Ft,"__esModule",{value:!0});Ft.lineDiff=void 0;Ft.diffLines=kx;Ft.diffTrimmedLines=$x;Ft.tokenize=um;var Cx=or(),wx=cm(),xx=(function(t){Ex(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.tokenize=um,r}return e.prototype.equals=function(r,n,s){return s.ignoreWhitespace?((!s.newlineIsToken||!r.includes(`
13
13
  `))&&(r=r.trim()),(!s.newlineIsToken||!n.includes(`
14
14
  `))&&(n=n.trim())):s.ignoreNewlineAtEof&&!s.newlineIsToken&&(r.endsWith(`
15
15
  `)&&(r=r.slice(0,-1)),n.endsWith(`
16
- `)&&(n=n.slice(0,-1))),t.prototype.equals.call(this,r,n,s)},e})(Ex.default);$t.lineDiff=new Sx;function Cx(t,e,r){return $t.lineDiff.diff(t,e,r)}function wx(t,e,r){return r=(0,bx.generateOptions)(r,{ignoreWhitespace:!0}),$t.lineDiff.diff(t,e,r)}function am(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
17
- `));var r=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var s=0;s<n.length;s++){var i=n[s];s%2&&!e.newlineIsToken?r[r.length-1]+=i:r.push(i)}return r}});var um=v(wr=>{"use strict";var xx=wr&&wr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(wr,"__esModule",{value:!0});wr.sentenceDiff=void 0;wr.diffSentences=Fx;var $x=nr();function kx(t){return t=="."||t=="!"||t=="?"}var Ax=(function(t){xx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){for(var n,s=[],i=0,o=0;o<r.length;o++){if(o==r.length-1){s.push(r.slice(i));break}if(kx(r[o])&&r[o+1].match(/\s/)){for(s.push(r.slice(i,o+1)),o=i=o+1;!((n=r[o+1])===null||n===void 0)&&n.match(/\s/);)o++;s.push(r.slice(i,o+1)),i=o+1}}return s},e})($x.default);wr.sentenceDiff=new Ax;function Fx(t,e,r){return wr.sentenceDiff.diff(t,e,r)}});var cm=v(xr=>{"use strict";var jx=xr&&xr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(xr,"__esModule",{value:!0});xr.cssDiff=void 0;xr.diffCss=Rx;var Ix=nr(),Tx=(function(t){jx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){return r.split(/([{}:;,]|\s+)/)},e})(Ix.default);xr.cssDiff=new Tx;function Rx(t,e,r){return xr.cssDiff.diff(t,e,r)}});var lm=v(sr=>{"use strict";var Px=sr&&sr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(sr,"__esModule",{value:!0});sr.jsonDiff=void 0;sr.diffJson=Bx;sr.canonicalize=_o;var Ox=nr(),Nx=vo(),Lx=(function(t){Px(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.tokenize=Nx.tokenize,r}return Object.defineProperty(e.prototype,"useLongestToken",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.castInput=function(r,n){var s=n.undefinedReplacement,i=n.stringifyReplacer,o=i===void 0?function(a,u){return typeof u>"u"?s:u}:i;return typeof r=="string"?r:JSON.stringify(_o(r,null,null,o),null," ")},e.prototype.equals=function(r,n,s){return t.prototype.equals.call(this,r.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"),s)},e})(Ox.default);sr.jsonDiff=new Lx;function Bx(t,e,r){return sr.jsonDiff.diff(t,e,r)}function _o(t,e,r,n,s){e=e||[],r=r||[],n&&(t=n(s===void 0?"":s,t));var i;for(i=0;i<e.length;i+=1)if(e[i]===t)return r[i];var o;if(Object.prototype.toString.call(t)==="[object Array]"){for(e.push(t),o=new Array(t.length),r.push(o),i=0;i<t.length;i+=1)o[i]=_o(t[i],e,r,n,String(i));return e.pop(),r.pop(),o}if(t&&t.toJSON&&(t=t.toJSON()),typeof t=="object"&&t!==null){e.push(t),o={},r.push(o);var a=[],u;for(u in t)Object.prototype.hasOwnProperty.call(t,u)&&a.push(u);for(a.sort(),i=0;i<a.length;i+=1)u=a[i],o[u]=_o(t[u],e,r,n,u);e.pop(),r.pop()}else o=t;return o}});var dm=v($r=>{"use strict";var Mx=$r&&$r.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty($r,"__esModule",{value:!0});$r.arrayDiff=void 0;$r.diffArrays=Hx;var qx=nr(),Wx=(function(t){Mx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){return r.slice()},e.prototype.join=function(r){return r},e.prototype.removeEmpty=function(r){return r},e})(qx.default);$r.arrayDiff=new Wx;function Hx(t,e,r){return $r.arrayDiff.diff(t,e,r)}});var pm=v(kr=>{"use strict";var Vt=kr&&kr.__assign||function(){return Vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Vt.apply(this,arguments)};Object.defineProperty(kr,"__esModule",{value:!0});kr.unixToWin=fm;kr.winToUnix=hm;kr.isUnix=Zx;kr.isWin=Ux;function fm(t){return Array.isArray(t)?t.map(function(e){return fm(e)}):Vt(Vt({},t),{hunks:t.hunks.map(function(e){return Vt(Vt({},e),{lines:e.lines.map(function(r,n){var s;return r.startsWith("\\")||r.endsWith("\r")||!((s=e.lines[n+1])===null||s===void 0)&&s.startsWith("\\")?r:r+"\r"})})})})}function hm(t){return Array.isArray(t)?t.map(function(e){return hm(e)}):Vt(Vt({},t),{hunks:t.hunks.map(function(e){return Vt(Vt({},e),{lines:e.lines.map(function(r){return r.endsWith("\r")?r.substring(0,r.length-1):r})})})})}function Zx(t){return Array.isArray(t)||(t=[t]),!t.some(function(e){return e.hunks.some(function(r){return r.lines.some(function(n){return!n.startsWith("\\")&&n.endsWith("\r")})})})}function Ux(t){return Array.isArray(t)||(t=[t]),t.some(function(e){return e.hunks.some(function(r){return r.lines.some(function(n){return n.endsWith("\r")})})})&&t.every(function(e){return e.hunks.every(function(r){return r.lines.every(function(n,s){var i;return n.startsWith("\\")||n.endsWith("\r")||((i=r.lines[s+1])===null||i===void 0?void 0:i.startsWith("\\"))})})})}});var yu=v(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.parsePatch=Vx;function Vx(t){var e=t.split(/\n/),r=[],n=0;function s(){var a={};for(r.push(a);n<e.length;){var u=e[n];if(/^(---|\+\+\+|@@)\s/.test(u))break;var c=/^(?:Index:|diff(?: -r \w+)+)\s+/.exec(u);c&&(a.index=u.substring(c[0].length).trim()),n++}for(i(a),i(a),a.hunks=[];n<e.length;){var u=e[n];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(u))break;if(/^@@/.test(u))a.hunks.push(o());else{if(u)throw new Error("Unknown line "+(n+1)+" "+JSON.stringify(u));n++}}}function i(a){var u=/^(---|\+\+\+)\s+/.exec(e[n]);if(u){var c=u[1],l=e[n].substring(3).trim().split(" ",2),d=(l[1]||"").trim(),f=l[0].replace(/\\\\/g,"\\");f.startsWith('"')&&f.endsWith('"')&&(f=f.substr(1,f.length-2)),c==="---"?(a.oldFileName=f,a.oldHeader=d):(a.newFileName=f,a.newHeader=d),n++}}function o(){var a,u=n,c=e[n++],l=c.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),d={oldStart:+l[1],oldLines:typeof l[2]>"u"?1:+l[2],newStart:+l[3],newLines:typeof l[4]>"u"?1:+l[4],lines:[]};d.oldLines===0&&(d.oldStart+=1),d.newLines===0&&(d.newStart+=1);for(var f=0,g=0;n<e.length&&(g<d.oldLines||f<d.newLines||!((a=e[n])===null||a===void 0)&&a.startsWith("\\"));n++){var m=e[n].length==0&&n!=e.length-1?" ":e[n][0];if(m==="+"||m==="-"||m===" "||m==="\\")d.lines.push(e[n]),m==="+"?f++:m==="-"?g++:m===" "&&(f++,g++);else throw new Error("Hunk at line ".concat(u+1," contained invalid line ").concat(e[n]))}if(!f&&d.newLines===1&&(d.newLines=0),!g&&d.oldLines===1&&(d.oldLines=0),f!==d.newLines)throw new Error("Added line count did not match for hunk at line "+(u+1));if(g!==d.oldLines)throw new Error("Removed line count did not match for hunk at line "+(u+1));return d}for(;n<e.length;)s();return r}});var mm=v(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.default=Gx;function Gx(t,e,r){var n=!0,s=!1,i=!1,o=1;return function a(){if(n&&!i){if(s?o++:n=!1,t+o<=r)return t+o;i=!0}if(!s)return i||(n=!0),e<=t-o?t-o++:(s=!0,a())}}});var vm=v(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.applyPatch=ym;bo.applyPatches=Xx;var gm=mu(),Eo=pm(),Dm=yu(),zx=mm();function ym(t,e,r){r===void 0&&(r={});var n;if(typeof e=="string"?n=(0,Dm.parsePatch)(e):Array.isArray(e)?n=e:n=[e],n.length>1)throw new Error("applyPatch only works with a single input.");return Yx(t,n[0],r)}function Yx(t,e,r){r===void 0&&(r={}),(r.autoConvertLineEndings||r.autoConvertLineEndings==null)&&((0,gm.hasOnlyWinLineEndings)(t)&&(0,Eo.isUnix)(e)?e=(0,Eo.unixToWin)(e):(0,gm.hasOnlyUnixLineEndings)(t)&&(0,Eo.isWin)(e)&&(e=(0,Eo.winToUnix)(e)));var n=t.split(`
18
- `),s=e.hunks,i=r.compareLine||(function(F,W,P,E){return W===E}),o=r.fuzzFactor||0,a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!s.length)return t;for(var u="",c=!1,l=!1,d=0;d<s[s.length-1].lines.length;d++){var f=s[s.length-1].lines[d];f[0]=="\\"&&(u[0]=="+"?c=!0:u[0]=="-"&&(l=!0)),u=f}if(c){if(l){if(!o&&n[n.length-1]=="")return!1}else if(n[n.length-1]=="")n.pop();else if(!o)return!1}else if(l){if(n[n.length-1]!="")n.push("");else if(!o)return!1}function g(F,W,P,E,Q,re,le){E===void 0&&(E=0),Q===void 0&&(Q=!0),re===void 0&&(re=[]),le===void 0&&(le=0);for(var $=0,k=!1;E<F.length;E++){var he=F[E],J=he.length>0?he[0]:" ",xe=he.length>0?he.substr(1):he;if(J==="-")if(i(W+1,n[W],J,xe))W++,$=0;else return!P||n[W]==null?null:(re[le]=n[W],g(F,W+1,P-1,E,!1,re,le+1));if(J==="+"){if(!Q)return null;re[le]=xe,le++,$=0,k=!0}if(J===" ")if($++,re[le]=n[W],i(W+1,n[W],J,xe))le++,Q=!0,k=!1,W++;else return k||!P?null:n[W]&&(g(F,W+1,P-1,E+1,!1,re,le+1)||g(F,W+1,P-1,E,!1,re,le+1))||g(F,W,P-1,E+1,!1,re,le)}return le-=$,W-=$,re.length=le,{patchedLines:re,oldLineLastI:W-1}}for(var m=[],D=0,d=0;d<s.length;d++){for(var h=s[d],w=void 0,C=n.length-h.oldLines+o,A=void 0,T=0;T<=o;T++){A=h.oldStart+D-1;for(var G=(0,zx.default)(A,a,C);A!==void 0&&(w=g(h.lines,A,T),!w);A=G());if(w)break}if(!w)return!1;for(var I=a;I<A;I++)m.push(n[I]);for(var Z=0;Z<w.patchedLines.length;Z++){var f=w.patchedLines[Z];m.push(f)}a=w.oldLineLastI+1,D=A+1-h.oldStart}for(var d=a;d<n.length;d++)m.push(n[d]);return m.join(`
19
- `)}function Xx(t,e){var r=typeof t=="string"?(0,Dm.parsePatch)(t):t,n=0;function s(){var i=r[n++];if(!i)return e.complete();e.loadFile(i,function(o,a){if(o)return e.complete(o);var u=ym(a,i,e);e.patched(i,u,function(c){if(c)return e.complete(c);s()})})}s()}});var Em=v(ts=>{"use strict";var So=ts&&ts.__assign||function(){return So=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},So.apply(this,arguments)};Object.defineProperty(ts,"__esModule",{value:!0});ts.reversePatch=_m;function _m(t){return Array.isArray(t)?t.map(function(e){return _m(e)}).reverse():So(So({},t),{oldFileName:t.newFileName,oldHeader:t.newHeader,newFileName:t.oldFileName,newHeader:t.oldHeader,hunks:t.hunks.map(function(e){return{oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(function(r){return r.startsWith("-")?"+".concat(r.slice(1)):r.startsWith("+")?"-".concat(r.slice(1)):r})}})})}});var Cm=v(ze=>{"use strict";var kn=ze&&ze.__assign||function(){return kn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},kn.apply(this,arguments)};Object.defineProperty(ze,"__esModule",{value:!0});ze.OMIT_HEADERS=ze.FILE_HEADERS_ONLY=ze.INCLUDE_HEADERS=void 0;ze.structuredPatch=_u;ze.formatPatch=Co;ze.createTwoFilesPatch=Sm;ze.createPatch=Jx;var bm=vo();ze.INCLUDE_HEADERS={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};ze.FILE_HEADERS_ONLY={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0};ze.OMIT_HEADERS={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1};function _u(t,e,r,n,s,i,o){var a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);var u=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){var c=a.callback;(0,bm.diffLines)(r,n,kn(kn({},a),{callback:function(d){var f=l(d);c(f)}}))}else return l((0,bm.diffLines)(r,n,a));function l(d){if(!d)return;d.push({value:"",lines:[]});function f(J){return J.map(function(xe){return" "+xe})}for(var g=[],m=0,D=0,h=[],w=1,C=1,A=0;A<d.length;A++){var T=d[A],G=T.lines||Kx(T.value);if(T.lines=G,T.added||T.removed){if(!m){var I=d[A-1];m=w,D=C,I&&(h=u>0?f(I.lines.slice(-u)):[],m-=h.length,D-=h.length)}for(var Z=0,F=G;Z<F.length;Z++){var W=F[Z];h.push((T.added?"+":"-")+W)}T.added?C+=G.length:w+=G.length}else{if(m)if(G.length<=u*2&&A<d.length-2)for(var P=0,E=f(G);P<E.length;P++){var W=E[P];h.push(W)}else{for(var Q=Math.min(G.length,u),re=0,le=f(G.slice(0,Q));re<le.length;re++){var W=le[re];h.push(W)}var $={oldStart:m,oldLines:w-m+Q,newStart:D,newLines:C-D+Q,lines:h};g.push($),m=0,D=0,h=[]}w+=G.length,C+=G.length}}for(var k=0,he=g;k<he.length;k++)for(var $=he[k],A=0;A<$.lines.length;A++)$.lines[A].endsWith(`
20
- `)?$.lines[A]=$.lines[A].slice(0,-1):($.lines.splice(A+1,0,"\"),A++);return{oldFileName:t,newFileName:e,oldHeader:s,newHeader:i,hunks:g}}}function Co(t,e){if(e||(e=ze.INCLUDE_HEADERS),Array.isArray(t)){if(t.length>1&&!e.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(function(u){return Co(u,e)}).join(`
16
+ `)&&(n=n.slice(0,-1))),t.prototype.equals.call(this,r,n,s)},e})(Cx.default);Ft.lineDiff=new xx;function kx(t,e,r){return Ft.lineDiff.diff(t,e,r)}function $x(t,e,r){return r=(0,wx.generateOptions)(r,{ignoreWhitespace:!0}),Ft.lineDiff.diff(t,e,r)}function um(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
17
+ `));var r=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var s=0;s<n.length;s++){var i=n[s];s%2&&!e.newlineIsToken?r[r.length-1]+=i:r.push(i)}return r}});var lm=v($r=>{"use strict";var Ax=$r&&$r.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty($r,"__esModule",{value:!0});$r.sentenceDiff=void 0;$r.diffSentences=Tx;var Fx=or();function jx(t){return t=="."||t=="!"||t=="?"}var Ix=(function(t){Ax(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){for(var n,s=[],i=0,o=0;o<r.length;o++){if(o==r.length-1){s.push(r.slice(i));break}if(jx(r[o])&&r[o+1].match(/\s/)){for(s.push(r.slice(i,o+1)),o=i=o+1;!((n=r[o+1])===null||n===void 0)&&n.match(/\s/);)o++;s.push(r.slice(i,o+1)),i=o+1}}return s},e})(Fx.default);$r.sentenceDiff=new Ix;function Tx(t,e,r){return $r.sentenceDiff.diff(t,e,r)}});var dm=v(Ar=>{"use strict";var Rx=Ar&&Ar.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Ar,"__esModule",{value:!0});Ar.cssDiff=void 0;Ar.diffCss=Nx;var Px=or(),Ox=(function(t){Rx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){return r.split(/([{}:;,]|\s+)/)},e})(Px.default);Ar.cssDiff=new Ox;function Nx(t,e,r){return Ar.cssDiff.diff(t,e,r)}});var fm=v(ir=>{"use strict";var Lx=ir&&ir.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(ir,"__esModule",{value:!0});ir.jsonDiff=void 0;ir.diffJson=Wx;ir.canonicalize=So;var Bx=or(),Mx=bo(),qx=(function(t){Lx(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.tokenize=Mx.tokenize,r}return Object.defineProperty(e.prototype,"useLongestToken",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.castInput=function(r,n){var s=n.undefinedReplacement,i=n.stringifyReplacer,o=i===void 0?function(a,c){return typeof c>"u"?s:c}:i;return typeof r=="string"?r:JSON.stringify(So(r,null,null,o),null," ")},e.prototype.equals=function(r,n,s){return t.prototype.equals.call(this,r.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"),s)},e})(Bx.default);ir.jsonDiff=new qx;function Wx(t,e,r){return ir.jsonDiff.diff(t,e,r)}function So(t,e,r,n,s){e=e||[],r=r||[],n&&(t=n(s===void 0?"":s,t));var i;for(i=0;i<e.length;i+=1)if(e[i]===t)return r[i];var o;if(Object.prototype.toString.call(t)==="[object Array]"){for(e.push(t),o=new Array(t.length),r.push(o),i=0;i<t.length;i+=1)o[i]=So(t[i],e,r,n,String(i));return e.pop(),r.pop(),o}if(t&&t.toJSON&&(t=t.toJSON()),typeof t=="object"&&t!==null){e.push(t),o={},r.push(o);var a=[],c;for(c in t)Object.prototype.hasOwnProperty.call(t,c)&&a.push(c);for(a.sort(),i=0;i<a.length;i+=1)c=a[i],o[c]=So(t[c],e,r,n,c);e.pop(),r.pop()}else o=t;return o}});var hm=v(Fr=>{"use strict";var Hx=Fr&&Fr.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Fr,"__esModule",{value:!0});Fr.arrayDiff=void 0;Fr.diffArrays=Vx;var Zx=or(),Ux=(function(t){Hx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){return r.slice()},e.prototype.join=function(r){return r},e.prototype.removeEmpty=function(r){return r},e})(Zx.default);Fr.arrayDiff=new Ux;function Vx(t,e,r){return Fr.arrayDiff.diff(t,e,r)}});var gm=v(jr=>{"use strict";var zt=jr&&jr.__assign||function(){return zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},zt.apply(this,arguments)};Object.defineProperty(jr,"__esModule",{value:!0});jr.unixToWin=pm;jr.winToUnix=mm;jr.isUnix=Gx;jr.isWin=zx;function pm(t){return Array.isArray(t)?t.map(function(e){return pm(e)}):zt(zt({},t),{hunks:t.hunks.map(function(e){return zt(zt({},e),{lines:e.lines.map(function(r,n){var s;return r.startsWith("\\")||r.endsWith("\r")||!((s=e.lines[n+1])===null||s===void 0)&&s.startsWith("\\")?r:r+"\r"})})})})}function mm(t){return Array.isArray(t)?t.map(function(e){return mm(e)}):zt(zt({},t),{hunks:t.hunks.map(function(e){return zt(zt({},e),{lines:e.lines.map(function(r){return r.endsWith("\r")?r.substring(0,r.length-1):r})})})})}function Gx(t){return Array.isArray(t)||(t=[t]),!t.some(function(e){return e.hunks.some(function(r){return r.lines.some(function(n){return!n.startsWith("\\")&&n.endsWith("\r")})})})}function zx(t){return Array.isArray(t)||(t=[t]),t.some(function(e){return e.hunks.some(function(r){return r.lines.some(function(n){return n.endsWith("\r")})})})&&t.every(function(e){return e.hunks.every(function(r){return r.lines.every(function(n,s){var i;return n.startsWith("\\")||n.endsWith("\r")||((i=r.lines[s+1])===null||i===void 0?void 0:i.startsWith("\\"))})})})}});var _c=v(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.parsePatch=Yx;function Yx(t){var e=t.split(/\n/),r=[],n=0;function s(){var a={};for(r.push(a);n<e.length;){var c=e[n];if(/^(---|\+\+\+|@@)\s/.test(c))break;var u=/^(?:Index:|diff(?: -r \w+)+)\s+/.exec(c);u&&(a.index=c.substring(u[0].length).trim()),n++}for(i(a),i(a),a.hunks=[];n<e.length;){var c=e[n];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(c))break;if(/^@@/.test(c))a.hunks.push(o());else{if(c)throw new Error("Unknown line "+(n+1)+" "+JSON.stringify(c));n++}}}function i(a){var c=/^(---|\+\+\+)\s+/.exec(e[n]);if(c){var u=c[1],l=e[n].substring(3).trim().split(" ",2),d=(l[1]||"").trim(),f=l[0].replace(/\\\\/g,"\\");f.startsWith('"')&&f.endsWith('"')&&(f=f.substr(1,f.length-2)),u==="---"?(a.oldFileName=f,a.oldHeader=d):(a.newFileName=f,a.newHeader=d),n++}}function o(){var a,c=n,u=e[n++],l=u.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),d={oldStart:+l[1],oldLines:typeof l[2]>"u"?1:+l[2],newStart:+l[3],newLines:typeof l[4]>"u"?1:+l[4],lines:[]};d.oldLines===0&&(d.oldStart+=1),d.newLines===0&&(d.newStart+=1);for(var f=0,g=0;n<e.length&&(g<d.oldLines||f<d.newLines||!((a=e[n])===null||a===void 0)&&a.startsWith("\\"));n++){var m=e[n].length==0&&n!=e.length-1?" ":e[n][0];if(m==="+"||m==="-"||m===" "||m==="\\")d.lines.push(e[n]),m==="+"?f++:m==="-"?g++:m===" "&&(f++,g++);else throw new Error("Hunk at line ".concat(c+1," contained invalid line ").concat(e[n]))}if(!f&&d.newLines===1&&(d.newLines=0),!g&&d.oldLines===1&&(d.oldLines=0),f!==d.newLines)throw new Error("Added line count did not match for hunk at line "+(c+1));if(g!==d.oldLines)throw new Error("Removed line count did not match for hunk at line "+(c+1));return d}for(;n<e.length;)s();return r}});var Dm=v(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.default=Jx;function Jx(t,e,r){var n=!0,s=!1,i=!1,o=1;return function a(){if(n&&!i){if(s?o++:n=!1,t+o<=r)return t+o;i=!0}if(!s)return i||(n=!0),e<=t-o?t-o++:(s=!0,a())}}});var bm=v(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.applyPatch=_m;Co.applyPatches=Qx;var ym=Dc(),Eo=gm(),vm=_c(),Xx=Dm();function _m(t,e,r){r===void 0&&(r={});var n;if(typeof e=="string"?n=(0,vm.parsePatch)(e):Array.isArray(e)?n=e:n=[e],n.length>1)throw new Error("applyPatch only works with a single input.");return Kx(t,n[0],r)}function Kx(t,e,r){r===void 0&&(r={}),(r.autoConvertLineEndings||r.autoConvertLineEndings==null)&&((0,ym.hasOnlyWinLineEndings)(t)&&(0,Eo.isUnix)(e)?e=(0,Eo.unixToWin)(e):(0,ym.hasOnlyUnixLineEndings)(t)&&(0,Eo.isWin)(e)&&(e=(0,Eo.winToUnix)(e)));var n=t.split(`
18
+ `),s=e.hunks,i=r.compareLine||(function(F,W,R,b){return W===b}),o=r.fuzzFactor||0,a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!s.length)return t;for(var c="",u=!1,l=!1,d=0;d<s[s.length-1].lines.length;d++){var f=s[s.length-1].lines[d];f[0]=="\\"&&(c[0]=="+"?u=!0:c[0]=="-"&&(l=!0)),c=f}if(u){if(l){if(!o&&n[n.length-1]=="")return!1}else if(n[n.length-1]=="")n.pop();else if(!o)return!1}else if(l){if(n[n.length-1]!="")n.push("");else if(!o)return!1}function g(F,W,R,b,Q,te,de){b===void 0&&(b=0),Q===void 0&&(Q=!0),te===void 0&&(te=[]),de===void 0&&(de=0);for(var x=0,k=!1;b<F.length;b++){var he=F[b],X=he.length>0?he[0]:" ",xe=he.length>0?he.substr(1):he;if(X==="-")if(i(W+1,n[W],X,xe))W++,x=0;else return!R||n[W]==null?null:(te[de]=n[W],g(F,W+1,R-1,b,!1,te,de+1));if(X==="+"){if(!Q)return null;te[de]=xe,de++,x=0,k=!0}if(X===" ")if(x++,te[de]=n[W],i(W+1,n[W],X,xe))de++,Q=!0,k=!1,W++;else return k||!R?null:n[W]&&(g(F,W+1,R-1,b+1,!1,te,de+1)||g(F,W+1,R-1,b,!1,te,de+1))||g(F,W,R-1,b+1,!1,te,de)}return de-=x,W-=x,te.length=de,{patchedLines:te,oldLineLastI:W-1}}for(var m=[],y=0,d=0;d<s.length;d++){for(var h=s[d],w=void 0,C=n.length-h.oldLines+o,A=void 0,T=0;T<=o;T++){A=h.oldStart+y-1;for(var G=(0,Xx.default)(A,a,C);A!==void 0&&(w=g(h.lines,A,T),!w);A=G());if(w)break}if(!w)return!1;for(var I=a;I<A;I++)m.push(n[I]);for(var Z=0;Z<w.patchedLines.length;Z++){var f=w.patchedLines[Z];m.push(f)}a=w.oldLineLastI+1,y=A+1-h.oldStart}for(var d=a;d<n.length;d++)m.push(n[d]);return m.join(`
19
+ `)}function Qx(t,e){var r=typeof t=="string"?(0,vm.parsePatch)(t):t,n=0;function s(){var i=r[n++];if(!i)return e.complete();e.loadFile(i,function(o,a){if(o)return e.complete(o);var c=_m(a,i,e);e.patched(i,c,function(u){if(u)return e.complete(u);s()})})}s()}});var Em=v(ns=>{"use strict";var wo=ns&&ns.__assign||function(){return wo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},wo.apply(this,arguments)};Object.defineProperty(ns,"__esModule",{value:!0});ns.reversePatch=Sm;function Sm(t){return Array.isArray(t)?t.map(function(e){return Sm(e)}).reverse():wo(wo({},t),{oldFileName:t.newFileName,oldHeader:t.newHeader,newFileName:t.oldFileName,newHeader:t.oldHeader,hunks:t.hunks.map(function(e){return{oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(function(r){return r.startsWith("-")?"+".concat(r.slice(1)):r.startsWith("+")?"-".concat(r.slice(1)):r})}})})}});var xm=v(Ke=>{"use strict";var Fn=Ke&&Ke.__assign||function(){return Fn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},Fn.apply(this,arguments)};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.OMIT_HEADERS=Ke.FILE_HEADERS_ONLY=Ke.INCLUDE_HEADERS=void 0;Ke.structuredPatch=Sc;Ke.formatPatch=xo;Ke.createTwoFilesPatch=wm;Ke.createPatch=ek;var Cm=bo();Ke.INCLUDE_HEADERS={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};Ke.FILE_HEADERS_ONLY={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0};Ke.OMIT_HEADERS={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1};function Sc(t,e,r,n,s,i,o){var a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);var c=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){var u=a.callback;(0,Cm.diffLines)(r,n,Fn(Fn({},a),{callback:function(d){var f=l(d);u(f)}}))}else return l((0,Cm.diffLines)(r,n,a));function l(d){if(!d)return;d.push({value:"",lines:[]});function f(X){return X.map(function(xe){return" "+xe})}for(var g=[],m=0,y=0,h=[],w=1,C=1,A=0;A<d.length;A++){var T=d[A],G=T.lines||tk(T.value);if(T.lines=G,T.added||T.removed){if(!m){var I=d[A-1];m=w,y=C,I&&(h=c>0?f(I.lines.slice(-c)):[],m-=h.length,y-=h.length)}for(var Z=0,F=G;Z<F.length;Z++){var W=F[Z];h.push((T.added?"+":"-")+W)}T.added?C+=G.length:w+=G.length}else{if(m)if(G.length<=c*2&&A<d.length-2)for(var R=0,b=f(G);R<b.length;R++){var W=b[R];h.push(W)}else{for(var Q=Math.min(G.length,c),te=0,de=f(G.slice(0,Q));te<de.length;te++){var W=de[te];h.push(W)}var x={oldStart:m,oldLines:w-m+Q,newStart:y,newLines:C-y+Q,lines:h};g.push(x),m=0,y=0,h=[]}w+=G.length,C+=G.length}}for(var k=0,he=g;k<he.length;k++)for(var x=he[k],A=0;A<x.lines.length;A++)x.lines[A].endsWith(`
20
+ `)?x.lines[A]=x.lines[A].slice(0,-1):(x.lines.splice(A+1,0,"\"),A++);return{oldFileName:t,newFileName:e,oldHeader:s,newHeader:i,hunks:g}}}function xo(t,e){if(e||(e=Ke.INCLUDE_HEADERS),Array.isArray(t)){if(t.length>1&&!e.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(function(c){return xo(c,e)}).join(`
21
21
  `)}var r=[];e.includeIndex&&t.oldFileName==t.newFileName&&r.push("Index: "+t.oldFileName),e.includeUnderline&&r.push("==================================================================="),e.includeFileHeaders&&(r.push("--- "+t.oldFileName+(typeof t.oldHeader>"u"?"":" "+t.oldHeader)),r.push("+++ "+t.newFileName+(typeof t.newHeader>"u"?"":" "+t.newHeader)));for(var n=0;n<t.hunks.length;n++){var s=t.hunks[n];s.oldLines===0&&(s.oldStart-=1),s.newLines===0&&(s.newStart-=1),r.push("@@ -"+s.oldStart+","+s.oldLines+" +"+s.newStart+","+s.newLines+" @@");for(var i=0,o=s.lines;i<o.length;i++){var a=o[i];r.push(a)}}return r.join(`
22
22
  `)+`
23
- `}function Sm(t,e,r,n,s,i,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){var u=o.callback;_u(t,e,r,n,s,i,kn(kn({},o),{callback:function(c){u(c?Co(c,o.headerOptions):void 0)}}))}else{var a=_u(t,e,r,n,s,i,o);return a?Co(a,o?.headerOptions):void 0}}function Jx(t,e,r,n,s,i){return Sm(t,t,e,r,n,s,i)}function Kx(t){var e=t.endsWith(`
23
+ `}function wm(t,e,r,n,s,i,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){var c=o.callback;Sc(t,e,r,n,s,i,Fn(Fn({},o),{callback:function(u){c(u?xo(u,o.headerOptions):void 0)}}))}else{var a=Sc(t,e,r,n,s,i,o);return a?xo(a,o?.headerOptions):void 0}}function ek(t,e,r,n,s,i){return wm(t,t,e,r,n,s,i)}function tk(t){var e=t.endsWith(`
24
24
  `),r=t.split(`
25
25
  `).map(function(n){return n+`
26
- `});return e?r.pop():r.push(r.pop().slice(0,-1)),r}});var wm=v(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.convertChangesToDMP=Qx;function Qx(t){for(var e=[],r,n,s=0;s<t.length;s++)r=t[s],r.added?n=1:r.removed?n=-1:n=0,e.push([n,r.value]);return e}});var xm=v(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.convertChangesToXML=e$;function e$(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n.added?e.push("<ins>"):n.removed&&e.push("<del>"),e.push(t$(n.value)),n.added?e.push("</ins>"):n.removed&&e.push("</del>")}return e.join("")}function t$(t){var e=t;return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;"),e}});var Im=v(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.canonicalize=z.convertChangesToXML=z.convertChangesToDMP=z.reversePatch=z.parsePatch=z.applyPatches=z.applyPatch=z.OMIT_HEADERS=z.FILE_HEADERS_ONLY=z.INCLUDE_HEADERS=z.formatPatch=z.createPatch=z.createTwoFilesPatch=z.structuredPatch=z.arrayDiff=z.diffArrays=z.jsonDiff=z.diffJson=z.cssDiff=z.diffCss=z.sentenceDiff=z.diffSentences=z.diffTrimmedLines=z.lineDiff=z.diffLines=z.wordsWithSpaceDiff=z.diffWordsWithSpace=z.wordDiff=z.diffWords=z.characterDiff=z.diffChars=z.Diff=void 0;var r$=nr();z.Diff=r$.default;var $m=Yp();Object.defineProperty(z,"diffChars",{enumerable:!0,get:function(){return $m.diffChars}});Object.defineProperty(z,"characterDiff",{enumerable:!0,get:function(){return $m.characterDiff}});var wo=om();Object.defineProperty(z,"diffWords",{enumerable:!0,get:function(){return wo.diffWords}});Object.defineProperty(z,"diffWordsWithSpace",{enumerable:!0,get:function(){return wo.diffWordsWithSpace}});Object.defineProperty(z,"wordDiff",{enumerable:!0,get:function(){return wo.wordDiff}});Object.defineProperty(z,"wordsWithSpaceDiff",{enumerable:!0,get:function(){return wo.wordsWithSpaceDiff}});var Su=vo();Object.defineProperty(z,"diffLines",{enumerable:!0,get:function(){return Su.diffLines}});Object.defineProperty(z,"diffTrimmedLines",{enumerable:!0,get:function(){return Su.diffTrimmedLines}});Object.defineProperty(z,"lineDiff",{enumerable:!0,get:function(){return Su.lineDiff}});var km=um();Object.defineProperty(z,"diffSentences",{enumerable:!0,get:function(){return km.diffSentences}});Object.defineProperty(z,"sentenceDiff",{enumerable:!0,get:function(){return km.sentenceDiff}});var Am=cm();Object.defineProperty(z,"diffCss",{enumerable:!0,get:function(){return Am.diffCss}});Object.defineProperty(z,"cssDiff",{enumerable:!0,get:function(){return Am.cssDiff}});var Cu=lm();Object.defineProperty(z,"diffJson",{enumerable:!0,get:function(){return Cu.diffJson}});Object.defineProperty(z,"canonicalize",{enumerable:!0,get:function(){return Cu.canonicalize}});Object.defineProperty(z,"jsonDiff",{enumerable:!0,get:function(){return Cu.jsonDiff}});var Fm=dm();Object.defineProperty(z,"diffArrays",{enumerable:!0,get:function(){return Fm.diffArrays}});Object.defineProperty(z,"arrayDiff",{enumerable:!0,get:function(){return Fm.arrayDiff}});var jm=vm();Object.defineProperty(z,"applyPatch",{enumerable:!0,get:function(){return jm.applyPatch}});Object.defineProperty(z,"applyPatches",{enumerable:!0,get:function(){return jm.applyPatches}});var n$=yu();Object.defineProperty(z,"parsePatch",{enumerable:!0,get:function(){return n$.parsePatch}});var s$=Em();Object.defineProperty(z,"reversePatch",{enumerable:!0,get:function(){return s$.reversePatch}});var tn=Cm();Object.defineProperty(z,"structuredPatch",{enumerable:!0,get:function(){return tn.structuredPatch}});Object.defineProperty(z,"createTwoFilesPatch",{enumerable:!0,get:function(){return tn.createTwoFilesPatch}});Object.defineProperty(z,"createPatch",{enumerable:!0,get:function(){return tn.createPatch}});Object.defineProperty(z,"formatPatch",{enumerable:!0,get:function(){return tn.formatPatch}});Object.defineProperty(z,"INCLUDE_HEADERS",{enumerable:!0,get:function(){return tn.INCLUDE_HEADERS}});Object.defineProperty(z,"FILE_HEADERS_ONLY",{enumerable:!0,get:function(){return tn.FILE_HEADERS_ONLY}});Object.defineProperty(z,"OMIT_HEADERS",{enumerable:!0,get:function(){return tn.OMIT_HEADERS}});var o$=wm();Object.defineProperty(z,"convertChangesToDMP",{enumerable:!0,get:function(){return o$.convertChangesToDMP}});var i$=xm();Object.defineProperty(z,"convertChangesToXML",{enumerable:!0,get:function(){return i$.convertChangesToXML}})});var xu=v((jI,Tm)=>{"use strict";var wu={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},a$={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},u$={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?wu.up():"");return t&&(e+=wu.left),e}};Tm.exports={cursor:wu,scroll:a$,erase:u$,beep:"\x07"}});var Qm=v(yt=>{"use strict";var tt=xu(),Ao=require("node:process"),Vm=require("node:readline"),c$=require("node:tty"),l$=Pn();function Gm(t){return t&&typeof t=="object"&&"default"in t?t.default:t}function d$(t){if(t&&typeof t=="object"&&"default"in t)return t;let e=Object.create(null);if(t)for(let r in t)e[r]=t[r];return e.default=t,e}var xo=d$(Vm),Rm=Gm(Vm),ko=Gm(l$);function f$({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var h$=f$();function zm(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(h$,"")}function Ym(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xm={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var s=n.charCodeAt(0),i=n.length==2?n.charCodeAt(1):0,o=s;return 55296<=s&&s<=56319&&56320<=i&&i<=57343&&(s&=1023,i&=1023,o=s<<10|i,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},e.characterLength=function(n){var s=this.eastAsianWidth(n);return s=="F"||s=="W"||s=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var s=r(n),i=0,o=0;o<s.length;o++)i=i+this.characterLength(s[o]);return i},e.slice=function(n,s,i){textLen=e.length(n),s=s||0,i=i||1,s<0&&(s=textLen+s),i<0&&(i=textLen+i);for(var o="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],d=e.length(l);if(a>=s-(d==2?1:0))if(a+d<=i)o+=l;else break;a+=d}return o}})(Xm);var p$=Xm.exports,m$=Ym(p$),g$=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},D$=Ym(g$);function rs(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=zm(t),t.length===0))return 0;t=t.replace(D$()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let s of t){let i=s.codePointAt(0);if(!(i<=31||i>=127&&i<=159||i>=768&&i<=879))switch(m$.eastAsianWidth(s)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var $u=10,Pm=(t=0)=>e=>`\x1B[${e+t}m`,Om=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Nm=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,we={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(we.modifier);var y$=Object.keys(we.color),v$=Object.keys(we.bgColor);[...y$,...v$];function _$(){let t=new Map;for(let[e,r]of Object.entries(we)){for(let[n,s]of Object.entries(r))we[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=we[n],t.set(s[0],s[1]);Object.defineProperty(we,e,{value:r,enumerable:!1})}return Object.defineProperty(we,"codes",{value:t,enumerable:!1}),we.color.close="\x1B[39m",we.bgColor.close="\x1B[49m",we.color.ansi=Pm(),we.color.ansi256=Om(),we.color.ansi16m=Nm(),we.bgColor.ansi=Pm($u),we.bgColor.ansi256=Om($u),we.bgColor.ansi16m=Nm($u),Object.defineProperties(we,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(i=>i+i).join(""));let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>we.rgbToAnsi256(...we.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,s;if(e>=232)r=((e-232)*10+8)/255,n=r,s=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,s=a%6/5}let i=Math.max(r,n,s)*2;if(i===0)return 30;let o=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>we.ansi256ToAnsi(we.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>we.ansi256ToAnsi(we.hexToAnsi256(e)),enumerable:!1}}),we}var E$=_$(),Fo=new Set(["\x1B","\x9B"]),b$=39,Pu="\x07",Jm="[",S$="]",Km="m",Ou=`${S$}8;;`,Lm=t=>`${Fo.values().next().value}${Jm}${t}${Km}`,Bm=t=>`${Fo.values().next().value}${Ou}${t}${Pu}`,C$=t=>t.split(" ").map(e=>rs(e)),ku=(t,e,r)=>{let n=[...e],s=!1,i=!1,o=rs(zm(t[t.length-1]));for(let[a,u]of n.entries()){let c=rs(u);if(o+c<=r?t[t.length-1]+=u:(t.push(u),o=0),Fo.has(u)&&(s=!0,i=n.slice(a+1).join("").startsWith(Ou)),s){i?u===Pu&&(s=!1,i=!1):u===Km&&(s=!1);continue}o+=c,o===r&&a<n.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},w$=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(rs(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},x$=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",s,i,o=C$(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let d=rs(a[a.length-1]);if(c!==0&&(d>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),d=0),(d>0||r.trim===!1)&&(a[a.length-1]+=" ",d++)),r.hard&&o[c]>e){let f=e-d,g=1+Math.floor((o[c]-f-1)/e);Math.floor((o[c]-1)/e)<g&&a.push(""),ku(a,l,e);continue}if(d+o[c]>e&&d>0&&o[c]>0){if(r.wordWrap===!1&&d<e){ku(a,l,e);continue}a.push("")}if(d+o[c]>e&&r.wordWrap===!1){ku(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>w$(c)));let u=[...a.join(`
27
- `)];for(let[c,l]of u.entries()){if(n+=l,Fo.has(l)){let{groups:f}=new RegExp(`(?:\\${Jm}(?<code>\\d+)m|\\${Ou}(?<uri>.*)${Pu})`).exec(u.slice(c).join(""))||{groups:{}};if(f.code!==void 0){let g=Number.parseFloat(f.code);s=g===b$?void 0:g}else f.uri!==void 0&&(i=f.uri.length===0?void 0:f.uri)}let d=E$.codes.get(Number(s));u[c+1]===`
28
- `?(i&&(n+=Bm("")),s&&d&&(n+=Lm(d))):l===`
29
- `&&(s&&d&&(n+=Lm(s)),i&&(n+=Bm(i)))}return n};function Mm(t,e,r){return String(t).normalize().replace(/\r\n/g,`
26
+ `});return e?r.pop():r.push(r.pop().slice(0,-1)),r}});var km=v(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.convertChangesToDMP=rk;function rk(t){for(var e=[],r,n,s=0;s<t.length;s++)r=t[s],r.added?n=1:r.removed?n=-1:n=0,e.push([n,r.value]);return e}});var $m=v(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.convertChangesToXML=nk;function nk(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n.added?e.push("<ins>"):n.removed&&e.push("<del>"),e.push(sk(n.value)),n.added?e.push("</ins>"):n.removed&&e.push("</del>")}return e.join("")}function sk(t){var e=t;return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;"),e}});var Rm=v(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.canonicalize=z.convertChangesToXML=z.convertChangesToDMP=z.reversePatch=z.parsePatch=z.applyPatches=z.applyPatch=z.OMIT_HEADERS=z.FILE_HEADERS_ONLY=z.INCLUDE_HEADERS=z.formatPatch=z.createPatch=z.createTwoFilesPatch=z.structuredPatch=z.arrayDiff=z.diffArrays=z.jsonDiff=z.diffJson=z.cssDiff=z.diffCss=z.sentenceDiff=z.diffSentences=z.diffTrimmedLines=z.lineDiff=z.diffLines=z.wordsWithSpaceDiff=z.diffWordsWithSpace=z.wordDiff=z.diffWords=z.characterDiff=z.diffChars=z.Diff=void 0;var ok=or();z.Diff=ok.default;var Am=Xp();Object.defineProperty(z,"diffChars",{enumerable:!0,get:function(){return Am.diffChars}});Object.defineProperty(z,"characterDiff",{enumerable:!0,get:function(){return Am.characterDiff}});var ko=am();Object.defineProperty(z,"diffWords",{enumerable:!0,get:function(){return ko.diffWords}});Object.defineProperty(z,"diffWordsWithSpace",{enumerable:!0,get:function(){return ko.diffWordsWithSpace}});Object.defineProperty(z,"wordDiff",{enumerable:!0,get:function(){return ko.wordDiff}});Object.defineProperty(z,"wordsWithSpaceDiff",{enumerable:!0,get:function(){return ko.wordsWithSpaceDiff}});var wc=bo();Object.defineProperty(z,"diffLines",{enumerable:!0,get:function(){return wc.diffLines}});Object.defineProperty(z,"diffTrimmedLines",{enumerable:!0,get:function(){return wc.diffTrimmedLines}});Object.defineProperty(z,"lineDiff",{enumerable:!0,get:function(){return wc.lineDiff}});var Fm=lm();Object.defineProperty(z,"diffSentences",{enumerable:!0,get:function(){return Fm.diffSentences}});Object.defineProperty(z,"sentenceDiff",{enumerable:!0,get:function(){return Fm.sentenceDiff}});var jm=dm();Object.defineProperty(z,"diffCss",{enumerable:!0,get:function(){return jm.diffCss}});Object.defineProperty(z,"cssDiff",{enumerable:!0,get:function(){return jm.cssDiff}});var xc=fm();Object.defineProperty(z,"diffJson",{enumerable:!0,get:function(){return xc.diffJson}});Object.defineProperty(z,"canonicalize",{enumerable:!0,get:function(){return xc.canonicalize}});Object.defineProperty(z,"jsonDiff",{enumerable:!0,get:function(){return xc.jsonDiff}});var Im=hm();Object.defineProperty(z,"diffArrays",{enumerable:!0,get:function(){return Im.diffArrays}});Object.defineProperty(z,"arrayDiff",{enumerable:!0,get:function(){return Im.arrayDiff}});var Tm=bm();Object.defineProperty(z,"applyPatch",{enumerable:!0,get:function(){return Tm.applyPatch}});Object.defineProperty(z,"applyPatches",{enumerable:!0,get:function(){return Tm.applyPatches}});var ik=_c();Object.defineProperty(z,"parsePatch",{enumerable:!0,get:function(){return ik.parsePatch}});var ak=Em();Object.defineProperty(z,"reversePatch",{enumerable:!0,get:function(){return ak.reversePatch}});var nn=xm();Object.defineProperty(z,"structuredPatch",{enumerable:!0,get:function(){return nn.structuredPatch}});Object.defineProperty(z,"createTwoFilesPatch",{enumerable:!0,get:function(){return nn.createTwoFilesPatch}});Object.defineProperty(z,"createPatch",{enumerable:!0,get:function(){return nn.createPatch}});Object.defineProperty(z,"formatPatch",{enumerable:!0,get:function(){return nn.formatPatch}});Object.defineProperty(z,"INCLUDE_HEADERS",{enumerable:!0,get:function(){return nn.INCLUDE_HEADERS}});Object.defineProperty(z,"FILE_HEADERS_ONLY",{enumerable:!0,get:function(){return nn.FILE_HEADERS_ONLY}});Object.defineProperty(z,"OMIT_HEADERS",{enumerable:!0,get:function(){return nn.OMIT_HEADERS}});var ck=km();Object.defineProperty(z,"convertChangesToDMP",{enumerable:!0,get:function(){return ck.convertChangesToDMP}});var uk=$m();Object.defineProperty(z,"convertChangesToXML",{enumerable:!0,get:function(){return uk.convertChangesToXML}})});var $c=v((NI,Pm)=>{"use strict";var kc={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},lk={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},dk={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?kc.up():"");return t&&(e+=kc.left),e}};Pm.exports={cursor:kc,scroll:lk,erase:dk,beep:"\x07"}});var tg=v(bt=>{"use strict";var ot=$c(),jo=require("node:process"),zm=require("node:readline"),fk=require("node:tty"),hk=Nn();function Ym(t){return t&&typeof t=="object"&&"default"in t?t.default:t}function pk(t){if(t&&typeof t=="object"&&"default"in t)return t;let e=Object.create(null);if(t)for(let r in t)e[r]=t[r];return e.default=t,e}var $o=pk(zm),Om=Ym(zm),Fo=Ym(hk);function mk({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var gk=mk();function Jm(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(gk,"")}function Xm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Km={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var s=n.charCodeAt(0),i=n.length==2?n.charCodeAt(1):0,o=s;return 55296<=s&&s<=56319&&56320<=i&&i<=57343&&(s&=1023,i&=1023,o=s<<10|i,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},e.characterLength=function(n){var s=this.eastAsianWidth(n);return s=="F"||s=="W"||s=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var s=r(n),i=0,o=0;o<s.length;o++)i=i+this.characterLength(s[o]);return i},e.slice=function(n,s,i){textLen=e.length(n),s=s||0,i=i||1,s<0&&(s=textLen+s),i<0&&(i=textLen+i);for(var o="",a=0,c=r(n),u=0;u<c.length;u++){var l=c[u],d=e.length(l);if(a>=s-(d==2?1:0))if(a+d<=i)o+=l;else break;a+=d}return o}})(Km);var Dk=Km.exports,yk=Xm(Dk),vk=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},_k=Xm(vk);function ss(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Jm(t),t.length===0))return 0;t=t.replace(_k()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let s of t){let i=s.codePointAt(0);if(!(i<=31||i>=127&&i<=159||i>=768&&i<=879))switch(yk.eastAsianWidth(s)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Ac=10,Nm=(t=0)=>e=>`\x1B[${e+t}m`,Lm=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Bm=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,$e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys($e.modifier);var bk=Object.keys($e.color),Sk=Object.keys($e.bgColor);[...bk,...Sk];function Ek(){let t=new Map;for(let[e,r]of Object.entries($e)){for(let[n,s]of Object.entries(r))$e[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=$e[n],t.set(s[0],s[1]);Object.defineProperty($e,e,{value:r,enumerable:!1})}return Object.defineProperty($e,"codes",{value:t,enumerable:!1}),$e.color.close="\x1B[39m",$e.bgColor.close="\x1B[49m",$e.color.ansi=Nm(),$e.color.ansi256=Lm(),$e.color.ansi16m=Bm(),$e.bgColor.ansi=Nm(Ac),$e.bgColor.ansi256=Lm(Ac),$e.bgColor.ansi16m=Bm(Ac),Object.defineProperties($e,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(i=>i+i).join(""));let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>$e.rgbToAnsi256(...$e.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,s;if(e>=232)r=((e-232)*10+8)/255,n=r,s=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,s=a%6/5}let i=Math.max(r,n,s)*2;if(i===0)return 30;let o=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>$e.ansi256ToAnsi($e.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>$e.ansi256ToAnsi($e.hexToAnsi256(e)),enumerable:!1}}),$e}var Ck=Ek(),Io=new Set(["\x1B","\x9B"]),wk=39,Nc="\x07",Qm="[",xk="]",eg="m",Lc=`${xk}8;;`,Mm=t=>`${Io.values().next().value}${Qm}${t}${eg}`,qm=t=>`${Io.values().next().value}${Lc}${t}${Nc}`,kk=t=>t.split(" ").map(e=>ss(e)),Fc=(t,e,r)=>{let n=[...e],s=!1,i=!1,o=ss(Jm(t[t.length-1]));for(let[a,c]of n.entries()){let u=ss(c);if(o+u<=r?t[t.length-1]+=c:(t.push(c),o=0),Io.has(c)&&(s=!0,i=n.slice(a+1).join("").startsWith(Lc)),s){i?c===Nc&&(s=!1,i=!1):c===eg&&(s=!1);continue}o+=u,o===r&&a<n.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},$k=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(ss(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},Ak=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",s,i,o=kk(t),a=[""];for(let[u,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let d=ss(a[a.length-1]);if(u!==0&&(d>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),d=0),(d>0||r.trim===!1)&&(a[a.length-1]+=" ",d++)),r.hard&&o[u]>e){let f=e-d,g=1+Math.floor((o[u]-f-1)/e);Math.floor((o[u]-1)/e)<g&&a.push(""),Fc(a,l,e);continue}if(d+o[u]>e&&d>0&&o[u]>0){if(r.wordWrap===!1&&d<e){Fc(a,l,e);continue}a.push("")}if(d+o[u]>e&&r.wordWrap===!1){Fc(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(u=>$k(u)));let c=[...a.join(`
27
+ `)];for(let[u,l]of c.entries()){if(n+=l,Io.has(l)){let{groups:f}=new RegExp(`(?:\\${Qm}(?<code>\\d+)m|\\${Lc}(?<uri>.*)${Nc})`).exec(c.slice(u).join(""))||{groups:{}};if(f.code!==void 0){let g=Number.parseFloat(f.code);s=g===wk?void 0:g}else f.uri!==void 0&&(i=f.uri.length===0?void 0:f.uri)}let d=Ck.codes.get(Number(s));c[u+1]===`
28
+ `?(i&&(n+=qm("")),s&&d&&(n+=Mm(d))):l===`
29
+ `&&(s&&d&&(n+=Mm(s)),i&&(n+=qm(i)))}return n};function Wm(t,e,r){return String(t).normalize().replace(/\r\n/g,`
30
30
  `).split(`
31
- `).map(n=>x$(n,e,r)).join(`
32
- `)}var $$=["up","down","left","right","space","enter","cancel"],An={actions:new Set($$),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function k$(t){for(let e in t){let r=e;if(!Object.hasOwn(t,r))continue;let n=t[r];switch(r){case"aliases":{for(let s in n)Object.hasOwn(n,s)&&(An.aliases.has(s)||An.aliases.set(s,n[s]));break}}}}function Nu(t,e){if(typeof t=="string")return An.aliases.get(t)===e;for(let r of t)if(r!==void 0&&Nu(r,e))return!0;return!1}function A$(t,e){if(t===e)return;let r=t.split(`
31
+ `).map(n=>Ak(n,e,r)).join(`
32
+ `)}var Fk=["up","down","left","right","space","enter","cancel"],jn={actions:new Set(Fk),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function jk(t){for(let e in t){let r=e;if(!Object.hasOwn(t,r))continue;let n=t[r];switch(r){case"aliases":{for(let s in n)Object.hasOwn(n,s)&&(jn.aliases.has(s)||jn.aliases.set(s,n[s]));break}}}}function Bc(t,e){if(typeof t=="string")return jn.aliases.get(t)===e;for(let r of t)if(r!==void 0&&Bc(r,e))return!0;return!1}function Ik(t,e){if(t===e)return;let r=t.split(`
33
33
  `),n=e.split(`
34
- `),s=[];for(let i=0;i<Math.max(r.length,n.length);i++)r[i]!==n[i]&&s.push(i);return s}var F$=globalThis.process.platform.startsWith("win"),Au=Symbol("clack:cancel");function j$(t){return t===Au}function $o(t,e){let r=t;r.isTTY&&r.setRawMode(e)}function I$({input:t=Ao.stdin,output:e=Ao.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let s=xo.createInterface({input:t,output:e,prompt:"",tabSize:1});xo.emitKeypressEvents(t,s),t.isTTY&&t.setRawMode(!0);let i=(o,{name:a,sequence:u})=>{let c=String(o);if(Nu([c,a,u],"cancel")){n&&e.write(tt.cursor.show),process.exit(0);return}if(!r)return;let l=a==="return"?0:-1,d=a==="return"?-1:0;xo.moveCursor(e,l,d,()=>{xo.clearLine(e,1,()=>{t.once("keypress",i)})})};return n&&e.write(tt.cursor.hide),t.once("keypress",i),()=>{t.off("keypress",i),n&&e.write(tt.cursor.show),t.isTTY&&!F$&&t.setRawMode(!1),s.terminal=!1,s.close()}}var T$=Object.defineProperty,R$=(t,e,r)=>e in t?T$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ut=(t,e,r)=>(R$(t,typeof e!="symbol"?e+"":e,r),r),Gt=class{constructor(e,r=!0){ut(this,"input"),ut(this,"output"),ut(this,"_abortSignal"),ut(this,"rl"),ut(this,"opts"),ut(this,"_render"),ut(this,"_track",!1),ut(this,"_prevFrame",""),ut(this,"_subscribers",new Map),ut(this,"_cursor",0),ut(this,"state","initial"),ut(this,"error",""),ut(this,"value");let{input:n=Ao.stdin,output:s=Ao.stdout,render:i,signal:o,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=r,this._abortSignal=o,this.input=n,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(e,r){let n=this._subscribers.get(e)??[];n.push(r),this._subscribers.set(e,n)}on(e,r){this.setSubscriber(e,{cb:r})}once(e,r){this.setSubscriber(e,{cb:r,once:!0})}emit(e,...r){let n=this._subscribers.get(e)??[],s=[];for(let i of n)i.cb(...r),i.once&&s.push(()=>n.splice(n.indexOf(i),1));for(let i of s)i()}prompt(){return new Promise((e,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(Au);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new c$.WriteStream(0);n._write=(s,i,o)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),o()},this.input.pipe(n),this.rl=Rm.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50}),Rm.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),$o(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(tt.cursor.show),this.output.off("resize",this.render),$o(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(tt.cursor.show),this.output.off("resize",this.render),$o(this.input,!1),e(Au)})})}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&An.aliases.has(r.name)&&this.emit("cursor",An.aliases.get(r.name)),An.actions.has(r.name)&&this.emit("cursor",r.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Nu([e,r?.name,r?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
35
- `),$o(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Mm(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
36
- `).length-1;this.output.write(tt.cursor.move(-999,e*-1))}render(){let e=Mm(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(tt.cursor.hide);else{let r=A$(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(tt.cursor.move(0,n)),this.output.write(tt.erase.lines(1));let s=e.split(`
37
- `);this.output.write(s[n]),this._prevFrame=e,this.output.write(tt.cursor.move(0,s.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(tt.cursor.move(0,n)),this.output.write(tt.erase.down());let s=e.split(`
34
+ `),s=[];for(let i=0;i<Math.max(r.length,n.length);i++)r[i]!==n[i]&&s.push(i);return s}var Tk=globalThis.process.platform.startsWith("win"),jc=Symbol("clack:cancel");function Rk(t){return t===jc}function Ao(t,e){let r=t;r.isTTY&&r.setRawMode(e)}function Pk({input:t=jo.stdin,output:e=jo.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let s=$o.createInterface({input:t,output:e,prompt:"",tabSize:1});$o.emitKeypressEvents(t,s),t.isTTY&&t.setRawMode(!0);let i=(o,{name:a,sequence:c})=>{let u=String(o);if(Bc([u,a,c],"cancel")){n&&e.write(ot.cursor.show),process.exit(0);return}if(!r)return;let l=a==="return"?0:-1,d=a==="return"?-1:0;$o.moveCursor(e,l,d,()=>{$o.clearLine(e,1,()=>{t.once("keypress",i)})})};return n&&e.write(ot.cursor.hide),t.once("keypress",i),()=>{t.off("keypress",i),n&&e.write(ot.cursor.show),t.isTTY&&!Tk&&t.setRawMode(!1),s.terminal=!1,s.close()}}var Ok=Object.defineProperty,Nk=(t,e,r)=>e in t?Ok(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lt=(t,e,r)=>(Nk(t,typeof e!="symbol"?e+"":e,r),r),Yt=class{constructor(e,r=!0){lt(this,"input"),lt(this,"output"),lt(this,"_abortSignal"),lt(this,"rl"),lt(this,"opts"),lt(this,"_render"),lt(this,"_track",!1),lt(this,"_prevFrame",""),lt(this,"_subscribers",new Map),lt(this,"_cursor",0),lt(this,"state","initial"),lt(this,"error",""),lt(this,"value");let{input:n=jo.stdin,output:s=jo.stdout,render:i,signal:o,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=r,this._abortSignal=o,this.input=n,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(e,r){let n=this._subscribers.get(e)??[];n.push(r),this._subscribers.set(e,n)}on(e,r){this.setSubscriber(e,{cb:r})}once(e,r){this.setSubscriber(e,{cb:r,once:!0})}emit(e,...r){let n=this._subscribers.get(e)??[],s=[];for(let i of n)i.cb(...r),i.once&&s.push(()=>n.splice(n.indexOf(i),1));for(let i of s)i()}prompt(){return new Promise((e,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(jc);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new fk.WriteStream(0);n._write=(s,i,o)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),o()},this.input.pipe(n),this.rl=Om.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50}),Om.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),Ao(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(ot.cursor.show),this.output.off("resize",this.render),Ao(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(ot.cursor.show),this.output.off("resize",this.render),Ao(this.input,!1),e(jc)})})}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&jn.aliases.has(r.name)&&this.emit("cursor",jn.aliases.get(r.name)),jn.actions.has(r.name)&&this.emit("cursor",r.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Bc([e,r?.name,r?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
35
+ `),Ao(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Wm(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
36
+ `).length-1;this.output.write(ot.cursor.move(-999,e*-1))}render(){let e=Wm(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(ot.cursor.hide);else{let r=Ik(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(ot.cursor.move(0,n)),this.output.write(ot.erase.lines(1));let s=e.split(`
37
+ `);this.output.write(s[n]),this._prevFrame=e,this.output.write(ot.cursor.move(0,s.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(ot.cursor.move(0,n)),this.output.write(ot.erase.down());let s=e.split(`
38
38
  `).slice(n);this.output.write(s.join(`
39
- `)),this._prevFrame=e;return}this.output.write(tt.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},Fu=class extends Gt{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(tt.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},P$=Object.defineProperty,O$=(t,e,r)=>e in t?P$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qm=(t,e,r)=>(O$(t,typeof e!="symbol"?e+"":e,r),r),N$=class extends Gt{constructor(t){super(t,!1),qm(this,"options"),qm(this,"cursor",0);let{options:e}=t;this.options=Object.entries(e).flatMap(([r,n])=>[{value:r,group:!0,label:r},...n.map(s=>({...s,group:r}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:r})=>r===t.cursorAt),0),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}getGroupItems(t){return this.options.filter(e=>e.group===t)}isGroupSelected(t){return this.getGroupItems(t).every(e=>this.value.includes(e.value))}toggleValue(){let t=this.options[this.cursor];if(t.group===!0){let e=t.value,r=this.getGroupItems(e);this.isGroupSelected(e)?this.value=this.value.filter(n=>r.findIndex(s=>s.value===n)===-1):this.value=[...this.value,...r.map(n=>n.value)],this.value=Array.from(new Set(this.value))}else{let e=this.value.includes(t.value);this.value=e?this.value.filter(r=>r!==t.value):[...this.value,t.value]}}},L$=Object.defineProperty,B$=(t,e,r)=>e in t?L$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wm=(t,e,r)=>(B$(t,typeof e!="symbol"?e+"":e,r),r),M$=class extends Gt{constructor(t){super(t,!1),Wm(this,"options"),Wm(this,"cursor",0),this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===t.cursorAt),0),this.on("key",e=>{e==="a"&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let t=this.value.length===this.options.length;this.value=t?[]:this.options.map(e=>e.value)}toggleValue(){let t=this.value.includes(this._value);this.value=t?this.value.filter(e=>e!==this._value):[...this.value,this._value]}},q$=Object.defineProperty,W$=(t,e,r)=>e in t?q$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Hm=(t,e,r)=>(W$(t,typeof e!="symbol"?e+"":e,r),r),ju=class extends Gt{constructor({mask:e,...r}){super(r),Hm(this,"valueWithCursor",""),Hm(this,"_mask","\u2022"),this._mask=e??"\u2022",this.on("finalize",()=>{this.valueWithCursor=this.masked}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${ko.inverse(ko.hidden("_"))}`;else{let n=this.masked.slice(0,this.cursor),s=this.masked.slice(this.cursor);this.valueWithCursor=`${n}${ko.inverse(s[0])}${s.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}},H$=Object.defineProperty,Z$=(t,e,r)=>e in t?H$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zm=(t,e,r)=>(Z$(t,typeof e!="symbol"?e+"":e,r),r),Iu=class extends Gt{constructor(e){super(e,!1),Zm(this,"options"),Zm(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:r})=>r===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},U$=Object.defineProperty,V$=(t,e,r)=>e in t?U$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Um=(t,e,r)=>(V$(t,typeof e!="symbol"?e+"":e,r),r),Tu=class extends Gt{constructor(e){super(e,!1),Um(this,"options"),Um(this,"cursor",0),this.options=e.options;let r=this.options.map(({value:[n]})=>n?.toLowerCase());this.cursor=Math.max(r.indexOf(e.initialValue),0),this.on("key",n=>{if(!r.includes(n))return;let s=this.options.find(({value:[i]})=>i?.toLowerCase()===n);s&&(this.value=s.value,this.state="submit",this.emit("submit"))})}},Ru=class extends Gt{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[r,...n]=this.value.slice(this.cursor);return`${e}${ko.inverse(r)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};yt.ConfirmPrompt=Fu,yt.GroupMultiSelectPrompt=N$,yt.MultiSelectPrompt=M$,yt.PasswordPrompt=ju,yt.Prompt=Gt,yt.SelectKeyPrompt=Tu,yt.SelectPrompt=Iu,yt.TextPrompt=Ru,yt.block=I$,yt.isCancel=j$,yt.updateSettings=k$});var Zu=v(Te=>{"use strict";var Lu=require("node:util"),At=Qm(),G$=require("node:process"),z$=Pn(),eg=xu();function rg(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var kt=rg(G$),_=rg(z$);function Y$(){return kt.platform!=="win32"?kt.env.TERM!=="linux":!!kt.env.CI||!!kt.env.WT_SESSION||!!kt.env.TERMINUS_SUBLIME||kt.env.ConEmuTask==="{cmd::Cmder}"||kt.env.TERM_PROGRAM==="Terminus-Sublime"||kt.env.TERM_PROGRAM==="vscode"||kt.env.TERM==="xterm-256color"||kt.env.TERM==="alacritty"||kt.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Bu=Y$(),Ae=(t,e)=>Bu?t:e,X$=Ae("\u25C6","*"),ng=Ae("\u25A0","x"),sg=Ae("\u25B2","x"),jo=Ae("\u25C7","o"),J$=Ae("\u250C","T"),te=Ae("\u2502","|"),rt=Ae("\u2514","\u2014"),Mu=Ae("\u25CF",">"),qu=Ae("\u25CB"," "),Wu=Ae("\u25FB","[\u2022]"),ns=Ae("\u25FC","[+]"),og=Ae("\u25FB","[ ]"),K$=Ae("\u25AA","\u2022"),tg=Ae("\u2500","-"),Q$=Ae("\u256E","+"),ek=Ae("\u251C","+"),tk=Ae("\u256F","+"),rk=Ae("\u25CF","\u2022"),nk=Ae("\u25C6","*"),sk=Ae("\u25B2","!"),ok=Ae("\u25A0","x"),nn=t=>{switch(t){case"initial":case"active":return _.cyan(X$);case"cancel":return _.red(ng);case"error":return _.yellow(sg);case"submit":return _.green(jo)}},Hu=t=>{let{cursor:e,options:r,style:n}=t,s=t.maxItems??Number.POSITIVE_INFINITY,i=Math.max(process.stdout.rows-4,0),o=Math.min(i,Math.max(s,5)),a=0;e>=a+o-3?a=Math.max(Math.min(e-o+3,r.length-o),0):e<a+2&&(a=Math.max(e-2,0));let u=o<r.length&&a>0,c=o<r.length&&a+o<r.length;return r.slice(a,a+o).map((l,d,f)=>{let g=d===0&&u,m=d===f.length-1&&c;return g||m?_.dim("..."):n(l,d+a===e)})},ik=t=>new At.TextPrompt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${_.gray(te)}
40
- ${nn(this.state)} ${t.message}
39
+ `)),this._prevFrame=e;return}this.output.write(ot.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},Ic=class extends Yt{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(ot.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},Lk=Object.defineProperty,Bk=(t,e,r)=>e in t?Lk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Hm=(t,e,r)=>(Bk(t,typeof e!="symbol"?e+"":e,r),r),Mk=class extends Yt{constructor(t){super(t,!1),Hm(this,"options"),Hm(this,"cursor",0);let{options:e}=t;this.options=Object.entries(e).flatMap(([r,n])=>[{value:r,group:!0,label:r},...n.map(s=>({...s,group:r}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:r})=>r===t.cursorAt),0),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}getGroupItems(t){return this.options.filter(e=>e.group===t)}isGroupSelected(t){return this.getGroupItems(t).every(e=>this.value.includes(e.value))}toggleValue(){let t=this.options[this.cursor];if(t.group===!0){let e=t.value,r=this.getGroupItems(e);this.isGroupSelected(e)?this.value=this.value.filter(n=>r.findIndex(s=>s.value===n)===-1):this.value=[...this.value,...r.map(n=>n.value)],this.value=Array.from(new Set(this.value))}else{let e=this.value.includes(t.value);this.value=e?this.value.filter(r=>r!==t.value):[...this.value,t.value]}}},qk=Object.defineProperty,Wk=(t,e,r)=>e in t?qk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zm=(t,e,r)=>(Wk(t,typeof e!="symbol"?e+"":e,r),r),Hk=class extends Yt{constructor(t){super(t,!1),Zm(this,"options"),Zm(this,"cursor",0),this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===t.cursorAt),0),this.on("key",e=>{e==="a"&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let t=this.value.length===this.options.length;this.value=t?[]:this.options.map(e=>e.value)}toggleValue(){let t=this.value.includes(this._value);this.value=t?this.value.filter(e=>e!==this._value):[...this.value,this._value]}},Zk=Object.defineProperty,Uk=(t,e,r)=>e in t?Zk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Um=(t,e,r)=>(Uk(t,typeof e!="symbol"?e+"":e,r),r),Tc=class extends Yt{constructor({mask:e,...r}){super(r),Um(this,"valueWithCursor",""),Um(this,"_mask","\u2022"),this._mask=e??"\u2022",this.on("finalize",()=>{this.valueWithCursor=this.masked}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${Fo.inverse(Fo.hidden("_"))}`;else{let n=this.masked.slice(0,this.cursor),s=this.masked.slice(this.cursor);this.valueWithCursor=`${n}${Fo.inverse(s[0])}${s.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}},Vk=Object.defineProperty,Gk=(t,e,r)=>e in t?Vk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vm=(t,e,r)=>(Gk(t,typeof e!="symbol"?e+"":e,r),r),Rc=class extends Yt{constructor(e){super(e,!1),Vm(this,"options"),Vm(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:r})=>r===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},zk=Object.defineProperty,Yk=(t,e,r)=>e in t?zk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Gm=(t,e,r)=>(Yk(t,typeof e!="symbol"?e+"":e,r),r),Pc=class extends Yt{constructor(e){super(e,!1),Gm(this,"options"),Gm(this,"cursor",0),this.options=e.options;let r=this.options.map(({value:[n]})=>n?.toLowerCase());this.cursor=Math.max(r.indexOf(e.initialValue),0),this.on("key",n=>{if(!r.includes(n))return;let s=this.options.find(({value:[i]})=>i?.toLowerCase()===n);s&&(this.value=s.value,this.state="submit",this.emit("submit"))})}},Oc=class extends Yt{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[r,...n]=this.value.slice(this.cursor);return`${e}${Fo.inverse(r)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};bt.ConfirmPrompt=Ic,bt.GroupMultiSelectPrompt=Mk,bt.MultiSelectPrompt=Hk,bt.PasswordPrompt=Tc,bt.Prompt=Yt,bt.SelectKeyPrompt=Pc,bt.SelectPrompt=Rc,bt.TextPrompt=Oc,bt.block=Pk,bt.isCancel=Rk,bt.updateSettings=jk});var Vc=v(Re=>{"use strict";var Mc=require("node:util"),It=tg(),Jk=require("node:process"),Xk=Nn(),rg=$c();function sg(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var jt=sg(Jk),_=sg(Xk);function Kk(){return jt.platform!=="win32"?jt.env.TERM!=="linux":!!jt.env.CI||!!jt.env.WT_SESSION||!!jt.env.TERMINUS_SUBLIME||jt.env.ConEmuTask==="{cmd::Cmder}"||jt.env.TERM_PROGRAM==="Terminus-Sublime"||jt.env.TERM_PROGRAM==="vscode"||jt.env.TERM==="xterm-256color"||jt.env.TERM==="alacritty"||jt.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var qc=Kk(),je=(t,e)=>qc?t:e,Qk=je("\u25C6","*"),og=je("\u25A0","x"),ig=je("\u25B2","x"),To=je("\u25C7","o"),e$=je("\u250C","T"),ee=je("\u2502","|"),it=je("\u2514","\u2014"),Wc=je("\u25CF",">"),Hc=je("\u25CB"," "),Zc=je("\u25FB","[\u2022]"),os=je("\u25FC","[+]"),ag=je("\u25FB","[ ]"),t$=je("\u25AA","\u2022"),ng=je("\u2500","-"),r$=je("\u256E","+"),n$=je("\u251C","+"),s$=je("\u256F","+"),o$=je("\u25CF","\u2022"),i$=je("\u25C6","*"),a$=je("\u25B2","!"),c$=je("\u25A0","x"),on=t=>{switch(t){case"initial":case"active":return _.cyan(Qk);case"cancel":return _.red(og);case"error":return _.yellow(ig);case"submit":return _.green(To)}},Uc=t=>{let{cursor:e,options:r,style:n}=t,s=t.maxItems??Number.POSITIVE_INFINITY,i=Math.max(process.stdout.rows-4,0),o=Math.min(i,Math.max(s,5)),a=0;e>=a+o-3?a=Math.max(Math.min(e-o+3,r.length-o),0):e<a+2&&(a=Math.max(e-2,0));let c=o<r.length&&a>0,u=o<r.length&&a+o<r.length;return r.slice(a,a+o).map((l,d,f)=>{let g=d===0&&c,m=d===f.length-1&&u;return g||m?_.dim("..."):n(l,d+a===e)})},u$=t=>new It.TextPrompt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${_.gray(ee)}
40
+ ${on(this.state)} ${t.message}
41
41
  `,r=t.placeholder?_.inverse(t.placeholder[0])+_.dim(t.placeholder.slice(1)):_.inverse(_.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
42
- ${_.yellow(te)} ${n}
43
- ${_.yellow(rt)} ${_.yellow(this.error)}
44
- `;case"submit":return`${e}${_.gray(te)} ${_.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${_.gray(te)} ${_.strikethrough(_.dim(this.value??""))}${this.value?.trim()?`
45
- ${_.gray(te)}`:""}`;default:return`${e}${_.cyan(te)} ${n}
46
- ${_.cyan(rt)}
47
- `}}}).prompt(),ak=t=>new At.PasswordPrompt({validate:t.validate,mask:t.mask??K$,render(){let e=`${_.gray(te)}
48
- ${nn(this.state)} ${t.message}
42
+ ${_.yellow(ee)} ${n}
43
+ ${_.yellow(it)} ${_.yellow(this.error)}
44
+ `;case"submit":return`${e}${_.gray(ee)} ${_.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${_.gray(ee)} ${_.strikethrough(_.dim(this.value??""))}${this.value?.trim()?`
45
+ ${_.gray(ee)}`:""}`;default:return`${e}${_.cyan(ee)} ${n}
46
+ ${_.cyan(it)}
47
+ `}}}).prompt(),l$=t=>new It.PasswordPrompt({validate:t.validate,mask:t.mask??t$,render(){let e=`${_.gray(ee)}
48
+ ${on(this.state)} ${t.message}
49
49
  `,r=this.valueWithCursor,n=this.masked;switch(this.state){case"error":return`${e.trim()}
50
- ${_.yellow(te)} ${n}
51
- ${_.yellow(rt)} ${_.yellow(this.error)}
52
- `;case"submit":return`${e}${_.gray(te)} ${_.dim(n)}`;case"cancel":return`${e}${_.gray(te)} ${_.strikethrough(_.dim(n??""))}${n?`
53
- ${_.gray(te)}`:""}`;default:return`${e}${_.cyan(te)} ${r}
54
- ${_.cyan(rt)}
55
- `}}}).prompt(),uk=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new At.ConfirmPrompt({active:e,inactive:r,initialValue:t.initialValue??!0,render(){let n=`${_.gray(te)}
56
- ${nn(this.state)} ${t.message}
57
- `,s=this.value?e:r;switch(this.state){case"submit":return`${n}${_.gray(te)} ${_.dim(s)}`;case"cancel":return`${n}${_.gray(te)} ${_.strikethrough(_.dim(s))}
58
- ${_.gray(te)}`;default:return`${n}${_.cyan(te)} ${this.value?`${_.green(Mu)} ${e}`:`${_.dim(qu)} ${_.dim(e)}`} ${_.dim("/")} ${this.value?`${_.dim(qu)} ${_.dim(r)}`:`${_.green(Mu)} ${r}`}
59
- ${_.cyan(rt)}
60
- `}}}).prompt()},ck=t=>{let e=(r,n)=>{let s=r.label??String(r.value);switch(n){case"selected":return`${_.dim(s)}`;case"active":return`${_.green(Mu)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`;case"cancelled":return`${_.strikethrough(_.dim(s))}`;default:return`${_.dim(qu)} ${_.dim(s)}`}};return new At.SelectPrompt({options:t.options,initialValue:t.initialValue,render(){let r=`${_.gray(te)}
61
- ${nn(this.state)} ${t.message}
62
- `;switch(this.state){case"submit":return`${r}${_.gray(te)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${_.gray(te)} ${e(this.options[this.cursor],"cancelled")}
63
- ${_.gray(te)}`;default:return`${r}${_.cyan(te)} ${Hu({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(n,s)=>e(n,s?"active":"inactive")}).join(`
64
- ${_.cyan(te)} `)}
65
- ${_.cyan(rt)}
66
- `}}}).prompt()},lk=t=>{let e=(r,n="inactive")=>{let s=r.label??String(r.value);return n==="selected"?`${_.dim(s)}`:n==="cancelled"?`${_.strikethrough(_.dim(s))}`:n==="active"?`${_.bgCyan(_.gray(` ${r.value} `))} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:`${_.gray(_.bgWhite(_.inverse(` ${r.value} `)))} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`};return new At.SelectKeyPrompt({options:t.options,initialValue:t.initialValue,render(){let r=`${_.gray(te)}
67
- ${nn(this.state)} ${t.message}
68
- `;switch(this.state){case"submit":return`${r}${_.gray(te)} ${e(this.options.find(n=>n.value===this.value)??t.options[0],"selected")}`;case"cancel":return`${r}${_.gray(te)} ${e(this.options[0],"cancelled")}
69
- ${_.gray(te)}`;default:return`${r}${_.cyan(te)} ${this.options.map((n,s)=>e(n,s===this.cursor?"active":"inactive")).join(`
70
- ${_.cyan(te)} `)}
71
- ${_.cyan(rt)}
72
- `}}}).prompt()},dk=t=>{let e=(r,n)=>{let s=r.label??String(r.value);return n==="active"?`${_.cyan(Wu)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="selected"?`${_.green(ns)} ${_.dim(s)}`:n==="cancelled"?`${_.strikethrough(_.dim(s))}`:n==="active-selected"?`${_.green(ns)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="submitted"?`${_.dim(s)}`:`${_.dim(og)} ${_.dim(s)}`};return new At.MultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
73
- ${_.reset(_.dim(`Press ${_.gray(_.bgWhite(_.inverse(" space ")))} to select, ${_.gray(_.bgWhite(_.inverse(" enter ")))} to submit`))}`},render(){let r=`${_.gray(te)}
74
- ${nn(this.state)} ${t.message}
75
- `,n=(s,i)=>{let o=this.value.includes(s.value);return i&&o?e(s,"active-selected"):o?e(s,"selected"):e(s,i?"active":"inactive")};switch(this.state){case"submit":return`${r}${_.gray(te)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>e(s,"submitted")).join(_.dim(", "))||_.dim("none")}`;case"cancel":{let s=this.options.filter(({value:i})=>this.value.includes(i)).map(i=>e(i,"cancelled")).join(_.dim(", "));return`${r}${_.gray(te)} ${s.trim()?`${s}
76
- ${_.gray(te)}`:""}`}case"error":{let s=this.error.split(`
77
- `).map((i,o)=>o===0?`${_.yellow(rt)} ${_.yellow(i)}`:` ${i}`).join(`
78
- `);return`${r+_.yellow(te)} ${Hu({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
79
- ${_.yellow(te)} `)}
50
+ ${_.yellow(ee)} ${n}
51
+ ${_.yellow(it)} ${_.yellow(this.error)}
52
+ `;case"submit":return`${e}${_.gray(ee)} ${_.dim(n)}`;case"cancel":return`${e}${_.gray(ee)} ${_.strikethrough(_.dim(n??""))}${n?`
53
+ ${_.gray(ee)}`:""}`;default:return`${e}${_.cyan(ee)} ${r}
54
+ ${_.cyan(it)}
55
+ `}}}).prompt(),d$=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new It.ConfirmPrompt({active:e,inactive:r,initialValue:t.initialValue??!0,render(){let n=`${_.gray(ee)}
56
+ ${on(this.state)} ${t.message}
57
+ `,s=this.value?e:r;switch(this.state){case"submit":return`${n}${_.gray(ee)} ${_.dim(s)}`;case"cancel":return`${n}${_.gray(ee)} ${_.strikethrough(_.dim(s))}
58
+ ${_.gray(ee)}`;default:return`${n}${_.cyan(ee)} ${this.value?`${_.green(Wc)} ${e}`:`${_.dim(Hc)} ${_.dim(e)}`} ${_.dim("/")} ${this.value?`${_.dim(Hc)} ${_.dim(r)}`:`${_.green(Wc)} ${r}`}
59
+ ${_.cyan(it)}
60
+ `}}}).prompt()},f$=t=>{let e=(r,n)=>{let s=r.label??String(r.value);switch(n){case"selected":return`${_.dim(s)}`;case"active":return`${_.green(Wc)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`;case"cancelled":return`${_.strikethrough(_.dim(s))}`;default:return`${_.dim(Hc)} ${_.dim(s)}`}};return new It.SelectPrompt({options:t.options,initialValue:t.initialValue,render(){let r=`${_.gray(ee)}
61
+ ${on(this.state)} ${t.message}
62
+ `;switch(this.state){case"submit":return`${r}${_.gray(ee)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${_.gray(ee)} ${e(this.options[this.cursor],"cancelled")}
63
+ ${_.gray(ee)}`;default:return`${r}${_.cyan(ee)} ${Uc({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(n,s)=>e(n,s?"active":"inactive")}).join(`
64
+ ${_.cyan(ee)} `)}
65
+ ${_.cyan(it)}
66
+ `}}}).prompt()},h$=t=>{let e=(r,n="inactive")=>{let s=r.label??String(r.value);return n==="selected"?`${_.dim(s)}`:n==="cancelled"?`${_.strikethrough(_.dim(s))}`:n==="active"?`${_.bgCyan(_.gray(` ${r.value} `))} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:`${_.gray(_.bgWhite(_.inverse(` ${r.value} `)))} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`};return new It.SelectKeyPrompt({options:t.options,initialValue:t.initialValue,render(){let r=`${_.gray(ee)}
67
+ ${on(this.state)} ${t.message}
68
+ `;switch(this.state){case"submit":return`${r}${_.gray(ee)} ${e(this.options.find(n=>n.value===this.value)??t.options[0],"selected")}`;case"cancel":return`${r}${_.gray(ee)} ${e(this.options[0],"cancelled")}
69
+ ${_.gray(ee)}`;default:return`${r}${_.cyan(ee)} ${this.options.map((n,s)=>e(n,s===this.cursor?"active":"inactive")).join(`
70
+ ${_.cyan(ee)} `)}
71
+ ${_.cyan(it)}
72
+ `}}}).prompt()},p$=t=>{let e=(r,n)=>{let s=r.label??String(r.value);return n==="active"?`${_.cyan(Zc)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="selected"?`${_.green(os)} ${_.dim(s)}`:n==="cancelled"?`${_.strikethrough(_.dim(s))}`:n==="active-selected"?`${_.green(os)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="submitted"?`${_.dim(s)}`:`${_.dim(ag)} ${_.dim(s)}`};return new It.MultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
73
+ ${_.reset(_.dim(`Press ${_.gray(_.bgWhite(_.inverse(" space ")))} to select, ${_.gray(_.bgWhite(_.inverse(" enter ")))} to submit`))}`},render(){let r=`${_.gray(ee)}
74
+ ${on(this.state)} ${t.message}
75
+ `,n=(s,i)=>{let o=this.value.includes(s.value);return i&&o?e(s,"active-selected"):o?e(s,"selected"):e(s,i?"active":"inactive")};switch(this.state){case"submit":return`${r}${_.gray(ee)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>e(s,"submitted")).join(_.dim(", "))||_.dim("none")}`;case"cancel":{let s=this.options.filter(({value:i})=>this.value.includes(i)).map(i=>e(i,"cancelled")).join(_.dim(", "));return`${r}${_.gray(ee)} ${s.trim()?`${s}
76
+ ${_.gray(ee)}`:""}`}case"error":{let s=this.error.split(`
77
+ `).map((i,o)=>o===0?`${_.yellow(it)} ${_.yellow(i)}`:` ${i}`).join(`
78
+ `);return`${r+_.yellow(ee)} ${Uc({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
79
+ ${_.yellow(ee)} `)}
80
80
  ${s}
81
- `}default:return`${r}${_.cyan(te)} ${Hu({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
82
- ${_.cyan(te)} `)}
83
- ${_.cyan(rt)}
84
- `}}}).prompt()},fk=t=>{let e=(r,n,s=[])=>{let i=r.label??String(r.value),o=typeof r.group=="string",a=o&&(s[s.indexOf(r)+1]??{group:!0}),u=o&&a.group===!0,c=o?`${u?rt:te} `:"";return n==="active"?`${_.dim(c)}${_.cyan(Wu)} ${i} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="group-active"?`${c}${_.cyan(Wu)} ${_.dim(i)}`:n==="group-active-selected"?`${c}${_.green(ns)} ${_.dim(i)}`:n==="selected"?`${_.dim(c)}${_.green(ns)} ${_.dim(i)}`:n==="cancelled"?`${_.strikethrough(_.dim(i))}`:n==="active-selected"?`${_.dim(c)}${_.green(ns)} ${i} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="submitted"?`${_.dim(i)}`:`${_.dim(c)}${_.dim(og)} ${_.dim(i)}`};return new At.GroupMultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
85
- ${_.reset(_.dim(`Press ${_.gray(_.bgWhite(_.inverse(" space ")))} to select, ${_.gray(_.bgWhite(_.inverse(" enter ")))} to submit`))}`},render(){let r=`${_.gray(te)}
86
- ${nn(this.state)} ${t.message}
87
- `;switch(this.state){case"submit":return`${r}${_.gray(te)} ${this.options.filter(({value:n})=>this.value.includes(n)).map(n=>e(n,"submitted")).join(_.dim(", "))}`;case"cancel":{let n=this.options.filter(({value:s})=>this.value.includes(s)).map(s=>e(s,"cancelled")).join(_.dim(", "));return`${r}${_.gray(te)} ${n.trim()?`${n}
88
- ${_.gray(te)}`:""}`}case"error":{let n=this.error.split(`
89
- `).map((s,i)=>i===0?`${_.yellow(rt)} ${_.yellow(s)}`:` ${s}`).join(`
90
- `);return`${r}${_.yellow(te)} ${this.options.map((s,i,o)=>{let a=this.value.includes(s.value)||s.group===!0&&this.isGroupSelected(`${s.value}`),u=i===this.cursor;return!u&&typeof s.group=="string"&&this.options[this.cursor].value===s.group?e(s,a?"group-active-selected":"group-active",o):u&&a?e(s,"active-selected",o):a?e(s,"selected",o):e(s,u?"active":"inactive",o)}).join(`
91
- ${_.yellow(te)} `)}
81
+ `}default:return`${r}${_.cyan(ee)} ${Uc({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
82
+ ${_.cyan(ee)} `)}
83
+ ${_.cyan(it)}
84
+ `}}}).prompt()},m$=t=>{let e=(r,n,s=[])=>{let i=r.label??String(r.value),o=typeof r.group=="string",a=o&&(s[s.indexOf(r)+1]??{group:!0}),c=o&&a.group===!0,u=o?`${c?it:ee} `:"";return n==="active"?`${_.dim(u)}${_.cyan(Zc)} ${i} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="group-active"?`${u}${_.cyan(Zc)} ${_.dim(i)}`:n==="group-active-selected"?`${u}${_.green(os)} ${_.dim(i)}`:n==="selected"?`${_.dim(u)}${_.green(os)} ${_.dim(i)}`:n==="cancelled"?`${_.strikethrough(_.dim(i))}`:n==="active-selected"?`${_.dim(u)}${_.green(os)} ${i} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="submitted"?`${_.dim(i)}`:`${_.dim(u)}${_.dim(ag)} ${_.dim(i)}`};return new It.GroupMultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
85
+ ${_.reset(_.dim(`Press ${_.gray(_.bgWhite(_.inverse(" space ")))} to select, ${_.gray(_.bgWhite(_.inverse(" enter ")))} to submit`))}`},render(){let r=`${_.gray(ee)}
86
+ ${on(this.state)} ${t.message}
87
+ `;switch(this.state){case"submit":return`${r}${_.gray(ee)} ${this.options.filter(({value:n})=>this.value.includes(n)).map(n=>e(n,"submitted")).join(_.dim(", "))}`;case"cancel":{let n=this.options.filter(({value:s})=>this.value.includes(s)).map(s=>e(s,"cancelled")).join(_.dim(", "));return`${r}${_.gray(ee)} ${n.trim()?`${n}
88
+ ${_.gray(ee)}`:""}`}case"error":{let n=this.error.split(`
89
+ `).map((s,i)=>i===0?`${_.yellow(it)} ${_.yellow(s)}`:` ${s}`).join(`
90
+ `);return`${r}${_.yellow(ee)} ${this.options.map((s,i,o)=>{let a=this.value.includes(s.value)||s.group===!0&&this.isGroupSelected(`${s.value}`),c=i===this.cursor;return!c&&typeof s.group=="string"&&this.options[this.cursor].value===s.group?e(s,a?"group-active-selected":"group-active",o):c&&a?e(s,"active-selected",o):a?e(s,"selected",o):e(s,c?"active":"inactive",o)}).join(`
91
+ ${_.yellow(ee)} `)}
92
92
  ${n}
93
- `}default:return`${r}${_.cyan(te)} ${this.options.map((n,s,i)=>{let o=this.value.includes(n.value)||n.group===!0&&this.isGroupSelected(`${n.value}`),a=s===this.cursor;return!a&&typeof n.group=="string"&&this.options[this.cursor].value===n.group?e(n,o?"group-active-selected":"group-active",i):a&&o?e(n,"active-selected",i):o?e(n,"selected",i):e(n,a?"active":"inactive",i)}).join(`
94
- ${_.cyan(te)} `)}
95
- ${_.cyan(rt)}
96
- `}}}).prompt()},hk=(t="",e="")=>{let r=`
93
+ `}default:return`${r}${_.cyan(ee)} ${this.options.map((n,s,i)=>{let o=this.value.includes(n.value)||n.group===!0&&this.isGroupSelected(`${n.value}`),a=s===this.cursor;return!a&&typeof n.group=="string"&&this.options[this.cursor].value===n.group?e(n,o?"group-active-selected":"group-active",i):a&&o?e(n,"active-selected",i):o?e(n,"selected",i):e(n,a?"active":"inactive",i)}).join(`
94
+ ${_.cyan(ee)} `)}
95
+ ${_.cyan(it)}
96
+ `}}}).prompt()},g$=(t="",e="")=>{let r=`
97
97
  ${t}
98
98
  `.split(`
99
- `),n=Lu.stripVTControlCharacters(e).length,s=Math.max(r.reduce((o,a)=>{let u=Lu.stripVTControlCharacters(a);return u.length>o?u.length:o},0),n)+2,i=r.map(o=>`${_.gray(te)} ${_.dim(o)}${" ".repeat(s-Lu.stripVTControlCharacters(o).length)}${_.gray(te)}`).join(`
100
- `);process.stdout.write(`${_.gray(te)}
101
- ${_.green(jo)} ${_.reset(e)} ${_.gray(tg.repeat(Math.max(s-n-1,1))+Q$)}
99
+ `),n=Mc.stripVTControlCharacters(e).length,s=Math.max(r.reduce((o,a)=>{let c=Mc.stripVTControlCharacters(a);return c.length>o?c.length:o},0),n)+2,i=r.map(o=>`${_.gray(ee)} ${_.dim(o)}${" ".repeat(s-Mc.stripVTControlCharacters(o).length)}${_.gray(ee)}`).join(`
100
+ `);process.stdout.write(`${_.gray(ee)}
101
+ ${_.green(To)} ${_.reset(e)} ${_.gray(ng.repeat(Math.max(s-n-1,1))+r$)}
102
102
  ${i}
103
- ${_.gray(ek+tg.repeat(s+2)+tk)}
104
- `)},pk=(t="")=>{process.stdout.write(`${_.gray(rt)} ${_.red(t)}
103
+ ${_.gray(n$+ng.repeat(s+2)+s$)}
104
+ `)},D$=(t="")=>{process.stdout.write(`${_.gray(it)} ${_.red(t)}
105
105
 
106
- `)},mk=(t="")=>{process.stdout.write(`${_.gray(J$)} ${t}
107
- `)},gk=(t="")=>{process.stdout.write(`${_.gray(te)}
108
- ${_.gray(rt)} ${t}
106
+ `)},y$=(t="")=>{process.stdout.write(`${_.gray(e$)} ${t}
107
+ `)},v$=(t="")=>{process.stdout.write(`${_.gray(ee)}
108
+ ${_.gray(it)} ${t}
109
109
 
110
- `)},rn={message:(t="",{symbol:e=_.gray(te)}={})=>{let r=[`${_.gray(te)}`];if(t){let[n,...s]=t.split(`
111
- `);r.push(`${e} ${n}`,...s.map(i=>`${_.gray(te)} ${i}`))}process.stdout.write(`${r.join(`
110
+ `)},sn={message:(t="",{symbol:e=_.gray(ee)}={})=>{let r=[`${_.gray(ee)}`];if(t){let[n,...s]=t.split(`
111
+ `);r.push(`${e} ${n}`,...s.map(i=>`${_.gray(ee)} ${i}`))}process.stdout.write(`${r.join(`
112
112
  `)}
113
- `)},info:t=>{rn.message(t,{symbol:_.blue(rk)})},success:t=>{rn.message(t,{symbol:_.green(nk)})},step:t=>{rn.message(t,{symbol:_.green(jo)})},warn:t=>{rn.message(t,{symbol:_.yellow(sk)})},warning:t=>{rn.warn(t)},error:t=>{rn.message(t,{symbol:_.red(ok)})}},ig=()=>{let t=Bu?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=Bu?80:120,r=process.env.CI==="true",n,s,i=!1,o="",a,u=w=>{let C=w>1?"Something went wrong":"Canceled";i&&h(C,w)},c=()=>u(2),l=()=>u(1),d=()=>{process.on("uncaughtExceptionMonitor",c),process.on("unhandledRejection",c),process.on("SIGINT",l),process.on("SIGTERM",l),process.on("exit",u)},f=()=>{process.removeListener("uncaughtExceptionMonitor",c),process.removeListener("unhandledRejection",c),process.removeListener("SIGINT",l),process.removeListener("SIGTERM",l),process.removeListener("exit",u)},g=()=>{if(a===void 0)return;r&&process.stdout.write(`
113
+ `)},info:t=>{sn.message(t,{symbol:_.blue(o$)})},success:t=>{sn.message(t,{symbol:_.green(i$)})},step:t=>{sn.message(t,{symbol:_.green(To)})},warn:t=>{sn.message(t,{symbol:_.yellow(a$)})},warning:t=>{sn.warn(t)},error:t=>{sn.message(t,{symbol:_.red(c$)})}},cg=()=>{let t=qc?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=qc?80:120,r=process.env.CI==="true",n,s,i=!1,o="",a,c=w=>{let C=w>1?"Something went wrong":"Canceled";i&&h(C,w)},u=()=>c(2),l=()=>c(1),d=()=>{process.on("uncaughtExceptionMonitor",u),process.on("unhandledRejection",u),process.on("SIGINT",l),process.on("SIGTERM",l),process.on("exit",c)},f=()=>{process.removeListener("uncaughtExceptionMonitor",u),process.removeListener("unhandledRejection",u),process.removeListener("SIGINT",l),process.removeListener("SIGTERM",l),process.removeListener("exit",c)},g=()=>{if(a===void 0)return;r&&process.stdout.write(`
114
114
  `);let w=a.split(`
115
- `);process.stdout.write(eg.cursor.move(-999,w.length-1)),process.stdout.write(eg.erase.down(w.length))},m=w=>w.replace(/\.+$/,""),D=(w="")=>{i=!0,n=At.block(),o=m(w),process.stdout.write(`${_.gray(te)}
116
- `);let C=0,A=0;d(),s=setInterval(()=>{if(r&&o===a)return;g(),a=o;let T=_.magenta(t[C]),G=r?"...":".".repeat(Math.floor(A)).slice(0,3);process.stdout.write(`${T} ${o}${G}`),C=C+1<t.length?C+1:0,A=A<t.length?A+.125:0},e)},h=(w="",C=0)=>{i=!1,clearInterval(s),g();let A=C===0?_.green(jo):C===1?_.red(ng):_.red(sg);o=m(w??o),process.stdout.write(`${A} ${o}
117
- `),f(),n()};return{start:D,stop:h,message:(w="")=>{o=m(w??o)}}},Dk=async(t,e)=>{let r={},n=Object.keys(t);for(let s of n){let i=t[s],o=await i({results:r})?.catch(a=>{throw a});if(typeof e?.onCancel=="function"&&At.isCancel(o)){r[s]="canceled",e.onCancel({results:r});continue}r[s]=o}return r},yk=async t=>{for(let e of t){if(e.enabled===!1)continue;let r=ig();r.start(e.title);let n=await e.task(r.message);r.stop(n||e.title)}};Te.isCancel=At.isCancel,Te.updateSettings=At.updateSettings,Te.cancel=pk,Te.confirm=uk,Te.group=Dk,Te.groupMultiselect=fk,Te.intro=mk,Te.log=rn,Te.multiselect=dk,Te.note=hk,Te.outro=gk,Te.password=ak,Te.select=ck,Te.selectKey=lk,Te.spinner=ig,Te.tasks=yk,Te.text=ik});var ss=v((OI,lg)=>{var qe=require("fs"),vt=require("path");function To(t){let e=vt.join(t,"rcode/skills"),r={agents:new Set,actions:new Set},n=vt.join(t,"rcode/agents");if(qe.existsSync(n))for(let o of qe.readdirSync(n,{withFileTypes:!0}))o.isFile()&&(!o.name.startsWith("rcode-")||!o.name.endsWith(".md")||r.agents.add(o.name.replace(/^rcode-/,"").replace(/\.md$/,"")));function s(o){try{let a=qe.readFileSync(vt.join(o,"SKILL.md"),"utf8");return/^internal:\s*true\s*$/m.test(a)}catch{return!1}}function i(o){if(qe.existsSync(o))for(let a of qe.readdirSync(o,{withFileTypes:!0})){if(!a.isDirectory())continue;let u=vt.join(o,a.name);if(qe.existsSync(vt.join(u,"SKILL.md"))){if(s(u))continue;let c=a.name.startsWith("rcode-")?a.name:`rcode-${a.name}`;r.actions.add(c)}else i(u)}}return i(vt.join(e,"actions")),r}function ag(t,e=null){if(!qe.existsSync(t))return new Set;let r=new Set;for(let n of qe.readdirSync(t,{withFileTypes:!0}))n.isDirectory()&&(e&&!n.name.startsWith(e)||r.add(e?n.name.slice(e.length):n.name));return r}function Io(t,e,r,n){let s=[...r].filter(o=>!n.has(o)).sort(),i=[...n].filter(o=>!r.has(o)).sort();return{editor:t,kind:e,expectedCount:r.size,installedCount:n.size,missing:s,extra:i}}function ug(t,e,r={}){let n=r.globalFallback!==!1,s=To(e),i=vt.join(t,".claude/agents"),o=vt.join(t,".claude/skills"),a=new Set;if(qe.existsSync(i))for(let l of qe.readdirSync(i))l.startsWith("rcode-")&&l.endsWith(".md")&&a.add(l.replace(/^rcode-/,"").replace(/\.md$/,""));if(a.size===0&&n)try{let l=require("os"),d=vt.join(l.homedir(),".claude/agents");if(qe.existsSync(d))for(let f of qe.readdirSync(d))f.startsWith("rcode-")&&f.endsWith(".md")&&a.add(f.replace(/^rcode-/,"").replace(/\.md$/,""))}catch{}let u=ag(o),c=new Set([...u].filter(l=>s.actions.has(l)));if(c.size===0&&n)try{let l=require("os"),d=vt.join(l.homedir(),".claude/skills"),f=ag(d);c=new Set([...f].filter(g=>s.actions.has(g)))}catch{}return[Io("claude","agents",s.agents,a),Io("claude","actions",s.actions,c)]}function Uu(t,e,r){let n=To(r),s=t==="cursor"?".cursor/rules":".windsurf/rules",i=vt.join(e,s,"rcode","agents"),o=new Set;if(qe.existsSync(i))for(let a of qe.readdirSync(i,{withFileTypes:!0}))a.isFile()&&(!a.name.startsWith("rcode-")||!a.name.endsWith(".mdc")||o.add(a.name.replace(/^rcode-/,"").replace(/\.mdc$/,"")));return[Io(t,"agents",n.agents,o)]}function cg(t,e){let r=To(e),n=vt.join(t,".antigravity/rcode/agents"),s=new Set;if(qe.existsSync(n))for(let i of qe.readdirSync(n,{withFileTypes:!0}))i.isFile()&&(!i.name.startsWith("rcode-")||!i.name.endsWith(".md")||s.add(i.name.replace(/^rcode-/,"").replace(/\.md$/,"")));return[Io("antigravity","agents",r.agents,s)]}function vk(t,e,r){let n=[];r.includes("claude")&&n.push(...ug(t,e)),r.includes("cursor")&&n.push(...Uu("cursor",t,e)),r.includes("windsurf")&&n.push(...Uu("windsurf",t,e)),r.includes("antigravity")&&n.push(...cg(t,e));let s=n.some(i=>i.missing.length>0||i.extra.length>0);return{reports:n,hasDrift:s}}function _k(t){let e=[];for(let r of t){let n=r.missing.length===0&&r.extra.length===0?"\u2713":"\u26A0";e.push(` ${n} ${r.editor.padEnd(12)} ${r.kind.padEnd(8)} ${r.installedCount}/${r.expectedCount}`),r.missing.length>0&&e.push(` missing: ${r.missing.join(", ")}`),r.extra.length>0&&e.push(` extra: ${r.extra.join(", ")}`)}return e.join(`
118
- `)}lg.exports={readPackageManifest:To,verifyInstall:vk,verifyClaudeInstall:ug,verifyRulesInstall:Uu,verifyAntigravityInstall:cg,formatReport:_k}});var is=v((NI,ct)=>{var y=require("fs"),p=require("path"),Ek=require("crypto"),bk=require("os"),{writeFileAtomic:It,safeRmSync:zu}=Jt(),{homedir:Ye}=lr(),X=Pn(),{createSpinner:Sk}=Hc(),Ck=Of(),{z:Ie}=Ga(),Fn=zp(),{createTwoFilesPatch:dg}=Im(),nt=Zu(),or=t=>X.green("\u2713")+" "+t,fg=t=>X.red("\u2717")+" "+t,_t=t=>X.yellow("\u26A0")+" "+t,Ro=t=>X.cyan("\u2192")+" "+t,Y=t=>X.dim(t),Ft=t=>X.bold(t),Et=p.resolve(__dirname,".."),$e=p.join(Et,"rcode"),os=Object.freeze(["claude","cursor","gemini","vscode","antigravity","windsurf","codex","grok"]);function wk(t){let e=t;for(;;){if(y.existsSync(p.join(e,"pnpm-workspace.yaml")))return e;let r=p.dirname(e);if(r===e)return null;e=r}}var xk=Ie.object({user_name:Ie.string().min(1),project_name:Ie.string().min(1),communication_language:Ie.string().default("English"),mode:Ie.enum(["guided","yolo"],{errorMap:()=>({message:'expected "guided" or "yolo"'})}).default("guided"),model_profile:Ie.string().optional(),commit_planning:Ie.boolean().optional(),rcode_source_path:Ie.string().optional(),workflow:Ie.object({research_by_default:Ie.boolean().optional(),plan_checker:Ie.boolean().optional(),post_execute_gates:Ie.boolean().optional(),ui_safety_gate:Ie.boolean().optional(),nyquist_validation:Ie.boolean().optional()}).optional(),output:Ie.object({verbose:Ie.boolean().optional()}).optional(),git:Ie.object({branching_strategy:Ie.string().optional()}).optional(),prompt_nudge:Ie.enum(["every","once-per-intent","when-stale","off"]).optional()}).passthrough();function Yu(t){let e={target:process.cwd(),targetProvided:!1,force:!1,reset:!1,yes:!1,userName:bk.userInfo().username||"User",projectName:null,language:"English",mode:"guided",ide:"claude",ideProvided:!1,help:!1,modules:[],commitPlanning:null,nonDestructive:!1,forceOverwrite:!1,showDiff:!1,diffStat:!1,acceptAll:!1,noUpdateCheck:!1,noBackup:!1,gitHooks:null,global:!1,silent:!1,noPrompt:!1,localOnly:!1,dryRun:!1,listFiles:!1},r=[];for(let n=0;n<t.length;n++){let s=t[n];s==="--help"||s==="-h"?e.help=!0:s==="--force"?e.force=!0:s==="--reset"?e.reset=!0:s==="--yes"||s==="-y"?e.yes=!0:s==="--user"?e.userName=t[++n]:s==="--project"?e.projectName=t[++n]:s==="--language"?e.language=t[++n]:s==="--mode"?e.mode=t[++n]:s==="--ide"?(e.ide=t[++n],e.ide==="claude-code"&&(e.ide="claude"),e.ideProvided=!0):s==="--module"?e.modules.push(t[++n]):s==="--commit-planning"?e.commitPlanning=!0:s==="--no-commit-planning"||s==="--ignore-planning"?e.commitPlanning=!1:s==="--non-destructive"?e.nonDestructive=!0:s==="--force-overwrite"?e.forceOverwrite=!0:s==="--show-diff"?e.showDiff=!0:s==="--diff-stat"?e.diffStat=!0:s==="--accept-all"?e.acceptAll=!0:s==="--no-update-check"?e.noUpdateCheck=!0:s==="--no-backup"?e.noBackup=!0:s==="--no-git-hooks"?e.gitHooks=!1:s==="--git-hooks"?e.gitHooks=!0:s==="--global"?e.global=!0:s==="--local-only"?e.localOnly=!0:s==="--silent"?e.silent=!0:s==="--no-prompt"?e.noPrompt=!0:s==="--dry-run"?e.dryRun=!0:s==="--list-files"?e.listFiles=!0:s.startsWith("--")||r.push(s)}if(r[0]&&(e.target=p.resolve(r[0]),e.targetProvided=!0),e.global&&!e.targetProvided&&(e.target=Ye()),!e.targetProvided&&!e.global){let n=process.cwd(),s=y.existsSync(p.join(n,"pnpm-workspace.yaml")),i=process.env.INIT_CWD;s&&i&&p.resolve(i)!==p.resolve(n)?e.target=p.resolve(i):wk(p.dirname(n))&&(e.target=n)}return e.projectName||(e.projectName=p.basename(e.target)),e}function $k(t,e){let{spawnSync:r}=require("child_process"),n=[];for(let c of e){let l=c.rel||c.dest;if(!l)continue;let d=p.join(t,l);y.existsSync(d)&&n.push(l)}for(let c of[".rcode/config.yaml",".rcode/state.json",".rcode/_config/manifest.yaml",".rcode/_config/files-manifest.csv"])y.existsSync(p.join(t,c))&&n.push(c);if(n.length===0)return{ok:!1,warning:"no existing files to back up \u2014 fresh install",fileCount:0};let s=p.join(t,".rcode/backups");try{y.mkdirSync(s,{recursive:!0})}catch(c){return{ok:!1,warning:`could not create .rcode/backups/: ${c.message}`,fileCount:0}}let i=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),o=p.join(s,`install-force-${i}.tgz`),a=p.relative(t,o),u=r("tar",["-czf",o,"-C",t,"--files-from=-"],{input:n.join(`
115
+ `);process.stdout.write(rg.cursor.move(-999,w.length-1)),process.stdout.write(rg.erase.down(w.length))},m=w=>w.replace(/\.+$/,""),y=(w="")=>{i=!0,n=It.block(),o=m(w),process.stdout.write(`${_.gray(ee)}
116
+ `);let C=0,A=0;d(),s=setInterval(()=>{if(r&&o===a)return;g(),a=o;let T=_.magenta(t[C]),G=r?"...":".".repeat(Math.floor(A)).slice(0,3);process.stdout.write(`${T} ${o}${G}`),C=C+1<t.length?C+1:0,A=A<t.length?A+.125:0},e)},h=(w="",C=0)=>{i=!1,clearInterval(s),g();let A=C===0?_.green(To):C===1?_.red(og):_.red(ig);o=m(w??o),process.stdout.write(`${A} ${o}
117
+ `),f(),n()};return{start:y,stop:h,message:(w="")=>{o=m(w??o)}}},_$=async(t,e)=>{let r={},n=Object.keys(t);for(let s of n){let i=t[s],o=await i({results:r})?.catch(a=>{throw a});if(typeof e?.onCancel=="function"&&It.isCancel(o)){r[s]="canceled",e.onCancel({results:r});continue}r[s]=o}return r},b$=async t=>{for(let e of t){if(e.enabled===!1)continue;let r=cg();r.start(e.title);let n=await e.task(r.message);r.stop(n||e.title)}};Re.isCancel=It.isCancel,Re.updateSettings=It.updateSettings,Re.cancel=D$,Re.confirm=d$,Re.group=_$,Re.groupMultiselect=m$,Re.intro=y$,Re.log=sn,Re.multiselect=p$,Re.note=g$,Re.outro=v$,Re.password=l$,Re.select=f$,Re.selectKey=h$,Re.spinner=cg,Re.tasks=b$,Re.text=u$});var is=v((WI,fg)=>{var Ue=require("fs"),St=require("path");function Po(t){let e=St.join(t,"rcode/skills"),r={agents:new Set,actions:new Set},n=St.join(t,"rcode/agents");if(Ue.existsSync(n))for(let o of Ue.readdirSync(n,{withFileTypes:!0}))o.isFile()&&(!o.name.startsWith("rcode-")||!o.name.endsWith(".md")||r.agents.add(o.name.replace(/^rcode-/,"").replace(/\.md$/,"")));function s(o){try{let a=Ue.readFileSync(St.join(o,"SKILL.md"),"utf8");return/^internal:\s*true\s*$/m.test(a)}catch{return!1}}function i(o){if(Ue.existsSync(o))for(let a of Ue.readdirSync(o,{withFileTypes:!0})){if(!a.isDirectory())continue;let c=St.join(o,a.name);if(Ue.existsSync(St.join(c,"SKILL.md"))){if(s(c))continue;let u=a.name.startsWith("rcode-")?a.name:`rcode-${a.name}`;r.actions.add(u)}else i(c)}}return i(St.join(e,"actions")),r}function ug(t,e=null){if(!Ue.existsSync(t))return new Set;let r=new Set;for(let n of Ue.readdirSync(t,{withFileTypes:!0}))n.isDirectory()&&(e&&!n.name.startsWith(e)||r.add(e?n.name.slice(e.length):n.name));return r}function Ro(t,e,r,n){let s=[...r].filter(o=>!n.has(o)).sort(),i=[...n].filter(o=>!r.has(o)).sort();return{editor:t,kind:e,expectedCount:r.size,installedCount:n.size,missing:s,extra:i}}function lg(t,e,r={}){let n=r.globalFallback!==!1,s=Po(e),i=St.join(t,".claude/agents"),o=St.join(t,".claude/skills"),a=new Set;if(Ue.existsSync(i))for(let l of Ue.readdirSync(i))l.startsWith("rcode-")&&l.endsWith(".md")&&a.add(l.replace(/^rcode-/,"").replace(/\.md$/,""));if(a.size===0&&n)try{let l=require("os"),d=St.join(l.homedir(),".claude/agents");if(Ue.existsSync(d))for(let f of Ue.readdirSync(d))f.startsWith("rcode-")&&f.endsWith(".md")&&a.add(f.replace(/^rcode-/,"").replace(/\.md$/,""))}catch{}let c=ug(o),u=new Set([...c].filter(l=>s.actions.has(l)));if(u.size===0&&n)try{let l=require("os"),d=St.join(l.homedir(),".claude/skills"),f=ug(d);u=new Set([...f].filter(g=>s.actions.has(g)))}catch{}return[Ro("claude","agents",s.agents,a),Ro("claude","actions",s.actions,u)]}function Gc(t,e,r){let n=Po(r),s=t==="cursor"?".cursor/rules":".windsurf/rules",i=St.join(e,s,"rcode","agents"),o=new Set;if(Ue.existsSync(i))for(let a of Ue.readdirSync(i,{withFileTypes:!0}))a.isFile()&&(!a.name.startsWith("rcode-")||!a.name.endsWith(".mdc")||o.add(a.name.replace(/^rcode-/,"").replace(/\.mdc$/,"")));return[Ro(t,"agents",n.agents,o)]}function dg(t,e){let r=Po(e),n=St.join(t,".antigravity/rcode/agents"),s=new Set;if(Ue.existsSync(n))for(let i of Ue.readdirSync(n,{withFileTypes:!0}))i.isFile()&&(!i.name.startsWith("rcode-")||!i.name.endsWith(".md")||s.add(i.name.replace(/^rcode-/,"").replace(/\.md$/,"")));return[Ro("antigravity","agents",r.agents,s)]}function S$(t,e,r){let n=[];r.includes("claude")&&n.push(...lg(t,e)),r.includes("cursor")&&n.push(...Gc("cursor",t,e)),r.includes("windsurf")&&n.push(...Gc("windsurf",t,e)),r.includes("antigravity")&&n.push(...dg(t,e));let s=n.some(i=>i.missing.length>0||i.extra.length>0);return{reports:n,hasDrift:s}}function E$(t){let e=[];for(let r of t){let n=r.missing.length===0&&r.extra.length===0?"\u2713":"\u26A0";e.push(` ${n} ${r.editor.padEnd(12)} ${r.kind.padEnd(8)} ${r.installedCount}/${r.expectedCount}`),r.missing.length>0&&e.push(` missing: ${r.missing.join(", ")}`),r.extra.length>0&&e.push(` extra: ${r.extra.join(", ")}`)}return e.join(`
118
+ `)}fg.exports={readPackageManifest:Po,verifyInstall:S$,verifyClaudeInstall:lg,verifyRulesInstall:Gc,verifyAntigravityInstall:dg,formatReport:E$}});var cs=v((HI,ft)=>{var D=require("fs"),p=require("path"),C$=require("crypto"),w$=require("os"),{writeFileAtomic:Oe,safeRmSync:Jc}=Qt(),{homedir:Qe}=hr(),J=Nn(),{createSpinner:x$}=Uu(),k$=Lf(),{z:Te}=Ya(),In=Jp(),{createTwoFilesPatch:hg}=Rm(),Pe=Vc(),ar=t=>J.green("\u2713")+" "+t,pg=t=>J.red("\u2717")+" "+t,Et=t=>J.yellow("\u26A0")+" "+t,Oo=t=>J.cyan("\u2192")+" "+t,Y=t=>J.dim(t),Tt=t=>J.bold(t),dt=p.resolve(__dirname,".."),Ae=p.join(dt,"rcode"),as=Object.freeze(["claude","cursor","gemini","vscode","antigravity","windsurf","codex","grok"]);function $$(t){let e=t;for(;;){if(D.existsSync(p.join(e,"pnpm-workspace.yaml")))return e;let r=p.dirname(e);if(r===e)return null;e=r}}var A$=Te.object({user_name:Te.string().min(1),project_name:Te.string().min(1),communication_language:Te.string().default("English"),mode:Te.enum(["guided","yolo"],{errorMap:()=>({message:'expected "guided" or "yolo"'})}).default("guided"),model_profile:Te.string().optional(),commit_planning:Te.boolean().optional(),rcode_source_path:Te.string().optional(),workflow:Te.object({research_by_default:Te.boolean().optional(),plan_checker:Te.boolean().optional(),post_execute_gates:Te.boolean().optional(),ui_safety_gate:Te.boolean().optional(),nyquist_validation:Te.boolean().optional()}).optional(),output:Te.object({verbose:Te.boolean().optional()}).optional(),git:Te.object({branching_strategy:Te.string().optional()}).optional(),prompt_nudge:Te.enum(["every","once-per-intent","when-stale","off"]).optional()}).passthrough();function Xc(t){let e={target:process.cwd(),targetProvided:!1,force:!1,reset:!1,yes:!1,userName:w$.userInfo().username||"User",projectName:null,language:"English",mode:"guided",ide:"claude",ideProvided:!1,help:!1,modules:[],commitPlanning:null,nonDestructive:!1,forceOverwrite:!1,showDiff:!1,diffStat:!1,acceptAll:!1,noUpdateCheck:!1,noBackup:!1,gitHooks:null,enableHooks:null,global:!1,silent:!1,noPrompt:!1,localOnly:!1,dryRun:!1,listFiles:!1},r=[];for(let n=0;n<t.length;n++){let s=t[n];s==="--help"||s==="-h"?e.help=!0:s==="--force"?e.force=!0:s==="--reset"?e.reset=!0:s==="--yes"||s==="-y"?e.yes=!0:s==="--user"?e.userName=t[++n]:s==="--project"?e.projectName=t[++n]:s==="--language"?e.language=t[++n]:s==="--mode"?e.mode=t[++n]:s==="--ide"?(e.ide=t[++n],e.ide==="claude-code"&&(e.ide="claude"),e.ideProvided=!0):s==="--module"?e.modules.push(t[++n]):s==="--commit-planning"?e.commitPlanning=!0:s==="--no-commit-planning"||s==="--ignore-planning"?e.commitPlanning=!1:s==="--non-destructive"?e.nonDestructive=!0:s==="--force-overwrite"?e.forceOverwrite=!0:s==="--show-diff"?e.showDiff=!0:s==="--diff-stat"?e.diffStat=!0:s==="--accept-all"?e.acceptAll=!0:s==="--no-update-check"?e.noUpdateCheck=!0:s==="--no-backup"?e.noBackup=!0:s==="--no-git-hooks"?e.gitHooks=!1:s==="--git-hooks"?e.gitHooks=!0:s==="--no-hooks"?e.enableHooks=!1:s==="--enable-hooks"?e.enableHooks=!0:s==="--global"?e.global=!0:s==="--local-only"?e.localOnly=!0:s==="--silent"?e.silent=!0:s==="--no-prompt"?e.noPrompt=!0:s==="--dry-run"?e.dryRun=!0:s==="--list-files"?e.listFiles=!0:s.startsWith("--")||r.push(s)}if(r[0]&&(e.target=p.resolve(r[0]),e.targetProvided=!0),e.global&&!e.targetProvided&&(e.target=Qe()),!e.targetProvided&&!e.global){let n=process.cwd(),s=D.existsSync(p.join(n,"pnpm-workspace.yaml")),i=process.env.INIT_CWD;s&&i&&p.resolve(i)!==p.resolve(n)?e.target=p.resolve(i):$$(p.dirname(n))&&(e.target=n)}return e.projectName||(e.projectName=p.basename(e.target)),e}function F$(t,e){let{spawnSync:r}=require("child_process"),n=[];for(let u of e){let l=u.rel||u.dest;if(!l)continue;let d=p.join(t,l);D.existsSync(d)&&n.push(l)}for(let u of[".rcode/config.yaml",".rcode/state.json",".rcode/_config/manifest.yaml",".rcode/_config/files-manifest.csv"])D.existsSync(p.join(t,u))&&n.push(u);if(n.length===0)return{ok:!1,warning:"no existing files to back up \u2014 fresh install",fileCount:0};let s=p.join(t,".rcode/backups");try{D.mkdirSync(s,{recursive:!0})}catch(u){return{ok:!1,warning:`could not create .rcode/backups/: ${u.message}`,fileCount:0}}let i=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),o=p.join(s,`install-force-${i}.tgz`),a=p.relative(t,o),c=r("tar",["-czf",o,"-C",t,"--files-from=-"],{input:n.join(`
119
119
  `)+`
120
- `,encoding:"utf8"});return u.status!==0?{ok:!1,warning:`tar failed: ${(u.stderr||"").trim().split(`
121
- `)[0]}`,fileCount:n.length}:{ok:!0,path:a,fileCount:n.length}}function kk(t){let e=t||We(),r=["",X.cyan("\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E"),X.cyan("\u2502")+" "+X.cyan("\u2502"),X.cyan("\u2502")+" "+X.bold(X.yellow("\u{1F54C} rcode Memory Bank"))+" "+Y("\u2014 installer")+" "+X.cyan("\u2502"),X.cyan("\u2502")+" "+Y("A persistent context-brain for your editor")+" "+X.cyan("\u2502"),X.cyan("\u2502")+" "+X.cyan("\u2502"),X.cyan("\u2502")+" "+Y("version ")+X.green("v"+e)+" "+X.cyan("\u2502"),X.cyan("\u2502")+" "+Y("docs ")+"github.com/hanzlahabib/rcode "+X.cyan("\u2502"),X.cyan("\u2502")+" "+Y("by ")+"Hanzla Habib "+X.cyan("\u2502"),X.cyan("\u2502")+" "+X.cyan("\u2502"),X.cyan("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F"),""];console.log(r.join(`
122
- `))}function hg(t){let e={claude:!1,cursor:!1,gemini:!1,vscode:!1,antigravity:!1,windsurf:!1,codex:!1};y.existsSync(p.join(t,".claude"))&&(e.claude=!0),y.existsSync(p.join(t,".cursor"))&&(e.cursor=!0),y.existsSync(p.join(t,".gemini"))&&(e.gemini=!0),y.existsSync(p.join(t,".vscode"))&&(e.vscode=!0),y.existsSync(p.join(t,".antigravity"))&&(e.antigravity=!0),y.existsSync(p.join(t,".windsurf"))&&(e.windsurf=!0);let r=Ye();return y.existsSync(p.join(r,".claude"))&&(e.claude=!0),y.existsSync(p.join(r,".cursor"))&&(e.cursor=!0),y.existsSync(p.join(r,".config","Cursor"))&&(e.cursor=!0),y.existsSync(p.join(r,".gemini"))&&(e.gemini=!0),y.existsSync(p.join(r,".vscode"))&&(e.vscode=!0),y.existsSync(p.join(r,".config","Code"))&&(e.vscode=!0),y.existsSync(p.join(r,".antigravity"))&&(e.antigravity=!0),y.existsSync(p.join(r,".windsurf"))&&(e.windsurf=!0),y.existsSync(p.join(r,".codeium","windsurf"))&&(e.windsurf=!0),(process.env.CURSOR_TRACE_ID||/cursor/i.test(process.env.TERM_PROGRAM||""))&&(e.cursor=!0),(process.env.CLAUDECODE==="1"||process.env.CLAUDE_CODE_ENTRYPOINT)&&(e.claude=!0),(process.env.VSCODE_PID||/vscode/i.test(process.env.TERM_PROGRAM||""))&&(e.vscode=!0),/windsurf/i.test(process.env.TERM_PROGRAM||"")&&(e.windsurf=!0),(process.env.CODEX_ENV||/codex/i.test(process.env.TERM_PROGRAM||""))&&(e.codex=!0),e}async function Ak(t){if(Array.isArray(t.ides)&&t.ides.length>0)return t.ides;if(t.ideProvided)return[t.ide];if(t.noPrompt||t.global)return["claude"];if(t.yes||!process.stdin.isTTY){let i=hg(t.target),o=os.filter(a=>i[a]);return o.length>0?o:["claude"]}let e=hg(t.target),r=os.filter(i=>i!=="antigravity"&&e[i]),n=r.length>0?r:["claude"],s=await nt.multiselect({message:"\u{1F3AF} Which editor(s) will you use rcode with?",initialValues:n,options:[{value:"claude",label:"Claude Code",hint:e.claude?"(detected)":void 0},{value:"cursor",label:"Cursor",hint:e.cursor?"(detected)":void 0},{value:"codex",label:"Codex (OpenAI CLI)",hint:e.codex?"(detected)":"(uses AGENTS.md + workflow bridge)"},{value:"gemini",label:"Gemini CLI",hint:e.gemini?"(detected)":"(beta \u2014 limited)"},{value:"vscode",label:"VS Code",hint:e.vscode?"(detected)":"(via Continue / Copilot extensions)"},{value:"antigravity",label:"Antigravity",hint:"(experimental \u2014 installs to .antigravity/)"}],required:!0});return nt.isCancel(s)&&(nt.cancel("Install cancelled."),process.exit(0)),s}async function Fk(t){if(t.commitPlanning!==null)return t.commitPlanning;if(t.global)return!1;if(t.noPrompt)return!0;let e=null;try{let s=p.join(t.target,".rcode","config.yaml");if(y.existsSync(s)){let o=y.readFileSync(s,"utf8").match(/^commit_planning:\s*(true|false)\s*$/m);o&&(e=o[1]==="true")}}catch{}if(t.yes||!process.stdin.isTTY)return e!==null?e:!0;let r=e===!1?"gitignore":"commit",n=await nt.select({message:e!==null?"\u{1F4CB} .planning/ tracking \u2014 current setting preserved unless you change it.":"\u{1F4CB} .planning/ holds PRDs, roadmaps, sprints, SUMMARY files. How should they be tracked?",initialValue:r,options:[{value:"commit",label:"Commit",hint:"collaborators see the same plans (recommended)"},{value:"gitignore",label:"Gitignore",hint:"planning stays local (good for sensitive PRDs)"}]});return nt.isCancel(n)&&(nt.cancel("Install cancelled."),process.exit(0)),n==="commit"}function gg(){console.log(`
120
+ `,encoding:"utf8"});return c.status!==0?{ok:!1,warning:`tar failed: ${(c.stderr||"").trim().split(`
121
+ `)[0]}`,fileCount:n.length}:{ok:!0,path:a,fileCount:n.length}}function j$(t){let e=t||Ve(),r=["",J.cyan("\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E"),J.cyan("\u2502")+" "+J.cyan("\u2502"),J.cyan("\u2502")+" "+J.bold(J.yellow("\u{1F54C} rcode Memory Bank"))+" "+Y("\u2014 installer")+" "+J.cyan("\u2502"),J.cyan("\u2502")+" "+Y("A persistent context-brain for your editor")+" "+J.cyan("\u2502"),J.cyan("\u2502")+" "+J.cyan("\u2502"),J.cyan("\u2502")+" "+Y("version ")+J.green("v"+e)+" "+J.cyan("\u2502"),J.cyan("\u2502")+" "+Y("docs ")+"github.com/hanzlahabib/rcode "+J.cyan("\u2502"),J.cyan("\u2502")+" "+Y("by ")+"Hanzla Habib "+J.cyan("\u2502"),J.cyan("\u2502")+" "+J.cyan("\u2502"),J.cyan("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F"),""];console.log(r.join(`
122
+ `))}function mg(t){let e={claude:!1,cursor:!1,gemini:!1,vscode:!1,antigravity:!1,windsurf:!1,codex:!1};D.existsSync(p.join(t,".claude"))&&(e.claude=!0),D.existsSync(p.join(t,".cursor"))&&(e.cursor=!0),D.existsSync(p.join(t,".gemini"))&&(e.gemini=!0),D.existsSync(p.join(t,".vscode"))&&(e.vscode=!0),D.existsSync(p.join(t,".antigravity"))&&(e.antigravity=!0),D.existsSync(p.join(t,".windsurf"))&&(e.windsurf=!0);let r=Qe();return D.existsSync(p.join(r,".claude"))&&(e.claude=!0),D.existsSync(p.join(r,".cursor"))&&(e.cursor=!0),D.existsSync(p.join(r,".config","Cursor"))&&(e.cursor=!0),D.existsSync(p.join(r,".gemini"))&&(e.gemini=!0),D.existsSync(p.join(r,".vscode"))&&(e.vscode=!0),D.existsSync(p.join(r,".config","Code"))&&(e.vscode=!0),D.existsSync(p.join(r,".antigravity"))&&(e.antigravity=!0),D.existsSync(p.join(r,".windsurf"))&&(e.windsurf=!0),D.existsSync(p.join(r,".codeium","windsurf"))&&(e.windsurf=!0),(process.env.CURSOR_TRACE_ID||/cursor/i.test(process.env.TERM_PROGRAM||""))&&(e.cursor=!0),(process.env.CLAUDECODE==="1"||process.env.CLAUDE_CODE_ENTRYPOINT)&&(e.claude=!0),(process.env.VSCODE_PID||/vscode/i.test(process.env.TERM_PROGRAM||""))&&(e.vscode=!0),/windsurf/i.test(process.env.TERM_PROGRAM||"")&&(e.windsurf=!0),(process.env.CODEX_ENV||/codex/i.test(process.env.TERM_PROGRAM||""))&&(e.codex=!0),e}async function I$(t){if(Array.isArray(t.ides)&&t.ides.length>0)return t.ides;if(t.ideProvided)return[t.ide];if(t.noPrompt||t.global)return["claude"];if(t.yes||!process.stdin.isTTY){let i=mg(t.target),o=as.filter(a=>i[a]);return o.length>0?o:["claude"]}let e=mg(t.target),r=as.filter(i=>i!=="antigravity"&&e[i]),n=r.length>0?r:["claude"],s=await Pe.multiselect({message:"\u{1F3AF} Which editor(s) will you use rcode with?",initialValues:n,options:[{value:"claude",label:"Claude Code",hint:e.claude?"(detected)":void 0},{value:"cursor",label:"Cursor",hint:e.cursor?"(detected)":void 0},{value:"codex",label:"Codex (OpenAI CLI)",hint:e.codex?"(detected)":"(uses AGENTS.md + workflow bridge)"},{value:"gemini",label:"Gemini CLI",hint:e.gemini?"(detected)":"(beta \u2014 limited)"},{value:"vscode",label:"VS Code",hint:e.vscode?"(detected)":"(via Continue / Copilot extensions)"},{value:"antigravity",label:"Antigravity",hint:"(experimental \u2014 installs to .antigravity/)"}],required:!0});return Pe.isCancel(s)&&(Pe.cancel("Install cancelled."),process.exit(0)),s}async function T$(t){if(t.commitPlanning!==null)return t.commitPlanning;if(t.global)return!1;if(t.noPrompt)return!0;let e=null;try{let s=p.join(t.target,".rcode","config.yaml");if(D.existsSync(s)){let o=D.readFileSync(s,"utf8").match(/^commit_planning:\s*(true|false)\s*$/m);o&&(e=o[1]==="true")}}catch{}if(t.yes||!process.stdin.isTTY)return e!==null?e:!0;let r=e===!1?"gitignore":"commit",n=await Pe.select({message:e!==null?"\u{1F4CB} .planning/ tracking \u2014 current setting preserved unless you change it.":"\u{1F4CB} .planning/ holds PRDs, roadmaps, sprints, SUMMARY files. How should they be tracked?",initialValue:r,options:[{value:"commit",label:"Commit",hint:"collaborators see the same plans (recommended)"},{value:"gitignore",label:"Gitignore",hint:"planning stays local (good for sensitive PRDs)"}]});return Pe.isCancel(n)&&(Pe.cancel("Install cancelled."),process.exit(0)),n==="commit"}async function R$(t){if(t.enableHooks!==null)return t.enableHooks;if(t.global||!t.ides.includes("claude"))return!1;if(t.noPrompt||t.yes||!process.stdin.isTTY)return!0;let e=await Pe.confirm({message:"\u{1F6E1}\uFE0F Enable rcode guardrail hooks in .claude/settings.json? (pre-edit checks, bash-guard, prompt-router, etc.)",initialValue:!0});return Pe.isCancel(e)&&(Pe.cancel("Install cancelled."),process.exit(0)),e}function P$(t,e={}){if(e.enableHooks!==!0)return{action:"skipped-flag"};let r=p.join(dt,"rcode","templates","settings-hooks.json");if(!D.existsSync(r))return{action:"skipped-template-missing"};let n;try{n=JSON.parse(D.readFileSync(r,"utf8"))}catch{return{action:"skipped-error"}}let s=p.join(t,".claude"),i=p.join(s,"settings.json"),o={};if(D.existsSync(i))try{o=JSON.parse(D.readFileSync(i,"utf8"))}catch{return{action:"skipped-error"}}o.hooks=o.hooks||{};for(let[a,c]of Object.entries(n.hooks||{})){o.hooks[a]=o.hooks[a]||[];for(let u of c){let l=o.hooks[a].find(d=>d.matcher===u.matcher);l||(l={matcher:u.matcher,hooks:[]},o.hooks[a].push(l));for(let d of u.hooks)l.hooks.some(g=>g.command===d.command&&g.type===d.type)||l.hooks.push(d)}}try{return D.mkdirSync(s,{recursive:!0}),Oe(i,JSON.stringify(o,null,2)+`
123
+ `),{action:"merged"}}catch{return{action:"skipped-error"}}}function vg(){console.log(`
123
124
  rcode installer
124
125
 
125
126
  Usage:
@@ -134,6 +135,8 @@ Options:
134
135
  --language <lang> set communication_language (default: English)
135
136
  --mode <guided|yolo> default mode (default: guided)
136
137
  --ide <name> target IDE (claude, cursor, gemini; default: claude)
138
+ --enable-hooks merge rcode guardrail hooks into .claude/settings.json (default: on)
139
+ --no-hooks skip guardrail hooks; enable later via /rcode-enable-hooks
137
140
  --dry-run preview what would be written; exit without writing any files
138
141
  --list-files alias for --dry-run
139
142
  --help this text
@@ -145,10 +148,10 @@ Installs (IDE-specific):
145
148
  cursor: target/.cursor/rules/rcode/ Cursor-specific rules + agents
146
149
  gemini: target/.gemini/rcode/ Gemini CLI commands + agents
147
150
  target/.planning/ artifact output dir (all IDEs)
148
- `)}function Xu(t,e){switch(t){case"claude":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"cursor":return{agentsDir:p.join(e,".cursor","rules","rcode","agents"),commandsDir:p.join(e,".cursor","rules","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"gemini":return{agentsDir:p.join(e,".gemini","rcode","agents"),commandsDir:p.join(e,".gemini","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"vscode":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin"),markerDir:p.join(e,".vscode","rcode")};case"antigravity":return{agentsDir:p.join(e,".antigravity","rcode","agents"),commandsDir:p.join(e,".antigravity","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"windsurf":return{agentsDir:p.join(e,".windsurf","rules","rcode","agents"),commandsDir:p.join(e,".windsurf","rules","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"codex":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"grok":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};default:throw new Error(`Unknown IDE: ${t}. Supported: ${os.join(", ")}`)}}function Ar(t,e=[]){return y.existsSync(t)?Ck.sync("**/*",{cwd:t,dot:!0,onlyFiles:!0,followSymbolicLinks:!1,ignore:e}).map(r=>p.join(t,r)):[]}function jn(t){return Ek.createHash("sha256").update(t).digest("hex")}function jt(t){y.mkdirSync(t,{recursive:!0})}function Dg(t,e){if(y.existsSync(t)){y.existsSync(e)||y.mkdirSync(e,{recursive:!0});for(let r of y.readdirSync(t,{withFileTypes:!0})){let n=p.join(t,r.name),s=p.join(e,r.name);r.isDirectory()?Dg(n,s):r.isFile()&&y.copyFileSync(n,s)}}}function jk(t,e){let r=p.join(t,".planning"),n=p.join(r,"ROADMAP.md"),s=p.join(r,"STATE.md"),i=p.join(r,"PROJECT.md");if(y.existsSync(n))return!1;y.mkdirSync(r,{recursive:!0});let o=new Date().toISOString().slice(0,10),a=e||p.basename(t),u=`<!-- INSTALL STUB \u2014 overwritten by /rcode-new-project. Delete this file or run
151
+ `)}function Kc(t,e){switch(t){case"claude":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"cursor":return{agentsDir:p.join(e,".cursor","rules","rcode","agents"),commandsDir:p.join(e,".cursor","rules","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"gemini":return{agentsDir:p.join(e,".gemini","rcode","agents"),commandsDir:p.join(e,".gemini","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"vscode":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin"),markerDir:p.join(e,".vscode","rcode")};case"antigravity":return{agentsDir:p.join(e,".antigravity","rcode","agents"),commandsDir:p.join(e,".antigravity","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"windsurf":return{agentsDir:p.join(e,".windsurf","rules","rcode","agents"),commandsDir:p.join(e,".windsurf","rules","rcode","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"codex":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};case"grok":return{agentsDir:p.join(e,".claude","agents"),commandsDir:p.join(e,".claude","commands"),workflowsDir:p.join(e,".rcode","workflows"),referencesDir:p.join(e,".rcode","references"),binDir:p.join(e,".rcode","bin")};default:throw new Error(`Unknown IDE: ${t}. Supported: ${as.join(", ")}`)}}function Ir(t,e=[]){return D.existsSync(t)?k$.sync("**/*",{cwd:t,dot:!0,onlyFiles:!0,followSymbolicLinks:!1,ignore:e}).map(r=>p.join(t,r)):[]}function Tn(t){return C$.createHash("sha256").update(t).digest("hex")}function Rt(t){D.mkdirSync(t,{recursive:!0})}function _g(t,e){if(D.existsSync(t)){D.existsSync(e)||D.mkdirSync(e,{recursive:!0});for(let r of D.readdirSync(t,{withFileTypes:!0})){let n=p.join(t,r.name),s=p.join(e,r.name);r.isDirectory()?_g(n,s):r.isFile()&&D.copyFileSync(n,s)}}}function O$(t,e){let r=p.join(t,".planning"),n=p.join(r,"ROADMAP.md"),s=p.join(r,"STATE.md"),i=p.join(r,"PROJECT.md");if(D.existsSync(n))return!1;D.mkdirSync(r,{recursive:!0});let o=new Date().toISOString().slice(0,10),a=e||p.basename(t),c=`<!-- INSTALL STUB \u2014 overwritten by /rcode-new-project. Delete this file or run
149
152
  /rcode-new-project before committing. See https://github.com/hanzlahabib/rcode/issues/670 -->
150
153
 
151
- `;y.writeFileSync(i,u+`# ${a}
154
+ `;D.writeFileSync(i,c+`# ${a}
152
155
 
153
156
  **One-line:** Describe what this project is in one sentence.
154
157
 
@@ -161,7 +164,7 @@ What this project delivers and who it serves.
161
164
  - Language/framework
162
165
  - Key dependencies
163
166
  - Deployment target
164
- `),y.writeFileSync(n,u+`# ${a} \u2014 Roadmap
167
+ `),D.writeFileSync(n,c+`# ${a} \u2014 Roadmap
165
168
 
166
169
  **Milestone: M1 \u2014 Initial Delivery** (v1.0)
167
170
  Started: ${o} \xB7 Current
@@ -176,7 +179,7 @@ Started: ${o} \xB7 Current
176
179
  ## Backlog
177
180
 
178
181
  Ideas and future phases go here.
179
- `),y.writeFileSync(s,u+`# ${a} \u2014 State
182
+ `),D.writeFileSync(s,c+`# ${a} \u2014 State
180
183
 
181
184
  **Last updated:** ${o}
182
185
  **Milestone:** M1 \u2014 Initial Delivery
@@ -196,171 +199,191 @@ _None._
196
199
  ## Next Action
197
200
 
198
201
  Run \`/rcode-new-project <description>\` to bootstrap, or \`/rcode-sprint-planning\` once a real phase exists.
199
- `);let c=p.join(t,".rcode","state.json");function l(){let d=p.join(t,".planning","ROADMAP.md");if(!y.existsSync(d))return!0;try{return y.readFileSync(d,"utf8").includes("<!-- INSTALL STUB")}catch{return!0}}if(!y.existsSync(c)){let d=new Date().toISOString(),f=l(),g=null,m=p.join(t,".rcode","config.yaml");if(y.existsSync(m))try{let A=y.readFileSync(m,"utf8").match(/^project_name:\s*"?([^"\n]+)"?/m);A&&(g=A[1].trim())}catch{}let D=null,h=p.join(t,".planning","ROADMAP.md");if(!f&&y.existsSync(h))try{let C=y.readFileSync(h,"utf8"),A=C.match(/^\|\s*(\d+(?:\.\d+)?)\s*\|/m);if(A)D=String(parseInt(A[1],10));else{let T=C.match(/^#{2,4}\s*Phase\s+(\d+(?:\.\d+)?)/im);T&&(D=String(parseInt(T[1],10)))}}catch{}let w={version:"1",schema_version:2,project:g||p.basename(t),...f?{_seeded_stub:!0}:{},created:d,updated:d,current_phase:D,current_plan:0,current_sprint:null,phases:[],milestones:[],executions:[],decisions:[],blockers:[],council_sessions:[],chains:[],workstreams:[],active_workstream:null,last_session:null,velocity_history:[]};y.mkdirSync(p.dirname(c),{recursive:!0}),It(c,JSON.stringify(w,null,2)+`
200
- `)}return!0}function Ik(t,e={}){let r=e.commitPlanning!==!1,n="# ===== rcode-managed gitignore block (npx @hanzlaa/rcode install) =====",s="# ===== end rcode-managed gitignore block =====",i=["",n,"# Added automatically on first rcode install. Idempotent \u2014 safe to re-run.","# Edit `commit_planning` in .rcode/config.yaml to flip planning-artifact tracking.","","# Installed methodology files (regenerate with: npx @hanzlaa/rcode install)",".claude/",".rcode/bin/",".rcode/data/",".rcode/workflows/",".rcode/references/",".rcode/commands/",".rcode/skills/","","# Pulled rcode brain content (refresh with: rcode brain pull)",".rcode/brain/rcode-github/",".rcode/brain/rcode-docs/",".rcode/brain/best-practices/","","# Runtime noise","node_modules/",".rcode/state.json.lock",".planning/debug/",".planning/_backup/"];r||i.push("","# Planning artifacts \u2014 kept local (commit_planning: false)",".planning/"),i.push("","# What you DO commit:","# .rcode/config.yaml - project mode/language/profile/commit_planning","# .rcode/state.json - decisions, roadmap pointer, blockers","# .rcode/brain/sources.yaml - brain source manifest",r?"# .planning/ - PRD, roadmap, sprints, SUMMARY.md files":"# (planning artifacts are NOT committed \u2014 see commit_planning in config)",s,"");let o=i.join(`
202
+ `);let u=p.join(t,".rcode","state.json");function l(){let d=p.join(t,".planning","ROADMAP.md");if(!D.existsSync(d))return!0;try{return D.readFileSync(d,"utf8").includes("<!-- INSTALL STUB")}catch{return!0}}if(!D.existsSync(u)){let d=new Date().toISOString(),f=l(),g=null,m=p.join(t,".rcode","config.yaml");if(D.existsSync(m))try{let A=D.readFileSync(m,"utf8").match(/^project_name:\s*"?([^"\n]+)"?/m);A&&(g=A[1].trim())}catch{}let y=null,h=p.join(t,".planning","ROADMAP.md");if(!f&&D.existsSync(h))try{let C=D.readFileSync(h,"utf8"),A=C.match(/^\|\s*(\d+(?:\.\d+)?)\s*\|/m);if(A)y=String(parseInt(A[1],10));else{let T=C.match(/^#{2,4}\s*Phase\s+(\d+(?:\.\d+)?)/im);T&&(y=String(parseInt(T[1],10)))}}catch{}let w={version:"1",schema_version:2,project:g||p.basename(t),...f?{_seeded_stub:!0}:{},created:d,updated:d,current_phase:y,current_plan:0,current_sprint:null,phases:[],milestones:[],executions:[],decisions:[],blockers:[],council_sessions:[],chains:[],workstreams:[],active_workstream:null,last_session:null,velocity_history:[]};D.mkdirSync(p.dirname(u),{recursive:!0}),Oe(u,JSON.stringify(w,null,2)+`
203
+ `)}return!0}function N$(t,e={}){let r=e.commitPlanning!==!1,n="# ===== rcode-managed gitignore block (npx @hanzlaa/rcode install) =====",s="# ===== end rcode-managed gitignore block =====",i=["",n,"# Added automatically on first rcode install. Idempotent \u2014 safe to re-run.","# Edit `commit_planning` in .rcode/config.yaml to flip planning-artifact tracking.","","# Installed methodology files (regenerate with: npx @hanzlaa/rcode install)",".claude/",".rcode/bin/",".rcode/data/",".rcode/workflows/",".rcode/references/",".rcode/commands/",".rcode/skills/","","# Pulled rcode brain content (refresh with: rcode brain pull)",".rcode/brain/rcode-github/",".rcode/brain/rcode-docs/",".rcode/brain/best-practices/","","# Runtime noise","node_modules/",".rcode/state.json.lock",".planning/debug/",".planning/_backup/"];r||i.push("","# Planning artifacts \u2014 kept local (commit_planning: false)",".planning/"),i.push("","# What you DO commit:","# .rcode/config.yaml - project mode/language/profile/commit_planning","# .rcode/state.json - decisions, roadmap pointer, blockers","# .rcode/brain/sources.yaml - brain source manifest",r?"# .planning/ - PRD, roadmap, sprints, SUMMARY.md files":"# (planning artifacts are NOT committed \u2014 see commit_planning in config)",s,"");let o=i.join(`
201
204
  `),a=p.join(t,".gitignore");try{let l=function(d,f){let g=d.indexOf(n);if(g<0)return null;let m=d.indexOf(s,g);if(m<0){let w=g;return w>0&&d[w-1]===`
202
- `&&(w-=1),d.slice(0,w)+f}let D=g;D>0&&d[D-1]===`
203
- `&&(D-=1);let h=m+s.length;return d[h]===`
204
- `&&(h+=1),d.slice(0,D)+f+d.slice(h)};var u=l;if(!y.existsSync(a))return It(a,o),{action:"created"};let c=y.readFileSync(a,"utf8");if(c.includes(n)){let d=l(c,o);return d!==null&&d!==c?(It(a,d),{action:"updated"}):{action:"already-present"}}return It(a,c+o),{action:"appended"}}catch(c){return{action:"skipped-error",error:c.message}}}function Tk(t,e={}){if(e.gitHooks===!1)return{action:"skipped-flag"};let r=p.join(t,".git");if(!y.existsSync(r)||!y.statSync(r).isDirectory())return{action:"skipped-no-git"};let n="# ===== rcode-managed pre-commit block =====",s="# ===== end rcode pre-commit block =====",i=["",n,"# Auto-syncs .rcode/state.json when planning files change.","# Added by rcode install \u2014 safe to re-run (idempotent).",'if git diff --cached --name-only | grep -qE "^\\.planning/|^\\.rcode/brain/sources\\.yaml$"; then'," if [ -x .rcode/bin/rcode-tools.cjs ]; then"," node .rcode/bin/rcode-tools.cjs state sync --from-disk > /dev/null 2>&1 || true"," git add .rcode/state.json 2>/dev/null || true"," fi","fi",s,""].join(`
205
+ `&&(w-=1),d.slice(0,w)+f}let y=g;y>0&&d[y-1]===`
206
+ `&&(y-=1);let h=m+s.length;return d[h]===`
207
+ `&&(h+=1),d.slice(0,y)+f+d.slice(h)};var c=l;if(!D.existsSync(a))return Oe(a,o),{action:"created"};let u=D.readFileSync(a,"utf8");if(u.includes(n)){let d=l(u,o);return d!==null&&d!==u?(Oe(a,d),{action:"updated"}):{action:"already-present"}}return Oe(a,u+o),{action:"appended"}}catch(u){return{action:"skipped-error",error:u.message}}}function gg(t,e,r,n){try{let o=function(c,u){let l=c.indexOf(e);if(l<0)return null;let d=c.indexOf(r,l);if(d<0){let m=l;return m>0&&c[m-1]===`
208
+ `&&(m-=1),c.slice(0,m)+u}let f=l;f>0&&c[f-1]===`
209
+ `&&(f-=1);let g=d+r.length;return c[g]===`
210
+ `&&(g+=1),c.slice(0,f)+u+c.slice(g)};var s=o;if(!D.existsSync(t))return D.mkdirSync(p.dirname(t),{recursive:!0}),Oe(t,n),{action:"created"};let i=D.readFileSync(t,"utf8");if(i.includes(e)){let c=o(i,n);return c!==null&&c!==i?(Oe(t,c),{action:"updated"}):{action:"already-present"}}let a=i.endsWith(`
211
+ `)?`
212
+ `:`
213
+
214
+ `;return Oe(t,i+a+n),{action:"appended"}}catch(i){return{action:"skipped-error",error:i.message}}}function L$(t,e){let r={},n=new Set(e||[]),s=i=>[`## ${i}`,"","This project has [rcode](https://www.npmjs.com/package/@hanzlaa/rcode) installed \u2014","persistent project memory, specialist agents, and structured workflows under `.rcode/`.","","For any non-trivial task (new feature, bug fix that needs investigation, multi-file","change, planning) prefer routing through **`/rcode-do <task description>`** \u2014 rcode's","command picker \u2014 instead of working ad hoc. It picks the right rcode command (plan,","execute, review, debug, etc.) for the task and keeps `.rcode/state.json` and the","Memory Bank in sync. Skip it only for trivial single-line/single-file edits that","don't need planning or memory."].join(`
215
+ `);if(n.has("claude")||n.has("vscode")){let i="<!-- ===== rcode-managed rule block (npx @hanzlaa/rcode install) ===== -->",o="<!-- ===== end rcode-managed rule block ===== -->",a=`${i}
216
+
217
+ ${s("Working with rcode")}
218
+
219
+ ${o}
220
+ `;r.claude=gg(p.join(t,"CLAUDE.md"),i,o,a)}if(n.has("codex")){let i="<!-- ===== rcode-managed rule block (npx @hanzlaa/rcode install) ===== -->",o="<!-- ===== end rcode-managed rule block ===== -->",a=`${i}
221
+
222
+ ${s("Working with rcode")}
223
+
224
+ ${o}
225
+ `;r.codex=gg(p.join(t,"AGENTS.md"),i,o,a)}if(n.has("cursor")){let i=["---","description: Prefer rcode's /rcode-do command for non-trivial work","alwaysApply: true","---","",s("Working with rcode"),""].join(`
226
+ `);try{let o=p.join(t,".cursor","rules","rcode-prefer-do.mdc");D.mkdirSync(p.dirname(o),{recursive:!0}),Oe(o,i),r.cursor={action:"written"}}catch(o){r.cursor={action:"skipped-error",error:o.message}}}if(n.has("windsurf")){let i=["---","description: Prefer rcode's /rcode-do command for non-trivial work","trigger: always_on","---","",s("Working with rcode"),""].join(`
227
+ `);try{let o=p.join(t,".windsurf","rules","rcode-prefer-do.mdc");D.mkdirSync(p.dirname(o),{recursive:!0}),Oe(o,i),r.windsurf={action:"written"}}catch(o){r.windsurf={action:"skipped-error",error:o.message}}}return r}function B$(t,e={}){if(e.gitHooks===!1)return{action:"skipped-flag"};let r=p.join(t,".git");if(!D.existsSync(r)||!D.statSync(r).isDirectory())return{action:"skipped-no-git"};let n="# ===== rcode-managed pre-commit block =====",s="# ===== end rcode pre-commit block =====",i=["",n,"# Auto-syncs .rcode/state.json when planning files change.","# Added by rcode install \u2014 safe to re-run (idempotent).",'if git diff --cached --name-only | grep -qE "^\\.planning/|^\\.rcode/brain/sources\\.yaml$"; then'," if [ -x .rcode/bin/rcode-tools.cjs ]; then"," node .rcode/bin/rcode-tools.cjs state sync --from-disk > /dev/null 2>&1 || true"," git add .rcode/state.json 2>/dev/null || true"," fi","fi",s,""].join(`
205
228
  `),o=p.join(r,"hooks"),a=p.join(o,"pre-commit");try{let l=function(d,f){let g=d.indexOf(n);if(g<0)return null;let m=d.indexOf(s,g);if(m<0){let w=g;return w>0&&d[w-1]===`
206
- `&&(w-=1),d.slice(0,w)+f}let D=g;D>0&&d[D-1]===`
207
- `&&(D-=1);let h=m+s.length;return d[h]===`
208
- `&&(h+=1),d.slice(0,D)+f+d.slice(h)};var u=l;if(y.mkdirSync(o,{recursive:!0}),!y.existsSync(a))return It(a,`#!/bin/sh
209
- ${i}`,{mode:493}),{action:"created"};let c=y.readFileSync(a,"utf8");if(c.includes(n)){let d=l(c,i);return d!==null&&d!==c?(It(a,d,{mode:493}),{action:"updated"}):{action:"already-present"}}return It(a,c+i,{mode:493}),{action:"appended"}}catch(c){return{action:"skipped-error",error:c.message}}}function Rk(t,e){let r=p.join(t,"rcode","brain"),n=p.join(e,".rcode","brain");y.mkdirSync(n,{recursive:!0});let s=0;for(let o of["sources.yaml","README.md"]){let a=p.join(r,o),u=p.join(n,o);y.existsSync(a)&&!y.existsSync(u)&&(y.copyFileSync(a,u),s++)}let i=p.join(t,"rcode","skills","_shared");if(y.existsSync(i)){let o=p.join(n,"best-practices");y.mkdirSync(o,{recursive:!0});for(let a of y.readdirSync(i,{withFileTypes:!0}))if(a.isFile()&&a.name.endsWith(".md")){let u=p.join(o,a.name);y.existsSync(u)||(y.copyFileSync(p.join(i,a.name),u),s++)}}return s}function pg(t,e,r={}){let n=p.join(t,"rcode/skills"),s=p.join(e,".claude/skills"),i=p.join(e,".rcode/skills");if(!y.existsSync(n))return{count:0,skippedGlobal:0};y.mkdirSync(s,{recursive:!0}),y.mkdirSync(i,{recursive:!0});let o=p.join(Ye(),".claude","skills"),a=r.skipGlobalDuplicates&&y.existsSync(o)?new Set(y.readdirSync(o).filter(m=>m.startsWith("rcode-"))):new Set,u=0,c=0,l=new Map;function d(m){if(l.has(m))return l.get(m);let D=p.join(m,"SKILL.md");if(!y.existsSync(D))return l.set(m,!1),!1;let h=y.readFileSync(D,"utf8"),w=/^internal:\s*true\s*$/m.test(h);return l.set(m,w),w}function f(m){if(!y.existsSync(m))return!1;try{return y.readdirSync(m).some(D=>D.endsWith(".local.md"))}catch{return!1}}function g(m){if(y.existsSync(m))for(let D of y.readdirSync(m,{withFileTypes:!0})){if(!D.isDirectory())continue;let h=p.join(m,D.name);if(y.existsSync(p.join(h,"SKILL.md"))){let C=D.name.startsWith("rcode-")?D.name:`rcode-${D.name}`,A=d(h),T=A?p.join(i,C):p.join(s,C);if(!A&&a.has(C)&&!f(T)){if(y.existsSync(T))try{zu(T,e)}catch{}c++;continue}Dg(h,T),u++}else g(h)}}for(let m of["agents","actions","core"])g(p.join(n,m));return{count:u,skippedGlobal:c}}function Vu(t){if(!t.startsWith(`---
229
+ `&&(w-=1),d.slice(0,w)+f}let y=g;y>0&&d[y-1]===`
230
+ `&&(y-=1);let h=m+s.length;return d[h]===`
231
+ `&&(h+=1),d.slice(0,y)+f+d.slice(h)};var c=l;if(D.mkdirSync(o,{recursive:!0}),!D.existsSync(a))return Oe(a,`#!/bin/sh
232
+ ${i}`,{mode:493}),{action:"created"};let u=D.readFileSync(a,"utf8");if(u.includes(n)){let d=l(u,i);return d!==null&&d!==u?(Oe(a,d,{mode:493}),{action:"updated"}):{action:"already-present"}}return Oe(a,u+i,{mode:493}),{action:"appended"}}catch(u){return{action:"skipped-error",error:u.message}}}function M$(t,e){let r=p.join(t,"rcode","brain"),n=p.join(e,".rcode","brain");D.mkdirSync(n,{recursive:!0});let s=0;for(let o of["sources.yaml","README.md"]){let a=p.join(r,o),c=p.join(n,o);D.existsSync(a)&&!D.existsSync(c)&&(D.copyFileSync(a,c),s++)}let i=p.join(t,"rcode","skills","_shared");if(D.existsSync(i)){let o=p.join(n,"best-practices");D.mkdirSync(o,{recursive:!0});for(let a of D.readdirSync(i,{withFileTypes:!0}))if(a.isFile()&&a.name.endsWith(".md")){let c=p.join(o,a.name);D.existsSync(c)||(D.copyFileSync(p.join(i,a.name),c),s++)}}return s}function Dg(t,e,r={}){let n=p.join(t,"rcode/skills"),s=p.join(e,".claude/skills"),i=p.join(e,".rcode/skills");if(!D.existsSync(n))return{count:0,skippedGlobal:0};D.mkdirSync(s,{recursive:!0}),D.mkdirSync(i,{recursive:!0});let o=p.join(Qe(),".claude","skills"),a=r.skipGlobalDuplicates&&D.existsSync(o)?new Set(D.readdirSync(o).filter(m=>m.startsWith("rcode-"))):new Set,c=0,u=0,l=new Map;function d(m){if(l.has(m))return l.get(m);let y=p.join(m,"SKILL.md");if(!D.existsSync(y))return l.set(m,!1),!1;let h=D.readFileSync(y,"utf8"),w=/^internal:\s*true\s*$/m.test(h);return l.set(m,w),w}function f(m){if(!D.existsSync(m))return!1;try{return D.readdirSync(m).some(y=>y.endsWith(".local.md"))}catch{return!1}}function g(m){if(D.existsSync(m))for(let y of D.readdirSync(m,{withFileTypes:!0})){if(!y.isDirectory())continue;let h=p.join(m,y.name);if(D.existsSync(p.join(h,"SKILL.md"))){let C=y.name.startsWith("rcode-")?y.name:`rcode-${y.name}`,A=d(h),T=A?p.join(i,C):p.join(s,C);if(!A&&a.has(C)&&!f(T)){if(D.existsSync(T))try{Jc(T,e)}catch{}u++;continue}_g(h,T),c++}else g(h)}}for(let m of["agents","actions","core"])g(p.join(n,m));return{count:c,skippedGlobal:u}}function zc(t){if(!t.startsWith(`---
210
233
  `))return{frontmatter:{},body:t};let e=t.indexOf(`
211
234
  ---
212
235
  `,4);if(e===-1)return{frontmatter:{},body:t};let r=t.slice(4,e),n=t.slice(e+5),s={};for(let i of r.split(`
213
- `)){let o=i.replace(/^#.*$/,"").trimEnd();if(!o)continue;let a=o.indexOf(":");if(a===-1)continue;let u=o.slice(0,a).trim(),c=o.slice(a+1).trim();!u||!c||(c.startsWith('"')&&c.endsWith('"')&&(c=c.slice(1,-1)),c.startsWith("'")&&c.endsWith("'")&&(c=c.slice(1,-1)),s[u]=c)}return{frontmatter:s,body:n}}function yg(t){let e=p.join(t,".claude","commands","rcode"),r=p.join(t,".claude","commands");if(!y.existsSync(e)||!y.statSync(e).isDirectory())return{moved:0,removed_dir:!1};let n=0;for(let i of y.readdirSync(e)){let o=p.join(e,i);if(!y.statSync(o).isFile()||!i.endsWith(".md"))continue;let u=p.basename(i,".md").startsWith("rcode-")?i:`rcode-${i}`,c=p.join(r,u);if(y.existsSync(c)){y.unlinkSync(o);continue}y.renameSync(o,c),n++}let s=!1;try{y.rmdirSync(e),s=!0}catch{}return{moved:n,removed_dir:s}}function Ju(t="claude",e=process.cwd()){if(Array.isArray(t)){let f=new Set,g=[];for(let m of t)for(let D of Ju(m,e)){let h=D.rel;f.has(h)||(f.add(h),g.push(D))}return g}let r=[],n=Xu(t,e),s=p.relative(e,n.workflowsDir),i=p.relative(e,n.referencesDir),o=p.relative(e,n.binDir),a=p.relative(e,n.agentsDir),u=p.relative(e,n.commandsDir);for(let f of Ar(p.join($e,"workflows"))){let g=p.relative(p.join($e,"workflows"),f);r.push({src:f,rel:p.join(s,g)})}for(let f of Ar(p.join($e,"references"))){let g=p.relative(p.join($e,"references"),f);r.push({src:f,rel:p.join(i,g)})}for(let f of Ar(p.join($e,"bin"))){let g=p.relative(p.join($e,"bin"),f);r.push({src:f,rel:p.join(o,g),executable:f.endsWith(".cjs")})}for(let f of Ar(p.join($e,"data"))){let g=p.relative(p.join($e,"data"),f);r.push({src:f,rel:p.join(".rcode","data",g)})}let c=p.join($e,"templates","projects"),l=p.relative(e,p.join(e,".rcode","templates","projects"));for(let f of Ar(c)){let g=p.relative(c,f);r.push({src:f,rel:p.join(l,g)})}for(let f of Ar(p.join($e,"agents"))){let g=p.relative(p.join($e,"agents"),f),m=t==="cursor"?".mdc":".md",D=p.basename(f,".md")+m;r.push({src:f,rel:p.join(a,p.dirname(g),D),ide:t,cursor:t==="cursor"})}for(let f of Ar(p.join($e,"commands"))){let g=p.relative(p.join($e,"commands"),f),m=t==="cursor"?".mdc":".md",D=p.basename(f,".md"),h=t==="claude"||t==="vscode"||t==="grok"?`rcode-${D}${m}`:D+m;r.push({src:f,rel:p.join(u,p.dirname(g),h),ide:t,cursor:t==="cursor"})}let d=p.join(e,".rcode","agents-rules");for(let f of Ar(p.join($e,"agents","rules"))){let g=p.relative(p.join($e,"agents","rules"),f);r.push({src:f,rel:p.join(".rcode","agents-rules",g)})}return r}function Pk(t){let e=p.join($e,"modules",`${t}.yaml`);if(!y.existsSync(e))return null;let r=y.readFileSync(e,"utf8"),n={name:t,requires:[],agents:[],workflows:[],commands:[],references:[]},s=null;for(let i of r.split(`
214
- `)){let o=i.replace(/#.*$/,"").trimEnd();if(!o.trim())continue;let a=o.match(/^(\w+):/);if(a&&!o.startsWith(" ")&&!o.startsWith("-")){let u=a[1],c=o.slice(o.indexOf(":")+1).trim();["agents","workflows","commands","references","requires"].includes(u)?(s=u,c&&c!=="[]"&&(n[u]=c.replace(/^\[|\]$/g,"").split(",").map(l=>l.trim().replace(/^["']|["']$/g,"")).filter(Boolean))):(s=null,u==="name"&&(n.name=c.replace(/^["']|["']$/g,"")));continue}if(s&&o.trim().startsWith("-")){let u=o.trim().slice(1).trim().replace(/^["']|["']$/g,"");u&&n[s].push(u)}}return n}function vg(){let t=p.join($e,"modules");return y.existsSync(t)?y.readdirSync(t).filter(e=>e.endsWith(".yaml")).map(e=>e.replace(".yaml","")):[]}function Ok(t,e){if(e.length===0)return t;let r=new Set;for(let n of e){let s=Pk(n);if(!s){console.warn(` \u26A0 Unknown module: ${n}`);continue}for(let i of s.agents)r.add(p.join(".claude","agents",i));for(let i of s.workflows)r.add(p.join(".rcode","workflows",i));for(let i of s.commands)r.add(p.join(".claude","commands",`rcode-${i}`));for(let i of s.references)r.add(p.join(".rcode","references",i))}return t.filter(n=>n.rel.startsWith(p.join(".rcode","bin"))||n.rel.startsWith(p.join(".rcode","data"))?!0:r.has(n.rel))}function Nk(t,e){let r=[["id","file","name","description","color"]],n=new Set,s=new Map,i=u=>(s.has(u)||s.set(u,y.readFileSync(u,"utf8")),s.get(u));for(let u of t){if(!u.rel.startsWith(p.join(".claude","agents"))||!u.rel.match(/^\.claude[\/\\]agents[\/\\][^\/\\]+\.md$/))continue;let c=p.join(e,u.rel),l=i(c),{frontmatter:d}=Vu(l),f=d.name||p.basename(u.rel,".md"),g=f.replace(/^rcode-/,"");if(n.has(g))continue;n.add(g);let m=(d.description||"").replace(/"/g,'""');r.push([g,u.rel,f,`"${m}"`,d.color||""])}let o=p.join(e,".claude","agents");if(y.existsSync(o)){let u=y.readdirSync(o).filter(l=>l.startsWith("rcode-")&&l.endsWith(".md")),c=new Set(t.filter(l=>l.rel.startsWith(p.join(".claude","agents"))).map(l=>p.basename(l.rel)));for(let l of u){if(c.has(l))continue;let d=p.join(o,l),f=i(d),{frontmatter:g}=Vu(f),m=g.name||p.basename(l,".md"),D=m.replace(/^rcode-/,"");if(n.has(D))continue;n.add(D);let h=(g.description||"").replace(/"/g,'""');r.push([D,p.join(".claude","agents",l),m,`"${h}"`,g.color||""])}}let a=[p.join(Ye(),".claude","agents"),p.join(Ye(),".rcode","agents")];try{let u=p.join($e,"agents");y.existsSync(u)&&a.push(u)}catch{}for(let u of a){if(!y.existsSync(u))continue;let c;try{c=y.readdirSync(u).filter(l=>l.startsWith("rcode-")&&l.endsWith(".md"))}catch{continue}for(let l of c){let d=p.join(u,l),f;try{f=i(d)}catch{continue}let{frontmatter:g}=Vu(f),m=g.name||p.basename(l,".md"),D=m.replace(/^rcode-/,"");if(n.has(D))continue;n.add(D);let h=(g.description||"").replace(/"/g,'""');r.push([D,p.join(".claude","agents",l),m,`"${h}"`,g.color||""])}}return r.map(u=>u.join(",")).join(`
236
+ `)){let o=i.replace(/^#.*$/,"").trimEnd();if(!o)continue;let a=o.indexOf(":");if(a===-1)continue;let c=o.slice(0,a).trim(),u=o.slice(a+1).trim();!c||!u||(u.startsWith('"')&&u.endsWith('"')&&(u=u.slice(1,-1)),u.startsWith("'")&&u.endsWith("'")&&(u=u.slice(1,-1)),s[c]=u)}return{frontmatter:s,body:n}}function bg(t){let e=p.join(t,".claude","commands","rcode"),r=p.join(t,".claude","commands");if(!D.existsSync(e)||!D.statSync(e).isDirectory())return{moved:0,removed_dir:!1};let n=0;for(let i of D.readdirSync(e)){let o=p.join(e,i);if(!D.statSync(o).isFile()||!i.endsWith(".md"))continue;let c=p.basename(i,".md").startsWith("rcode-")?i:`rcode-${i}`,u=p.join(r,c);if(D.existsSync(u)){D.unlinkSync(o);continue}D.renameSync(o,u),n++}let s=!1;try{D.rmdirSync(e),s=!0}catch{}return{moved:n,removed_dir:s}}function Qc(t="claude",e=process.cwd()){if(Array.isArray(t)){let f=new Set,g=[];for(let m of t)for(let y of Qc(m,e)){let h=y.rel;f.has(h)||(f.add(h),g.push(y))}return g}let r=[],n=Kc(t,e),s=p.relative(e,n.workflowsDir),i=p.relative(e,n.referencesDir),o=p.relative(e,n.binDir),a=p.relative(e,n.agentsDir),c=p.relative(e,n.commandsDir);for(let f of Ir(p.join(Ae,"workflows"))){let g=p.relative(p.join(Ae,"workflows"),f);r.push({src:f,rel:p.join(s,g)})}for(let f of Ir(p.join(Ae,"references"))){let g=p.relative(p.join(Ae,"references"),f);r.push({src:f,rel:p.join(i,g)})}for(let f of Ir(p.join(Ae,"bin"))){let g=p.relative(p.join(Ae,"bin"),f);r.push({src:f,rel:p.join(o,g),executable:f.endsWith(".cjs")})}for(let f of Ir(p.join(Ae,"data"))){let g=p.relative(p.join(Ae,"data"),f);r.push({src:f,rel:p.join(".rcode","data",g)})}let u=p.join(Ae,"templates","projects"),l=p.relative(e,p.join(e,".rcode","templates","projects"));for(let f of Ir(u)){let g=p.relative(u,f);r.push({src:f,rel:p.join(l,g)})}for(let f of Ir(p.join(Ae,"agents"))){let g=p.relative(p.join(Ae,"agents"),f),m=t==="cursor"?".mdc":".md",y=p.basename(f,".md")+m;r.push({src:f,rel:p.join(a,p.dirname(g),y),ide:t,cursor:t==="cursor"})}for(let f of Ir(p.join(Ae,"commands"))){let g=p.relative(p.join(Ae,"commands"),f),m=t==="cursor"?".mdc":".md",y=p.basename(f,".md"),h=t==="claude"||t==="vscode"||t==="grok"?`rcode-${y}${m}`:y+m;r.push({src:f,rel:p.join(c,p.dirname(g),h),ide:t,cursor:t==="cursor"})}let d=p.join(e,".rcode","agents-rules");for(let f of Ir(p.join(Ae,"agents","rules"))){let g=p.relative(p.join(Ae,"agents","rules"),f);r.push({src:f,rel:p.join(".rcode","agents-rules",g)})}return r}function q$(t){let e=p.join(Ae,"modules",`${t}.yaml`);if(!D.existsSync(e))return null;let r=D.readFileSync(e,"utf8"),n={name:t,requires:[],agents:[],workflows:[],commands:[],references:[]},s=null;for(let i of r.split(`
237
+ `)){let o=i.replace(/#.*$/,"").trimEnd();if(!o.trim())continue;let a=o.match(/^(\w+):/);if(a&&!o.startsWith(" ")&&!o.startsWith("-")){let c=a[1],u=o.slice(o.indexOf(":")+1).trim();["agents","workflows","commands","references","requires"].includes(c)?(s=c,u&&u!=="[]"&&(n[c]=u.replace(/^\[|\]$/g,"").split(",").map(l=>l.trim().replace(/^["']|["']$/g,"")).filter(Boolean))):(s=null,c==="name"&&(n.name=u.replace(/^["']|["']$/g,"")));continue}if(s&&o.trim().startsWith("-")){let c=o.trim().slice(1).trim().replace(/^["']|["']$/g,"");c&&n[s].push(c)}}return n}function Sg(){let t=p.join(Ae,"modules");return D.existsSync(t)?D.readdirSync(t).filter(e=>e.endsWith(".yaml")).map(e=>e.replace(".yaml","")):[]}function W$(t,e){if(e.length===0)return t;let r=new Set;for(let n of e){let s=q$(n);if(!s){console.warn(` \u26A0 Unknown module: ${n}`);continue}for(let i of s.agents)r.add(p.join(".claude","agents",i));for(let i of s.workflows)r.add(p.join(".rcode","workflows",i));for(let i of s.commands)r.add(p.join(".claude","commands",`rcode-${i}`));for(let i of s.references)r.add(p.join(".rcode","references",i))}return t.filter(n=>n.rel.startsWith(p.join(".rcode","bin"))||n.rel.startsWith(p.join(".rcode","data"))?!0:r.has(n.rel))}function H$(t,e){let r=[["id","file","name","description","color"]],n=new Set,s=new Map,i=c=>(s.has(c)||s.set(c,D.readFileSync(c,"utf8")),s.get(c));for(let c of t){if(!c.rel.startsWith(p.join(".claude","agents"))||!c.rel.match(/^\.claude[\/\\]agents[\/\\][^\/\\]+\.md$/))continue;let u=p.join(e,c.rel),l=i(u),{frontmatter:d}=zc(l),f=d.name||p.basename(c.rel,".md"),g=f.replace(/^rcode-/,"");if(n.has(g))continue;n.add(g);let m=(d.description||"").replace(/"/g,'""');r.push([g,c.rel,f,`"${m}"`,d.color||""])}let o=p.join(e,".claude","agents");if(D.existsSync(o)){let c=D.readdirSync(o).filter(l=>l.startsWith("rcode-")&&l.endsWith(".md")),u=new Set(t.filter(l=>l.rel.startsWith(p.join(".claude","agents"))).map(l=>p.basename(l.rel)));for(let l of c){if(u.has(l))continue;let d=p.join(o,l),f=i(d),{frontmatter:g}=zc(f),m=g.name||p.basename(l,".md"),y=m.replace(/^rcode-/,"");if(n.has(y))continue;n.add(y);let h=(g.description||"").replace(/"/g,'""');r.push([y,p.join(".claude","agents",l),m,`"${h}"`,g.color||""])}}let a=[p.join(Qe(),".claude","agents"),p.join(Qe(),".rcode","agents")];try{let c=p.join(Ae,"agents");D.existsSync(c)&&a.push(c)}catch{}for(let c of a){if(!D.existsSync(c))continue;let u;try{u=D.readdirSync(c).filter(l=>l.startsWith("rcode-")&&l.endsWith(".md"))}catch{continue}for(let l of u){let d=p.join(c,l),f;try{f=i(d)}catch{continue}let{frontmatter:g}=zc(f),m=g.name||p.basename(l,".md"),y=m.replace(/^rcode-/,"");if(n.has(y))continue;n.add(y);let h=(g.description||"").replace(/"/g,'""');r.push([y,p.join(".claude","agents",l),m,`"${h}"`,g.color||""])}}return r.map(c=>c.join(",")).join(`
215
238
  `)+`
216
- `}function Lk(t,e,{mergeExistingManifest:r=!1,extraScanDirs:n=[]}={}){let s=[["rel","sha256","size"]],i=new Set,o=new Map,a=c=>(o.has(c)||o.set(c,y.readFileSync(c)),o.get(c));for(let c of t){let l=p.join(e,c.rel);if(!y.existsSync(l))continue;let d=a(l),f=c.rel.split(p.sep).join("/");s.push([f,jn(d),String(d.length)]),i.add(f)}function u(c){if(y.existsSync(c))for(let l of y.readdirSync(c,{withFileTypes:!0})){let d=p.join(c,l.name);if(l.isDirectory())u(d);else if(l.isFile()){let f=p.relative(e,d).split(p.sep).join("/");if(i.has(f)||f.startsWith("..")||p.isAbsolute(f))continue;try{let g=a(d);s.push([f,jn(g),String(g.length)]),i.add(f)}catch{}}}}for(let c of n)u(c);if(r){let c=p.join(e,".rcode","_config","files-manifest.csv");if(y.existsSync(c))try{let l=y.readFileSync(c,"utf8").split(`
217
- `).slice(1).filter(Boolean);for(let d of l){let[f]=d.split(",");if(!f||i.has(f))continue;let g=p.join(e,f);if(!y.existsSync(g))continue;let m=a(g);s.push([f,jn(m),String(m.length)]),i.add(f)}}catch{}}return s.map(c=>c.join(",")).join(`
239
+ `}function Z$(t,e,{mergeExistingManifest:r=!1,extraScanDirs:n=[]}={}){let s=[["rel","sha256","size"]],i=new Set,o=new Map,a=u=>(o.has(u)||o.set(u,D.readFileSync(u)),o.get(u));for(let u of t){let l=p.join(e,u.rel);if(!D.existsSync(l))continue;let d=a(l),f=u.rel.split(p.sep).join("/");s.push([f,Tn(d),String(d.length)]),i.add(f)}function c(u){if(D.existsSync(u))for(let l of D.readdirSync(u,{withFileTypes:!0})){let d=p.join(u,l.name);if(l.isDirectory())c(d);else if(l.isFile()){let f=p.relative(e,d).split(p.sep).join("/");if(i.has(f)||f.startsWith("..")||p.isAbsolute(f))continue;try{let g=a(d);s.push([f,Tn(g),String(g.length)]),i.add(f)}catch{}}}}for(let u of n)c(u);if(r){let u=p.join(e,".rcode","_config","files-manifest.csv");if(D.existsSync(u))try{let l=D.readFileSync(u,"utf8").split(`
240
+ `).slice(1).filter(Boolean);for(let d of l){let[f]=d.split(",");if(!f||i.has(f))continue;let g=p.join(e,f);if(!D.existsSync(g))continue;let m=a(g);s.push([f,Tn(m),String(m.length)]),i.add(f)}}catch{}}return s.map(u=>u.join(",")).join(`
218
241
  `)+`
219
- `}function Bk(t,e){let r=p.join(t,".rcode","_config","files-manifest.csv");if(!y.existsSync(r))return 0;let n;try{n=y.readFileSync(r,"utf8").split(`
220
- `).slice(1).filter(Boolean).map(f=>f.split(",")[0]).filter(Boolean)}catch{return 0}let s=new Set(e.map(d=>d.rel.split(p.sep).join("/"))),i=/^(\.rcode\/config\.yaml|\.rcode\/state\.json|\.rcode\/state\.json\.lock|\.planning\/|\.rcode\/brain\/sources\.yaml)/,o=d=>/\.local\.(md|mdc|json|yaml|yml|toml|js|ts)$/.test(d),a=0,u=new Set,c=p.resolve(t);for(let d of n){if(s.has(d)||i.test(d)||o(d)||d.includes("..")||p.isAbsolute(d))continue;let f=p.join(t,d);if(!y.existsSync(f))continue;zu(f,c).ok&&(u.add(p.dirname(f)),a+=1)}let l=Array.from(u).sort((d,f)=>f.length-d.length);for(let d of l)try{y.existsSync(d)&&y.readdirSync(d).length===0&&y.rmdirSync(d)}catch(f){console.error("[install] sweepStaleInstalledFiles: failed to remove empty dir",d+":",f?.message||f)}return a}function Mk(t){let e=p.join(t,"package.json"),r=p.join(t,"pnpm-lock.yaml");if(!y.existsSync(e)||!y.existsSync(r))return{ok:!0};try{let n=JSON.parse(y.readFileSync(e,"utf8")),s=Object.prototype.hasOwnProperty.call(n.dependencies||{},"@hanzlaa/rcode"),i=Object.prototype.hasOwnProperty.call(n.devDependencies||{},"@hanzlaa/rcode");return!s&&!i?{ok:!1,message:"@hanzlaa/rcode not found in package.json \u2014 if you ran `pnpm add -D @hanzlaa/rcode` and it reported success, your lockfile may be corrupted.\n Fix: pnpm install --fix-lockfile && pnpm add -D @hanzlaa/rcode"}:{ok:!0}}catch{return{ok:!0}}}function We(){try{return JSON.parse(y.readFileSync(p.join(Et,"package.json"),"utf8")).version||"0.0.0"}catch{return"0.0.0"}}function mg(t){let e=We(),r=t.modules.length>0?t.modules:vg(),n=[],s=null,i=p.join(t.target,".rcode","_config","manifest.yaml");if(y.existsSync(i)){let c=y.readFileSync(i,"utf8"),l=!1;for(let d of c.split(`
221
- `)){if(d.startsWith("version:")){let f=d.replace("version:","").trim();Fn.valid(f)&&f!==e&&(s=f)}if(d.startsWith("modules:")){l=!0;continue}l&&d.trim().startsWith("-")?n.push(d.trim().slice(1).trim()):l&&!d.startsWith(" ")&&(l=!1)}}let a=[...new Set([...n,...r])].map(c=>` - ${c}`).join(`
222
- `),u=["# rcode v2 install manifest",`version: ${e}`,`installDate: ${new Date().toISOString()}`];return s&&u.push(`previous_version: ${s}`),u.push("modules:",a,"ides:"," - claude-code",""),u.join(`
223
- `)}function Po(t){return(t||"").replace(/[\n\r]/g," ").replace(/"/g,'\\"')}function qk(t){return["# rcode v2 project config","# Generated by install. Safe to edit.",`user_name: "${Po(t.userName)}"`,`project_name: "${Po(t.projectName)}"`,`communication_language: "${Po(t.language)}"`,`mode: "${Po(t.mode)}"`,'model_profile: "balanced"',`commit_planning: ${t.commitPlanning!==!1}`,"workflow:"," research_by_default: false"," plan_checker: true"," post_execute_gates: true"," ui_safety_gate: true","git:",' branching_strategy: "none"',""].join(`
224
- `)}function Wk(t){let e=xk.safeParse(t);return e.success?{valid:!0}:{valid:!1,errors:e.error.issues.map(n=>` ${n.path.join(".")||"(root)"}: ${n.message}`)}}function Hk(t){let e={},r=null;for(let n of t.split(`
225
- `)){let s=n.replace(/#.*$/,"");if(!s.trim())continue;let i=s.match(/^(\s*)/)[1].length;if(i===0){let o=s.indexOf(":");if(o===-1)continue;let a=s.slice(0,o).trim(),u=s.slice(o+1).trim();if(u===""){r=a,e[a]={};continue}r=null,u.startsWith('"')&&u.endsWith('"')&&(u=u.slice(1,-1)),u.startsWith("'")&&u.endsWith("'")&&(u=u.slice(1,-1)),u==="true"?u=!0:u==="false"&&(u=!1),e[a]=u}else if(r&&i>0){let o=s.indexOf(":");if(o===-1)continue;let a=s.slice(0,o).trim(),u=s.slice(o+1).trim();u.startsWith('"')&&u.endsWith('"')&&(u=u.slice(1,-1)),u==="true"?u=!0:u==="false"&&(u=!1),e[r][a]=u}}return e}async function Ku(t){if(t.help)return gg(),0;if(t.reset&&!t.force)return console.log(""),console.log(" "+_t("--reset has no effect without --force.")),console.log(" "+Y(" --reset wipes config.yaml and state.json. To prevent accidental data loss,")),console.log(" "+Y(" it must be paired with --force. Re-run as:")),console.log(" "+Y(" rcode install --reset --force")),console.log(""),2;let e=()=>{};if(!t.global){let r=Zk(t.target);if(!r.ok)return console.log(""),console.log(" "+_t(`Another install is already running here (PID ${r.pid}).`)),console.log(" "+Y(` Lock: ${r.lockPath}`)),console.log(" "+Y(" If the other process crashed, delete the lock file and retry:")),console.log(" "+Y(` rm ${r.lockPath}`)),console.log(""),3;e=r.release,process.on("exit",e)}try{return await Uk(t)}finally{e(),process.removeListener("exit",e)}}function Zk(t){let e=p.join(t,".rcode"),r=p.join(e,".install.lock");try{y.mkdirSync(e,{recursive:!0})}catch{}function n(s){try{return process.kill(s,0),!0}catch{return!1}}for(let s=0;s<2;s++)try{let i=y.openSync(r,"wx");return y.writeSync(i,String(process.pid)),y.closeSync(i),{ok:!0,release:()=>{try{y.unlinkSync(r)}catch(o){console.error("[install] acquireInstallLock: failed to release lock",r+":",o?.message||o)}}}}catch(i){if(i.code!=="EEXIST")throw i;let o=0;try{o=parseInt(y.readFileSync(r,"utf8"),10)}catch(a){console.error("[install] acquireInstallLock: failed to read lock pid from",r+":",a?.message||a)}if(o&&!n(o)){try{y.unlinkSync(r)}catch{}continue}return{ok:!1,pid:o,lockPath:r}}return{ok:!1,pid:0,lockPath:r}}function Qu(t){let e=Ye(),r=p.join(e,".rcode","slash-commands"),n=p.join(e,".rcode","bin");jt(r),jt(n);let s=p.join($e,"commands"),i=0;for(let u of y.readdirSync(s))u.endsWith(".md")&&(y.copyFileSync(p.join(s,u),p.join(r,u)),i++);let o=p.join(Et,"cli","rcode-slash-router.cjs"),a=p.join(n,"rcode-slash-router.cjs");return y.copyFileSync(o,a),t&&t.global!=="silent"&&console.log(" "+or(`Slash-router: ${i} command bodies \u2192 ~/.rcode/slash-commands/ + router \u2192 ~/.rcode/bin/`)),a}function _g(){return`node "${p.join(Ye(),".rcode","bin","rcode-slash-router.cjs")}"`}function Eg(t,e,r,n){let s={};if(y.existsSync(t))try{s=JSON.parse(y.readFileSync(t,"utf8"))||{}}catch{return console.log(" "+_t(`${n}: ${t} is not valid JSON \u2014 skipped slash-router wiring.`)),!1}return(!s.hooks||typeof s.hooks!="object")&&(s.hooks={}),Array.isArray(s.hooks[e])||(s.hooks[e]=[]),s.hooks[e].some(o=>Array.isArray(o?.hooks)&&o.hooks.some(a=>typeof a?.command=="string"&&a.command.includes("rcode-slash-router.cjs")))?(console.log(" "+or(`${n}: slash-router hook already present (idempotent).`)),!1):(s.hooks[e].push({hooks:[{type:"command",command:r,timeout:10}]}),jt(p.dirname(t)),y.writeFileSync(t,JSON.stringify(s,null,2)+`
226
- `),console.log(" "+or(`${n}: wired slash-router into ${e} hook (existing hooks preserved).`)),!0)}function bg(t){Qu(t);let e=p.join(Ye(),".codex","hooks.json");Eg(e,"UserPromptSubmit",_g(),"Codex")}function Sg(t){Qu(t);let e=p.join(Ye(),".gemini","antigravity","settings.json");Eg(e,"UserPrompt",_g(),"Antigravity")}function Gu(t){if(!t||!t.global)return;let e=Array.isArray(t.ides)?t.ides:[t.ide].filter(Boolean);for(let r of e)switch(r){case"codex":bg(t);break;case"antigravity":Sg(t);break;default:break}}async function Uk(t){let e=We();process.stdin.isTTY&&!t.yes&&kk(e),t.ides=await Ak(t),t.commitPlanning=await Fk(t),console.log(`
227
- \u{1F54C} ${Ft("rcode")} ${X.cyan("v"+e)} ${Y("\u2192")} ${t.target}`);let n=p.join(t.target,".rcode","_config","manifest.yaml");if(y.existsSync(n)){let x=y.readFileSync(n,"utf8").match(/^version:\s*(.+)$/m),j=x?x[1].trim():"unknown",R=Fn.valid(j)&&Fn.valid(e)?Fn.lt(j,e):j!==e;console.log(R?" "+Ro(`Upgrading ${X.dim("v"+j)} \u2192 ${X.green("v"+e)} (config + state + .planning preserved)`):" "+Ro(`Refreshing v${j} (config + state + .planning preserved)`)),t.force||console.log(Y(" Pass --force to also sweep orphaned files from the previous version."))}if(!y.existsSync($e))return console.error(`\u2716 Source tree not found at ${$e}. Running from wrong dir?`),1;t.ides=t.ides.map(x=>x==="claude-code"?"claude":x);let s=t.ides.filter(x=>!os.includes(x));if(s.length>0)return console.error(`\u2716 --ide ${s.join(", ")} is not supported in v${We()}.`),console.error(""),console.error(" Currently supported:"),console.error(" claude \u2014 Claude Code native (recommended)"),console.error(" cursor \u2014 Cursor IDE"),console.error(" codex \u2014 Codex CLI"),console.error(" gemini \u2014 Gemini CLI (planned \u2014 not yet implemented)"),console.error(" vscode \u2014 VS Code (with Claude Code / Continue / Copilot extension)"),console.error(" windsurf \u2014 Windsurf (Codeium)"),console.error(" antigravity \u2014 Antigravity (experimental)"),console.error(" grok \u2014 Grok Build (xAI CLI, Claude-Code-compatible)"),console.error(""),console.error(" Tracked for future:"),console.error(" jetbrains \u2014 IntelliJ / PyCharm"),console.error(" zed \u2014 Zed editor"),console.error(""),1;if(t.ides.includes("vscode")&&console.log(" "+Y("VS Code \u2192 installing to .claude/ paths (read by Claude Code / Continue / Copilot extensions).")),t.ides.includes("codex")&&(console.log(" "+Y("Codex \u2192 installing to .claude/ paths + AGENTS.md. Use `rcode workflow show <name>` to feed workflows to Codex.")),t.global||console.log(" "+_t("Codex /rcode-* slash commands need a GLOBAL install \u2014 re-run with `--global` to wire the ~/.codex/hooks.json router. This project-local install does NOT enable them."))),t.ides.includes("gemini")&&(console.log(`
242
+ `}function U$(t,e){let r=p.join(t,".rcode","_config","files-manifest.csv");if(!D.existsSync(r))return 0;let n;try{n=D.readFileSync(r,"utf8").split(`
243
+ `).slice(1).filter(Boolean).map(f=>f.split(",")[0]).filter(Boolean)}catch{return 0}let s=new Set(e.map(d=>d.rel.split(p.sep).join("/"))),i=/^(\.rcode\/config\.yaml|\.rcode\/state\.json|\.rcode\/state\.json\.lock|\.planning\/|\.rcode\/brain\/sources\.yaml)/,o=d=>/\.local\.(md|mdc|json|yaml|yml|toml|js|ts)$/.test(d),a=0,c=new Set,u=p.resolve(t);for(let d of n){if(s.has(d)||i.test(d)||o(d)||d.includes("..")||p.isAbsolute(d))continue;let f=p.join(t,d);if(!D.existsSync(f))continue;Jc(f,u).ok&&(c.add(p.dirname(f)),a+=1)}let l=Array.from(c).sort((d,f)=>f.length-d.length);for(let d of l)try{D.existsSync(d)&&D.readdirSync(d).length===0&&D.rmdirSync(d)}catch(f){console.error("[install] sweepStaleInstalledFiles: failed to remove empty dir",d+":",f?.message||f)}return a}function V$(t){let e=p.join(t,"package.json"),r=p.join(t,"pnpm-lock.yaml");if(!D.existsSync(e)||!D.existsSync(r))return{ok:!0};try{let n=JSON.parse(D.readFileSync(e,"utf8")),s=Object.prototype.hasOwnProperty.call(n.dependencies||{},"@hanzlaa/rcode"),i=Object.prototype.hasOwnProperty.call(n.devDependencies||{},"@hanzlaa/rcode");return!s&&!i?{ok:!1,message:"@hanzlaa/rcode not found in package.json \u2014 if you ran `pnpm add -D @hanzlaa/rcode` and it reported success, your lockfile may be corrupted.\n Fix: pnpm install --fix-lockfile && pnpm add -D @hanzlaa/rcode"}:{ok:!0}}catch{return{ok:!0}}}function Ve(){try{return JSON.parse(D.readFileSync(p.join(dt,"package.json"),"utf8")).version||"0.0.0"}catch{return"0.0.0"}}function yg(t){let e=Ve(),r=t.modules.length>0?t.modules:Sg(),n=[],s=null,i=p.join(t.target,".rcode","_config","manifest.yaml");if(D.existsSync(i)){let u=D.readFileSync(i,"utf8"),l=!1;for(let d of u.split(`
244
+ `)){if(d.startsWith("version:")){let f=d.replace("version:","").trim();In.valid(f)&&f!==e&&(s=f)}if(d.startsWith("modules:")){l=!0;continue}l&&d.trim().startsWith("-")?n.push(d.trim().slice(1).trim()):l&&!d.startsWith(" ")&&(l=!1)}}let a=[...new Set([...n,...r])].map(u=>` - ${u}`).join(`
245
+ `),c=["# rcode v2 install manifest",`version: ${e}`,`installDate: ${new Date().toISOString()}`];return s&&c.push(`previous_version: ${s}`),c.push("modules:",a,"ides:"," - claude-code",""),c.join(`
246
+ `)}function No(t){return(t||"").replace(/[\n\r]/g," ").replace(/"/g,'\\"')}function G$(t){return["# rcode v2 project config","# Generated by install. Safe to edit.",`user_name: "${No(t.userName)}"`,`project_name: "${No(t.projectName)}"`,`communication_language: "${No(t.language)}"`,`mode: "${No(t.mode)}"`,'model_profile: "balanced"',`commit_planning: ${t.commitPlanning!==!1}`,"workflow:"," research_by_default: false"," plan_checker: true"," post_execute_gates: true"," ui_safety_gate: true","git:",' branching_strategy: "none"',""].join(`
247
+ `)}function z$(t){let e=A$.safeParse(t);return e.success?{valid:!0}:{valid:!1,errors:e.error.issues.map(n=>` ${n.path.join(".")||"(root)"}: ${n.message}`)}}function Y$(t){let e={},r=null;for(let n of t.split(`
248
+ `)){let s=n.replace(/#.*$/,"");if(!s.trim())continue;let i=s.match(/^(\s*)/)[1].length;if(i===0){let o=s.indexOf(":");if(o===-1)continue;let a=s.slice(0,o).trim(),c=s.slice(o+1).trim();if(c===""){r=a,e[a]={};continue}r=null,c.startsWith('"')&&c.endsWith('"')&&(c=c.slice(1,-1)),c.startsWith("'")&&c.endsWith("'")&&(c=c.slice(1,-1)),c==="true"?c=!0:c==="false"&&(c=!1),e[a]=c}else if(r&&i>0){let o=s.indexOf(":");if(o===-1)continue;let a=s.slice(0,o).trim(),c=s.slice(o+1).trim();c.startsWith('"')&&c.endsWith('"')&&(c=c.slice(1,-1)),c==="true"?c=!0:c==="false"&&(c=!1),e[r][a]=c}}return e}async function eu(t){if(t.help)return vg(),0;if(t.reset&&!t.force)return console.log(""),console.log(" "+Et("--reset has no effect without --force.")),console.log(" "+Y(" --reset wipes config.yaml and state.json. To prevent accidental data loss,")),console.log(" "+Y(" it must be paired with --force. Re-run as:")),console.log(" "+Y(" rcode install --reset --force")),console.log(""),2;let e=()=>{};if(!t.global){let r=J$(t.target);if(!r.ok)return console.log(""),console.log(" "+Et(`Another install is already running here (PID ${r.pid}).`)),console.log(" "+Y(` Lock: ${r.lockPath}`)),console.log(" "+Y(" If the other process crashed, delete the lock file and retry:")),console.log(" "+Y(` rm ${r.lockPath}`)),console.log(""),3;e=r.release,process.on("exit",e)}try{return await X$(t)}finally{e(),process.removeListener("exit",e)}}function J$(t){let e=p.join(t,".rcode"),r=p.join(e,".install.lock");try{D.mkdirSync(e,{recursive:!0})}catch{}function n(s){try{return process.kill(s,0),!0}catch{return!1}}for(let s=0;s<2;s++)try{let i=D.openSync(r,"wx");return D.writeSync(i,String(process.pid)),D.closeSync(i),{ok:!0,release:()=>{try{D.unlinkSync(r)}catch(o){console.error("[install] acquireInstallLock: failed to release lock",r+":",o?.message||o)}}}}catch(i){if(i.code!=="EEXIST")throw i;let o=0;try{o=parseInt(D.readFileSync(r,"utf8"),10)}catch(a){console.error("[install] acquireInstallLock: failed to read lock pid from",r+":",a?.message||a)}if(o&&!n(o)){try{D.unlinkSync(r)}catch{}continue}return{ok:!1,pid:o,lockPath:r}}return{ok:!1,pid:0,lockPath:r}}function tu(t){let e=Qe(),r=p.join(e,".rcode","slash-commands"),n=p.join(e,".rcode","bin");Rt(r),Rt(n);let s=p.join(Ae,"commands"),i=0;for(let c of D.readdirSync(s))c.endsWith(".md")&&(D.copyFileSync(p.join(s,c),p.join(r,c)),i++);let o=p.join(dt,"cli","rcode-slash-router.cjs"),a=p.join(n,"rcode-slash-router.cjs");return D.copyFileSync(o,a),t&&t.global!=="silent"&&console.log(" "+ar(`Slash-router: ${i} command bodies \u2192 ~/.rcode/slash-commands/ + router \u2192 ~/.rcode/bin/`)),a}function Eg(){return`node "${p.join(Qe(),".rcode","bin","rcode-slash-router.cjs")}"`}function Cg(t,e,r,n){let s={};if(D.existsSync(t))try{s=JSON.parse(D.readFileSync(t,"utf8"))||{}}catch{return console.log(" "+Et(`${n}: ${t} is not valid JSON \u2014 skipped slash-router wiring.`)),!1}return(!s.hooks||typeof s.hooks!="object")&&(s.hooks={}),Array.isArray(s.hooks[e])||(s.hooks[e]=[]),s.hooks[e].some(o=>Array.isArray(o?.hooks)&&o.hooks.some(a=>typeof a?.command=="string"&&a.command.includes("rcode-slash-router.cjs")))?(console.log(" "+ar(`${n}: slash-router hook already present (idempotent).`)),!1):(s.hooks[e].push({hooks:[{type:"command",command:r,timeout:10}]}),Rt(p.dirname(t)),D.writeFileSync(t,JSON.stringify(s,null,2)+`
249
+ `),console.log(" "+ar(`${n}: wired slash-router into ${e} hook (existing hooks preserved).`)),!0)}function wg(t){tu(t);let e=p.join(Qe(),".codex","hooks.json");Cg(e,"UserPromptSubmit",Eg(),"Codex")}function xg(t){tu(t);let e=p.join(Qe(),".gemini","antigravity","settings.json");Cg(e,"UserPrompt",Eg(),"Antigravity")}function Yc(t){if(!t||!t.global)return;let e=Array.isArray(t.ides)?t.ides:[t.ide].filter(Boolean);for(let r of e)switch(r){case"codex":wg(t);break;case"antigravity":xg(t);break;default:break}}async function X$(t){let e=Ve();process.stdin.isTTY&&!t.yes&&j$(e),t.ides=await I$(t),t.commitPlanning=await T$(t),t.enableHooks=await R$(t),console.log(`
250
+ \u{1F54C} ${Tt("rcode")} ${J.cyan("v"+e)} ${Y("\u2192")} ${t.target}`);let n=p.join(t.target,".rcode","_config","manifest.yaml");if(D.existsSync(n)){let $=D.readFileSync(n,"utf8").match(/^version:\s*(.+)$/m),j=$?$[1].trim():"unknown",O=In.valid(j)&&In.valid(e)?In.lt(j,e):j!==e;console.log(O?" "+Oo(`Upgrading ${J.dim("v"+j)} \u2192 ${J.green("v"+e)} (config + state + .planning preserved)`):" "+Oo(`Refreshing v${j} (config + state + .planning preserved)`)),t.force||console.log(Y(" Pass --force to also sweep orphaned files from the previous version."))}if(!D.existsSync(Ae))return console.error(`\u2716 Source tree not found at ${Ae}. Running from wrong dir?`),1;t.ides=t.ides.map($=>$==="claude-code"?"claude":$);let s=t.ides.filter($=>!as.includes($));if(s.length>0)return console.error(`\u2716 --ide ${s.join(", ")} is not supported in v${Ve()}.`),console.error(""),console.error(" Currently supported:"),console.error(" claude \u2014 Claude Code native (recommended)"),console.error(" cursor \u2014 Cursor IDE"),console.error(" codex \u2014 Codex CLI"),console.error(" gemini \u2014 Gemini CLI (planned \u2014 not yet implemented)"),console.error(" vscode \u2014 VS Code (with Claude Code / Continue / Copilot extension)"),console.error(" windsurf \u2014 Windsurf (Codeium)"),console.error(" antigravity \u2014 Antigravity (experimental)"),console.error(" grok \u2014 Grok Build (xAI CLI, Claude-Code-compatible)"),console.error(""),console.error(" Tracked for future:"),console.error(" jetbrains \u2014 IntelliJ / PyCharm"),console.error(" zed \u2014 Zed editor"),console.error(""),1;if(t.ides.includes("vscode")&&console.log(" "+Y("VS Code \u2192 installing to .claude/ paths (read by Claude Code / Continue / Copilot extensions).")),t.ides.includes("codex")&&(console.log(" "+Y("Codex \u2192 installing to .claude/ paths + AGENTS.md. Use `rcode workflow show <name>` to feed workflows to Codex.")),t.global||console.log(" "+Et("Codex /rcode-* slash commands need a GLOBAL install \u2014 re-run with `--global` to wire the ~/.codex/hooks.json router. This project-local install does NOT enable them."))),t.ides.includes("gemini")&&(console.log(`
228
251
  \u26A0\uFE0F Gemini CLI install not yet implemented
229
252
  `),console.log("Gemini IDE requires aggregating all agents and commands into a single GEMINI.md file."),console.log(`This feature is planned but not yet available.
230
253
  `),console.log(`For now, use: --ide claude or --ide cursor
231
- `),t.ides=t.ides.filter(x=>x!=="gemini"),t.ides.length===0))return 1;if(t.ides.includes("antigravity")&&(t.global?(console.log(" "+_t("Antigravity install is experimental. Files land at .antigravity/rcode/{agents,commands}/.")),console.log(" "+Y("If Antigravity expects a different path, adjust .rcode/config.yaml and re-run."))):console.log(" "+_t("Antigravity /rcode-* slash commands need a GLOBAL install \u2014 re-run with `--global`. Skipping .antigravity/ files on this project-local install (they would be inert)."))),t.modules.length>0){let x=vg(),j=t.modules.filter(R=>!x.includes(R));if(j.length>0)return console.error(`\u2716 Unknown module(s): ${j.join(", ")}`),console.error(` Available modules: ${x.join(", ")}`),1}if(Array.isArray(t.ides)&&t.ides.includes("vscode")||t.ide==="vscode"){let x=yg(t.target);x.moved>0&&console.log(` \u21BB Migrated ${x.moved} legacy vscode-layout command(s) to .claude/commands/rcode-{name}.md`)}let i=!t.global&&Array.isArray(t.ides)?t.ides.filter(x=>x!=="antigravity"):t.ides,o=Ju(i,t.target),a=Ok(o,t.modules);if(a.length===0)return Array.isArray(t.ides)&&t.ides.includes("antigravity")&&!t.global?(console.error("\u2716 Nothing to install \u2014 Antigravity was the only target IDE, and its files need a GLOBAL install."),console.error(" Re-run with --global, or pick another --ide."),1):(console.error("\u2716 Nothing to install \u2014 install plan is empty."),t.modules.length>0&&console.error(` Modules requested: ${t.modules.join(", ")}`),1);if(t.modules.length>0&&console.log(` Modules: ${t.modules.join(", ")}`),t.dryRun||t.listFiles){console.log("DRY RUN: the following paths would be written:");for(let x of a)console.log(" + "+x.rel);return 0}if(t.forceOverwrite&&!t.noBackup){let x=$k(t.target,a);if(x.ok)console.log(" "+Ro(`${X.dim("--force-overwrite")} backup: ${X.cyan(x.path)} ${X.dim("("+x.fileCount+" files \u2014 restore with: tar -xzf "+x.path+")")}`));else if(x.fileCount>0)return console.error(""),console.error(`\u2716 Could not create backup: ${x.warning}`),console.error(" Refusing to --force-overwrite without a backup. Pass --no-backup to override."),console.error(""),1}let u=0;t.force&&(u=Bk(t.target,a));let c=new Map;if(t.nonDestructive){let x=p.join(t.target,".rcode","_config","files-manifest.csv");if(y.existsSync(x))try{let j=y.readFileSync(x,"utf8").split(`
232
- `).slice(1).filter(Boolean);for(let R of j){let[N,ee]=R.split(",");N&&ee&&c.set(N,ee)}}catch{}}let l=0,d=0,f=0,g=0,m=[],D=[],h=[],w=Sk(Y(`Installing ${a.length} files\u2026`),{color:"cyan"}).start();for(let x of a){let j=p.join(t.target,x.rel),R=x.rel.split(p.sep).join("/");jt(p.dirname(j));let N=null,ee=null,de=()=>(N||(N=y.readFileSync(j)),N),St=()=>(ee||(ee=y.readFileSync(x.src)),ee);if(t.nonDestructive&&!t.forceOverwrite&&!t.acceptAll&&y.existsSync(j)){let Ot=c.get(R);if(Ot){let ur=de().toString("utf8");if(jn(de())!==Ot){let Xt=St().toString("utf8"),jc=dg(R,R,ur,Xt,"installed","source"),Ic=0,Tc=0;for(let Es of jc.split(`
233
- `))Es.startsWith("+")&&!Es.startsWith("+++")&&Ic++,Es.startsWith("-")&&!Es.startsWith("---")&&Tc++;f+=1,m.push(R),D.push({rel:R,insertions:Ic,deletions:Tc,patch:jc}),d+=1;continue}}}if(y.existsSync(j)&&!t.force&&!t.forceOverwrite){let Ot=jn(de()),ur=jn(St());if(Ot===ur){d++;continue}if(!t.yes&&!t.nonDestructive){h.push({rel:R,src:x.src,destPath:j,existingContent:de().toString("utf8"),sourceContent:St().toString("utf8")}),d++;continue}}if(y.existsSync(j)&&t.forceOverwrite){let Ot=de(),ur=St();Ot.equals(ur)||w.update({text:Y(`overwriting ${x.rel}`)})}let Pt=St().toString("utf8");x.cursor&&(Pt=Pt),y.writeFileSync(j,Pt,"utf8"),x.executable&&y.chmodSync(j,493),l++}if(w.success({text:or(`${l} files installed`)}),h.length>0){let x={workflows:[],agents:[],commands:[],skills:[],references:[],other:[]};for(let j of h)j.rel.includes("/workflows/")?x.workflows.push(j):j.rel.includes("/agents/")?x.agents.push(j):j.rel.includes("/commands/")?x.commands.push(j):j.rel.includes("/skills/")?x.skills.push(j):j.rel.includes("/references/")?x.references.push(j):x.other.push(j);console.log(""),console.log(" "+_t(`${h.length} file${h.length===1?"":"s"} have local edits AND v${We()} updates:`));for(let[j,R]of Object.entries(x))R.length!==0&&console.log(" "+Y(`${R.length} ${j}`));if(console.log(""),!t.yes&&process.stdin.isTTY){let j=await nt.select({message:"How should we handle these?",initialValue:"review",options:[{value:"review",label:"Review each one",hint:"see the diff, decide per file"},{value:"upstream",label:"Take v"+We()+" for all",hint:"lose local edits, get all bug fixes"},{value:"keep",label:"Keep my local edits",hint:"skip v"+We()+" updates for these files (current behaviour)"}]});if(nt.isCancel(j))nt.note("Skipped \u2014 local edits preserved.");else if(j==="upstream"){let R=0;for(let N of h)y.writeFileSync(N.destPath,N.sourceContent,"utf8"),R++;g+=R,console.log(" "+or(`Applied v${We()} to ${R} file${R===1?"":"s"}.`))}else if(j==="review"){let R=0,N=0;for(let ee of h){let de=dg(ee.rel,ee.rel,ee.existingContent,ee.sourceContent,"local","v"+We()),St=0,Pt=0;for(let cr of de.split(`
234
- `))cr.startsWith("+")&&!cr.startsWith("+++")&&St++,cr.startsWith("-")&&!cr.startsWith("---")&&Pt++;console.log(""),console.log(" "+X.bold(ee.rel)+Y(" ")+X.green(`+${St}`)+" "+X.red(`-${Pt}`));let Ot=await nt.select({message:"Take upstream, keep local, or view diff?",initialValue:"view",options:[{value:"upstream",label:"Take v"+We()},{value:"keep",label:"Keep local"},{value:"view",label:"View diff first"}]}),ur=Ot;if(nt.isCancel(Ot)||Ot==="view"){for(let Xt of de.split(`
235
- `).slice(4))Xt.startsWith("+")?process.stdout.write(X.green(Xt)+`
236
- `):Xt.startsWith("-")?process.stdout.write(X.red(Xt)+`
237
- `):Xt.startsWith("@")?process.stdout.write(X.cyan(Xt)+`
238
- `):process.stdout.write(Y(Xt)+`
239
- `);let cr=await nt.select({message:"Now: take upstream or keep local?",initialValue:"keep",options:[{value:"upstream",label:"Take v"+We()},{value:"keep",label:"Keep local"}]});ur=nt.isCancel(cr)?"keep":cr}ur==="upstream"?(y.writeFileSync(ee.destPath,ee.sourceContent,"utf8"),R++):N++}g+=R,console.log(" "+or(`Review complete: ${R} applied, ${N} kept local.`))}else console.log(" "+Y(`${h.length} file${h.length===1?"":"s"} kept local. Re-run with --force-overwrite or 'rcode update' anytime.`))}else console.log(" "+Y(`Re-run with --force-overwrite to apply v${We()} updates, or pipe through an interactive shell to resolve per-file.`));console.log("")}if(g>0&&(console.log(" "+or(`Total this run: ${l} installed \xB7 ${g} updated \xB7 ${f+d} unchanged.`)),console.log("")),t.global){let x=p.join(t.target,".rcode","_config");jt(x),y.writeFileSync(p.join(x,"manifest.yaml"),mg(t));let R=pg(Et,t.target).count;try{let{main:N}=require(p.join(Et,"cli","generate-command-skills.cjs")),ee=p.join(t.target,".claude","skills"),de=N(Et,ee,We(),{skipGlobalDuplicates:!0});R+=de.generated}catch{}console.log(""),console.log(` ${Y(`${R} skills installed globally`)}`);try{Gu(t)}catch(N){process.stderr.write(X.yellow(`WARNING: native slash-command install skipped: ${N?.message||N}`)+`
240
- `)}return 0}let C=p.join(Ye(),".claude","commands"),A=p.join(t.target,".claude","commands"),T=t.target!==Ye()&&!t.localOnly;if(T&&!t.forceOverwrite)try{let x=y.existsSync(C)&&(y.readdirSync(C).some(R=>R.startsWith("rcode-")&&R.endsWith(".md"))||y.existsSync(p.join(C,"rcode"))),j=y.existsSync(A)&&(y.readdirSync(A).some(R=>R.startsWith("rcode-")&&R.endsWith(".md"))||y.existsSync(p.join(A,"rcode")));if(x&&!j){let R=a.length,N=a.filter(ee=>!ee.rel.split(p.sep).join("/").startsWith(".claude/commands/"));N.length<R&&(a.length=0,N.forEach(ee=>a.push(ee)),console.log(" "+Y("Global rcode commands detected in ~/.claude/ \u2014 skipping project-level command install to avoid duplicates.")),console.log(" "+Y("Use --force-overwrite to install locally anyway.")))}else if(x&&j){try{let N=y.readdirSync(A).filter(de=>de.startsWith("rcode-")&&de.endsWith(".md"));for(let de of N)y.unlinkSync(p.join(A,de));let ee=p.join(A,"rcode");y.existsSync(ee)&&zu(ee,t.target),console.log(" "+Y("Removed duplicate project-level rcode commands (global ones in ~/.claude/ take precedence)."))}catch{}let R=a.filter(N=>!N.rel.split(p.sep).join("/").startsWith(".claude/commands/"));a.length=0,R.forEach(N=>a.push(N))}}catch{}let G=p.join(t.target,".rcode","_config");jt(G),jt(p.join(t.target,".planning")),y.writeFileSync(p.join(G,"manifest.yaml"),mg(t)),y.writeFileSync(p.join(G,"agent-manifest.csv"),Nk(a,t.target));let I=p.join(t.target,".rcode","config.yaml"),Z=p.join(t.target,".rcode","state.json"),F=!1;if(t.reset&&t.force?(y.existsSync(I)&&y.unlinkSync(I),y.existsSync(Z)&&y.unlinkSync(Z)):t.force&&(y.existsSync(I)||y.existsSync(Z))&&(F=!0),!y.existsSync(I))It(I,qk(t));else try{let x=y.readFileSync(I,"utf8"),j=t.commitPlanning!==!1,R=/^commit_planning:\s*(true|false)\s*$/m,N=x.match(R),ee=N?N[1]==="true":null;if(N&&ee!==j){let de=x.replace(R,`commit_planning: ${j}`);It(I,de),console.log(" "+Y(`Updated commit_planning in config.yaml (${ee} \u2192 ${j}) \u2014 closes #685.`))}else if(!N){let de=x.replace(/\n*$/,"")+`
254
+ `),t.ides=t.ides.filter($=>$!=="gemini"),t.ides.length===0))return 1;if(t.ides.includes("antigravity")&&(t.global?(console.log(" "+Et("Antigravity install is experimental. Files land at .antigravity/rcode/{agents,commands}/.")),console.log(" "+Y("If Antigravity expects a different path, adjust .rcode/config.yaml and re-run."))):console.log(" "+Et("Antigravity /rcode-* slash commands need a GLOBAL install \u2014 re-run with `--global`. Skipping .antigravity/ files on this project-local install (they would be inert)."))),t.modules.length>0){let $=Sg(),j=t.modules.filter(O=>!$.includes(O));if(j.length>0)return console.error(`\u2716 Unknown module(s): ${j.join(", ")}`),console.error(` Available modules: ${$.join(", ")}`),1}if(Array.isArray(t.ides)&&t.ides.includes("vscode")||t.ide==="vscode"){let $=bg(t.target);$.moved>0&&console.log(` \u21BB Migrated ${$.moved} legacy vscode-layout command(s) to .claude/commands/rcode-{name}.md`)}let i=!t.global&&Array.isArray(t.ides)?t.ides.filter($=>$!=="antigravity"):t.ides,o=Qc(i,t.target),a=W$(o,t.modules);if(a.length===0)return Array.isArray(t.ides)&&t.ides.includes("antigravity")&&!t.global?(console.error("\u2716 Nothing to install \u2014 Antigravity was the only target IDE, and its files need a GLOBAL install."),console.error(" Re-run with --global, or pick another --ide."),1):(console.error("\u2716 Nothing to install \u2014 install plan is empty."),t.modules.length>0&&console.error(` Modules requested: ${t.modules.join(", ")}`),1);if(t.modules.length>0&&console.log(` Modules: ${t.modules.join(", ")}`),t.dryRun||t.listFiles){console.log("DRY RUN: the following paths would be written:");for(let $ of a)console.log(" + "+$.rel);return 0}if(t.forceOverwrite&&!t.noBackup){let $=F$(t.target,a);if($.ok)console.log(" "+Oo(`${J.dim("--force-overwrite")} backup: ${J.cyan($.path)} ${J.dim("("+$.fileCount+" files \u2014 restore with: tar -xzf "+$.path+")")}`));else if($.fileCount>0)return console.error(""),console.error(`\u2716 Could not create backup: ${$.warning}`),console.error(" Refusing to --force-overwrite without a backup. Pass --no-backup to override."),console.error(""),1}let c=0;t.force&&(c=U$(t.target,a));let u=new Map;if(t.nonDestructive){let $=p.join(t.target,".rcode","_config","files-manifest.csv");if(D.existsSync($))try{let j=D.readFileSync($,"utf8").split(`
255
+ `).slice(1).filter(Boolean);for(let O of j){let[q,se]=O.split(",");q&&se&&u.set(q,se)}}catch{}}let l=0,d=0,f=0,g=0,m=[],y=[],h=[],w=x$(Y(`Installing ${a.length} files\u2026`),{color:"cyan"}).start();for(let $ of a){let j=p.join(t.target,$.rel),O=$.rel.split(p.sep).join("/");Rt(p.dirname(j));let q=null,se=null,ke=()=>(q||(q=D.readFileSync(j)),q),xt=()=>(se||(se=D.readFileSync($.src)),se);if(t.nonDestructive&&!t.forceOverwrite&&!t.acceptAll&&D.existsSync(j)){let Lt=u.get(O);if(Lt){let dr=ke().toString("utf8");if(Tn(ke())!==Lt){let Kt=xt().toString("utf8"),Tu=hg(O,O,dr,Kt,"installed","source"),Ru=0,Pu=0;for(let Es of Tu.split(`
256
+ `))Es.startsWith("+")&&!Es.startsWith("+++")&&Ru++,Es.startsWith("-")&&!Es.startsWith("---")&&Pu++;f+=1,m.push(O),y.push({rel:O,insertions:Ru,deletions:Pu,patch:Tu}),d+=1;continue}}}if(D.existsSync(j)&&!t.force&&!t.forceOverwrite){let Lt=Tn(ke()),dr=Tn(xt());if(Lt===dr){d++;continue}if(!t.yes&&!t.nonDestructive){h.push({rel:O,src:$.src,destPath:j,existingContent:ke().toString("utf8"),sourceContent:xt().toString("utf8")}),d++;continue}}if(D.existsSync(j)&&t.forceOverwrite){let Lt=ke(),dr=xt();Lt.equals(dr)||w.update({text:Y(`overwriting ${$.rel}`)})}let Nt=xt().toString("utf8");$.cursor&&(Nt=Nt),D.writeFileSync(j,Nt,"utf8"),$.executable&&D.chmodSync(j,493),l++}if(w.success({text:ar(`${l} files installed`)}),h.length>0){let $={workflows:[],agents:[],commands:[],skills:[],references:[],other:[]};for(let j of h)j.rel.includes("/workflows/")?$.workflows.push(j):j.rel.includes("/agents/")?$.agents.push(j):j.rel.includes("/commands/")?$.commands.push(j):j.rel.includes("/skills/")?$.skills.push(j):j.rel.includes("/references/")?$.references.push(j):$.other.push(j);console.log(""),console.log(" "+Et(`${h.length} file${h.length===1?"":"s"} have local edits AND v${Ve()} updates:`));for(let[j,O]of Object.entries($))O.length!==0&&console.log(" "+Y(`${O.length} ${j}`));if(console.log(""),!t.yes&&process.stdin.isTTY){let j=await Pe.select({message:"How should we handle these?",initialValue:"review",options:[{value:"review",label:"Review each one",hint:"see the diff, decide per file"},{value:"upstream",label:"Take v"+Ve()+" for all",hint:"lose local edits, get all bug fixes"},{value:"keep",label:"Keep my local edits",hint:"skip v"+Ve()+" updates for these files (current behaviour)"}]});if(Pe.isCancel(j))Pe.note("Skipped \u2014 local edits preserved.");else if(j==="upstream"){let O=0;for(let q of h)D.writeFileSync(q.destPath,q.sourceContent,"utf8"),O++;g+=O,console.log(" "+ar(`Applied v${Ve()} to ${O} file${O===1?"":"s"}.`))}else if(j==="review"){let O=0,q=0;for(let se of h){let ke=hg(se.rel,se.rel,se.existingContent,se.sourceContent,"local","v"+Ve()),xt=0,Nt=0;for(let fr of ke.split(`
257
+ `))fr.startsWith("+")&&!fr.startsWith("+++")&&xt++,fr.startsWith("-")&&!fr.startsWith("---")&&Nt++;console.log(""),console.log(" "+J.bold(se.rel)+Y(" ")+J.green(`+${xt}`)+" "+J.red(`-${Nt}`));let Lt=await Pe.select({message:"Take upstream, keep local, or view diff?",initialValue:"view",options:[{value:"upstream",label:"Take v"+Ve()},{value:"keep",label:"Keep local"},{value:"view",label:"View diff first"}]}),dr=Lt;if(Pe.isCancel(Lt)||Lt==="view"){for(let Kt of ke.split(`
258
+ `).slice(4))Kt.startsWith("+")?process.stdout.write(J.green(Kt)+`
259
+ `):Kt.startsWith("-")?process.stdout.write(J.red(Kt)+`
260
+ `):Kt.startsWith("@")?process.stdout.write(J.cyan(Kt)+`
261
+ `):process.stdout.write(Y(Kt)+`
262
+ `);let fr=await Pe.select({message:"Now: take upstream or keep local?",initialValue:"keep",options:[{value:"upstream",label:"Take v"+Ve()},{value:"keep",label:"Keep local"}]});dr=Pe.isCancel(fr)?"keep":fr}dr==="upstream"?(D.writeFileSync(se.destPath,se.sourceContent,"utf8"),O++):q++}g+=O,console.log(" "+ar(`Review complete: ${O} applied, ${q} kept local.`))}else console.log(" "+Y(`${h.length} file${h.length===1?"":"s"} kept local. Re-run with --force-overwrite or 'rcode update' anytime.`))}else console.log(" "+Y(`Re-run with --force-overwrite to apply v${Ve()} updates, or pipe through an interactive shell to resolve per-file.`));console.log("")}if(g>0&&(console.log(" "+ar(`Total this run: ${l} installed \xB7 ${g} updated \xB7 ${f+d} unchanged.`)),console.log("")),t.global){let $=p.join(t.target,".rcode","_config");Rt($),D.writeFileSync(p.join($,"manifest.yaml"),yg(t));let O=Dg(dt,t.target).count;try{let{main:q}=require(p.join(dt,"cli","generate-command-skills.cjs")),se=p.join(t.target,".claude","skills"),ke=q(dt,se,Ve(),{skipGlobalDuplicates:!0});O+=ke.generated}catch{}console.log(""),console.log(` ${Y(`${O} skills installed globally`)}`);try{Yc(t)}catch(q){process.stderr.write(J.yellow(`WARNING: native slash-command install skipped: ${q?.message||q}`)+`
263
+ `)}return 0}let C=p.join(Qe(),".claude","commands"),A=p.join(t.target,".claude","commands"),T=t.target!==Qe()&&!t.localOnly;if(T&&!t.forceOverwrite)try{let $=D.existsSync(C)&&(D.readdirSync(C).some(O=>O.startsWith("rcode-")&&O.endsWith(".md"))||D.existsSync(p.join(C,"rcode"))),j=D.existsSync(A)&&(D.readdirSync(A).some(O=>O.startsWith("rcode-")&&O.endsWith(".md"))||D.existsSync(p.join(A,"rcode")));if($&&!j){let O=a.length,q=a.filter(se=>!se.rel.split(p.sep).join("/").startsWith(".claude/commands/"));q.length<O&&(a.length=0,q.forEach(se=>a.push(se)),console.log(" "+Y("Global rcode commands detected in ~/.claude/ \u2014 skipping project-level command install to avoid duplicates.")),console.log(" "+Y("Use --force-overwrite to install locally anyway.")))}else if($&&j){try{let q=D.readdirSync(A).filter(ke=>ke.startsWith("rcode-")&&ke.endsWith(".md"));for(let ke of q)D.unlinkSync(p.join(A,ke));let se=p.join(A,"rcode");D.existsSync(se)&&Jc(se,t.target),console.log(" "+Y("Removed duplicate project-level rcode commands (global ones in ~/.claude/ take precedence)."))}catch{}let O=a.filter(q=>!q.rel.split(p.sep).join("/").startsWith(".claude/commands/"));a.length=0,O.forEach(q=>a.push(q))}}catch{}let G=p.join(t.target,".rcode","_config");Rt(G),Rt(p.join(t.target,".planning")),D.writeFileSync(p.join(G,"manifest.yaml"),yg(t)),D.writeFileSync(p.join(G,"agent-manifest.csv"),H$(a,t.target));let I=p.join(t.target,".rcode","config.yaml"),Z=p.join(t.target,".rcode","state.json"),F=!1;if(t.reset&&t.force?(D.existsSync(I)&&D.unlinkSync(I),D.existsSync(Z)&&D.unlinkSync(Z)):t.force&&(D.existsSync(I)||D.existsSync(Z))&&(F=!0),!D.existsSync(I))Oe(I,G$(t));else try{let $=D.readFileSync(I,"utf8"),j=t.commitPlanning!==!1,O=/^commit_planning:\s*(true|false)\s*$/m,q=$.match(O),se=q?q[1]==="true":null;if(q&&se!==j){let ke=$.replace(O,`commit_planning: ${j}`);Oe(I,ke),console.log(" "+Y(`Updated commit_planning in config.yaml (${se} \u2192 ${j}) \u2014 closes #685.`))}else if(!q){let ke=$.replace(/\n*$/,"")+`
241
264
  commit_planning: ${j}
242
- `;It(I,de)}}catch{}try{let x=y.readFileSync(I,"utf8"),j=Hk(x),R=Wk(j);if(!R.valid){console.log(""),console.log(" "+_t("config.yaml has validation errors:"));for(let N of R.errors)console.log(X.yellow(N));console.log(Y(" \u2192 Edit .rcode/config.yaml to fix, then run /rcode-status"))}}catch{}if(!y.existsSync(Z)){let x=p.join($e,"state.json");if(y.existsSync(x)){let j=new Date().toISOString(),R=JSON.stringify(String(t.projectName||p.basename(t.target))).slice(1,-1),N=y.readFileSync(x,"utf8").replace(/__PROJECT_NAME__/g,R).replace(/__INSTALL_DATE__/g,j),ee=p.join(t.target,".planning","ROADMAP.md");if(y.existsSync(ee))try{y.readFileSync(ee,"utf8").includes("<!-- INSTALL STUB")||(N=N.replace(/^\s*"_seeded_stub":\s*true,?\s*\n/m,""))}catch{}jt(p.dirname(Z)),It(Z,N)}}jt(p.join(t.target,".planning","council-sessions"));let W=p.join(t.target,".rcode","context");jt(W);let P=p.join(W,"active.md"),E=p.join(W,"project-brief.md");y.existsSync(P)||y.writeFileSync(P,`# Active Context
265
+ `;Oe(I,ke)}}catch{}try{let $=D.readFileSync(I,"utf8"),j=Y$($),O=z$(j);if(!O.valid){console.log(""),console.log(" "+Et("config.yaml has validation errors:"));for(let q of O.errors)console.log(J.yellow(q));console.log(Y(" \u2192 Edit .rcode/config.yaml to fix, then run /rcode-status"))}}catch{}if(!D.existsSync(Z)){let $=p.join(Ae,"state.json");if(D.existsSync($)){let j=new Date().toISOString(),O=JSON.stringify(String(t.projectName||p.basename(t.target))).slice(1,-1),q=D.readFileSync($,"utf8").replace(/__PROJECT_NAME__/g,O).replace(/__INSTALL_DATE__/g,j),se=p.join(t.target,".planning","ROADMAP.md");if(D.existsSync(se))try{D.readFileSync(se,"utf8").includes("<!-- INSTALL STUB")||(q=q.replace(/^\s*"_seeded_stub":\s*true,?\s*\n/m,""))}catch{}Rt(p.dirname(Z)),Oe(Z,q)}}Rt(p.join(t.target,".planning","council-sessions"));let W=p.join(t.target,".rcode","context");Rt(W);let R=p.join(W,"active.md"),b=p.join(W,"project-brief.md");D.existsSync(R)||D.writeFileSync(R,`# Active Context
243
266
 
244
267
  _Run \`/rcode-init\` inside your AI editor to populate this file._
245
- `),y.existsSync(E)||y.writeFileSync(E,`# Project Brief
268
+ `),D.existsSync(b)||D.writeFileSync(b,`# Project Brief
246
269
 
247
270
  _Run \`/rcode-init\` inside your AI editor to populate this file._
248
- `);let Q=p.join(Ye(),".rcode","agents");jt(Q);let re=pg(Et,t.target,{skipGlobalDuplicates:T}),le=re.count;re.skippedGlobal>0&&(console.log(" "+Y(`Skipped ${re.skippedGlobal} project-level rcode skills (global ones in ~/.claude/skills/ take precedence) \u2014 closes #679.`)),console.log(" "+Y(" \u21B3 This project now depends on your GLOBAL rcode install for those skills.")),console.log(" "+Y(" For a self-contained project (e.g. for collaborators/CI), reinstall with --local-only.")));try{let{main:x}=require(p.join(Et,"cli","generate-command-skills.cjs")),j=p.join(t.target,".claude","skills"),R=x(Et,j,We(),{skipGlobalDuplicates:T});R.generated>0&&(console.log(" "+Y(`${R.generated} sidebar skill stub${R.generated===1?"":"s"} generated for command discoverability`)),le+=R.generated),R.skippedGlobal>0&&console.log(" "+Y(`Skipped ${R.skippedGlobal} sidebar stub${R.skippedGlobal===1?"":"s"} that duplicate global ~/.claude/skills/ \u2014 closes #679.`))}catch(x){console.log(" "+Y(`(sidebar stub generation skipped: ${x.message})`))}y.writeFileSync(p.join(G,"files-manifest.csv"),Lk(a,t.target,{mergeExistingManifest:!t.force,extraScanDirs:[p.join(t.target,".claude","skills"),p.join(t.target,".rcode","skills")]}));let $=jk(t.target,t.projectName);Rk(Et,t.target);let k=Ik(t.target,{commitPlanning:t.commitPlanning}),he=Tk(t.target,{gitHooks:t.gitHooks}),J=null,xe=!1;try{let{spawn:x}=require("child_process"),j=p.join(t.target,".rcode","bin","rcode-tools.cjs");y.existsSync(j)&&(x("node",[j,"brain","pull"],{cwd:t.target,stdio:"ignore",detached:!0}).unref(),xe=!0)}catch(x){J={ok:!1,error:String(x.message||x).slice(0,200)}}if(console.log(""),t.force&&u>0&&console.log(" "+Ro(`${u} stale files swept`)),t.force&&F&&console.log(" "+_t("config.yaml and state.json preserved (pass --reset to wipe)")),xe?console.log(" "+Y("Brain: pulling in background (may take up to a minute on a cold cache; run `rcode brain status` to check)")):J&&J.error&&console.log(" "+Y(`Brain: skipped (${J.error})`)),k){let x={created:".gitignore created with rcode block",appended:".gitignore updated \u2014 rcode block appended","already-present":".gitignore rcode block already present",updated:".gitignore rcode block refreshed","skipped-error":`.gitignore skipped (${k.error})`}[k.action]||".gitignore unchanged";console.log(" "+Y(x))}if(he){let x={created:"pre-commit hook installed (.git/hooks/pre-commit)",appended:"pre-commit hook updated \u2014 rcode block appended","already-present":"pre-commit hook rcode block already present",updated:"pre-commit hook rcode block refreshed","skipped-flag":"pre-commit hook skipped (--no-git-hooks)","skipped-no-git":"pre-commit hook skipped (no .git/ directory)","skipped-error":`pre-commit hook skipped (${he.error})`}[he.action]||"pre-commit hook unchanged";console.log(" "+Y(x))}if(d>0&&console.log(" "+Y(`${d} files skipped (unchanged)`)),f>0&&t.nonDestructive){console.log(""),console.log(" "+_t(`${f} file${f===1?"":"s"} preserved (modified since install):`));for(let x of D.slice(0,10)){let j=X.green(`+${x.insertions}`)+" "+X.red(`-${x.deletions}`);if(console.log(` ${Y(x.rel)} ${j}`),t.showDiff&&x.patch)for(let R of x.patch.split(`
249
- `).slice(4))R.startsWith("+")?process.stdout.write(X.green(R)+`
250
- `):R.startsWith("-")?process.stdout.write(X.red(R)+`
251
- `):R.startsWith("@")?process.stdout.write(X.cyan(R)+`
252
- `):process.stdout.write(Y(R)+`
253
- `)}D.length>10&&console.log(Y(` \u2026 and ${D.length-10} more`)),console.log(Y(" To overwrite: re-run with --force-overwrite | To see full diffs: --show-diff")),console.log("")}let st=t.ides.includes("claude")?"claude":t.ides[0],Fe=Xu(st,t.target),Ir=Fe.agentsDir,_s=Fe.commandsDir,bt=0,Ze=0,ce=!1,Tr=!1;try{if(y.existsSync(Ir)&&(bt=y.readdirSync(Ir).filter(x=>(x.startsWith("rcode-")||x.startsWith("rcode-"))&&(x.endsWith(".md")||x.endsWith(".mdc"))).length),y.existsSync(_s)){let x=st==="claude"?j=>j.startsWith("rcode-")&&(j.endsWith(".md")||j.endsWith(".mdc")):j=>j.endsWith(".md")||j.endsWith(".mdc");Ze=y.readdirSync(_s).filter(x).length}if(bt===0||Ze===0||le<20){let x=p.join(Ye(),".claude/agents"),j=p.join(Ye(),".claude/commands"),R=p.join(Ye(),".claude/skills");if(bt===0&&y.existsSync(x)){let N=y.readdirSync(x).filter(ee=>(ee.startsWith("rcode-")||ee.startsWith("rcode-"))&&ee.endsWith(".md")).length;N>0&&(bt=N,ce=!0)}if(Ze===0&&y.existsSync(j)){let N=y.readdirSync(j).filter(ee=>(ee.startsWith("rcode-")||ee.startsWith("rcode-"))&&ee.endsWith(".md")).length;N>0&&(Ze=N,Tr=!0)}if(le<20&&y.existsSync(R))try{let N=y.readdirSync(R,{withFileTypes:!0}).filter(ee=>ee.isDirectory()&&ee.name.startsWith("rcode-")).length;N>le&&(le=N)}catch{}}}catch(x){console.error("[install] installInner: failed to count installed agents/commands:",x?.message||x)}try{let x=p.join(t.target,".rcode","skills"),j=p.join(t.target,".claude","commands"),R=[x,j],N=!1,ee=!1;for(let de of R){if(!y.existsSync(de))continue;let St=y.readdirSync(de);St.some(Pt=>Pt.startsWith("rcode-"))&&(N=!0),St.some(Pt=>Pt.startsWith("rihal-"))&&(ee=!0)}N&&ee&&process.stderr.write(X.yellow("WARNING: rcode-* and rihal-* namespaces both detected \u2014 consider removing one to reduce roster size.")+`
254
- `)}catch{}try{Gu(t)}catch(x){process.stderr.write(X.yellow(`WARNING: native slash-command install skipped: ${x?.message||x}`)+`
255
- `)}let Rr=We();console.log(""),console.log(` ${Ft("Version:")} ${X.cyan("@hanzlaa/rcode@"+Rr)}`),console.log(` ${Ft("IDE:")} ${t.ides.join(", ")}`),console.log(` ${Ft("Language:")} ${t.language} ${Y("(change in .rcode/config.yaml)")}`),console.log(` ${Ft("Mode:")} ${t.mode} ${Y("(guided=confirm at gates, yolo=autonomous)")}`),console.log(` ${Ft("Planning:")} ${t.commitPlanning!==!1?"committed":"gitignored"} ${Y("(flip: rcode-tools gitignore refresh)")}`),console.log("");let M=p.relative(t.target,Fe.agentsDir)||Fe.agentsDir,ve=p.relative(t.target,Fe.commandsDir)||Fe.commandsDir;if(console.log(` ${Ft("Agents:")} ${X.green(String(bt))} in ${ce?"~/.claude/agents/ (global)":M+"/"}`),console.log(` ${Ft("Commands:")} ${X.green(String(Ze))} slash commands in ${Tr?"~/.claude/commands/ (global)":ve+"/"}`),le>0&&console.log(` ${Ft("Skills:")} ${X.green(String(le))} phrase-activated`),console.log(""),$&&(console.log(" "+or("Starter planning scaffolded in .planning/ (ROADMAP, STATE, PROJECT)")),console.log("")),console.log(` ${Ft("Next:")}`),console.log(` cd ${t.target}`),console.log(" claude # start Claude Code (reload window if already open)"),console.log(" /rcode-progress # where you are, what's next"),console.log(" /rcode-do # interactive command picker"),console.log(" /rcode-council <q> # multi-agent strategic answer"),console.log(""),(t.global||t.noPrompt)&&(console.log(` ${Y("Configure interactively (one-time, per project):")}`),console.log(` ${Y("rcode install # pick IDE + planning policy for THIS project")}`),console.log(` ${Y("rcode config # adjust defaults later")}`),console.log("")),console.log(Y(" Refresh anytime:")),console.log(Y(" pnpm dlx @hanzlaa/rcode@latest install # recommended (avoids npm 11.x npx issues)")),console.log(Y(" npx @hanzlaa/rcode@latest install # npm / yarn")),console.log(Y(` /rcode-update v${Rr} # pin rcode to a specific version`)),console.log(""),console.log(Y(" Want the rcode CLI on your PATH? (optional \u2014 needed for rcode version / rcode update):")),console.log(Y(" npm install -g @hanzlaa/rcode # installs rcode, rcode, rcode commands")),console.log(Y(" rcode version # verify")),console.log(""),console.log(Y(" Customize without losing changes on update:")),console.log(Y(" Create <name>.local.md siblings (e.g. .claude/agents/rcode-waleed.local.md)")),console.log(Y(" *.local.md files are NEVER touched by install / --force-overwrite / uninstall.")),console.log(""),console.log(" "+_t("If your IDE is already open, reload the window to refresh skills/commands.")),console.log(Y(" Claude Code / VS Code / Cursor: Cmd+Shift+P \u2192 Reload Window")),console.log(""),!t.noUpdateCheck&&process.stdout.isTTY&&!process.env.CI&&!process.env.RCODE_NO_UPDATE_NOTIFIER){let{execFile:x}=require("child_process");x("npm",["view","@hanzlaa/rcode","version","--json"],{timeout:4e3},(j,R)=>{if(!j)try{let N=JSON.parse(R.trim());Fn.valid(N)&&Fn.gt(N,Rr)&&(console.log(""),console.log(" \u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E"),console.log(` \u2502 ${X.yellow("Update available:")} ${X.dim(Rr)} \u2192 ${X.green(N)}${" ".repeat(Math.max(0,20-Rr.length-N.length))} \u2502`),console.log(" \u2502 Run: npx @hanzlaa/rcode@latest install . \u2502"),console.log(" \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F"),console.log(""))}catch{}})}if(!t.global){let x=Mk(t.target);x.ok||(console.log(" "+_t(x.message)),console.log(""))}return Vk(t.target,{agentCount:bt,commandCount:Ze,skillsInstalled:le})?0:1}function Vk(t,e){console.log(` ${Ft("Health check:")}`);let{execFileSync:r}=require("child_process"),n=0,s={agents:20,skills:20,commands:20};try{let{readPackageManifest:o}=ss(),a=o(Et);if(a&&a.agents instanceof Set&&a.actions instanceof Set){let u=l=>Math.max(1,Math.floor(l*.9));s.agents=u(a.agents.size),s.skills=u(a.actions.size);let c=p.join(Et,"rcode","commands");if(y.existsSync(c)){let l=y.readdirSync(c).filter(d=>d.endsWith(".md")&&!d.startsWith("_")).length;s.commands=u(l)}}}catch{}function i(o,a){try{let u=a();console.log(` ${or(o)}${u?Y(" \u2014 "+u):""}`)}catch(u){n+=1,console.log(` ${fg(o)} ${X.red("\u2014")} ${String(u.message||u).slice(0,120)}`)}}return i("rcode-tools.cjs runs",()=>{let o=p.join(t,".rcode","bin","rcode-tools.cjs");if(!y.existsSync(o))throw new Error("bin/rcode-tools.cjs not installed");return r("node",["-c",o],{stdio:"pipe"}),"syntax ok"}),i(".rcode/config.yaml present",()=>{let o=p.join(t,".rcode","config.yaml");if(!y.existsSync(o))throw new Error("missing");let a=y.readFileSync(o,"utf8");if(!/user_name:|project_name:/.test(a))throw new Error("config.yaml incomplete");return`${y.statSync(o).size} bytes`}),i(".rcode/state.json parses",()=>{let o=p.join(t,".rcode","state.json");if(!y.existsSync(o))throw new Error("missing");return JSON.parse(y.readFileSync(o,"utf8")),"valid JSON"}),i("agents installed",()=>{if((e.agentCount||0)<s.agents)throw new Error(`only ${e.agentCount} agents (expected \u2265 ${s.agents})`);return`${e.agentCount}`}),i("skills + commands installed",()=>{let o=[];if((e.skillsInstalled||0)<s.skills&&o.push(`${e.skillsInstalled} skills (expected \u2265 ${s.skills})`),(e.commandCount||0)<s.commands&&o.push(`${e.commandCount} commands (expected \u2265 ${s.commands})`),o.length)throw new Error(`low count: ${o.join(", ")}`);return`${e.skillsInstalled} skills + ${e.commandCount} commands`}),n>0?(console.log(""),console.log(" "+fg(`${n} health check${n===1?"":"s"} failed \u2014 install may be broken.`)),console.log(Y(" Debug: node .rcode/bin/rcode-tools.cjs state read && ls -la .rcode/")),console.log(Y(" Reinstall: rcode install . --force")),console.log(""),!1):(console.log(""),!0)}async function Gk(){let t=process.argv.slice(2),e=Yu(t);if(e.help){gg();return}!e.yes&&process.stdin.isTTY&&!process.env.CI&&await zk(e);try{let n=await Ku(e);process.exit(n)}catch(n){(n.code==="EACCES"||n.code==="EPERM")&&(console.error(`\u2716 Permission denied: ${n.path||n.message}`),process.exit(1)),n.code==="ENOENT"&&(console.error(`\u2716 Path not found: ${n.path||n.message}`),process.exit(1)),console.error(`\u2716 Install failed: ${n.message}`),process.env.DEBUG&&console.error(n.stack),process.exit(1)}}async function zk(t){let{intro:e,outro:r,text:n,select:s,multiselect:i,confirm:o,isCancel:a,cancel:u,note:c}=nt,l=We();if(console.log(""),e(X.bold("\u{1F54C} rcode")+X.dim(` v${l}`)),!t.targetProvided){let h=await n({message:"Install directory?",placeholder:t.target,defaultValue:t.target,initialValue:t.target});a(h)&&(u("Installation cancelled."),process.exit(0));let w=p.resolve((h||t.target).trim());t.target=w,t.projectName=p.basename(w)}let d=await i({message:"Which editor(s) are you installing for?",options:[{value:"claude",label:"Claude Code",hint:"recommended"},{value:"cursor",label:"Cursor"},{value:"codex",label:"Codex (OpenAI CLI)",hint:"AGENTS.md + workflow bridge"},{value:"gemini",label:"Gemini CLI",hint:"coming soon"},{value:"vscode",label:"VS Code",hint:"via Continue / Copilot extensions"},{value:"antigravity",label:"Antigravity",hint:"experimental"}],initialValues:t.ide?[t.ide]:["claude"],required:!0});a(d)&&(u("Installation cancelled."),process.exit(0)),t.ides=d,t.ide=d[0],t.ideProvided=!0;let f=await s({message:"Communication language?",options:[{value:"English",label:"English"},{value:"Arabic",label:"Arabic (\u0627\u0644\u0639\u0631\u0628\u064A\u0629)"},{value:"French",label:"French (Fran\xE7ais)"},{value:"Spanish",label:"Spanish (Espa\xF1ol)"},{value:"Urdu",label:"Urdu (\u0627\u0631\u062F\u0648)"}],initialValue:t.language||"English"});a(f)&&(u("Installation cancelled."),process.exit(0)),t.language=f;let g=await s({message:"Agent mode?",options:[{value:"guided",label:"Guided",hint:"confirm at key decision gates"},{value:"yolo",label:"Yolo",hint:"fully autonomous \u2014 no confirmation"}],initialValue:t.mode||"guided"});a(g)&&(u("Installation cancelled."),process.exit(0)),t.mode=g;let m=await s({message:"Where should planning artifacts (.planning/) be saved?",options:[{value:!0,label:"Commit to git",hint:"recommended \u2014 team sees the same plans"},{value:!1,label:"Keep local",hint:"gitignore \u2014 good for sensitive PRDs"}],initialValue:!0});a(m)&&(u("Installation cancelled."),process.exit(0)),t.commitPlanning=m;let D=await n({message:"Your name? (used in agent responses)",placeholder:t.userName,defaultValue:t.userName,initialValue:t.userName});a(D)&&(u("Installation cancelled."),process.exit(0)),t.userName=(D||t.userName).trim(),c([`${X.dim("Directory:")} ${t.target}`,`${X.dim("Editor:")} ${t.ides.join(", ")}`,`${X.dim("Language:")} ${t.language}`,`${X.dim("Mode:")} ${t.mode}`,`${X.dim("Planning:")} ${t.commitPlanning?"committed to git":"kept local (gitignored)"}`,`${X.dim("User:")} ${t.userName}`].join(`
256
- `),"Installing with these settings"),console.log("")}require.main===ct&&Gk();async function Yk(t){let e=Array.isArray(t)?t:[],r=Yu(e),n=await Ku(r);n!==0&&process.exit(n)}ct.exports=Yk;ct.exports.parseArgs=Yu;ct.exports.buildInstallPlan=Ju;ct.exports.install=Ku;ct.exports.SUPPORTED_IDES=os;ct.exports.migrateVscodeCommandsLayout=yg;ct.exports.getPathsForIde=Xu;ct.exports.installSlashRouterCommands=Qu;ct.exports.installCodexSlashRouterHook=bg;ct.exports.installAntigravitySlashRouterHook=Sg;ct.exports.installNativeHomeSlashCommands=Gu});var as=v((LI,wg)=>{var Xk=require("readline"),zt=class extends Error{constructor(e="Prompt aborted"){super(e),this.name="PromptAbortError"}},Cg=!1;function Jk(){Cg||(Cg=!0,process.on("SIGINT",()=>{process.stdout.write(`
271
+ `);let Q=p.join(Qe(),".rcode","agents");Rt(Q);let te=Dg(dt,t.target,{skipGlobalDuplicates:T}),de=te.count;te.skippedGlobal>0&&(console.log(" "+Y(`Skipped ${te.skippedGlobal} project-level rcode skills (global ones in ~/.claude/skills/ take precedence) \u2014 closes #679.`)),console.log(" "+Y(" \u21B3 This project now depends on your GLOBAL rcode install for those skills.")),console.log(" "+Y(" For a self-contained project (e.g. for collaborators/CI), reinstall with --local-only.")));try{let{main:$}=require(p.join(dt,"cli","generate-command-skills.cjs")),j=p.join(t.target,".claude","skills"),O=$(dt,j,Ve(),{skipGlobalDuplicates:T});O.generated>0&&(console.log(" "+Y(`${O.generated} sidebar skill stub${O.generated===1?"":"s"} generated for command discoverability`)),de+=O.generated),O.skippedGlobal>0&&console.log(" "+Y(`Skipped ${O.skippedGlobal} sidebar stub${O.skippedGlobal===1?"":"s"} that duplicate global ~/.claude/skills/ \u2014 closes #679.`))}catch($){console.log(" "+Y(`(sidebar stub generation skipped: ${$.message})`))}D.writeFileSync(p.join(G,"files-manifest.csv"),Z$(a,t.target,{mergeExistingManifest:!t.force,extraScanDirs:[p.join(t.target,".claude","skills"),p.join(t.target,".rcode","skills")]}));let x=O$(t.target,t.projectName);M$(dt,t.target);let k=N$(t.target,{commitPlanning:t.commitPlanning}),he=B$(t.target,{gitHooks:t.gitHooks}),X=P$(t.target,{enableHooks:t.enableHooks}),xe=L$(t.target,t.ides),ze=null,Le=!1;try{let{spawn:$}=require("child_process"),j=p.join(t.target,".rcode","bin","rcode-tools.cjs");D.existsSync(j)&&($("node",[j,"brain","pull"],{cwd:t.target,stdio:"ignore",detached:!0}).unref(),Le=!0)}catch($){ze={ok:!1,error:String($.message||$).slice(0,200)}}if(console.log(""),t.force&&c>0&&console.log(" "+Oo(`${c} stale files swept`)),t.force&&F&&console.log(" "+Et("config.yaml and state.json preserved (pass --reset to wipe)")),Le?console.log(" "+Y("Brain: pulling in background (may take up to a minute on a cold cache; run `rcode brain status` to check)")):ze&&ze.error&&console.log(" "+Y(`Brain: skipped (${ze.error})`)),k){let $={created:".gitignore created with rcode block",appended:".gitignore updated \u2014 rcode block appended","already-present":".gitignore rcode block already present",updated:".gitignore rcode block refreshed","skipped-error":`.gitignore skipped (${k.error})`}[k.action]||".gitignore unchanged";console.log(" "+Y($))}if(he){let $={created:"pre-commit hook installed (.git/hooks/pre-commit)",appended:"pre-commit hook updated \u2014 rcode block appended","already-present":"pre-commit hook rcode block already present",updated:"pre-commit hook rcode block refreshed","skipped-flag":"pre-commit hook skipped (--no-git-hooks)","skipped-no-git":"pre-commit hook skipped (no .git/ directory)","skipped-error":`pre-commit hook skipped (${he.error})`}[he.action]||"pre-commit hook unchanged";console.log(" "+Y($))}if(X){let $={merged:"guardrail hooks enabled (.claude/settings.json)","skipped-flag":"guardrail hooks skipped (--no-hooks or declined)","skipped-template-missing":"guardrail hooks skipped (settings-hooks.json template missing)","skipped-error":"guardrail hooks skipped (error merging .claude/settings.json)"}[X.action]||"guardrail hooks unchanged";console.log(" "+Y($))}if(xe&&Object.keys(xe).length>0){let $={claude:"CLAUDE.md",codex:"AGENTS.md",cursor:".cursor/rules/rcode-prefer-do.mdc",windsurf:".windsurf/rules/rcode-prefer-do.mdc"};for(let[j,O]of Object.entries(xe)){let q=$[j]||j,se={created:`${q}: /rcode-do rule added`,appended:`${q}: /rcode-do rule appended`,updated:`${q}: /rcode-do rule refreshed`,"already-present":`${q}: /rcode-do rule already present`,written:`${q}: /rcode-do rule written`,"skipped-error":`${q}: /rcode-do rule skipped (${O.error})`}[O.action]||`${q}: /rcode-do rule unchanged`;console.log(" "+Y(se))}}if(d>0&&console.log(" "+Y(`${d} files skipped (unchanged)`)),f>0&&t.nonDestructive){console.log(""),console.log(" "+Et(`${f} file${f===1?"":"s"} preserved (modified since install):`));for(let $ of y.slice(0,10)){let j=J.green(`+${$.insertions}`)+" "+J.red(`-${$.deletions}`);if(console.log(` ${Y($.rel)} ${j}`),t.showDiff&&$.patch)for(let O of $.patch.split(`
272
+ `).slice(4))O.startsWith("+")?process.stdout.write(J.green(O)+`
273
+ `):O.startsWith("-")?process.stdout.write(J.red(O)+`
274
+ `):O.startsWith("@")?process.stdout.write(J.cyan(O)+`
275
+ `):process.stdout.write(Y(O)+`
276
+ `)}y.length>10&&console.log(Y(` \u2026 and ${y.length-10} more`)),console.log(Y(" To overwrite: re-run with --force-overwrite | To see full diffs: --show-diff")),console.log("")}let Pr=t.ides.includes("claude")?"claude":t.ides[0],lr=Kc(Pr,t.target),Or=lr.agentsDir,Ct=lr.commandsDir,oe=0,wt=0,Ss=!1,B=!1;try{if(D.existsSync(Or)&&(oe=D.readdirSync(Or).filter($=>($.startsWith("rcode-")||$.startsWith("rcode-"))&&($.endsWith(".md")||$.endsWith(".mdc"))).length),D.existsSync(Ct)){let $=Pr==="claude"?j=>j.startsWith("rcode-")&&(j.endsWith(".md")||j.endsWith(".mdc")):j=>j.endsWith(".md")||j.endsWith(".mdc");wt=D.readdirSync(Ct).filter($).length}if(oe===0||wt===0||de<20){let $=p.join(Qe(),".claude/agents"),j=p.join(Qe(),".claude/commands"),O=p.join(Qe(),".claude/skills");if(oe===0&&D.existsSync($)){let q=D.readdirSync($).filter(se=>(se.startsWith("rcode-")||se.startsWith("rcode-"))&&se.endsWith(".md")).length;q>0&&(oe=q,Ss=!0)}if(wt===0&&D.existsSync(j)){let q=D.readdirSync(j).filter(se=>(se.startsWith("rcode-")||se.startsWith("rcode-"))&&se.endsWith(".md")).length;q>0&&(wt=q,B=!0)}if(de<20&&D.existsSync(O))try{let q=D.readdirSync(O,{withFileTypes:!0}).filter(se=>se.isDirectory()&&se.name.startsWith("rcode-")).length;q>de&&(de=q)}catch{}}}catch($){console.error("[install] installInner: failed to count installed agents/commands:",$?.message||$)}try{let $=p.join(t.target,".rcode","skills"),j=p.join(t.target,".claude","commands"),O=[$,j],q=!1,se=!1;for(let ke of O){if(!D.existsSync(ke))continue;let xt=D.readdirSync(ke);xt.some(Nt=>Nt.startsWith("rcode-"))&&(q=!0),xt.some(Nt=>Nt.startsWith("rihal-"))&&(se=!0)}q&&se&&process.stderr.write(J.yellow("WARNING: rcode-* and rihal-* namespaces both detected \u2014 consider removing one to reduce roster size.")+`
277
+ `)}catch{}try{Yc(t)}catch($){process.stderr.write(J.yellow(`WARNING: native slash-command install skipped: ${$?.message||$}`)+`
278
+ `)}let me=Ve();console.log(""),console.log(` ${Tt("Version:")} ${J.cyan("@hanzlaa/rcode@"+me)}`),console.log(` ${Tt("IDE:")} ${t.ides.join(", ")}`),console.log(` ${Tt("Language:")} ${t.language} ${Y("(change in .rcode/config.yaml)")}`),console.log(` ${Tt("Mode:")} ${t.mode} ${Y("(guided=confirm at gates, yolo=autonomous)")}`),console.log(` ${Tt("Planning:")} ${t.commitPlanning!==!1?"committed":"gitignored"} ${Y("(flip: rcode-tools gitignore refresh)")}`),console.log("");let L=p.relative(t.target,lr.agentsDir)||lr.agentsDir,le=p.relative(t.target,lr.commandsDir)||lr.commandsDir;if(console.log(` ${Tt("Agents:")} ${J.green(String(oe))} in ${Ss?"~/.claude/agents/ (global)":L+"/"}`),console.log(` ${Tt("Commands:")} ${J.green(String(wt))} slash commands in ${B?"~/.claude/commands/ (global)":le+"/"}`),de>0&&console.log(` ${Tt("Skills:")} ${J.green(String(de))} phrase-activated`),console.log(""),x&&(console.log(" "+ar("Starter planning scaffolded in .planning/ (ROADMAP, STATE, PROJECT)")),console.log("")),console.log(` ${Tt("Next:")}`),console.log(` cd ${t.target}`),console.log(" claude # start Claude Code (reload window if already open)"),console.log(" /rcode-progress # where you are, what's next"),console.log(" /rcode-do # interactive command picker"),console.log(" /rcode-council <q> # multi-agent strategic answer"),console.log(""),(t.global||t.noPrompt)&&(console.log(` ${Y("Configure interactively (one-time, per project):")}`),console.log(` ${Y("rcode install # pick IDE + planning policy for THIS project")}`),console.log(` ${Y("rcode config # adjust defaults later")}`),console.log("")),console.log(Y(" Refresh anytime:")),console.log(Y(" pnpm dlx @hanzlaa/rcode@latest install # recommended (avoids npm 11.x npx issues)")),console.log(Y(" npx @hanzlaa/rcode@latest install # npm / yarn")),console.log(Y(` /rcode-update v${me} # pin rcode to a specific version`)),console.log(""),console.log(Y(" Want the rcode CLI on your PATH? (optional \u2014 needed for rcode version / rcode update):")),console.log(Y(" npm install -g @hanzlaa/rcode # installs rcode, rcode, rcode commands")),console.log(Y(" rcode version # verify")),console.log(""),console.log(Y(" Customize without losing changes on update:")),console.log(Y(" Create <name>.local.md siblings (e.g. .claude/agents/rcode-waleed.local.md)")),console.log(Y(" *.local.md files are NEVER touched by install / --force-overwrite / uninstall.")),console.log(""),console.log(" "+Et("If your IDE is already open, reload the window to refresh skills/commands.")),console.log(Y(" Claude Code / VS Code / Cursor: Cmd+Shift+P \u2192 Reload Window")),console.log(""),!t.noUpdateCheck&&process.stdout.isTTY&&!process.env.CI&&!process.env.RCODE_NO_UPDATE_NOTIFIER){let{execFile:$}=require("child_process");$("npm",["view","@hanzlaa/rcode","version","--json"],{timeout:4e3},(j,O)=>{if(!j)try{let q=JSON.parse(O.trim());In.valid(q)&&In.gt(q,me)&&(console.log(""),console.log(" \u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E"),console.log(` \u2502 ${J.yellow("Update available:")} ${J.dim(me)} \u2192 ${J.green(q)}${" ".repeat(Math.max(0,20-me.length-q.length))} \u2502`),console.log(" \u2502 Run: npx @hanzlaa/rcode@latest install . \u2502"),console.log(" \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F"),console.log(""))}catch{}})}if(!t.global){let $=V$(t.target);$.ok||(console.log(" "+Et($.message)),console.log(""))}return K$(t.target,{agentCount:oe,commandCount:wt,skillsInstalled:de})?0:1}function K$(t,e){console.log(` ${Tt("Health check:")}`);let{execFileSync:r}=require("child_process"),n=0,s={agents:20,skills:20,commands:20};try{let{readPackageManifest:o}=is(),a=o(dt);if(a&&a.agents instanceof Set&&a.actions instanceof Set){let c=l=>Math.max(1,Math.floor(l*.9));s.agents=c(a.agents.size),s.skills=c(a.actions.size);let u=p.join(dt,"rcode","commands");if(D.existsSync(u)){let l=D.readdirSync(u).filter(d=>d.endsWith(".md")&&!d.startsWith("_")).length;s.commands=c(l)}}}catch{}function i(o,a){try{let c=a();console.log(` ${ar(o)}${c?Y(" \u2014 "+c):""}`)}catch(c){n+=1,console.log(` ${pg(o)} ${J.red("\u2014")} ${String(c.message||c).slice(0,120)}`)}}return i("rcode-tools.cjs runs",()=>{let o=p.join(t,".rcode","bin","rcode-tools.cjs");if(!D.existsSync(o))throw new Error("bin/rcode-tools.cjs not installed");return r("node",["-c",o],{stdio:"pipe"}),"syntax ok"}),i(".rcode/config.yaml present",()=>{let o=p.join(t,".rcode","config.yaml");if(!D.existsSync(o))throw new Error("missing");let a=D.readFileSync(o,"utf8");if(!/user_name:|project_name:/.test(a))throw new Error("config.yaml incomplete");return`${D.statSync(o).size} bytes`}),i(".rcode/state.json parses",()=>{let o=p.join(t,".rcode","state.json");if(!D.existsSync(o))throw new Error("missing");return JSON.parse(D.readFileSync(o,"utf8")),"valid JSON"}),i("agents installed",()=>{if((e.agentCount||0)<s.agents)throw new Error(`only ${e.agentCount} agents (expected \u2265 ${s.agents})`);return`${e.agentCount}`}),i("skills + commands installed",()=>{let o=[];if((e.skillsInstalled||0)<s.skills&&o.push(`${e.skillsInstalled} skills (expected \u2265 ${s.skills})`),(e.commandCount||0)<s.commands&&o.push(`${e.commandCount} commands (expected \u2265 ${s.commands})`),o.length)throw new Error(`low count: ${o.join(", ")}`);return`${e.skillsInstalled} skills + ${e.commandCount} commands`}),n>0?(console.log(""),console.log(" "+pg(`${n} health check${n===1?"":"s"} failed \u2014 install may be broken.`)),console.log(Y(" Debug: node .rcode/bin/rcode-tools.cjs state read && ls -la .rcode/")),console.log(Y(" Reinstall: rcode install . --force")),console.log(""),!1):(console.log(""),!0)}async function Q$(){let t=process.argv.slice(2),e=Xc(t);if(e.help){vg();return}!e.yes&&process.stdin.isTTY&&!process.env.CI&&await eA(e);try{let n=await eu(e);process.exit(n)}catch(n){(n.code==="EACCES"||n.code==="EPERM")&&(console.error(`\u2716 Permission denied: ${n.path||n.message}`),process.exit(1)),n.code==="ENOENT"&&(console.error(`\u2716 Path not found: ${n.path||n.message}`),process.exit(1)),console.error(`\u2716 Install failed: ${n.message}`),process.env.DEBUG&&console.error(n.stack),process.exit(1)}}async function eA(t){let{intro:e,outro:r,text:n,select:s,multiselect:i,confirm:o,isCancel:a,cancel:c,note:u}=Pe,l=Ve();if(console.log(""),e(J.bold("\u{1F54C} rcode")+J.dim(` v${l}`)),!t.targetProvided){let h=await n({message:"Install directory?",placeholder:t.target,defaultValue:t.target,initialValue:t.target});a(h)&&(c("Installation cancelled."),process.exit(0));let w=p.resolve((h||t.target).trim());t.target=w,t.projectName=p.basename(w)}let d=await i({message:"Which editor(s) are you installing for?",options:[{value:"claude",label:"Claude Code",hint:"recommended"},{value:"cursor",label:"Cursor"},{value:"codex",label:"Codex (OpenAI CLI)",hint:"AGENTS.md + workflow bridge"},{value:"gemini",label:"Gemini CLI",hint:"coming soon"},{value:"vscode",label:"VS Code",hint:"via Continue / Copilot extensions"},{value:"antigravity",label:"Antigravity",hint:"experimental"}],initialValues:t.ide?[t.ide]:["claude"],required:!0});a(d)&&(c("Installation cancelled."),process.exit(0)),t.ides=d,t.ide=d[0],t.ideProvided=!0;let f=await s({message:"Communication language?",options:[{value:"English",label:"English"},{value:"Arabic",label:"Arabic (\u0627\u0644\u0639\u0631\u0628\u064A\u0629)"},{value:"French",label:"French (Fran\xE7ais)"},{value:"Spanish",label:"Spanish (Espa\xF1ol)"},{value:"Urdu",label:"Urdu (\u0627\u0631\u062F\u0648)"}],initialValue:t.language||"English"});a(f)&&(c("Installation cancelled."),process.exit(0)),t.language=f;let g=await s({message:"Agent mode?",options:[{value:"guided",label:"Guided",hint:"confirm at key decision gates"},{value:"yolo",label:"Yolo",hint:"fully autonomous \u2014 no confirmation"}],initialValue:t.mode||"guided"});a(g)&&(c("Installation cancelled."),process.exit(0)),t.mode=g;let m=await s({message:"Where should planning artifacts (.planning/) be saved?",options:[{value:!0,label:"Commit to git",hint:"recommended \u2014 team sees the same plans"},{value:!1,label:"Keep local",hint:"gitignore \u2014 good for sensitive PRDs"}],initialValue:!0});a(m)&&(c("Installation cancelled."),process.exit(0)),t.commitPlanning=m;let y=await n({message:"Your name? (used in agent responses)",placeholder:t.userName,defaultValue:t.userName,initialValue:t.userName});a(y)&&(c("Installation cancelled."),process.exit(0)),t.userName=(y||t.userName).trim(),u([`${J.dim("Directory:")} ${t.target}`,`${J.dim("Editor:")} ${t.ides.join(", ")}`,`${J.dim("Language:")} ${t.language}`,`${J.dim("Mode:")} ${t.mode}`,`${J.dim("Planning:")} ${t.commitPlanning?"committed to git":"kept local (gitignored)"}`,`${J.dim("User:")} ${t.userName}`].join(`
279
+ `),"Installing with these settings"),console.log("")}require.main===ft&&Q$();async function tA(t){let e=Array.isArray(t)?t:[],r=Xc(e),n=await eu(r);n!==0&&process.exit(n)}ft.exports=tA;ft.exports.parseArgs=Xc;ft.exports.buildInstallPlan=Qc;ft.exports.install=eu;ft.exports.SUPPORTED_IDES=as;ft.exports.migrateVscodeCommandsLayout=bg;ft.exports.getPathsForIde=Kc;ft.exports.installSlashRouterCommands=tu;ft.exports.installCodexSlashRouterHook=wg;ft.exports.installAntigravitySlashRouterHook=xg;ft.exports.installNativeHomeSlashCommands=Yc});var us=v((ZI,$g)=>{var rA=require("readline"),Jt=class extends Error{constructor(e="Prompt aborted"){super(e),this.name="PromptAbortError"}},kg=!1;function nA(){kg||(kg=!0,process.on("SIGINT",()=>{process.stdout.write(`
257
280
 
258
281
  Cancelled.
259
- `),process.exit(0)}))}var sn=null;function ec(){return sn||(sn=Kk(),sn)}function Kk(){Jk();let t=!!process.stdin.isTTY,e=Xk.createInterface({input:process.stdin,output:process.stdout,terminal:t}),r=!1,n=!1;e.on("close",()=>{n=!0});let s=[],i=[];t||(e.on("line",u=>{if(i.length>0){let{resolve:c}=i.shift();c(u)}else s.push(u)}),e.on("close",()=>{for(;i.length>0;){let{reject:u}=i.shift();r||u(new zt("Input stream closed"))}}));function o(u){return t?n?Promise.reject(new zt("Input stream closed")):new Promise((c,l)=>{let d=!1,f=()=>{!d&&!r&&(d=!0,l(new zt("Input stream closed")))};e.once("close",f),e.question(u,g=>{d||(d=!0,e.removeListener("close",f),c((g||"").trim()))})}):(process.stdout.write(u),s.length>0?Promise.resolve((s.shift()||"").trim()):n?Promise.reject(new zt("Input stream closed")):new Promise((c,l)=>{i.push({resolve:d=>c((d||"").trim()),reject:l})}))}function a(){r=!0,e.close()}return{ask:o,close:a}}async function Qk(t,{choices:e,default:r="",allowMulti:n=!0,expand:s=null,maxAttempts:i=3}={}){if(!Array.isArray(e)||e.length===0)throw new Error("askChoice: `choices` must be a non-empty array");let o=e.map(l=>l.key),a=e.map(l=>l.id),u=`Valid options: ${o.join(", ")} (or ${a.join(", ")})`,c=ec();for(let l=0;l<i;l++){let d=await c.ask(t),f=d===""?r:d;if(f===""){console.log(` \u26A0 No input and no default. ${u}`);continue}let g=f.split(",").map(h=>h.trim()).filter(Boolean);if(!n&&g.length>1){console.log(` \u26A0 Only one choice allowed, you typed ${g.length}.`);continue}let m=[],D=[];for(let h of g){let w=e.find(C=>C.key===h||C.id===h);if(!w)D.push(h);else if(s)for(let C of s(w.id))m.push(C);else m.push(w.id)}if(m.length===0){console.log(` \u26A0 Didn't recognize: ${D.map(h=>`"${h}"`).join(", ")}`),console.log(` ${u}`),console.log();continue}return D.length>0&&console.log(` \u26A0 Skipping unknown: ${D.map(h=>`"${h}"`).join(", ")}`),[...new Set(m)]}throw new zt(`No valid selection after ${i} attempts`)}async function eA(t,{default:e="n",maxAttempts:r=3}={}){let n=e.toLowerCase()==="y"?"y":"n",s=ec();for(let i=0;i<r;i++){let o=(await s.ask(t)).toLowerCase(),a=o===""?n:o;if(a==="y"||a==="yes")return!0;if(a==="n"||a==="no")return!1;console.log(' \u26A0 Please answer "y" or "n".')}throw new zt(`No valid yes/no answer after ${r} attempts`)}async function tA(t,{default:e="",validate:r=null,maxAttempts:n=3}={}){let s=ec();for(let i=0;i<n;i++){let o=await s.ask(t),a=o===""?e:o;if(r){let u=r(a);if(u!==!0){console.log(` \u26A0 ${typeof u=="string"?u:"Invalid input."}`);continue}}else if(a===""){console.log(" \u26A0 Please enter a value.");continue}return a}throw new zt(`No valid text input after ${n} attempts`)}function rA(){sn&&(sn.close(),sn=null)}wg.exports={askChoice:Qk,askConfirm:eA,askText:tA,closeSession:rA,PromptAbortError:zt}});var Oo=v((BI,Ag)=>{"use strict";var Tt=require("fs"),ye=require("path");function on(t){if(!Tt.existsSync(t))return[];try{return Tt.readdirSync(t,{withFileTypes:!0})}catch{return[]}}function tc(t){let e=[],r=ye.join(t,"skills");for(let a of on(r)){if(!a.isDirectory()||!a.name.startsWith("rihal-"))continue;let u="rcode-"+a.name.slice(6);Tt.existsSync(ye.join(r,u))&&e.push({name:a.name,twin:u,srcPath:ye.join(r,a.name),kind:"skill"})}let n=[],s=ye.join(t,"commands");for(let a of on(s)){if(!a.isFile()||!a.name.startsWith("rihal-")||!a.name.endsWith(".md"))continue;let u="rcode-"+a.name.slice(6);Tt.existsSync(ye.join(s,u))&&n.push({name:a.name,twin:u,srcPath:ye.join(s,a.name),kind:"command"})}let i=[],o=ye.join(t,"agents");for(let a of on(o)){if(!a.isFile()||!a.name.startsWith("rihal-")||!a.name.endsWith(".md"))continue;let u="rcode-"+a.name.slice(6);Tt.existsSync(ye.join(o,u))&&i.push({name:a.name,twin:u,srcPath:ye.join(o,a.name),kind:"agent"})}return{skills:e,commands:n,agents:i}}function rc(t){let e=[],r=ye.join(t,"commands");for(let n of on(r)){if(!n.isFile()||!n.name.endsWith(".md")||n.name.startsWith("rcode-")||n.name.startsWith("rihal-"))continue;let s="rcode-"+n.name;Tt.existsSync(ye.join(r,s))&&e.push({name:n.name,twin:s,srcPath:ye.join(r,n.name),kind:"command"})}return e}function xg(t,e){let r=[];if(ye.resolve(t)===ye.resolve(e))return r;let n=ye.join(t,"commands"),s=ye.join(e,"commands"),i=new Set(on(n).filter(o=>o.isFile()&&o.name.endsWith(".md")).map(o=>o.name));for(let o of on(s))!o.isFile()||!o.name.endsWith(".md")||i.has(o.name)&&r.push({name:o.name,srcPath:ye.join(s,o.name),keptPath:ye.join(n,o.name),kind:"command"});return r}function $g(t){let e=[],r=ye.join(t,".rcode","slash-commands");for(let n of on(r)){if(!n.isFile()||!n.name.startsWith("rihal-")||!n.name.endsWith(".md"))continue;let s="rcode-"+n.name.slice(6);Tt.existsSync(ye.join(r,s))&&e.push({name:n.name,twin:s,srcPath:ye.join(r,n.name),kind:"command"})}return e}function kg(t,e){let r=ye.join(t,".claude"),n=ye.join(e,".claude"),s=tc(r),i=tc(n),o=rc(r),a=rc(n),u=xg(r,n),c=$g(e),l=s.skills.length+i.skills.length,d=s.commands.length+i.commands.length,f=s.agents.length+i.agents.length,g=o.length+a.length,m=u.length,D=c.length;return{legacySkillCount:l,legacyCommandCount:d,legacyAgentCount:f,unprefixedCount:g,crossScopeCount:m,legacyCodexCommandCount:D,totalCount:l+d+f+g+m+D,detail:{projectLegacy:s,globalLegacy:i,projectUnprefixed:o,globalUnprefixed:a,crossScope:u,codexSlashCommands:c}}}function nA(t,e,r,n){if(!Tt.existsSync(t))return!1;let s=n==="skill"?"skills":n==="agent"?"agents":"commands",i=ye.join(e,r,s);Tt.mkdirSync(i,{recursive:!0});let o=ye.join(i,ye.basename(t));return Tt.cpSync(t,o,{recursive:!0}),Tt.rmSync(t,{recursive:!0,force:!0}),!0}function sA(t,e){let r=kg(t,e),n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),s=ye.join(e,".claude",".rcode-backup",n),i={backupDir:null,removed:{legacySkills:0,legacyCommands:0,legacyAgents:0,unprefixedDupes:0,crossScopeDupes:0,legacyCodexCommands:0}},o=(u,c,l)=>{let d=0;for(let f of u)nA(f.srcPath,s,c,l)&&d++;return d};return i.removed.legacySkills=o(r.detail.projectLegacy.skills,"project","skill")+o(r.detail.globalLegacy.skills,"global","skill"),i.removed.legacyCommands=o(r.detail.projectLegacy.commands,"project","command")+o(r.detail.globalLegacy.commands,"global","command"),i.removed.legacyAgents=o(r.detail.projectLegacy.agents,"project","agent")+o(r.detail.globalLegacy.agents,"global","agent"),i.removed.unprefixedDupes=o(r.detail.projectUnprefixed,"project","command")+o(r.detail.globalUnprefixed,"global","command"),i.removed.crossScopeDupes=o(r.detail.crossScope,"global","command"),i.removed.legacyCodexCommands=o(r.detail.codexSlashCommands,"global","command"),Object.values(i.removed).reduce((u,c)=>u+c,0)>0&&(i.backupDir=s),i}Ag.exports={findLegacyRihalArtifacts:tc,findUnprefixedTwinDupes:rc,findCrossScopeDupes:xg,findLegacyCodexSlashCommands:$g,scanNamespaceDuplication:kg,migrateNamespace:sA}});var Tg=v((MI,No)=>{var ue=require("fs"),fe=require("path"),{spawnSync:Fg}=require("child_process"),us=Zu(),{PromptAbortError:oA}=as(),{writeFileAtomic:iA}=Jt(),{homedir:aA}=lr(),{verifyInstall:uA,formatReport:cA}=ss(),lA=is();function dA(t){let e=ue.readFileSync(t,"utf8"),r={};for(let n of e.split(/\r?\n/)){let s=n.replace(/#.*$/,"").trimEnd();if(!s||s.startsWith(" "))continue;let i=s.indexOf(":");if(i===-1)continue;let o=s.slice(0,i).trim(),a=s.slice(i+1).trim();a.startsWith('"')&&a.endsWith('"')&&(a=a.slice(1,-1)),a==="true"?a=!0:a==="false"&&(a=!1),r[o]=a}return{obj:r,raw:e}}function fA(t,e,r){let n=new RegExp(`^${e}:[^\\S\\n]*[^\\r\\n]*$`,"m"),s=typeof r=="string"?`${e}: "${r.replace(/"/g,'\\"')}"`:`${e}: ${r}`;return n.test(t)?t.replace(n,s):t.replace(/(?:\r?\n)*$/,"")+`
282
+ `),process.exit(0)}))}var an=null;function ru(){return an||(an=sA(),an)}function sA(){nA();let t=!!process.stdin.isTTY,e=rA.createInterface({input:process.stdin,output:process.stdout,terminal:t}),r=!1,n=!1;e.on("close",()=>{n=!0});let s=[],i=[];t||(e.on("line",c=>{if(i.length>0){let{resolve:u}=i.shift();u(c)}else s.push(c)}),e.on("close",()=>{for(;i.length>0;){let{reject:c}=i.shift();r||c(new Jt("Input stream closed"))}}));function o(c){return t?n?Promise.reject(new Jt("Input stream closed")):new Promise((u,l)=>{let d=!1,f=()=>{!d&&!r&&(d=!0,l(new Jt("Input stream closed")))};e.once("close",f),e.question(c,g=>{d||(d=!0,e.removeListener("close",f),u((g||"").trim()))})}):(process.stdout.write(c),s.length>0?Promise.resolve((s.shift()||"").trim()):n?Promise.reject(new Jt("Input stream closed")):new Promise((u,l)=>{i.push({resolve:d=>u((d||"").trim()),reject:l})}))}function a(){r=!0,e.close()}return{ask:o,close:a}}async function oA(t,{choices:e,default:r="",allowMulti:n=!0,expand:s=null,maxAttempts:i=3}={}){if(!Array.isArray(e)||e.length===0)throw new Error("askChoice: `choices` must be a non-empty array");let o=e.map(l=>l.key),a=e.map(l=>l.id),c=`Valid options: ${o.join(", ")} (or ${a.join(", ")})`,u=ru();for(let l=0;l<i;l++){let d=await u.ask(t),f=d===""?r:d;if(f===""){console.log(` \u26A0 No input and no default. ${c}`);continue}let g=f.split(",").map(h=>h.trim()).filter(Boolean);if(!n&&g.length>1){console.log(` \u26A0 Only one choice allowed, you typed ${g.length}.`);continue}let m=[],y=[];for(let h of g){let w=e.find(C=>C.key===h||C.id===h);if(!w)y.push(h);else if(s)for(let C of s(w.id))m.push(C);else m.push(w.id)}if(m.length===0){console.log(` \u26A0 Didn't recognize: ${y.map(h=>`"${h}"`).join(", ")}`),console.log(` ${c}`),console.log();continue}return y.length>0&&console.log(` \u26A0 Skipping unknown: ${y.map(h=>`"${h}"`).join(", ")}`),[...new Set(m)]}throw new Jt(`No valid selection after ${i} attempts`)}async function iA(t,{default:e="n",maxAttempts:r=3}={}){let n=e.toLowerCase()==="y"?"y":"n",s=ru();for(let i=0;i<r;i++){let o=(await s.ask(t)).toLowerCase(),a=o===""?n:o;if(a==="y"||a==="yes")return!0;if(a==="n"||a==="no")return!1;console.log(' \u26A0 Please answer "y" or "n".')}throw new Jt(`No valid yes/no answer after ${r} attempts`)}async function aA(t,{default:e="",validate:r=null,maxAttempts:n=3}={}){let s=ru();for(let i=0;i<n;i++){let o=await s.ask(t),a=o===""?e:o;if(r){let c=r(a);if(c!==!0){console.log(` \u26A0 ${typeof c=="string"?c:"Invalid input."}`);continue}}else if(a===""){console.log(" \u26A0 Please enter a value.");continue}return a}throw new Jt(`No valid text input after ${n} attempts`)}function cA(){an&&(an.close(),an=null)}$g.exports={askChoice:oA,askConfirm:iA,askText:aA,closeSession:cA,PromptAbortError:Jt}});var Lo=v((UI,Ig)=>{"use strict";var Pt=require("fs"),ve=require("path");function cn(t){if(!Pt.existsSync(t))return[];try{return Pt.readdirSync(t,{withFileTypes:!0})}catch{return[]}}function nu(t){let e=[],r=ve.join(t,"skills");for(let a of cn(r)){if(!a.isDirectory()||!a.name.startsWith("rihal-"))continue;let c="rcode-"+a.name.slice(6);Pt.existsSync(ve.join(r,c))&&e.push({name:a.name,twin:c,srcPath:ve.join(r,a.name),kind:"skill"})}let n=[],s=ve.join(t,"commands");for(let a of cn(s)){if(!a.isFile()||!a.name.startsWith("rihal-")||!a.name.endsWith(".md"))continue;let c="rcode-"+a.name.slice(6);Pt.existsSync(ve.join(s,c))&&n.push({name:a.name,twin:c,srcPath:ve.join(s,a.name),kind:"command"})}let i=[],o=ve.join(t,"agents");for(let a of cn(o)){if(!a.isFile()||!a.name.startsWith("rihal-")||!a.name.endsWith(".md"))continue;let c="rcode-"+a.name.slice(6);Pt.existsSync(ve.join(o,c))&&i.push({name:a.name,twin:c,srcPath:ve.join(o,a.name),kind:"agent"})}return{skills:e,commands:n,agents:i}}function su(t){let e=[],r=ve.join(t,"commands");for(let n of cn(r)){if(!n.isFile()||!n.name.endsWith(".md")||n.name.startsWith("rcode-")||n.name.startsWith("rihal-"))continue;let s="rcode-"+n.name;Pt.existsSync(ve.join(r,s))&&e.push({name:n.name,twin:s,srcPath:ve.join(r,n.name),kind:"command"})}return e}function Ag(t,e){let r=[];if(ve.resolve(t)===ve.resolve(e))return r;let n=ve.join(t,"commands"),s=ve.join(e,"commands"),i=new Set(cn(n).filter(o=>o.isFile()&&o.name.endsWith(".md")).map(o=>o.name));for(let o of cn(s))!o.isFile()||!o.name.endsWith(".md")||i.has(o.name)&&r.push({name:o.name,srcPath:ve.join(s,o.name),keptPath:ve.join(n,o.name),kind:"command"});return r}function Fg(t){let e=[],r=ve.join(t,".rcode","slash-commands");for(let n of cn(r)){if(!n.isFile()||!n.name.startsWith("rihal-")||!n.name.endsWith(".md"))continue;let s="rcode-"+n.name.slice(6);Pt.existsSync(ve.join(r,s))&&e.push({name:n.name,twin:s,srcPath:ve.join(r,n.name),kind:"command"})}return e}function jg(t,e){let r=ve.join(t,".claude"),n=ve.join(e,".claude"),s=nu(r),i=nu(n),o=su(r),a=su(n),c=Ag(r,n),u=Fg(e),l=s.skills.length+i.skills.length,d=s.commands.length+i.commands.length,f=s.agents.length+i.agents.length,g=o.length+a.length,m=c.length,y=u.length;return{legacySkillCount:l,legacyCommandCount:d,legacyAgentCount:f,unprefixedCount:g,crossScopeCount:m,legacyCodexCommandCount:y,totalCount:l+d+f+g+m+y,detail:{projectLegacy:s,globalLegacy:i,projectUnprefixed:o,globalUnprefixed:a,crossScope:c,codexSlashCommands:u}}}function uA(t,e,r,n){if(!Pt.existsSync(t))return!1;let s=n==="skill"?"skills":n==="agent"?"agents":"commands",i=ve.join(e,r,s);Pt.mkdirSync(i,{recursive:!0});let o=ve.join(i,ve.basename(t));return Pt.cpSync(t,o,{recursive:!0}),Pt.rmSync(t,{recursive:!0,force:!0}),!0}function lA(t,e){let r=jg(t,e),n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),s=ve.join(e,".claude",".rcode-backup",n),i={backupDir:null,removed:{legacySkills:0,legacyCommands:0,legacyAgents:0,unprefixedDupes:0,crossScopeDupes:0,legacyCodexCommands:0}},o=(c,u,l)=>{let d=0;for(let f of c)uA(f.srcPath,s,u,l)&&d++;return d};return i.removed.legacySkills=o(r.detail.projectLegacy.skills,"project","skill")+o(r.detail.globalLegacy.skills,"global","skill"),i.removed.legacyCommands=o(r.detail.projectLegacy.commands,"project","command")+o(r.detail.globalLegacy.commands,"global","command"),i.removed.legacyAgents=o(r.detail.projectLegacy.agents,"project","agent")+o(r.detail.globalLegacy.agents,"global","agent"),i.removed.unprefixedDupes=o(r.detail.projectUnprefixed,"project","command")+o(r.detail.globalUnprefixed,"global","command"),i.removed.crossScopeDupes=o(r.detail.crossScope,"global","command"),i.removed.legacyCodexCommands=o(r.detail.codexSlashCommands,"global","command"),Object.values(i.removed).reduce((c,u)=>c+u,0)>0&&(i.backupDir=s),i}Ig.exports={findLegacyRihalArtifacts:nu,findUnprefixedTwinDupes:su,findCrossScopeDupes:Ag,findLegacyCodexSlashCommands:Fg,scanNamespaceDuplication:jg,migrateNamespace:lA}});var Og=v((VI,Bo)=>{var ue=require("fs"),fe=require("path"),{spawnSync:Tg}=require("child_process"),ls=Vc(),{PromptAbortError:dA}=us(),{writeFileAtomic:fA}=Qt(),{homedir:hA}=hr(),{verifyInstall:pA,formatReport:mA}=is(),gA=cs();function DA(t){let e=ue.readFileSync(t,"utf8"),r={};for(let n of e.split(/\r?\n/)){let s=n.replace(/#.*$/,"").trimEnd();if(!s||s.startsWith(" "))continue;let i=s.indexOf(":");if(i===-1)continue;let o=s.slice(0,i).trim(),a=s.slice(i+1).trim();a.startsWith('"')&&a.endsWith('"')&&(a=a.slice(1,-1)),a==="true"?a=!0:a==="false"&&(a=!1),r[o]=a}return{obj:r,raw:e}}function yA(t,e,r){let n=new RegExp(`^${e}:[^\\S\\n]*[^\\r\\n]*$`,"m"),s=typeof r=="string"?`${e}: "${r.replace(/"/g,'\\"')}"`:`${e}: ${r}`;return n.test(t)?t.replace(n,s):t.replace(/(?:\r?\n)*$/,"")+`
260
283
  ${s}
261
- `}function jg(t){let e={yes:!1};for(let r of t)(r==="--yes"||r==="-y")&&(e.yes=!0);return e}function Ig(t){let e=[],r=fe.join(aA(),".claude/skills"),n=ue.existsSync(fe.join(t,".claude/skills"))&&ue.readdirSync(fe.join(t,".claude/skills")).some(o=>o.startsWith("rcode-"))||ue.existsSync(fe.join(t,".claude/agents"))&&ue.readdirSync(fe.join(t,".claude/agents")).some(o=>o.startsWith("rcode-"))||ue.existsSync(fe.join(t,".claude/commands"))&&ue.readdirSync(fe.join(t,".claude/commands")).some(o=>o.startsWith("rcode-")),s=ue.existsSync(r)&&ue.readdirSync(r).some(o=>o.startsWith("rcode-")),i=ue.existsSync(fe.join(t,".rcode/config.yaml"));return(n||i&&s)&&e.push("claude"),ue.existsSync(fe.join(t,".cursor/rules"))&&ue.readdirSync(fe.join(t,".cursor/rules")).some(a=>a.startsWith("rcode-")&&a.endsWith(".mdc"))&&e.push("cursor"),ue.existsSync(fe.join(t,".windsurf/rules"))&&ue.readdirSync(fe.join(t,".windsurf/rules")).some(a=>a.startsWith("rcode-")&&a.endsWith(".mdc"))&&e.push("windsurf"),ue.existsSync(fe.join(t,".antigravity/agents"))&&ue.readdirSync(fe.join(t,".antigravity/agents")).some(a=>a.startsWith("rcode-"))&&e.push("antigravity"),e}function hA(t,e){let r=[];e.includes("claude")&&r.push(".claude/skills",".claude/commands/rcode"),e.includes("cursor")&&r.push(".cursor/rules"),e.includes("windsurf")&&r.push(".windsurf/rules"),e.includes("antigravity")&&r.push(".antigravity/agents"),ue.existsSync(fe.join(t,"AGENTS.md"))&&r.push("AGENTS.md");let n=r.filter(l=>ue.existsSync(fe.join(t,l)));if(n.length===0)return{ok:!1,warning:"nothing to back up"};if(Fg("tar",["--version"],{stdio:"ignore"}).status!==0)return{ok:!1,warning:"tar not available"};let i=fe.join(t,".rcode/backups");try{ue.mkdirSync(i,{recursive:!0})}catch(l){return{ok:!1,warning:`could not create backups dir: ${l.message}`}}let o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),a=fe.join(i,`update-${o}.tgz`),u=fe.relative(t,a),c=Fg("tar",["-czf",a,"-C",t,"--files-from=-"],{input:n.join(`
284
+ `}function Rg(t){let e={yes:!1};for(let r of t)(r==="--yes"||r==="-y")&&(e.yes=!0);return e}function Pg(t){let e=[],r=fe.join(hA(),".claude/skills"),n=ue.existsSync(fe.join(t,".claude/skills"))&&ue.readdirSync(fe.join(t,".claude/skills")).some(o=>o.startsWith("rcode-"))||ue.existsSync(fe.join(t,".claude/agents"))&&ue.readdirSync(fe.join(t,".claude/agents")).some(o=>o.startsWith("rcode-"))||ue.existsSync(fe.join(t,".claude/commands"))&&ue.readdirSync(fe.join(t,".claude/commands")).some(o=>o.startsWith("rcode-")),s=ue.existsSync(r)&&ue.readdirSync(r).some(o=>o.startsWith("rcode-")),i=ue.existsSync(fe.join(t,".rcode/config.yaml"));return(n||i&&s)&&e.push("claude"),ue.existsSync(fe.join(t,".cursor/rules"))&&ue.readdirSync(fe.join(t,".cursor/rules")).some(a=>a.startsWith("rcode-")&&a.endsWith(".mdc"))&&e.push("cursor"),ue.existsSync(fe.join(t,".windsurf/rules"))&&ue.readdirSync(fe.join(t,".windsurf/rules")).some(a=>a.startsWith("rcode-")&&a.endsWith(".mdc"))&&e.push("windsurf"),ue.existsSync(fe.join(t,".antigravity/agents"))&&ue.readdirSync(fe.join(t,".antigravity/agents")).some(a=>a.startsWith("rcode-"))&&e.push("antigravity"),e}function vA(t,e){let r=[];e.includes("claude")&&r.push(".claude/skills",".claude/commands/rcode"),e.includes("cursor")&&r.push(".cursor/rules"),e.includes("windsurf")&&r.push(".windsurf/rules"),e.includes("antigravity")&&r.push(".antigravity/agents"),ue.existsSync(fe.join(t,"AGENTS.md"))&&r.push("AGENTS.md");let n=r.filter(l=>ue.existsSync(fe.join(t,l)));if(n.length===0)return{ok:!1,warning:"nothing to back up"};if(Tg("tar",["--version"],{stdio:"ignore"}).status!==0)return{ok:!1,warning:"tar not available"};let i=fe.join(t,".rcode/backups");try{ue.mkdirSync(i,{recursive:!0})}catch(l){return{ok:!1,warning:`could not create backups dir: ${l.message}`}}let o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),a=fe.join(i,`update-${o}.tgz`),c=fe.relative(t,a),u=Tg("tar",["-czf",a,"-C",t,"--files-from=-"],{input:n.join(`
262
285
  `)+`
263
- `,encoding:"utf8"});return c.status!==0?{ok:!1,warning:`tar failed: ${(c.stderr||"").trim()}`}:{ok:!0,path:u}}function pA(t,e){let r={claude:0,cursor:0,windsurf:0,antigravity:0};if(e.includes("claude")){let n=fe.join(t,".claude/skills");if(ue.existsSync(n))for(let o of ue.readdirSync(n))o.startsWith("rcode-")&&(ue.rmSync(fe.join(n,o),{recursive:!0,force:!0}),r.claude++);let s=fe.join(t,".claude/commands/rcode");ue.existsSync(s)&&ue.rmSync(s,{recursive:!0,force:!0});let i=fe.join(t,".claude/commands");if(ue.existsSync(i))for(let o of ue.readdirSync(i))o.startsWith("rcode-")&&(o.endsWith(".md")||o.endsWith(".mdc"))&&ue.unlinkSync(fe.join(i,o))}if(e.includes("cursor")){let n=fe.join(t,".cursor/rules");if(ue.existsSync(n))for(let s of ue.readdirSync(n))s.startsWith("rcode-")&&s.endsWith(".mdc")&&(ue.rmSync(fe.join(n,s)),r.cursor++)}if(e.includes("windsurf")){let n=fe.join(t,".windsurf/rules");if(ue.existsSync(n))for(let s of ue.readdirSync(n))s.startsWith("rcode-")&&s.endsWith(".mdc")&&(ue.rmSync(fe.join(n,s)),r.windsurf++)}if(e.includes("antigravity")){let n=fe.join(t,".antigravity/agents");if(ue.existsSync(n))for(let s of ue.readdirSync(n))s.startsWith("rcode-")&&(ue.rmSync(fe.join(n,s)),r.antigravity++)}return r}function mA(t){let e=fe.join(t,"AGENTS.md");if(!ue.existsSync(e))return;let r=ue.readFileSync(e,"utf8"),n=[/\n*---\n+## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/],s=!1;for(let i of n)i.test(r)&&(r=r.replace(i,""),s=!0);if(s){r=r.replace(/\n---\n+$/,`
264
- `);let{writeFileAtomic:i}=Jt();i(e,r)}}No.exports=async function(e,{packageRoot:r,packageJson:n}){try{return await gA(e,{packageRoot:r,packageJson:n})}catch(s){throw s instanceof oA&&(console.log(`
265
- \u274C Update cancelled \u2014 ${s.message}.`),process.exit(0)),s}};async function gA(t,{packageRoot:e,packageJson:r}){let n=process.cwd(),s=jg(t),i=r?.version||"0.0.0",o=fe.join(n,".rcode/config.yaml"),a=fe.join(n,".rcode/config.json"),u=ue.existsSync(o)?o:a;ue.existsSync(u)||(console.error(`
286
+ `,encoding:"utf8"});return u.status!==0?{ok:!1,warning:`tar failed: ${(u.stderr||"").trim()}`}:{ok:!0,path:c}}function _A(t,e){let r={claude:0,cursor:0,windsurf:0,antigravity:0};if(e.includes("claude")){let n=fe.join(t,".claude/skills");if(ue.existsSync(n))for(let o of ue.readdirSync(n))o.startsWith("rcode-")&&(ue.rmSync(fe.join(n,o),{recursive:!0,force:!0}),r.claude++);let s=fe.join(t,".claude/commands/rcode");ue.existsSync(s)&&ue.rmSync(s,{recursive:!0,force:!0});let i=fe.join(t,".claude/commands");if(ue.existsSync(i))for(let o of ue.readdirSync(i))o.startsWith("rcode-")&&(o.endsWith(".md")||o.endsWith(".mdc"))&&ue.unlinkSync(fe.join(i,o))}if(e.includes("cursor")){let n=fe.join(t,".cursor/rules");if(ue.existsSync(n))for(let s of ue.readdirSync(n))s.startsWith("rcode-")&&s.endsWith(".mdc")&&(ue.rmSync(fe.join(n,s)),r.cursor++)}if(e.includes("windsurf")){let n=fe.join(t,".windsurf/rules");if(ue.existsSync(n))for(let s of ue.readdirSync(n))s.startsWith("rcode-")&&s.endsWith(".mdc")&&(ue.rmSync(fe.join(n,s)),r.windsurf++)}if(e.includes("antigravity")){let n=fe.join(t,".antigravity/agents");if(ue.existsSync(n))for(let s of ue.readdirSync(n))s.startsWith("rcode-")&&(ue.rmSync(fe.join(n,s)),r.antigravity++)}return r}function bA(t){let e=fe.join(t,"AGENTS.md");if(!ue.existsSync(e))return;let r=ue.readFileSync(e,"utf8"),n=[/\n*---\n+## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/],s=!1;for(let i of n)i.test(r)&&(r=r.replace(i,""),s=!0);if(s){r=r.replace(/\n---\n+$/,`
287
+ `);let{writeFileAtomic:i}=Qt();i(e,r)}}Bo.exports=async function(e,{packageRoot:r,packageJson:n}){try{return await SA(e,{packageRoot:r,packageJson:n})}catch(s){throw s instanceof dA&&(console.log(`
288
+ \u274C Update cancelled \u2014 ${s.message}.`),process.exit(0)),s}};async function SA(t,{packageRoot:e,packageJson:r}){let n=process.cwd(),s=Rg(t),i=r?.version||"0.0.0",o=fe.join(n,".rcode/config.yaml"),a=fe.join(n,".rcode/config.json"),c=ue.existsSync(o)?o:a;ue.existsSync(c)||(console.error(`
266
289
  \u274C rcode is not installed in this directory.`),console.error(` To install: rcode install
267
- `),process.exit(1));let c,l="",d=u.endsWith(".yaml");try{if(d){let T=dA(u);c=T.obj,l=T.raw}else c=JSON.parse(ue.readFileSync(u,"utf8"))}catch(T){console.error(`
268
- \u274C ${fe.basename(u)} is not parseable: ${T.message}
269
- `),process.exit(1)}let f=c.installed_version||"(unknown, pre-tracking)",g=Ig(n);if(g.length===0&&(console.error(`
290
+ `),process.exit(1));let u,l="",d=c.endsWith(".yaml");try{if(d){let T=DA(c);u=T.obj,l=T.raw}else u=JSON.parse(ue.readFileSync(c,"utf8"))}catch(T){console.error(`
291
+ \u274C ${fe.basename(c)} is not parseable: ${T.message}
292
+ `),process.exit(1)}let f=u.installed_version||"(unknown, pre-tracking)",g=Pg(n);if(g.length===0&&(console.error(`
270
293
  \u274C No editor install detected.`),console.error(` Run 'rcode install' to set up at least one editor first.
271
294
  `),process.exit(1)),console.log(`
272
295
  \u{1F54C} rcode \u2014 Update
273
- `),console.log(` Installed: ${f}`),console.log(` Package: ${i}`),console.log(` Editors: ${g.join(", ")}`),console.log(),f===i&&(console.log(" \u2139 Already at the current package version."),console.log(" Refreshing files will overwrite any manual changes to"),console.log(" installed skill/command files with the package copies."),console.log()),!s.yes){let G=["claude","cursor","gemini"].filter(I=>!g.includes(I));if(G.length>0){let I={claude:"Claude Code",cursor:"Cursor",gemini:"Gemini CLI"},Z=await us.multiselect({message:"Add support for additional editors?",options:G.map(F=>({value:F,label:I[F]||F})),required:!1});us.isCancel(Z)&&(us.cancel("Update cancelled."),process.exit(0));for(let F of Z)g.push(F);console.log(` Editors to update: ${g.join(", ")}`),console.log()}}if(!s.yes){let T=await us.confirm({message:"Proceed with update?",initialValue:!1});if(us.isCancel(T)||!T){console.log(`
274
- \u274C Update cancelled. Nothing changed.`);return}}console.log();let m=hA(n,g);m.ok?console.log(` \u{1F4BE} backup: ${m.path}`):console.log(` \u26A0 no backup created (${m.warning}) \u2014 continuing anyway`);let D=pA(n,g),h=D.claude+D.cursor+D.windsurf+D.antigravity;console.log(` \u{1F9F9} cleaned ${h} old skill files`),mA(n),console.log();let w=g.filter(T=>["claude","cursor","gemini"].includes(T));if(w.length>0){if(g.some(T=>!["claude","cursor","gemini"].includes(T))){let T=g.filter(G=>!["claude","cursor","gemini"].includes(G));console.log(` \u26A0 ${T.join(", ")} refresh not yet supported by installer \u2014 skipping`)}lA.install({target:n,force:!0,yes:!0,userName:c.user_name||require("os").userInfo().username,projectName:c.project_name||require("path").basename(n),language:c.language||"English",mode:c.mode||"guided",ides:w,modules:[],help:!1}),console.log(` \u2713 [${w.join(", ")}] \u2192 refreshed via install.js`)}if(d){let T=fA(l,"installed_version",i);iA(u,T)}else{c.installed_version=i;let{writeJsonAtomic:T}=Jt();T(u,c)}console.log(` \u2713 ${fe.relative(n,u)} \u2192 installed_version: ${i}`);try{let{migrateNamespace:T}=Oo(),{homedir:G}=lr(),I=T(n,G()),Z=Object.values(I.removed).reduce((F,W)=>F+W,0);Z>0&&(console.log(` \u{1F9F9} migrated ${Z} legacy rihal-*/duplicate command registration(s)`),I.backupDir&&console.log(` backup: ${I.backupDir}`))}catch(T){console.log(` \u26A0 namespace migration skipped: ${T.message}`)}console.log();let{reports:C,hasDrift:A}=uA(n,e,g);A?(console.log("\u26A0 Post-update verification found drift:"),console.log(cA(C)),console.log(`
275
- Run 'rcode doctor' for details, or re-run update to retry.`)):console.log(" \u2713 Post-update verification passed."),console.log(),console.log(f===i?`\u2705 rcode ${i} refreshed.`:`\u2705 rcode updated: ${f} \u2192 ${i}`),m.ok&&console.log(` Rollback: tar -xzf ${m.path}`),console.log()}No.exports.parseArgs=jg;No.exports.detectInstalledEditors=Ig});var ic=v((qI,ir)=>{var H=require("fs"),nc=require("os"),q=require("path"),{spawnSync:Rg}=require("child_process"),{askConfirm:Pg,PromptAbortError:Og}=as(),{writeFileAtomic:oc,safeRmSync:Fr}=Jt();function DA(t){let e={editor:null,keepState:!1,deleteState:!1,yes:!1,purge:!1};for(let r of t)r.startsWith("--editor=")?e.editor=r.slice(9):r==="--keep-state"?e.keepState=!0:r==="--delete-state"?e.deleteState=!0:r==="--yes"||r==="-y"?e.yes=!0:(r==="--purge"||r==="--all")&&(e.purge=!0,e.deleteState=!0);return e}function Ng(t){return/\.local\.(md|mdc|json|yaml|yml|toml|js|ts)$/.test(t)}function Lg(t){return t.replace(/\n?# ===== rcode-managed gitignore block[\s\S]*?# ===== end rcode-managed gitignore block =====\n?/g,`
296
+ `),console.log(` Installed: ${f}`),console.log(` Package: ${i}`),console.log(` Editors: ${g.join(", ")}`),console.log(),f===i&&(console.log(" \u2139 Already at the current package version."),console.log(" Refreshing files will overwrite any manual changes to"),console.log(" installed skill/command files with the package copies."),console.log()),!s.yes){let G=["claude","cursor","gemini"].filter(I=>!g.includes(I));if(G.length>0){let I={claude:"Claude Code",cursor:"Cursor",gemini:"Gemini CLI"},Z=await ls.multiselect({message:"Add support for additional editors?",options:G.map(F=>({value:F,label:I[F]||F})),required:!1});ls.isCancel(Z)&&(ls.cancel("Update cancelled."),process.exit(0));for(let F of Z)g.push(F);console.log(` Editors to update: ${g.join(", ")}`),console.log()}}if(!s.yes){let T=await ls.confirm({message:"Proceed with update?",initialValue:!1});if(ls.isCancel(T)||!T){console.log(`
297
+ \u274C Update cancelled. Nothing changed.`);return}}console.log();let m=vA(n,g);m.ok?console.log(` \u{1F4BE} backup: ${m.path}`):console.log(` \u26A0 no backup created (${m.warning}) \u2014 continuing anyway`);let y=_A(n,g),h=y.claude+y.cursor+y.windsurf+y.antigravity;console.log(` \u{1F9F9} cleaned ${h} old skill files`),bA(n),console.log();let w=g.filter(T=>["claude","cursor","gemini"].includes(T));if(w.length>0){if(g.some(T=>!["claude","cursor","gemini"].includes(T))){let T=g.filter(G=>!["claude","cursor","gemini"].includes(G));console.log(` \u26A0 ${T.join(", ")} refresh not yet supported by installer \u2014 skipping`)}gA.install({target:n,force:!0,yes:!0,userName:u.user_name||require("os").userInfo().username,projectName:u.project_name||require("path").basename(n),language:u.language||"English",mode:u.mode||"guided",ides:w,modules:[],help:!1}),console.log(` \u2713 [${w.join(", ")}] \u2192 refreshed via install.js`)}if(d){let T=yA(l,"installed_version",i);fA(c,T)}else{u.installed_version=i;let{writeJsonAtomic:T}=Qt();T(c,u)}console.log(` \u2713 ${fe.relative(n,c)} \u2192 installed_version: ${i}`);try{let{migrateNamespace:T}=Lo(),{homedir:G}=hr(),I=T(n,G()),Z=Object.values(I.removed).reduce((F,W)=>F+W,0);Z>0&&(console.log(` \u{1F9F9} migrated ${Z} legacy rihal-*/duplicate command registration(s)`),I.backupDir&&console.log(` backup: ${I.backupDir}`))}catch(T){console.log(` \u26A0 namespace migration skipped: ${T.message}`)}console.log();let{reports:C,hasDrift:A}=pA(n,e,g);A?(console.log("\u26A0 Post-update verification found drift:"),console.log(mA(C)),console.log(`
298
+ Run 'rcode doctor' for details, or re-run update to retry.`)):console.log(" \u2713 Post-update verification passed."),console.log(),console.log(f===i?`\u2705 rcode ${i} refreshed.`:`\u2705 rcode updated: ${f} \u2192 ${i}`),m.ok&&console.log(` Rollback: tar -xzf ${m.path}`),console.log()}Bo.exports.parseArgs=Rg;Bo.exports.detectInstalledEditors=Pg});var cu=v((GI,cr)=>{var H=require("fs"),ou=require("os"),M=require("path"),{spawnSync:Ng}=require("child_process"),{askConfirm:Lg,PromptAbortError:Bg}=us(),{writeFileAtomic:au,safeRmSync:Tr}=Qt();function EA(t){let e={editor:null,keepState:!1,deleteState:!1,yes:!1,purge:!1};for(let r of t)r.startsWith("--editor=")?e.editor=r.slice(9):r==="--keep-state"?e.keepState=!0:r==="--delete-state"?e.deleteState=!0:r==="--yes"||r==="-y"?e.yes=!0:(r==="--purge"||r==="--all")&&(e.purge=!0,e.deleteState=!0);return e}function Mg(t){return/\.local\.(md|mdc|json|yaml|yml|toml|js|ts)$/.test(t)}function qg(t){return t.replace(/\n?# ===== rcode-managed gitignore block[\s\S]*?# ===== end rcode-managed gitignore block =====\n?/g,`
276
299
  `).replace(/\n?# >>> rcode >>>[\s\S]*?# <<< rcode <<<\n?/g,`
277
300
  `).replace(/\n{3,}/g,`
278
301
 
279
- `)}function yA(t){let e=q.join(t,".git","hooks","pre-commit");if(!H.existsSync(e))return"skipped";let r="# ===== rcode-managed pre-commit block =====",n="# ===== end rcode pre-commit block =====",s;try{s=H.readFileSync(e,"utf8")}catch{return"skipped"}if(!s.includes(r))return"unchanged";let i=s.indexOf(r),o=s.indexOf(n,i);if(o<0)return"unchanged";let a=i;a>0&&s[a-1]===`
280
- `&&a--;let u=o+n.length;u<s.length&&s[u]===`
281
- `&&u++;let c=s.slice(0,a)+s.slice(u),l=c.trim();if(l===""||l==="#!/bin/sh"||l==="#!/bin/bash")try{return H.unlinkSync(e),"removed"}catch{return"skipped"}try{return oc(e,c,{mode:493}),"stripped"}catch{return"skipped"}}function sc(t,e){if(!H.existsSync(t))return"skipped";let r;try{r=JSON.parse(H.readFileSync(t,"utf8"))}catch{return"skipped"}if(!r||typeof r!="object"||!r.hooks||!Array.isArray(r.hooks[e]))return"unchanged";let n=r.hooks[e].length;if(r.hooks[e]=r.hooks[e].filter(s=>!(Array.isArray(s?.hooks)&&s.hooks.some(i=>typeof i?.command=="string"&&i.command.includes("rcode-slash-router.cjs")))),r.hooks[e].length===n)return"unchanged";r.hooks[e].length===0&&delete r.hooks[e];try{return oc(t,JSON.stringify(r,null,2)+`
282
- `),"removed"}catch{return"skipped"}}function In(t,e){if(!H.existsSync(t))return 0;let r=0,n=q.resolve(process.cwd());for(let s of H.readdirSync(t,{withFileTypes:!0})){if(Ng(s.name)||!e(s.name))continue;let i=q.join(t,s.name),o=Fr(i,n);if(!o.ok&&o.reason==="outside-root"){console.log(` \u26A0 refused to remove ${i} \u2014 symlink resolves outside project root`);continue}r++}return r}function vA(t){if(!H.existsSync(t))return!1;try{if(H.readdirSync(t).length===0)return H.rmdirSync(t),!0}catch{}return!1}function _A(t,e){for(let r of e)vA(q.join(t,r))}function EA(t,e){let r={claude:{skills:[],commands:[],agents:[],agentsRulesDir:!1},cursor:[],windsurf:[],antigravity:[],gemini:[],vscode:[],agentsMd:null,stateDir:null,planningDir:null};if(e.includes("vscode")){e.includes("claude")||e.push("claude");let o=q.join(t,".vscode/rcode");H.existsSync(o)&&r.vscode.push(".vscode/rcode")}if(e.includes("claude")){let o=q.join(t,".claude/skills");H.existsSync(o)&&(r.claude.skills=H.readdirSync(o).filter(l=>l.startsWith("rcode-")||Mg(l)));let a=q.join(t,".claude/commands/rcode");H.existsSync(a)&&(r.claude.commands=H.readdirSync(a));let u=q.join(t,".claude/commands");if(H.existsSync(u)){let l=H.readdirSync(u).filter(d=>d.startsWith("rcode-")&&(d.endsWith(".md")||d.endsWith(".mdc")));r.claude.commands=[...r.claude.commands,...l]}let c=q.join(t,".claude/agents");if(H.existsSync(c)){let l=H.readdirSync(c);r.claude.agents=l.filter(d=>d.startsWith("rcode-")&&d.endsWith(".md")),r.claude.agents=[...r.claude.agents,...l.filter(d=>d.startsWith("rihal-")&&d.endsWith(".md"))]}H.existsSync(q.join(t,".claude/agents/rules"))&&(r.claude.agentsRulesDir=!0)}if(e.includes("cursor")){let o=q.join(t,".cursor/rules");H.existsSync(o)&&(r.cursor=H.readdirSync(o).filter(a=>a.startsWith("rcode-")||a==="rcode.mdc"||a==="rcode-method.mdc"||a==="rcode"))}if(e.includes("windsurf")){let o=q.join(t,".windsurf/rules");H.existsSync(o)&&(r.windsurf=H.readdirSync(o).filter(a=>a.startsWith("rcode-")||a==="rcode.mdc"||a==="rcode-method.mdc"))}if(e.includes("antigravity")){let o=q.join(t,".antigravity/agents");H.existsSync(o)&&(r.antigravity=H.readdirSync(o).filter(a=>a.startsWith("rcode-")))}if(e.includes("gemini"))for(let o of["agents","commands"]){let a=q.join(t,".gemini","rcode",o);if(H.existsSync(a))for(let u of H.readdirSync(a))(u.startsWith("rcode-")||u.endsWith(".md"))&&r.gemini.push(q.join(".gemini/rcode",o,u))}let n=q.join(t,"AGENTS.md");if(H.existsSync(n)){let o=H.readFileSync(n,"utf8");(o.includes("## rcode Agents (installed)")||o.includes("## rcode Method Agents (installed)"))&&(r.agentsMd="present")}let s=q.join(t,".rcode");if(H.existsSync(s)){let a=function(u){for(let c of H.readdirSync(u,{withFileTypes:!0}))c.isDirectory()?a(q.join(u,c.name)):o++};var i=a;let o=0;try{a(s)}catch{}r.stateDir={files:o}}return r}function Bg(){try{let{readPackageManifest:t}=ss(),e=q.resolve(__dirname,".."),r=t(e);if(r&&r.actions instanceof Set&&r.actions.size>0)return Array.from(r.actions)}catch{}return[]}var bA=Bg();function Mg(t){return bA.includes(t)}function qg(t,e,r={}){let n=[];for(let i of t.claude.skills)n.push(q.join(".claude/skills",i));for(let i of t.claude.commands)i.startsWith("rcode-")&&i.endsWith(".md")&&n.push(q.join(".claude/commands",i));t.claude.commands.some(i=>!i.startsWith("rcode-"))&&n.push(".claude/commands/rcode");for(let i of t.claude.agents)n.push(q.join(".claude/agents",i));t.claude.agentsRulesDir&&n.push(".claude/agents/rules");for(let i of t.cursor)n.push(q.join(".cursor/rules",i));for(let i of t.windsurf)n.push(q.join(".windsurf/rules",i));for(let i of t.antigravity)n.push(q.join(".antigravity/agents",i));if(Array.isArray(t.gemini))for(let i of t.gemini)n.push(i);if(Array.isArray(t.vscode))for(let i of t.vscode)n.push(i);if(t.agentsMd&&H.existsSync(q.join(e,"AGENTS.md"))&&n.push("AGENTS.md"),r.purge){let i=q.join(e,".rcode");if(H.existsSync(i))try{for(let o of H.readdirSync(i))o!=="backups"&&n.push(q.join(".rcode",o))}catch{}H.existsSync(q.join(e,".planning"))&&n.push(".planning")}return n}function SA(t,e,r={}){let n=qg(e,t,{purge:r.purge===!0}).map(l=>l.split(q.sep).join("/"));if(n.length===0)return{ok:!1,warning:"nothing to back up"};if(Rg("tar",["--version"],{stdio:"ignore"}).status!==0)return{ok:!1,warning:"tar not available on this system"};let i=r.purge?q.join(t,".rcode-backups"):q.join(t,".rcode/backups");try{H.mkdirSync(i,{recursive:!0})}catch(l){return{ok:!1,warning:`could not create ${q.relative(t,i)}/: ${l.message}`}}let o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),a=q.join(i,`uninstall-${o}.tgz`),u=q.relative(t,a),c=Rg("tar",["-czf",a,"-C",t,"--files-from=-"],{input:n.join(`
302
+ `)}function CA(t){let e=M.join(t,".git","hooks","pre-commit");if(!H.existsSync(e))return"skipped";let r="# ===== rcode-managed pre-commit block =====",n="# ===== end rcode pre-commit block =====",s;try{s=H.readFileSync(e,"utf8")}catch{return"skipped"}if(!s.includes(r))return"unchanged";let i=s.indexOf(r),o=s.indexOf(n,i);if(o<0)return"unchanged";let a=i;a>0&&s[a-1]===`
303
+ `&&a--;let c=o+n.length;c<s.length&&s[c]===`
304
+ `&&c++;let u=s.slice(0,a)+s.slice(c),l=u.trim();if(l===""||l==="#!/bin/sh"||l==="#!/bin/bash")try{return H.unlinkSync(e),"removed"}catch{return"skipped"}try{return au(e,u,{mode:493}),"stripped"}catch{return"skipped"}}function iu(t,e){if(!H.existsSync(t))return"skipped";let r;try{r=JSON.parse(H.readFileSync(t,"utf8"))}catch{return"skipped"}if(!r||typeof r!="object"||!r.hooks||!Array.isArray(r.hooks[e]))return"unchanged";let n=r.hooks[e].length;if(r.hooks[e]=r.hooks[e].filter(s=>!(Array.isArray(s?.hooks)&&s.hooks.some(i=>typeof i?.command=="string"&&i.command.includes("rcode-slash-router.cjs")))),r.hooks[e].length===n)return"unchanged";r.hooks[e].length===0&&delete r.hooks[e];try{return au(t,JSON.stringify(r,null,2)+`
305
+ `),"removed"}catch{return"skipped"}}function Rn(t,e){if(!H.existsSync(t))return 0;let r=0,n=M.resolve(process.cwd());for(let s of H.readdirSync(t,{withFileTypes:!0})){if(Mg(s.name)||!e(s.name))continue;let i=M.join(t,s.name),o=Tr(i,n);if(!o.ok&&o.reason==="outside-root"){console.log(` \u26A0 refused to remove ${i} \u2014 symlink resolves outside project root`);continue}r++}return r}function wA(t){if(!H.existsSync(t))return!1;try{if(H.readdirSync(t).length===0)return H.rmdirSync(t),!0}catch{}return!1}function xA(t,e){for(let r of e)wA(M.join(t,r))}function kA(t,e){let r={claude:{skills:[],commands:[],agents:[],agentsRulesDir:!1},cursor:[],windsurf:[],antigravity:[],gemini:[],vscode:[],agentsMd:null,stateDir:null,planningDir:null};if(e.includes("vscode")){e.includes("claude")||e.push("claude");let o=M.join(t,".vscode/rcode");H.existsSync(o)&&r.vscode.push(".vscode/rcode")}if(e.includes("claude")){let o=M.join(t,".claude/skills");H.existsSync(o)&&(r.claude.skills=H.readdirSync(o).filter(l=>l.startsWith("rcode-")||Hg(l)));let a=M.join(t,".claude/commands/rcode");H.existsSync(a)&&(r.claude.commands=H.readdirSync(a));let c=M.join(t,".claude/commands");if(H.existsSync(c)){let l=H.readdirSync(c).filter(d=>d.startsWith("rcode-")&&(d.endsWith(".md")||d.endsWith(".mdc")));r.claude.commands=[...r.claude.commands,...l]}let u=M.join(t,".claude/agents");if(H.existsSync(u)){let l=H.readdirSync(u);r.claude.agents=l.filter(d=>d.startsWith("rcode-")&&d.endsWith(".md")),r.claude.agents=[...r.claude.agents,...l.filter(d=>d.startsWith("rihal-")&&d.endsWith(".md"))]}H.existsSync(M.join(t,".claude/agents/rules"))&&(r.claude.agentsRulesDir=!0)}if(e.includes("cursor")){let o=M.join(t,".cursor/rules");H.existsSync(o)&&(r.cursor=H.readdirSync(o).filter(a=>a.startsWith("rcode-")||a==="rcode.mdc"||a==="rcode-method.mdc"||a==="rcode"))}if(e.includes("windsurf")){let o=M.join(t,".windsurf/rules");H.existsSync(o)&&(r.windsurf=H.readdirSync(o).filter(a=>a.startsWith("rcode-")||a==="rcode.mdc"||a==="rcode-method.mdc"))}if(e.includes("antigravity")){let o=M.join(t,".antigravity/agents");H.existsSync(o)&&(r.antigravity=H.readdirSync(o).filter(a=>a.startsWith("rcode-")))}if(e.includes("gemini"))for(let o of["agents","commands"]){let a=M.join(t,".gemini","rcode",o);if(H.existsSync(a))for(let c of H.readdirSync(a))(c.startsWith("rcode-")||c.endsWith(".md"))&&r.gemini.push(M.join(".gemini/rcode",o,c))}let n=M.join(t,"AGENTS.md");if(H.existsSync(n)){let o=H.readFileSync(n,"utf8");(o.includes("## rcode Agents (installed)")||o.includes("## rcode Method Agents (installed)"))&&(r.agentsMd="present")}let s=M.join(t,".rcode");if(H.existsSync(s)){let a=function(c){for(let u of H.readdirSync(c,{withFileTypes:!0}))u.isDirectory()?a(M.join(c,u.name)):o++};var i=a;let o=0;try{a(s)}catch{}r.stateDir={files:o}}return r}function Wg(){try{let{readPackageManifest:t}=is(),e=M.resolve(__dirname,".."),r=t(e);if(r&&r.actions instanceof Set&&r.actions.size>0)return Array.from(r.actions)}catch{}return[]}var $A=Wg();function Hg(t){return $A.includes(t)}function Zg(t,e,r={}){let n=[];for(let i of t.claude.skills)n.push(M.join(".claude/skills",i));for(let i of t.claude.commands)i.startsWith("rcode-")&&i.endsWith(".md")&&n.push(M.join(".claude/commands",i));t.claude.commands.some(i=>!i.startsWith("rcode-"))&&n.push(".claude/commands/rcode");for(let i of t.claude.agents)n.push(M.join(".claude/agents",i));t.claude.agentsRulesDir&&n.push(".claude/agents/rules");for(let i of t.cursor)n.push(M.join(".cursor/rules",i));for(let i of t.windsurf)n.push(M.join(".windsurf/rules",i));for(let i of t.antigravity)n.push(M.join(".antigravity/agents",i));if(Array.isArray(t.gemini))for(let i of t.gemini)n.push(i);if(Array.isArray(t.vscode))for(let i of t.vscode)n.push(i);if(t.agentsMd&&H.existsSync(M.join(e,"AGENTS.md"))&&n.push("AGENTS.md"),r.purge){let i=M.join(e,".rcode");if(H.existsSync(i))try{for(let o of H.readdirSync(i))o!=="backups"&&n.push(M.join(".rcode",o))}catch{}H.existsSync(M.join(e,".planning"))&&n.push(".planning")}return n}function AA(t,e,r={}){let n=Zg(e,t,{purge:r.purge===!0}).map(l=>l.split(M.sep).join("/"));if(n.length===0)return{ok:!1,warning:"nothing to back up"};if(Ng("tar",["--version"],{stdio:"ignore"}).status!==0)return{ok:!1,warning:"tar not available on this system"};let i=r.purge?M.join(t,".rcode-backups"):M.join(t,".rcode/backups");try{H.mkdirSync(i,{recursive:!0})}catch(l){return{ok:!1,warning:`could not create ${M.relative(t,i)}/: ${l.message}`}}let o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),a=M.join(i,`uninstall-${o}.tgz`),c=M.relative(t,a),u=Ng("tar",["-czf",a,"-C",t,"--files-from=-"],{input:n.join(`
283
306
  `)+`
284
- `,encoding:"utf8"});return c.status!==0?{ok:!1,warning:`tar exited ${c.status}: ${(c.stderr||"").trim()}`}:{ok:!0,path:u}}function CA(t){if(!H.existsSync(t))return!1;let e=H.readFileSync(t,"utf8"),r=!1,n=[/\n*---\n+## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*---\n+## rcode Method Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*## rcode Method Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/];for(let s of n)s.test(e)&&(e=e.replace(s,""),r=!0);return r&&(e=e.replace(/\n---\n+$/,`
285
- `),oc(t,e)),r}ir.exports=async function(e){try{return await wA(e)}catch(r){throw r instanceof Og&&(console.log(`
286
- \u274C Uninstall cancelled \u2014 ${r.message}.`),process.exit(0)),r}};async function wA(t){let e=DA(t),r=process.cwd(),{SUPPORTED_IDES:n}=is(),s=e.editor?e.editor==="all"?Array.from(n):[e.editor]:Array.from(n);console.log(`
307
+ `,encoding:"utf8"});return u.status!==0?{ok:!1,warning:`tar exited ${u.status}: ${(u.stderr||"").trim()}`}:{ok:!0,path:c}}function FA(t){if(!H.existsSync(t))return!1;let e=H.readFileSync(t,"utf8"),r=!1,n=[/\n*---\n+## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*---\n+## rcode Method Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*## rcode Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/,/\n*## rcode Method Agents \(installed\)[\s\S]*?(?=\n## |\n*$)/];for(let s of n)s.test(e)&&(e=e.replace(s,""),r=!0);return r&&(e=e.replace(/\n---\n+$/,`
308
+ `),au(t,e)),r}cr.exports=async function(e){try{return await jA(e)}catch(r){throw r instanceof Bg&&(console.log(`
309
+ \u274C Uninstall cancelled \u2014 ${r.message}.`),process.exit(0)),r}};async function jA(t){let e=EA(t),r=process.cwd(),{SUPPORTED_IDES:n}=cs(),s=e.editor?e.editor==="all"?Array.from(n):[e.editor]:Array.from(n);console.log(`
287
310
  \u{1F54C} rcode \u2014 Uninstall
288
- `),console.log(` Project: ${r}`),console.log(` Scope: ${s.join(", ")}`),console.log();let i=H.existsSync(q.join(r,".rcode/config.yaml"))||H.existsSync(q.join(r,".rcode/config.json")),o=H.existsSync(q.join(r,".claude/skills"))||H.existsSync(q.join(r,".cursor/rules"))||H.existsSync(q.join(r,".windsurf/rules"))||H.existsSync(q.join(r,".antigravity/agents"));if(!i&&!o){console.log(`
289
- \u274C rcode is not installed in this directory.`),console.log(" Nothing to uninstall."),console.log(),console.log(" To install: rcode install"),console.log();return}let a=EA(r,s),u=a.claude.skills.length,c=a.claude.commands.length,l=a.cursor.length,d=a.windsurf.length,f=a.antigravity.length,g=a.claude.agents.length,m=u+c+g+l+d+f;if(m===0&&!a.agentsMd&&!a.stateDir){console.log(`
311
+ `),console.log(` Project: ${r}`),console.log(` Scope: ${s.join(", ")}`),console.log();let i=H.existsSync(M.join(r,".rcode/config.yaml"))||H.existsSync(M.join(r,".rcode/config.json")),o=H.existsSync(M.join(r,".claude/skills"))||H.existsSync(M.join(r,".cursor/rules"))||H.existsSync(M.join(r,".windsurf/rules"))||H.existsSync(M.join(r,".antigravity/agents"));if(!i&&!o){console.log(`
312
+ \u274C rcode is not installed in this directory.`),console.log(" Nothing to uninstall."),console.log(),console.log(" To install: rcode install"),console.log();return}let a=kA(r,s),c=a.claude.skills.length,u=a.claude.commands.length,l=a.cursor.length,d=a.windsurf.length,f=a.antigravity.length,g=a.claude.agents.length,m=c+u+g+l+d+f;if(m===0&&!a.agentsMd&&!a.stateDir){console.log(`
290
313
  \u274C No rcode files found to remove.`),console.log(" The install markers are present but all files have already been deleted."),console.log();return}if(console.log(`What will be removed:
291
- `),s.includes("claude")&&(console.log(" Claude Code"),console.log(` .claude/skills/ (rcode-*): ${u} skills`),console.log(` .claude/commands/rcode/: ${c} slash commands`),console.log(` .claude/agents/rcode-*.md: ${g} agents`)),s.includes("cursor")&&(console.log(" Cursor"),console.log(` .cursor/rules/rcode-*.mdc: ${l} rules`)),s.includes("windsurf")&&(console.log(" Windsurf"),console.log(` .windsurf/rules/rcode-*.mdc: ${d} rules`)),s.includes("antigravity")&&(console.log(" Antigravity"),console.log(` .antigravity/agents/rcode-*: ${f} agents`)),a.agentsMd&&(console.log(" AGENTS.md"),console.log(" rcode section will be stripped (file preserved)")),a.stateDir&&(console.log(),console.log("\u26A0\uFE0F .rcode/ state directory detected"),console.log(` Contains ${a.stateDir.files} files (phases, decisions, progress, artifacts)`),console.log(" This is YOUR PROJECT DATA \u2014 not the skill files."),e.deleteState?console.log(" \u2192 Will be DELETED (--delete-state flag)"):e.keepState?console.log(" \u2192 Will be KEPT (--keep-state flag)"):console.log(" \u2192 Will ask separately after the main confirmation.")),console.log(),!e.yes&&!await Pg(`Proceed with removing ${m} skill/command files${a.agentsMd?" + AGENTS.md section":""}? [y/N] `,{default:"n"})){console.log(`
292
- \u274C Aborted. Nothing was removed.`);return}console.log();let D=SA(r,a,{purge:e.purge===!0});D.ok?(console.log(` \u{1F4BE} backup created: ${D.path}`),e.purge&&console.log(" includes .rcode/ and .planning/ (state, decisions, planning artifacts)")):console.log(` \u26A0 no backup created (${D.warning}) \u2014 continuing anyway`),console.log();let h=0;if(s.includes("claude")){let P=q.join(r,".claude/skills"),E=In(P,J=>J.startsWith("rcode-")||Mg(J));h+=E,E>0&&console.log(` \u2713 removed ${E} Claude skills`);let Q=q.join(r,".claude/commands/rcode");if(H.existsSync(Q)){let J=Fr(Q,q.resolve(r));!J.ok&&J.reason==="outside-root"&&console.log(` \u26A0 refused to remove ${Q} \u2014 symlink resolves outside project root`)}let re=q.join(r,".claude/commands"),le=0;if(H.existsSync(re))for(let J of H.readdirSync(re))J.startsWith("rcode-")&&(J.endsWith(".md")||J.endsWith(".mdc"))&&(H.unlinkSync(q.join(re,J)),le++);let $=a.claude.commands.length;h+=$,$>0&&console.log(` \u2713 removed ${$} slash commands from .claude/commands/`);let k=q.join(r,".claude/agents"),he=In(k,J=>J.startsWith("rcode-")&&J.endsWith(".md"));if(h+=he,he>0&&console.log(` \u2713 removed ${he} Claude agents`),a.claude.agentsRulesDir){let J=q.join(r,".claude/agents/rules"),xe=Fr(J,q.resolve(r));xe.ok&&xe.reason!=="missing"?console.log(" \u2713 removed .claude/agents/rules/ (agent reference rules)"):xe.reason==="outside-root"&&console.log(" \u26A0 refused to remove .claude/agents/rules/ \u2014 symlink resolves outside project root")}try{H.existsSync(q.join(r,".claude/commands"))&&H.readdirSync(q.join(r,".claude/commands")).length===0&&H.rmdirSync(q.join(r,".claude/commands")),H.existsSync(k)&&H.readdirSync(k).length===0&&H.rmdirSync(k)}catch{}}if(s.includes("cursor")){let P=q.join(r,".cursor/rules"),E=In(P,Q=>Q.startsWith("rcode-")||Q==="rcode.mdc"||Q==="rcode-method.mdc"||Q==="rcode");h+=E,E>0&&console.log(` \u2713 removed ${E} Cursor rules`)}if(s.includes("windsurf")){let P=q.join(r,".windsurf/rules"),E=In(P,Q=>Q.startsWith("rcode-")||Q==="rcode.mdc"||Q==="rcode-method.mdc");h+=E,E>0&&console.log(` \u2713 removed ${E} Windsurf rules`)}if(s.includes("antigravity")){let P=q.join(r,".antigravity/agents"),E=In(P,Q=>Q.startsWith("rcode-"));h+=E,E>0&&console.log(` \u2713 removed ${E} Antigravity agents`)}if(s.includes("codex")&&sc(q.join(nc.homedir(),".codex","hooks.json"),"UserPromptSubmit")==="removed"&&console.log(" \u2713 removed rcode slash-router hook from ~/.codex/hooks.json"),s.includes("antigravity")&&sc(q.join(nc.homedir(),".gemini","antigravity","settings.json"),"UserPrompt")==="removed"&&console.log(" \u2713 removed rcode slash-router hook from ~/.gemini/antigravity/settings.json"),s.includes("codex")||s.includes("antigravity")){let P=nc.homedir();for(let E of[q.join(P,".rcode","slash-commands"),q.join(P,".rcode","bin")])H.existsSync(E)&&Fr(E,P).ok&&console.log(` \u2713 removed ${E}`)}if(s.includes("gemini")){let P=0;for(let E of["agents","commands"]){let Q=q.join(r,".gemini","rcode",E);P+=In(Q,re=>re.startsWith("rcode-")||re.endsWith(".md"))}h+=P,P>0&&console.log(` \u2713 removed ${P} Gemini files`)}if(s.includes("vscode")){let P=q.join(r,".vscode/rcode");H.existsSync(P)&&Fr(P,q.resolve(r)).ok&&(h+=1,console.log(" \u2713 removed .vscode/rcode/ marker"))}if(a.agentsMd){let P=q.join(r,"AGENTS.md");CA(P)&&console.log(" \u2713 stripped rcode section from AGENTS.md")}let w=q.join(r,".gitignore");if(H.existsSync(w))try{let P=H.readFileSync(w,"utf8"),E=Lg(P);E!==P&&(H.writeFileSync(w,E),console.log(" \u2713 stripped rcode block from .gitignore"))}catch(P){console.log(` \u26A0 could not strip .gitignore block: ${P.message}`)}let C=yA(r);C==="removed"?console.log(" \u2713 removed .git/hooks/pre-commit (was rcode-only)"):C==="stripped"&&console.log(" \u2713 stripped rcode block from .git/hooks/pre-commit"),_A(r,[".claude/skills",".claude/commands",".claude",".cursor/rules",".cursor",".windsurf/rules",".windsurf",".antigravity/agents",".antigravity"]);let A=q.join(r,".rcode","brain");if(H.existsSync(A)){let P=Fr(A,q.resolve(r));P.ok?console.log(" \u2713 removed .rcode/brain/ (pulled content, will refresh on reinstall)"):P.reason==="outside-root"&&console.log(" \u26A0 refused to remove .rcode/brain/ \u2014 symlink resolves outside project root")}if(a.stateDir){let P=q.join(r,".rcode"),E=e.deleteState;if(!e.deleteState&&!e.keepState&&!e.yes&&(console.log(),console.log("\u26A0\uFE0F The .rcode/ state directory contains your project data:"),console.log(" - config.yaml, state.json, JOURNEY.md"),console.log(" - phases, decisions, progress, artifacts, context"),console.log(` - ${a.stateDir.files} files total`),console.log(),console.log(' If you keep it: /rcode-init will report "already configured"'),console.log(" and reuse your existing config + history on next install."),console.log(" If you delete it: next install starts fresh \u2014 no carry-over."),console.log(),E=await Pg("Also delete .rcode/ state? This is destructive and cannot be undone. [y/N] ",{default:"n"})),E){let Q=Fr(P,q.resolve(r));Q.ok?console.log(" \u2713 removed .rcode/ state directory"):Q.reason==="outside-root"?console.log(" \u26A0 refused to remove .rcode/ \u2014 symlink resolves outside project root"):console.log(` \u26A0 could not remove .rcode/: ${Q.reason}`)}else console.log(" \u2139 kept .rcode/ state directory (your project data is preserved)")}if(e.purge){let P=q.join(r,".planning");if(H.existsSync(P)){let E=Fr(P,q.resolve(r));E.ok?console.log(" \u2713 removed .planning/ (--purge)"):E.reason==="outside-root"?console.log(" \u26A0 refused to remove .planning/ \u2014 symlink resolves outside project root"):console.log(` \u26A0 could not remove .planning/: ${E.reason}`)}}console.log(`
293
- \u2705 Uninstall complete. Removed ${h} files.`),D.ok&&console.log(` Backup: ${D.path} (restore with: tar -xzf ${D.path})`);let T=a.stateDir&&H.existsSync(q.join(r,".rcode")),G=!e.purge&&H.existsSync(q.join(r,".planning")),I=!e.purge&&H.existsSync(q.join(r,".claude/agents/rules")),Z=!e.purge&&(()=>{let P=q.join(r,".cursor/rules");if(!H.existsSync(P))return!1;try{return H.readdirSync(P).some(E=>E.startsWith("rcode-")||E==="rcode.mdc"||E==="rcode-method.mdc"||E==="rcode")}catch{return!1}})(),F=!e.purge&&(()=>{try{let P=q.join(r,".gitignore");if(!H.existsSync(P))return!1;let E=H.readFileSync(P,"utf8");return E.includes("# ===== rcode-managed gitignore block")||E.includes("# >>> rcode >>>")}catch{return!1}})(),W=!e.purge&&(()=>{let P=q.join(r,".git/hooks/pre-commit");if(!H.existsSync(P))return!1;try{return H.readFileSync(P,"utf8").includes("# ===== rcode-managed pre-commit block =====")}catch{return!1}})();(T||G||I||Z||F||W)&&(console.log(),console.log("\u2139 Preserved (use --purge to remove all of these):"),T&&console.log(" .rcode/ project state, config, decisions"),G&&console.log(" .planning/ ROADMAP, STATE, PROJECT scaffolds"),I&&console.log(" .claude/agents/rules/ agent rule files"),Z&&console.log(" .cursor/ Cursor IDE integration"),F&&console.log(" .gitignore rcode-managed block still present"),W&&console.log(" .git/hooks/ pre-commit hook still present"),console.log(),console.log(" Full cleanup: rcode uninstall --purge")),console.log(),console.log("\u{1F4A1} IDE reload required:"),console.log(' VS Code / Cursor: Cmd+Shift+P \u2192 "Developer: Reload Window"'),console.log(" If commands still appear after reload, check ~/.claude/commands/ for"),console.log(" any globally-installed rcode-* items (rcode does not touch global installs)."),console.log(`
294
- To reinstall later:`),console.log(" rcode install")}ir.exports.isLocalOverride=Ng;ir.exports.planToPathList=qg;ir.exports.discoverKnownActionSkills=Bg;ir.exports.stripRcodeGitignoreBlock=Lg;ir.exports.removeSlashRouterHook=sc;require.main===ir&&ir.exports(process.argv.slice(2)).catch(t=>{t instanceof Og&&(console.log(`
314
+ `),s.includes("claude")&&(console.log(" Claude Code"),console.log(` .claude/skills/ (rcode-*): ${c} skills`),console.log(` .claude/commands/rcode/: ${u} slash commands`),console.log(` .claude/agents/rcode-*.md: ${g} agents`)),s.includes("cursor")&&(console.log(" Cursor"),console.log(` .cursor/rules/rcode-*.mdc: ${l} rules`)),s.includes("windsurf")&&(console.log(" Windsurf"),console.log(` .windsurf/rules/rcode-*.mdc: ${d} rules`)),s.includes("antigravity")&&(console.log(" Antigravity"),console.log(` .antigravity/agents/rcode-*: ${f} agents`)),a.agentsMd&&(console.log(" AGENTS.md"),console.log(" rcode section will be stripped (file preserved)")),a.stateDir&&(console.log(),console.log("\u26A0\uFE0F .rcode/ state directory detected"),console.log(` Contains ${a.stateDir.files} files (phases, decisions, progress, artifacts)`),console.log(" This is YOUR PROJECT DATA \u2014 not the skill files."),e.deleteState?console.log(" \u2192 Will be DELETED (--delete-state flag)"):e.keepState?console.log(" \u2192 Will be KEPT (--keep-state flag)"):console.log(" \u2192 Will ask separately after the main confirmation.")),console.log(),!e.yes&&!await Lg(`Proceed with removing ${m} skill/command files${a.agentsMd?" + AGENTS.md section":""}? [y/N] `,{default:"n"})){console.log(`
315
+ \u274C Aborted. Nothing was removed.`);return}console.log();let y=AA(r,a,{purge:e.purge===!0});y.ok?(console.log(` \u{1F4BE} backup created: ${y.path}`),e.purge&&console.log(" includes .rcode/ and .planning/ (state, decisions, planning artifacts)")):console.log(` \u26A0 no backup created (${y.warning}) \u2014 continuing anyway`),console.log();let h=0;if(s.includes("claude")){let R=M.join(r,".claude/skills"),b=Rn(R,X=>X.startsWith("rcode-")||Hg(X));h+=b,b>0&&console.log(` \u2713 removed ${b} Claude skills`);let Q=M.join(r,".claude/commands/rcode");if(H.existsSync(Q)){let X=Tr(Q,M.resolve(r));!X.ok&&X.reason==="outside-root"&&console.log(` \u26A0 refused to remove ${Q} \u2014 symlink resolves outside project root`)}let te=M.join(r,".claude/commands"),de=0;if(H.existsSync(te))for(let X of H.readdirSync(te))X.startsWith("rcode-")&&(X.endsWith(".md")||X.endsWith(".mdc"))&&(H.unlinkSync(M.join(te,X)),de++);let x=a.claude.commands.length;h+=x,x>0&&console.log(` \u2713 removed ${x} slash commands from .claude/commands/`);let k=M.join(r,".claude/agents"),he=Rn(k,X=>X.startsWith("rcode-")&&X.endsWith(".md"));if(h+=he,he>0&&console.log(` \u2713 removed ${he} Claude agents`),a.claude.agentsRulesDir){let X=M.join(r,".claude/agents/rules"),xe=Tr(X,M.resolve(r));xe.ok&&xe.reason!=="missing"?console.log(" \u2713 removed .claude/agents/rules/ (agent reference rules)"):xe.reason==="outside-root"&&console.log(" \u26A0 refused to remove .claude/agents/rules/ \u2014 symlink resolves outside project root")}try{H.existsSync(M.join(r,".claude/commands"))&&H.readdirSync(M.join(r,".claude/commands")).length===0&&H.rmdirSync(M.join(r,".claude/commands")),H.existsSync(k)&&H.readdirSync(k).length===0&&H.rmdirSync(k)}catch{}}if(s.includes("cursor")){let R=M.join(r,".cursor/rules"),b=Rn(R,Q=>Q.startsWith("rcode-")||Q==="rcode.mdc"||Q==="rcode-method.mdc"||Q==="rcode");h+=b,b>0&&console.log(` \u2713 removed ${b} Cursor rules`)}if(s.includes("windsurf")){let R=M.join(r,".windsurf/rules"),b=Rn(R,Q=>Q.startsWith("rcode-")||Q==="rcode.mdc"||Q==="rcode-method.mdc");h+=b,b>0&&console.log(` \u2713 removed ${b} Windsurf rules`)}if(s.includes("antigravity")){let R=M.join(r,".antigravity/agents"),b=Rn(R,Q=>Q.startsWith("rcode-"));h+=b,b>0&&console.log(` \u2713 removed ${b} Antigravity agents`)}if(s.includes("codex")&&iu(M.join(ou.homedir(),".codex","hooks.json"),"UserPromptSubmit")==="removed"&&console.log(" \u2713 removed rcode slash-router hook from ~/.codex/hooks.json"),s.includes("antigravity")&&iu(M.join(ou.homedir(),".gemini","antigravity","settings.json"),"UserPrompt")==="removed"&&console.log(" \u2713 removed rcode slash-router hook from ~/.gemini/antigravity/settings.json"),s.includes("codex")||s.includes("antigravity")){let R=ou.homedir();for(let b of[M.join(R,".rcode","slash-commands"),M.join(R,".rcode","bin")])H.existsSync(b)&&Tr(b,R).ok&&console.log(` \u2713 removed ${b}`)}if(s.includes("gemini")){let R=0;for(let b of["agents","commands"]){let Q=M.join(r,".gemini","rcode",b);R+=Rn(Q,te=>te.startsWith("rcode-")||te.endsWith(".md"))}h+=R,R>0&&console.log(` \u2713 removed ${R} Gemini files`)}if(s.includes("vscode")){let R=M.join(r,".vscode/rcode");H.existsSync(R)&&Tr(R,M.resolve(r)).ok&&(h+=1,console.log(" \u2713 removed .vscode/rcode/ marker"))}if(a.agentsMd){let R=M.join(r,"AGENTS.md");FA(R)&&console.log(" \u2713 stripped rcode section from AGENTS.md")}let w=M.join(r,".gitignore");if(H.existsSync(w))try{let R=H.readFileSync(w,"utf8"),b=qg(R);b!==R&&(H.writeFileSync(w,b),console.log(" \u2713 stripped rcode block from .gitignore"))}catch(R){console.log(` \u26A0 could not strip .gitignore block: ${R.message}`)}let C=CA(r);C==="removed"?console.log(" \u2713 removed .git/hooks/pre-commit (was rcode-only)"):C==="stripped"&&console.log(" \u2713 stripped rcode block from .git/hooks/pre-commit"),xA(r,[".claude/skills",".claude/commands",".claude",".cursor/rules",".cursor",".windsurf/rules",".windsurf",".antigravity/agents",".antigravity"]);let A=M.join(r,".rcode","brain");if(H.existsSync(A)){let R=Tr(A,M.resolve(r));R.ok?console.log(" \u2713 removed .rcode/brain/ (pulled content, will refresh on reinstall)"):R.reason==="outside-root"&&console.log(" \u26A0 refused to remove .rcode/brain/ \u2014 symlink resolves outside project root")}if(a.stateDir){let R=M.join(r,".rcode"),b=e.deleteState;if(!e.deleteState&&!e.keepState&&!e.yes&&(console.log(),console.log("\u26A0\uFE0F The .rcode/ state directory contains your project data:"),console.log(" - config.yaml, state.json, JOURNEY.md"),console.log(" - phases, decisions, progress, artifacts, context"),console.log(` - ${a.stateDir.files} files total`),console.log(),console.log(' If you keep it: /rcode-init will report "already configured"'),console.log(" and reuse your existing config + history on next install."),console.log(" If you delete it: next install starts fresh \u2014 no carry-over."),console.log(),b=await Lg("Also delete .rcode/ state? This is destructive and cannot be undone. [y/N] ",{default:"n"})),b){let Q=Tr(R,M.resolve(r));Q.ok?console.log(" \u2713 removed .rcode/ state directory"):Q.reason==="outside-root"?console.log(" \u26A0 refused to remove .rcode/ \u2014 symlink resolves outside project root"):console.log(` \u26A0 could not remove .rcode/: ${Q.reason}`)}else console.log(" \u2139 kept .rcode/ state directory (your project data is preserved)")}if(e.purge){let R=M.join(r,".planning");if(H.existsSync(R)){let b=Tr(R,M.resolve(r));b.ok?console.log(" \u2713 removed .planning/ (--purge)"):b.reason==="outside-root"?console.log(" \u26A0 refused to remove .planning/ \u2014 symlink resolves outside project root"):console.log(` \u26A0 could not remove .planning/: ${b.reason}`)}}console.log(`
316
+ \u2705 Uninstall complete. Removed ${h} files.`),y.ok&&console.log(` Backup: ${y.path} (restore with: tar -xzf ${y.path})`);let T=a.stateDir&&H.existsSync(M.join(r,".rcode")),G=!e.purge&&H.existsSync(M.join(r,".planning")),I=!e.purge&&H.existsSync(M.join(r,".claude/agents/rules")),Z=!e.purge&&(()=>{let R=M.join(r,".cursor/rules");if(!H.existsSync(R))return!1;try{return H.readdirSync(R).some(b=>b.startsWith("rcode-")||b==="rcode.mdc"||b==="rcode-method.mdc"||b==="rcode")}catch{return!1}})(),F=!e.purge&&(()=>{try{let R=M.join(r,".gitignore");if(!H.existsSync(R))return!1;let b=H.readFileSync(R,"utf8");return b.includes("# ===== rcode-managed gitignore block")||b.includes("# >>> rcode >>>")}catch{return!1}})(),W=!e.purge&&(()=>{let R=M.join(r,".git/hooks/pre-commit");if(!H.existsSync(R))return!1;try{return H.readFileSync(R,"utf8").includes("# ===== rcode-managed pre-commit block =====")}catch{return!1}})();(T||G||I||Z||F||W)&&(console.log(),console.log("\u2139 Preserved (use --purge to remove all of these):"),T&&console.log(" .rcode/ project state, config, decisions"),G&&console.log(" .planning/ ROADMAP, STATE, PROJECT scaffolds"),I&&console.log(" .claude/agents/rules/ agent rule files"),Z&&console.log(" .cursor/ Cursor IDE integration"),F&&console.log(" .gitignore rcode-managed block still present"),W&&console.log(" .git/hooks/ pre-commit hook still present"),console.log(),console.log(" Full cleanup: rcode uninstall --purge")),console.log(),console.log("\u{1F4A1} IDE reload required:"),console.log(' VS Code / Cursor: Cmd+Shift+P \u2192 "Developer: Reload Window"'),console.log(" If commands still appear after reload, check ~/.claude/commands/ for"),console.log(" any globally-installed rcode-* items (rcode does not touch global installs)."),console.log(`
317
+ To reinstall later:`),console.log(" rcode install")}cr.exports.isLocalOverride=Mg;cr.exports.planToPathList=Zg;cr.exports.discoverKnownActionSkills=Wg;cr.exports.stripRcodeGitignoreBlock=qg;cr.exports.removeSlashRouterHook=iu;require.main===cr&&cr.exports(process.argv.slice(2)).catch(t=>{t instanceof Bg&&(console.log(`
295
318
  \u274C Aborted.`),process.exit(1)),console.error(`
296
- \u274C Uninstall failed: ${t.message}`),process.env.DEBUG&&console.error(t.stack),process.exit(1)})});var Zg=v((WI,Hg)=>{"use strict";var cs=require("fs"),Ee=require("path"),{spawnSync:ar}=require("child_process"),{homedir:ac}=lr();function He(t){try{return cs.accessSync(t),!0}catch{return!1}}function Tn(t){try{return cs.readdirSync(t)}catch{return[]}}function xA(){let t=ac(),e=[];try{let n=ar("npm",["root","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"npm",dir:n.stdout.trim()})}catch{}try{let n=ar("pnpm",["root","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"pnpm",dir:n.stdout.trim()})}catch{}try{let n=ar("yarn",["global","dir"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"yarn",dir:Ee.join(n.stdout.trim(),"node_modules")})}catch{}try{let n=ar("bun",["pm","bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"bun",dir:Ee.join(t,".bun","install","global","node_modules")})}catch{}let r=Ee.join(t,".nvm","versions","node");if(He(r))for(let n of Tn(r)){let s=Ee.join(r,n,"lib","node_modules");He(s)&&!e.some(i=>i.dir===s)&&e.push({manager:`nvm/${n}`,dir:s})}return e}function $A(t){let e=[];for(let r of["@hanzlaa","@hanzlahabib"]){let n=Ee.join(t,r);if(He(n))for(let s of Tn(n))(s==="rcode"||s==="rcode"||s.startsWith("rcode"))&&e.push({scope:r,pkg:s,dir:Ee.join(n,s)})}return e}function kA(){let t=ac(),e=new Set;try{let n=ar("npm",["prefix","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(Ee.join(n.stdout.trim(),"bin"))}catch{}try{let n=ar("pnpm",["bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}try{let n=ar("yarn",["global","bin"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}try{let n=ar("bun",["pm","bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}e.add(Ee.join(t,".local","share","pnpm")),e.add(Ee.join(t,".local","bin")),e.add(Ee.join(t,".bun","bin"));let r=Ee.join(t,".nvm","versions","node");if(He(r))for(let n of Tn(r))e.add(Ee.join(r,n,"bin"));return[...e].filter(He)}var AA=["rcode","rcode","rcode"];function FA(t){let e=[];for(let r of AA){let n=Ee.join(t,r);if(He(n)){let s=null;try{s=cs.readlinkSync(n)}catch{}(!s||/rcode|rcode|@hanzlaa|@hanzlahabib/.test(s))&&e.push({name:r,path:n,target:s})}}return e}function Wg(t){let e=[];if(!He(t))return e;let r=Ee.join(t,"commands");if(He(r)){for(let o of Tn(r))o.startsWith("rcode-")&&(o.endsWith(".md")||o.endsWith(".mdc"))&&e.push({kind:"command",path:Ee.join(r,o)});let i=Ee.join(r,"rcode");He(i)&&e.push({kind:"commands-dir",path:i})}let n=Ee.join(t,"agents");if(He(n))for(let i of Tn(n))i.startsWith("rcode-")&&(i.endsWith(".md")||i.endsWith(".mdc"))&&e.push({kind:"agent",path:Ee.join(n,i)});let s=Ee.join(t,"skills");if(He(s))for(let i of Tn(s))i.startsWith("rcode-")&&e.push({kind:"skill-dir",path:Ee.join(s,i)});return e}function jA({includePlanning:t}){let e=ac(),r=process.cwd(),n={packages:[],bins:[],globalClaude:[],globalrcode:null,projectClaude:[],projectrcode:null,projectPlanning:null};for(let{manager:o,dir:a}of xA())for(let u of $A(a))n.packages.push({manager:o,...u});for(let o of kA())for(let a of FA(o))n.bins.push({binDir:o,...a});n.globalClaude=Wg(Ee.join(e,".claude"));let s=Ee.join(e,".rcode");He(s)&&(n.globalrcode=s),n.projectClaude=Wg(Ee.join(r,".claude"));let i=Ee.join(r,".rcode");if(He(i)&&r!==e&&(n.projectrcode=i),t){let o=Ee.join(r,".planning");He(o)&&r!==e&&(n.projectPlanning=o)}return n}function IA(t,{dryRun:e}){console.log(`
319
+ \u274C Uninstall failed: ${t.message}`),process.env.DEBUG&&console.error(t.stack),process.exit(1)})});var Gg=v((zI,Vg)=>{"use strict";var ds=require("fs"),Se=require("path"),{spawnSync:ur}=require("child_process"),{homedir:uu}=hr();function Ge(t){try{return ds.accessSync(t),!0}catch{return!1}}function Pn(t){try{return ds.readdirSync(t)}catch{return[]}}function IA(){let t=uu(),e=[];try{let n=ur("npm",["root","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"npm",dir:n.stdout.trim()})}catch{}try{let n=ur("pnpm",["root","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"pnpm",dir:n.stdout.trim()})}catch{}try{let n=ur("yarn",["global","dir"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"yarn",dir:Se.join(n.stdout.trim(),"node_modules")})}catch{}try{let n=ur("bun",["pm","bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"bun",dir:Se.join(t,".bun","install","global","node_modules")})}catch{}let r=Se.join(t,".nvm","versions","node");if(Ge(r))for(let n of Pn(r)){let s=Se.join(r,n,"lib","node_modules");Ge(s)&&!e.some(i=>i.dir===s)&&e.push({manager:`nvm/${n}`,dir:s})}return e}function TA(t){let e=[];for(let r of["@hanzlaa","@hanzlahabib"]){let n=Se.join(t,r);if(Ge(n))for(let s of Pn(n))(s==="rcode"||s==="rcode"||s.startsWith("rcode"))&&e.push({scope:r,pkg:s,dir:Se.join(n,s)})}return e}function RA(){let t=uu(),e=new Set;try{let n=ur("npm",["prefix","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(Se.join(n.stdout.trim(),"bin"))}catch{}try{let n=ur("pnpm",["bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}try{let n=ur("yarn",["global","bin"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}try{let n=ur("bun",["pm","bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}e.add(Se.join(t,".local","share","pnpm")),e.add(Se.join(t,".local","bin")),e.add(Se.join(t,".bun","bin"));let r=Se.join(t,".nvm","versions","node");if(Ge(r))for(let n of Pn(r))e.add(Se.join(r,n,"bin"));return[...e].filter(Ge)}var PA=["rcode","rcode","rcode"];function OA(t){let e=[];for(let r of PA){let n=Se.join(t,r);if(Ge(n)){let s=null;try{s=ds.readlinkSync(n)}catch{}(!s||/rcode|rcode|@hanzlaa|@hanzlahabib/.test(s))&&e.push({name:r,path:n,target:s})}}return e}function Ug(t){let e=[];if(!Ge(t))return e;let r=Se.join(t,"commands");if(Ge(r)){for(let o of Pn(r))o.startsWith("rcode-")&&(o.endsWith(".md")||o.endsWith(".mdc"))&&e.push({kind:"command",path:Se.join(r,o)});let i=Se.join(r,"rcode");Ge(i)&&e.push({kind:"commands-dir",path:i})}let n=Se.join(t,"agents");if(Ge(n))for(let i of Pn(n))i.startsWith("rcode-")&&(i.endsWith(".md")||i.endsWith(".mdc"))&&e.push({kind:"agent",path:Se.join(n,i)});let s=Se.join(t,"skills");if(Ge(s))for(let i of Pn(s))i.startsWith("rcode-")&&e.push({kind:"skill-dir",path:Se.join(s,i)});return e}function NA({includePlanning:t}){let e=uu(),r=process.cwd(),n={packages:[],bins:[],globalClaude:[],globalrcode:null,projectClaude:[],projectrcode:null,projectPlanning:null};for(let{manager:o,dir:a}of IA())for(let c of TA(a))n.packages.push({manager:o,...c});for(let o of RA())for(let a of OA(o))n.bins.push({binDir:o,...a});n.globalClaude=Ug(Se.join(e,".claude"));let s=Se.join(e,".rcode");Ge(s)&&(n.globalrcode=s),n.projectClaude=Ug(Se.join(r,".claude"));let i=Se.join(r,".rcode");if(Ge(i)&&r!==e&&(n.projectrcode=i),t){let o=Se.join(r,".planning");Ge(o)&&r!==e&&(n.projectPlanning=o)}return n}function LA(t,{dryRun:e}){console.log(`
297
320
  \u{1F525} rcode nuke \xB7 by Hanzla Habib ${e?"[DRY RUN \u2014 pass --yes to remove]":"[REMOVING]"}
298
321
  `);let n=0,s=(i,o)=>{if(!(!o||Array.isArray(o)&&o.length===0)){if(console.log(`${i}`),Array.isArray(o))for(let a of o)console.log(` \u2022 ${a.description||a.path||a.dir||JSON.stringify(a)}`),n++;else console.log(` \u2022 ${o}`),n++;console.log("")}};return s("\u{1F4E6} Global packages (node_modules):",t.packages.map(i=>({description:`[${i.manager}] ${i.scope}/${i.pkg} \u2192 ${i.dir}`}))),s("\u{1F517} Global binaries:",t.bins.map(i=>({description:`${i.path}${i.target?` \u2192 ${i.target}`:""}`}))),s("\u{1F916} ~/.claude/ artifacts:",t.globalClaude.map(i=>({description:`[${i.kind}] ${i.path}`}))),t.globalrcode&&s("\u{1F5C2}\uFE0F ~/.rcode/ (global state):",t.globalrcode),s("\u{1F916} ./.claude/ artifacts (current project):",t.projectClaude.map(i=>({description:`[${i.kind}] ${i.path}`}))),t.projectrcode&&s("\u{1F5C2}\uFE0F ./.rcode/ (project state):",t.projectrcode),t.projectPlanning&&s("\u{1F4CB} ./.planning/ (your work \u2014 only with --include-planning):",t.projectPlanning),console.log(n===0?` \u2713 nothing to remove \u2014 system is clean.
299
322
  `:` Total: ${n} item(s).
300
- `),n}function an(t){try{return cs.rmSync(t,{recursive:!0,force:!0}),!0}catch(e){return console.warn(` \u26A0 failed to remove ${t}: ${e.message}`),!1}}function TA(t,e,r){let n=`${e}/${r}`,s=t==="pnpm"?["pnpm",["remove","-g",n]]:t==="yarn"?["yarn",["global","remove",n]]:t==="bun"?["bun",["remove","-g",n]]:["npm",["uninstall","-g",n]];try{return ar(s[0],s[1],{stdio:"pipe",encoding:"utf8"}).status===0}catch{return!1}}function RA(t){let e=0;for(let r of t.packages){let n=r.manager.startsWith("nvm/")?"npm":r.manager;process.stdout.write(` ${n} uninstall ${r.scope}/${r.pkg} ... `);let s=TA(n,r.scope,r.pkg);console.log(s?"\u2713":"\u26A0 failed via PM, falling back to rm"),s||an(r.dir),e++}for(let r of t.bins)He(r.path)&&an(r.path)&&(console.log(` \u2713 removed bin ${r.path}`),e++);for(let r of t.globalClaude)an(r.path)&&(console.log(` \u2713 removed ${r.path}`),e++);t.globalrcode&&an(t.globalrcode)&&(console.log(` \u2713 removed ${t.globalrcode}`),e++);for(let r of t.projectClaude)an(r.path)&&(console.log(` \u2713 removed ${r.path}`),e++);return t.projectrcode&&an(t.projectrcode)&&(console.log(` \u2713 removed ${t.projectrcode}`),e++),t.projectPlanning&&an(t.projectPlanning)&&(console.log(` \u2713 removed ${t.projectPlanning}`),e++),e}Hg.exports=function(e=[]){let r=!e.includes("--yes")&&!e.includes("-y"),n=e.includes("--include-planning"),s=Ee.join(process.cwd(),"package.json");if(He(s))try{let u=JSON.parse(cs.readFileSync(s,"utf8"));if((u.name==="@hanzlaa/rcode"||u.name==="@hanzlahabib/rihal-code")&&(console.log(`
323
+ `),n}function un(t){try{return ds.rmSync(t,{recursive:!0,force:!0}),!0}catch(e){return console.warn(` \u26A0 failed to remove ${t}: ${e.message}`),!1}}function BA(t,e,r){let n=`${e}/${r}`,s=t==="pnpm"?["pnpm",["remove","-g",n]]:t==="yarn"?["yarn",["global","remove",n]]:t==="bun"?["bun",["remove","-g",n]]:["npm",["uninstall","-g",n]];try{return ur(s[0],s[1],{stdio:"pipe",encoding:"utf8"}).status===0}catch{return!1}}function MA(t){let e=0;for(let r of t.packages){let n=r.manager.startsWith("nvm/")?"npm":r.manager;process.stdout.write(` ${n} uninstall ${r.scope}/${r.pkg} ... `);let s=BA(n,r.scope,r.pkg);console.log(s?"\u2713":"\u26A0 failed via PM, falling back to rm"),s||un(r.dir),e++}for(let r of t.bins)Ge(r.path)&&un(r.path)&&(console.log(` \u2713 removed bin ${r.path}`),e++);for(let r of t.globalClaude)un(r.path)&&(console.log(` \u2713 removed ${r.path}`),e++);t.globalrcode&&un(t.globalrcode)&&(console.log(` \u2713 removed ${t.globalrcode}`),e++);for(let r of t.projectClaude)un(r.path)&&(console.log(` \u2713 removed ${r.path}`),e++);return t.projectrcode&&un(t.projectrcode)&&(console.log(` \u2713 removed ${t.projectrcode}`),e++),t.projectPlanning&&un(t.projectPlanning)&&(console.log(` \u2713 removed ${t.projectPlanning}`),e++),e}Vg.exports=function(e=[]){let r=!e.includes("--yes")&&!e.includes("-y"),n=e.includes("--include-planning"),s=Se.join(process.cwd(),"package.json");if(Ge(s))try{let c=JSON.parse(ds.readFileSync(s,"utf8"));if((c.name==="@hanzlaa/rcode"||c.name==="@hanzlahabib/rihal-code")&&(console.log(`
301
324
  \u26A0 You are inside the rcode source repo.`),console.log(" Nuke would remove this repo's .claude/, .rcode/, and possibly .planning/."),console.log(" That is your source code \u2014 almost certainly not what you want."),console.log(` Run nuke from a different directory, or pass --i-know-what-im-doing to override.
302
- `),!e.includes("--i-know-what-im-doing")))return}catch{}let i=jA({includePlanning:n}),o=IA(i,{dryRun:r});if(o===0||r){r&&o>0&&(console.log("To actually remove these, re-run with: rcode nuke --yes"),console.log(`To also remove .planning/ (your work): rcode nuke --yes --include-planning
325
+ `),!e.includes("--i-know-what-im-doing")))return}catch{}let i=NA({includePlanning:n}),o=LA(i,{dryRun:r});if(o===0||r){r&&o>0&&(console.log("To actually remove these, re-run with: rcode nuke --yes"),console.log(`To also remove .planning/ (your work): rcode nuke --yes --include-planning
303
326
  `));return}console.log(`Executing...
304
- `);let a=RA(i);console.log(`
327
+ `);let a=MA(i);console.log(`
305
328
  \u2705 Done. Removed ${a} item(s). Reinstall: npm install -g @hanzlaa/rcode
306
- `)}});var Vg=v((HI,uc)=>{var PA=require("path"),{homedir:OA}=lr(),{scanNamespaceDuplication:NA,migrateNamespace:LA}=Oo();function Ug(t){return{yes:t.includes("--yes")||t.includes("-y")}}function BA(t){if(console.log(`
329
+ `)}});var Yg=v((YI,lu)=>{var qA=require("path"),{homedir:WA}=hr(),{scanNamespaceDuplication:HA,migrateNamespace:ZA}=Lo();function zg(t){return{yes:t.includes("--yes")||t.includes("-y")}}function UA(t){if(console.log(`
307
330
  \u{1F54C} rcode \u2014 Namespace Migration
308
331
  `),t.totalCount===0){console.log(` \u2713 No legacy rihal-* or duplicate command registrations found.
309
- `);return}console.log(` Found ${t.totalCount} artifact(s) to migrate:`),console.log(` legacy rihal-* skills: ${t.legacySkillCount}`),console.log(` legacy rihal-* commands: ${t.legacyCommandCount}`),console.log(` legacy rihal-* agents: ${t.legacyAgentCount}`),console.log(` unprefixed dupes: ${t.unprefixedCount}`),console.log(` cross-scope dupes: ${t.crossScopeCount} (global copy shadowed by project)`),console.log(` legacy Codex commands: ${t.legacyCodexCommandCount} (~/.rcode/slash-commands/)`),console.log()}uc.exports=function(e=[]){let r=Ug(e),n=process.cwd(),s=OA(),i=NA(n,s);if(BA(i),i.totalCount===0)return;if(!r.yes){console.log(` [DRY RUN] Nothing removed. Pass --yes to back up and remove these files.
310
- `);return}let o=LA(n,s),a=Object.values(o.removed).reduce((u,c)=>u+c,0);console.log(` \u2713 Removed ${a} artifact(s):`),console.log(` legacy skills: ${o.removed.legacySkills}`),console.log(` legacy commands: ${o.removed.legacyCommands}`),console.log(` legacy agents: ${o.removed.legacyAgents}`),console.log(` unprefixed: ${o.removed.unprefixedDupes}`),console.log(` cross-scope: ${o.removed.crossScopeDupes}`),console.log(` codex commands: ${o.removed.legacyCodexCommands}`),o.backupDir&&console.log(` \u{1F4BE} backup: ${PA.relative(s,o.backupDir)} (under ~/.claude/.rcode-backup/)`),console.log()};uc.exports.parseArgs=Ug});var cc=v((ZI,zg)=>{var Gg=require("path"),{spawn:MA}=require("child_process");zg.exports=function(e,{packageRoot:r}){let n=Gg.join(r,"server/dashboard.js"),s=process.cwd(),i=Gg.join(s,".rcode");console.log(`
311
- \u{1F54C} Starting Diwan dashboard...`),console.log(` Scanning: ${i}`);let o=MA("node",[n],{stdio:"inherit",env:{...process.env,RCODE_DIR:i}});o.on("error",u=>{console.error("Failed to start dashboard:",u.message),process.exit(1)});let a=()=>{console.log(`
312
- Stopping dashboard...`),o.kill("SIGTERM"),process.exit(0)};process.on("SIGINT",a),process.on("SIGTERM",a)}});var Kg=v((UI,Jg)=>{var jr=require("fs"),Lo=require("path");function qA(t){let e=t.replace(/^rcode-/,"");if(e.includes("..")||e.includes("/")||e.includes("\\"))throw new Error(`Invalid agent name: '${t}'`);return e}function Yg(t,e){let r=jr.existsSync(t)?jr.readdirSync(t).filter(s=>s.endsWith(".md")&&s!=="README.md").map(s=>s.replace(".md","")):[],n=jr.existsSync(e)?jr.readdirSync(e).filter(s=>s.endsWith(".md")&&s.startsWith("rcode-")).map(s=>s.replace(/^rcode-/,"").replace(".md","")):[];return Array.from(new Set([...r,...n])).sort()}function Xg(t,e,r){let n=Lo.join(e,`${t}.md`);if(jr.existsSync(n))return{file:n,source:"digest"};let s=Lo.join(r,`rcode-${t}.md`);return jr.existsSync(s)?{file:s,source:"agent"}:null}Jg.exports=function(e,{packageRoot:r}){let n=Lo.join(r,"rcode/digests"),s=Lo.join(r,"rcode/agents"),i=e[0];if(i){let a=qA(i),u=Xg(a,n,s);u||(console.error(`No digest or agent found for: ${i}`),console.error(`Available: ${Yg(n,s).join(", ")}`),process.exit(1)),u.source==="agent"&&console.log(`# (fallback: full agent file \u2014 no curated digest exists)
313
- `),console.log(jr.readFileSync(u.file,"utf8"));return}let o=Yg(n,s);console.log(`
332
+ `);return}console.log(` Found ${t.totalCount} artifact(s) to migrate:`),console.log(` legacy rihal-* skills: ${t.legacySkillCount}`),console.log(` legacy rihal-* commands: ${t.legacyCommandCount}`),console.log(` legacy rihal-* agents: ${t.legacyAgentCount}`),console.log(` unprefixed dupes: ${t.unprefixedCount}`),console.log(` cross-scope dupes: ${t.crossScopeCount} (global copy shadowed by project)`),console.log(` legacy Codex commands: ${t.legacyCodexCommandCount} (~/.rcode/slash-commands/)`),console.log()}lu.exports=function(e=[]){let r=zg(e),n=process.cwd(),s=WA(),i=HA(n,s);if(UA(i),i.totalCount===0)return;if(!r.yes){console.log(` [DRY RUN] Nothing removed. Pass --yes to back up and remove these files.
333
+ `);return}let o=ZA(n,s),a=Object.values(o.removed).reduce((c,u)=>c+u,0);console.log(` \u2713 Removed ${a} artifact(s):`),console.log(` legacy skills: ${o.removed.legacySkills}`),console.log(` legacy commands: ${o.removed.legacyCommands}`),console.log(` legacy agents: ${o.removed.legacyAgents}`),console.log(` unprefixed: ${o.removed.unprefixedDupes}`),console.log(` cross-scope: ${o.removed.crossScopeDupes}`),console.log(` codex commands: ${o.removed.legacyCodexCommands}`),o.backupDir&&console.log(` \u{1F4BE} backup: ${qA.relative(s,o.backupDir)} (under ~/.claude/.rcode-backup/)`),console.log()};lu.exports.parseArgs=zg});var du=v((JI,Xg)=>{var Jg=require("path"),{spawn:VA}=require("child_process");Xg.exports=function(e,{packageRoot:r}){let n=Jg.join(r,"server/dashboard.js"),s=process.cwd(),i=Jg.join(s,".rcode");console.log(`
334
+ \u{1F54C} Starting Diwan dashboard...`),console.log(` Scanning: ${i}`);let o=VA("node",[n],{stdio:"inherit",env:{...process.env,RCODE_DIR:i}});o.on("error",c=>{console.error("Failed to start dashboard:",c.message),process.exit(1)});let a=()=>{console.log(`
335
+ Stopping dashboard...`),o.kill("SIGTERM"),process.exit(0)};process.on("SIGINT",a),process.on("SIGTERM",a)}});var tD=v((XI,eD)=>{var Rr=require("fs"),Mo=require("path");function GA(t){let e=t.replace(/^rcode-/,"");if(e.includes("..")||e.includes("/")||e.includes("\\"))throw new Error(`Invalid agent name: '${t}'`);return e}function Kg(t,e){let r=Rr.existsSync(t)?Rr.readdirSync(t).filter(s=>s.endsWith(".md")&&s!=="README.md").map(s=>s.replace(".md","")):[],n=Rr.existsSync(e)?Rr.readdirSync(e).filter(s=>s.endsWith(".md")&&s.startsWith("rcode-")).map(s=>s.replace(/^rcode-/,"").replace(".md","")):[];return Array.from(new Set([...r,...n])).sort()}function Qg(t,e,r){let n=Mo.join(e,`${t}.md`);if(Rr.existsSync(n))return{file:n,source:"digest"};let s=Mo.join(r,`rcode-${t}.md`);return Rr.existsSync(s)?{file:s,source:"agent"}:null}eD.exports=function(e,{packageRoot:r}){let n=Mo.join(r,"rcode/digests"),s=Mo.join(r,"rcode/agents"),i=e[0];if(i){let a=GA(i),c=Qg(a,n,s);c||(console.error(`No digest or agent found for: ${i}`),console.error(`Available: ${Kg(n,s).join(", ")}`),process.exit(1)),c.source==="agent"&&console.log(`# (fallback: full agent file \u2014 no curated digest exists)
336
+ `),console.log(Rr.readFileSync(c.file,"utf8"));return}let o=Kg(n,s);console.log(`
314
337
  \u{1F54C} All rcode Agent Digests
315
- `);for(let a of o){let u=Xg(a,n,s);u&&(console.log(jr.readFileSync(u.file,"utf8")),console.log(`
338
+ `);for(let a of o){let c=Qg(a,n,s);c&&(console.log(Rr.readFileSync(c.file,"utf8")),console.log(`
316
339
  `+"\u2550".repeat(80)+`
317
- `))}}});var tD=v((VI,eD)=>{var lc=require("fs"),Qg=require("path");eD.exports=function(e,{packageRoot:r}){let n=Qg.join(r,"rcode/digests");lc.existsSync(n)||(console.error("Agent digests not found. Is the package installed correctly?"),process.exit(1));let s=lc.readdirSync(n).filter(i=>i.endsWith(".md")&&i!=="README.md");console.log(`
340
+ `))}}});var sD=v((KI,nD)=>{var fu=require("fs"),rD=require("path");nD.exports=function(e,{packageRoot:r}){let n=rD.join(r,"rcode/digests");fu.existsSync(n)||(console.error("Agent digests not found. Is the package installed correctly?"),process.exit(1));let s=fu.readdirSync(n).filter(i=>i.endsWith(".md")&&i!=="README.md");console.log(`
318
341
  \u{1F54C} rcode Team Roster (${s.length} agents)
319
- `),console.log("\u2500".repeat(80));for(let i of s.sort()){let o=lc.readFileSync(Qg.join(n,i),"utf8"),a=o.split(`
320
- `)[0].replace(/^#\s*/,""),u=(o.match(/\*\*Arabic:\*\*\s*(.+)/)||[])[1]||"",c=(o.match(/\*\*Authority:\*\*\s*(.+)/)||[])[1]||"";console.log(`${a.padEnd(45)} ${u.padEnd(15)}`),c&&console.log(` \u2192 ${c.slice(0,70)}`),console.log()}console.log("\u2500".repeat(80)),console.log(`
342
+ `),console.log("\u2500".repeat(80));for(let i of s.sort()){let o=fu.readFileSync(rD.join(n,i),"utf8"),a=o.split(`
343
+ `)[0].replace(/^#\s*/,""),c=(o.match(/\*\*Arabic:\*\*\s*(.+)/)||[])[1]||"",u=(o.match(/\*\*Authority:\*\*\s*(.+)/)||[])[1]||"";console.log(`${a.padEnd(45)} ${c.padEnd(15)}`),u&&console.log(` \u2192 ${u.slice(0,70)}`),console.log()}console.log("\u2500".repeat(80)),console.log(`
321
344
  For full agent details: cat rcode/digests/{agent}.md`),console.log(`For full skill: rcode/skills/agents/{agent-dir}/SKILL.md
322
- `)}});var oD=v((GI,sD)=>{var{spawnSync:rD}=require("child_process"),dc=require("fs"),nD=require("path");sD.exports=function(e,{packageRoot:r}){let n=nD.join(r,"rcode/agents");if(e.includes("--list")||e.length===0){let g=dc.readdirSync(n).filter(m=>m.startsWith("rcode-")&&m.endsWith(".md")).map(m=>m.replace(/^rcode-/,"").replace(/\.md$/,"")).sort();e.length===0&&console.log(`Usage: rcode agent <name> [-- extra args]
345
+ `)}});var cD=v((QI,aD)=>{var{spawnSync:oD}=require("child_process"),hu=require("fs"),iD=require("path");aD.exports=function(e,{packageRoot:r}){let n=iD.join(r,"rcode/agents");if(e.includes("--list")||e.length===0){let g=hu.readdirSync(n).filter(m=>m.startsWith("rcode-")&&m.endsWith(".md")).map(m=>m.replace(/^rcode-/,"").replace(/\.md$/,"")).sort();e.length===0&&console.log(`Usage: rcode agent <name> [-- extra args]
323
346
  `),console.log(`Available agents (${g.length}):
324
- `),g.forEach(m=>console.log(` rcode agent ${m}`));return}let s=e[0],o=`rcode-${s.startsWith("rcode-")?s.slice(6):s}`,a=nD.join(n,`${o}.md`);if(!dc.existsSync(a)){let g=dc.readdirSync(n).filter(m=>m.startsWith("rcode-")&&m.endsWith(".md")).map(m=>m.replace(/^rcode-/,"").replace(/\.md$/,"")).sort().join(", ");console.error(`Error: No agent named '${o}' found.`),console.error(`Available: ${g}`),process.exit(1)}let u=process.platform==="win32"?"where":"which";rD(u,["claude"],{encoding:"utf8"}).status!==0&&(console.error("Error: claude binary not found. Install Claude Code: https://claude.ai/code"),process.exit(1));let l=e.indexOf("--"),d=l!==-1?e.slice(l+1):[],f=rD("claude",["--agent",o,...d],{stdio:"inherit"});process.exit(f.status??0)}});var pc=v((zI,fD)=>{var un=require("fs"),Bo=require("path"),WA=require("crypto"),{spawnSync:fc}=require("child_process"),{writeJsonAtomic:HA}=Jt(),ls={commitsSinceInit:20,daysSinceInit:14},iD=["package-lock.json","pnpm-lock.yaml","yarn.lock","package.json","pyproject.toml","poetry.lock","requirements.txt","Pipfile.lock","Cargo.lock","Cargo.toml","go.sum","go.mod","Gemfile.lock","Gemfile","composer.lock","composer.json","pom.xml","build.gradle","build.gradle.kts"];function aD(t){return WA.createHash("sha256").update(t).digest("hex").slice(0,16)}function ZA(t){if(!un.existsSync(t))return null;try{let e=un.readFileSync(t);return aD(e)}catch(e){return console.error("[memory-bank] hashFileIfExists: failed to read",t+":",e?.message||e),null}}function UA(t){for(let e of iD){let r=Bo.join(t,e),n=ZA(r);if(n)return{name:e,hash:n}}return null}function VA(t){try{let e=un.readdirSync(t,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>r.name).filter(r=>!r.startsWith(".")&&r!=="node_modules"&&r!=="dist"&&r!=="build").sort();return{dirs:e,hash:aD(e.join("|"))}}catch(e){return console.error("[memory-bank] structureFingerprint: failed to read directory:",e?.message||e),{dirs:[],hash:null}}}function GA(t){try{let e=fc("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8"});if(e.status!==0)return null;let r=fc("git",["branch","--show-current"],{cwd:t,encoding:"utf8"});return{head:e.stdout.trim(),branch:r.status===0?r.stdout.trim():null}}catch(e){return console.error("[memory-bank] gitFingerprint: git command failed:",e?.message||e),null}}function uD(t,e,r){if(!e||!r)return null;try{let n=fc("git",["rev-list","--count",`${e}..${r}`],{cwd:t,encoding:"utf8"});return n.status!==0?null:parseInt(n.stdout.trim(),10)}catch(n){return console.error("[memory-bank] commitsBetween: git rev-list failed:",n?.message||n),null}}function hc(t){let e=GA(t),r=UA(t),n=VA(t);return{timestamp:new Date().toISOString(),git_head:e?e.head:null,git_branch:e?e.branch:null,manifest_name:r?r.name:null,manifest_hash:r?r.hash:null,structure_hash:n.hash,structure_dirs:n.dirs}}function cD(t){return Bo.join(t,".rcode","state.json")}function lD(t){let e=cD(t);if(!un.existsSync(e))return null;try{return JSON.parse(un.readFileSync(e,"utf8"))}catch(r){return console.error("[memory-bank] readState: failed to parse state.json at",e+":",r?.message||r),null}}function zA(t){let e=lD(t)||{},r=hc(t);return e.memory_bank={...e.memory_bank,last_init:r},HA(cD(t),e),r}function dD(t){return lD(t)?.memory_bank?.last_init||null}function YA(t){let e=hc(t),r=dD(t),n=Bo.join(t,".rcode/context/active.md"),s=Bo.join(t,".rcode/context/project-brief.md"),i={active:un.existsSync(n),brief:un.existsSync(s)};if(!i.active&&!i.brief)return{status:"never",reasons:["memory bank has never been initialized \u2014 run /rcode-init"],current:e,stored:r,context_files:i};if(!i.active||!i.brief){let a=[];return i.active||a.push(".rcode/context/active.md"),i.brief||a.push(".rcode/context/project-brief.md"),{status:"stale",reasons:[`incomplete memory bank \u2014 missing: ${a.join(", ")}`],current:e,stored:r,context_files:i}}if(!r)return{status:"stale",reasons:["run /rcode-init in your editor to populate project context"],current:e,stored:r,context_files:i};let o=[];if(e.manifest_hash&&r.manifest_hash&&e.manifest_hash!==r.manifest_hash&&o.push(`${e.manifest_name||"dependency manifest"} changed since last init`),e.structure_hash&&r.structure_hash&&e.structure_hash!==r.structure_hash){let a=new Set(r.structure_dirs||[]),u=new Set(e.structure_dirs||[]),c=[...u].filter(f=>!a.has(f)),l=[...a].filter(f=>!u.has(f)),d=[];c.length&&d.push(`added: ${c.join(", ")}`),l.length&&d.push(`removed: ${l.join(", ")}`),o.push(`top-level structure changed (${d.join("; ")||"reorganized"})`)}if(e.git_head&&r.git_head&&e.git_head!==r.git_head){let a=uD(t,r.git_head,e.git_head);a!==null&&a>=ls.commitsSinceInit&&o.push(`${a} commits since last init (threshold: ${ls.commitsSinceInit})`)}if(r.timestamp){let a=Date.parse(r.timestamp);if(!Number.isNaN(a)){let u=(Date.now()-a)/864e5;u>=ls.daysSinceInit&&o.push(`${Math.floor(u)} days since last init (threshold: ${ls.daysSinceInit})`)}}return{status:o.length>0?"stale":"fresh",reasons:o,current:e,stored:r,context_files:i}}fD.exports={computeFingerprint:hc,writeFingerprint:zA,readFingerprint:dD,checkStaleness:YA,commitsBetween:uD,STALE_THRESHOLDS:ls,MANIFEST_CANDIDATES:iD}});var yD=v((YI,DD)=>{var{z:De}=Ga();function XA(t){if(typeof t!="string")return{frontmatter:{},body:t||""};if(t=t.replace(/\r\n/g,`
347
+ `),g.forEach(m=>console.log(` rcode agent ${m}`));return}let s=e[0],o=`rcode-${s.startsWith("rcode-")?s.slice(6):s}`,a=iD.join(n,`${o}.md`);if(!hu.existsSync(a)){let g=hu.readdirSync(n).filter(m=>m.startsWith("rcode-")&&m.endsWith(".md")).map(m=>m.replace(/^rcode-/,"").replace(/\.md$/,"")).sort().join(", ");console.error(`Error: No agent named '${o}' found.`),console.error(`Available: ${g}`),process.exit(1)}let c=process.platform==="win32"?"where":"which";oD(c,["claude"],{encoding:"utf8"}).status!==0&&(console.error("Error: claude binary not found. Install Claude Code: https://claude.ai/code"),process.exit(1));let l=e.indexOf("--"),d=l!==-1?e.slice(l+1):[],f=oD("claude",["--agent",o,...d],{stdio:"inherit"});process.exit(f.status??0)}});var gu=v((eT,mD)=>{var ln=require("fs"),qo=require("path"),zA=require("crypto"),{spawnSync:pu}=require("child_process"),{writeJsonAtomic:YA}=Qt(),fs={commitsSinceInit:20,daysSinceInit:14},uD=["package-lock.json","pnpm-lock.yaml","yarn.lock","package.json","pyproject.toml","poetry.lock","requirements.txt","Pipfile.lock","Cargo.lock","Cargo.toml","go.sum","go.mod","Gemfile.lock","Gemfile","composer.lock","composer.json","pom.xml","build.gradle","build.gradle.kts"];function lD(t){return zA.createHash("sha256").update(t).digest("hex").slice(0,16)}function JA(t){if(!ln.existsSync(t))return null;try{let e=ln.readFileSync(t);return lD(e)}catch(e){return console.error("[memory-bank] hashFileIfExists: failed to read",t+":",e?.message||e),null}}function XA(t){for(let e of uD){let r=qo.join(t,e),n=JA(r);if(n)return{name:e,hash:n}}return null}function KA(t){try{let e=ln.readdirSync(t,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>r.name).filter(r=>!r.startsWith(".")&&r!=="node_modules"&&r!=="dist"&&r!=="build").sort();return{dirs:e,hash:lD(e.join("|"))}}catch(e){return console.error("[memory-bank] structureFingerprint: failed to read directory:",e?.message||e),{dirs:[],hash:null}}}function QA(t){try{let e=pu("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8"});if(e.status!==0)return null;let r=pu("git",["branch","--show-current"],{cwd:t,encoding:"utf8"});return{head:e.stdout.trim(),branch:r.status===0?r.stdout.trim():null}}catch(e){return console.error("[memory-bank] gitFingerprint: git command failed:",e?.message||e),null}}function dD(t,e,r){if(!e||!r)return null;try{let n=pu("git",["rev-list","--count",`${e}..${r}`],{cwd:t,encoding:"utf8"});return n.status!==0?null:parseInt(n.stdout.trim(),10)}catch(n){return console.error("[memory-bank] commitsBetween: git rev-list failed:",n?.message||n),null}}function mu(t){let e=QA(t),r=XA(t),n=KA(t);return{timestamp:new Date().toISOString(),git_head:e?e.head:null,git_branch:e?e.branch:null,manifest_name:r?r.name:null,manifest_hash:r?r.hash:null,structure_hash:n.hash,structure_dirs:n.dirs}}function fD(t){return qo.join(t,".rcode","state.json")}function hD(t){let e=fD(t);if(!ln.existsSync(e))return null;try{return JSON.parse(ln.readFileSync(e,"utf8"))}catch(r){return console.error("[memory-bank] readState: failed to parse state.json at",e+":",r?.message||r),null}}function e1(t){let e=hD(t)||{},r=mu(t);return e.memory_bank={...e.memory_bank,last_init:r},YA(fD(t),e),r}function pD(t){return hD(t)?.memory_bank?.last_init||null}function t1(t){let e=mu(t),r=pD(t),n=qo.join(t,".rcode/context/active.md"),s=qo.join(t,".rcode/context/project-brief.md"),i={active:ln.existsSync(n),brief:ln.existsSync(s)};if(!i.active&&!i.brief)return{status:"never",reasons:["memory bank has never been initialized \u2014 run /rcode-init"],current:e,stored:r,context_files:i};if(!i.active||!i.brief){let a=[];return i.active||a.push(".rcode/context/active.md"),i.brief||a.push(".rcode/context/project-brief.md"),{status:"stale",reasons:[`incomplete memory bank \u2014 missing: ${a.join(", ")}`],current:e,stored:r,context_files:i}}if(!r)return{status:"stale",reasons:["run /rcode-init in your editor to populate project context"],current:e,stored:r,context_files:i};let o=[];if(e.manifest_hash&&r.manifest_hash&&e.manifest_hash!==r.manifest_hash&&o.push(`${e.manifest_name||"dependency manifest"} changed since last init`),e.structure_hash&&r.structure_hash&&e.structure_hash!==r.structure_hash){let a=new Set(r.structure_dirs||[]),c=new Set(e.structure_dirs||[]),u=[...c].filter(f=>!a.has(f)),l=[...a].filter(f=>!c.has(f)),d=[];u.length&&d.push(`added: ${u.join(", ")}`),l.length&&d.push(`removed: ${l.join(", ")}`),o.push(`top-level structure changed (${d.join("; ")||"reorganized"})`)}if(e.git_head&&r.git_head&&e.git_head!==r.git_head){let a=dD(t,r.git_head,e.git_head);a!==null&&a>=fs.commitsSinceInit&&o.push(`${a} commits since last init (threshold: ${fs.commitsSinceInit})`)}if(r.timestamp){let a=Date.parse(r.timestamp);if(!Number.isNaN(a)){let c=(Date.now()-a)/864e5;c>=fs.daysSinceInit&&o.push(`${Math.floor(c)} days since last init (threshold: ${fs.daysSinceInit})`)}}return{status:o.length>0?"stale":"fresh",reasons:o,current:e,stored:r,context_files:i}}mD.exports={computeFingerprint:mu,writeFingerprint:e1,readFingerprint:pD,checkStaleness:t1,commitsBetween:dD,STALE_THRESHOLDS:fs,MANIFEST_CANDIDATES:uD}});var bD=v((tT,_D)=>{var{z:ye}=Ya();function r1(t){if(typeof t!="string")return{frontmatter:{},body:t||""};if(t=t.replace(/\r\n/g,`
325
348
  `),!t.startsWith(`---
326
349
  `))return{frontmatter:{},body:t};let e=t.indexOf(`
327
350
  ---
328
351
  `,4);if(e===-1)return{frontmatter:{},body:t};let r=t.slice(4,e),n=t.slice(e+5),s={},i=r.split(`
329
- `),o=0;for(;o<i.length;){let a=i[o];if(!a.trim()||a.trim().startsWith("#")){o++;continue}let u=a.match(/^([A-Za-z0-9_-]+):(.*)$/);if(!u){o++;continue}let c=u[1].trim(),l=u[2].trim();if(l=l.replace(/\s+#.*$/,"").trim(),l===">"||l==="|"||l===">-"||l==="|-"){let d=[];for(o++;o<i.length;){let f=i[o];if(f.trim()===""){d.push(""),o++;continue}if(/^\s/.test(f)){d.push(f.trim()),o++;continue}break}s[c]=d.join(" ").replace(/\s+/g," ").trim();continue}if(l===""){let d=[],f=o+1;for(;f<i.length;){let g=i[f];if(g.trim()===""||g.trim().startsWith("#")){f++;continue}let m=g.match(/^\s+-\s+(.*)$/);if(!m)break;let D=m[1].trim();D.startsWith('"')&&D.endsWith('"')&&(D=D.slice(1,-1)),D.startsWith("'")&&D.endsWith("'")&&(D=D.slice(1,-1)),d.push(D),f++}if(d.length){s[c]=d,o=f;continue}s[c]="",o++;continue}l.startsWith('"')&&l.endsWith('"')&&(l=l.slice(1,-1)),l.startsWith("'")&&l.endsWith("'")&&(l=l.slice(1,-1)),s[c]=l,o++}return{frontmatter:s,body:n}}function hD(t){let r=(typeof t.description=="string"?t.description:"").match(/"[^"]+"/g)||[];return r.length>0?r.length:Array.isArray(t.triggers)?t.triggers.filter(n=>typeof n=="string"&&n.trim()).length:typeof t.triggers=="string"&&t.triggers.trim()?t.triggers.split(",").map(n=>n.trim()).filter(Boolean).length:0}var pD=De.object({name:De.string().min(1,"name is required"),description:De.string().min(1,"description is required")}),JA=/not for|do not|does not|don't|never\b|audit-only|negative/i;function KA(t,e=""){let r=[],n=[],s=pD.safeParse(t||{});if(!s.success)for(let i of s.error.issues){let o=i.path.length?i.path.join("."):"(root)";r.push(`${o}: ${i.message}`)}if(t&&typeof t=="object"){let i=hD(t);i<5?r.push(`too few trigger phrases: found ${i}, need at least 5`):i>12&&n.push(`many trigger phrases: found ${i}, recommended max is 12`);let o=typeof t.description=="string"?t.description:"",a=typeof e=="string"?e:"";JA.test(o)||/##[^\n]*\bnot\b/i.test(a)||/\bdo not (use|include)\b/i.test(a)||/\bdon't touch\b/i.test(a)||r.push('missing negative-boundary clause (e.g. "Do NOT use for: ..." in the description or a "## Do NOT use" section)')}return{ok:r.length===0,errors:r,warnings:n}}var mD=De.object({name:De.string().min(1,"name is required").refine(t=>t.startsWith("rcode-"),'name must start with the "rcode-" prefix'),description:De.string().min(1,"description is required"),color:De.string().min(1,"color is required")});function QA(t){let e=[],r=mD.safeParse(t||{});if(!r.success)for(let n of r.error.issues){let s=n.path.length?n.path.join("."):"(root)";e.push(`${s}: ${n.message}`)}if(t&&typeof t=="object"){let n=t.tools;(Array.isArray(n)?n.length>0:typeof n=="string"&&n.trim().length>0)||e.push("tools is required (comma-separated string or array)")}else e.push("tools is required (comma-separated string or array)");return{ok:e.length===0,errors:e}}var gD=De.object({version:De.union([De.string(),De.number()]),project:De.string().min(1),phases:De.array(De.any()),schema_version:De.number(),current_phase:De.union([De.string(),De.number()]).optional(),current_plan:De.union([De.string(),De.number()]).optional(),current_sprint:De.union([De.string(),De.number()]).nullable().optional(),velocity_history:De.array(De.any()).optional(),milestones:De.array(De.any()).optional()}).passthrough();function e1(t){let e=[],r=gD.safeParse(t||{});if(!r.success)for(let n of r.error.issues){let s=n.path.length?n.path.join("."):"(root)";e.push(`${s}: ${n.message}`)}return{ok:e.length===0,errors:e}}DD.exports={parseFrontmatter:XA,countTriggerPhrases:hD,skillFrontmatterSchema:pD,agentFrontmatterSchema:mD,stateSchema:gD,validateSkillFrontmatter:KA,validateAgentFrontmatter:QA,validateState:e1}});var bD=v((XI,qo)=>{var pe=require("fs"),be=require("path"),{spawnSync:vD}=require("child_process"),{verifyInstall:t1,formatReport:r1}=ss(),{checkStaleness:n1}=pc(),{homedir:s1}=lr(),{scanNamespaceDuplication:o1}=Oo(),{parseFrontmatter:mc,validateSkillFrontmatter:i1,validateAgentFrontmatter:a1}=yD();function gc(t){let e=[];if(!pe.existsSync(t))return e;for(let r of pe.readdirSync(t,{withFileTypes:!0})){let n=be.join(t,r.name);r.isDirectory()?e.push(...gc(n)):r.isFile()&&r.name==="SKILL.md"&&e.push(n)}return e}function u1(t){return pe.existsSync(t)?pe.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(".md")).map(e=>be.join(t,e.name)):[]}var c1=/not for|do not|does not|don't|never\b|audit-only|negative/i;function l1(t){let e=pe.readFileSync(t,"utf8"),{frontmatter:r,body:n}=mc(e),s=[];/^name:/m.test(e)||s.push("name"),/^description:/m.test(e)||s.push("description"),/^## Overview/m.test(e)||s.push("Overview section"),/^## Output Format/m.test(e)||s.push("Output Format"),/^## Examples/m.test(e)||s.push("Examples");let i=r["not-for"],o=Array.isArray(i)&&i.length>0,a=typeof r.description=="string"?r.description:"";return o||c1.test(a)||/##[^\n]*\bnot\b/i.test(n)||/\bdo not (use|include)\b/i.test(n)||s.push("negative-boundary clause"),s}function d1(t){try{return pe.accessSync(t,pe.constants.W_OK),!0}catch{return!1}}function Mo(t){let e=process.platform==="win32"?"where":"which";return vD(e,[t],{stdio:"ignore"}).status===0}function _D(t){let e=Array.isArray(t?.phases)?t.phases:[],r=e.filter(s=>s&&s.status==="executing");if(r.length===0)return[];let n=e.filter(s=>s&&s.status==="complete").map(s=>parseFloat(s.number)).filter(s=>!Number.isNaN(s)).reduce((s,i)=>Math.max(s,i),-1/0);return n===-1/0?[]:r.filter(s=>{let i=parseFloat(s.number);return!Number.isNaN(i)&&i<n})}function ED(t,e){let r=[],n=process.versions.node,s=parseInt(n.split(".")[0],10);r.push({label:"Node.js \u2265 18",status:s>=18?"ok":"fail",message:`v${n}${s<18?" \u2014 upgrade to 18 LTS or newer":""}`});let i=be.join(t,".rcode");pe.existsSync(i)?r.push({label:".rcode/ writable",status:d1(i)?"ok":"fail",message:i}):r.push({label:".rcode/ state",status:"warn",message:"not initialized in this directory (run `rcode install`)"});let o=be.join(e,"rcode/config/model-profiles.json");if(pe.existsSync(o))try{let a=JSON.parse(pe.readFileSync(o,"utf8")),u=["quality","balanced","budget","inherit"],c=Object.keys(a.profiles||a),l=u.filter(d=>!c.includes(d));l.length===0?r.push({label:"model-profiles.json",status:"ok",message:`${c.length} profiles (${c.join(", ")})`}):r.push({label:"model-profiles.json",status:"fail",message:`missing expected profiles: ${l.join(", ")}`})}catch(a){r.push({label:"model-profiles.json",status:"fail",message:`invalid JSON: ${a.message}`})}else r.push({label:"model-profiles.json",status:"fail",message:"missing from package"});r.push({label:"git CLI",status:Mo("git")?"ok":"warn",message:Mo("git")?"available":"not found (some features disabled)"}),r.push({label:"gh CLI",status:Mo("gh")?"ok":"warn",message:Mo("gh")?"available (github-sync ready)":"not found (github-sync unavailable)"});try{let a=o1(t,s1());a.totalCount>0?r.push({label:"Namespace duplication",status:"warn",message:`${a.totalCount} duplicate registration(s) \u2014 legacy skills: ${a.legacySkillCount}, legacy commands: ${a.legacyCommandCount}, legacy agents: ${a.legacyAgentCount}, unprefixed: ${a.unprefixedCount}, cross-scope: ${a.crossScopeCount}, legacy Codex commands: ${a.legacyCodexCommandCount} (run \`rcode migrate-namespace --yes\` or \`rcode update\`)`}):r.push({label:"Namespace duplication",status:"ok",message:"no duplicate rihal-*/rcode-* registrations found"})}catch(a){r.push({label:"Namespace duplication",status:"warn",message:`could not scan: ${a.message}`})}if(pe.existsSync(i)){let a=[],u=be.join(t,".claude/commands");if((pe.existsSync(u)&&pe.readdirSync(u).some(m=>m.startsWith("rcode-")&&m.endsWith(".md"))||pe.existsSync(be.join(t,".claude/skills")))&&a.push("claude"),pe.existsSync(be.join(t,".cursor/rules"))&&a.push("cursor"),pe.existsSync(be.join(t,".windsurf/rules"))&&a.push("windsurf"),pe.existsSync(be.join(t,".antigravity/agents"))&&a.push("antigravity"),a.length>0){let{reports:m,hasDrift:D}=t1(t,e,a);if(D)r.push({label:"Agent manifest",status:"fail",message:`drift detected across ${a.join(", ")}`,detail:r1(m)});else{let h=m.map(w=>`${w.editor}:${w.installedCount}`).join(" ");r.push({label:"Agent manifest",status:"ok",message:h})}}let l=n1(t);l.status==="fresh"?r.push({label:"Memory bank",status:"ok",message:"fresh"}):l.status==="never"?r.push({label:"Memory bank",status:"warn",message:"never initialized (run /rcode-init to populate)"}):r.push({label:"Memory bank",status:"warn",message:`STALE \u2014 ${l.reasons[0]}${l.reasons.length>1?` (+${l.reasons.length-1} more)`:""}`});let d=be.join(i,"data","intent-table.json");r.push({label:"intent-table.json",status:pe.existsSync(d)?"ok":"warn",message:pe.existsSync(d)?be.relative(t,d):"missing \u2014 run `npx @hanzlaa/rcode update` to sync .rcode/data/"});let f=be.join(i,"state.json");if(pe.existsSync(f))try{let m=JSON.parse(pe.readFileSync(f,"utf8")),D=_D(m);r.push({label:"Phase state",status:D.length>0?"warn":"ok",message:D.length>0?`${D.length} phase(s) stuck 'executing' while a later phase is complete: ${D.map(h=>h.number).join(", ")}`:"no stuck phases"})}catch(m){r.push({label:"Phase state",status:"warn",message:`state.json unreadable: ${m.message}`})}let g=be.join(i,"memory","INDEX.md");if(pe.existsSync(g)){let m=Math.floor((Date.now()-pe.statSync(g).mtimeMs)/864e5);r.push({label:"Memory INDEX.md",status:m>30?"warn":"ok",message:m>30?`STALE \u2014 last updated ${m}d ago (run /rcode-memory-update)`:`fresh \u2014 updated ${m}d ago`})}else r.push({label:"Memory INDEX.md",status:"warn",message:"missing (run /rcode-memory-init)"})}return r}function f1(t){let e=0;for(let r of t){let n=r.status==="ok"?"\u2713":r.status==="warn"?"\u26A0":"\u2717";console.log(` ${n} ${r.label.padEnd(22)} ${r.message}`),r.detail&&console.log(r.detail),r.status==="fail"&&e++}return e}function h1(t){let e=[be.join(t,"rcode/skills/agents"),be.join(t,"rcode/skills/actions")],r=0,n=0,s=[];for(let i of e){let o=gc(i);for(let a of o){r++;let u=l1(a);if(u.length>0){n++;let c=be.relative(t,a);s.push({file:c,missing:u})}}}if(s.length>0){console.log(` \u2717 ${n} / ${r} skills are non-compliant:
330
- `);for(let i of s)console.log(` ${i.file}`),console.log(` missing: ${i.missing.join(", ")}`)}else console.log(` \u2713 All ${r} skills compliant with 5-component standard`);return n}function p1(t){let e=[be.join(t,"rcode/skills/agents"),be.join(t,"rcode/skills/actions")],r=0,n=0,s=0,i=0;for(let o of e)for(let a of gc(o)){r++;let{frontmatter:u,body:c}=mc(pe.readFileSync(a,"utf8")),l=i1(u,c),d=be.relative(t,a);if(!l.ok){s++,console.log(` \u2717 ${d}`);for(let f of l.errors)console.log(` ${f}`)}if(l.warnings&&l.warnings.length>0){i++;for(let f of l.warnings)console.log(` \u26A0 ${d}: ${f}`)}}for(let o of u1(be.join(t,"rcode/agents"))){n++;let{frontmatter:a}=mc(pe.readFileSync(o,"utf8")),u=a1(a);if(!u.ok){s++;let c=be.relative(t,o);console.log(` \u2717 ${c}`);for(let l of u.errors)console.log(` ${l}`)}}return console.log(s===0?` \u2713 ${r} skill + ${n} agent frontmatter blocks pass schema validation`+(i>0?` (${i} with advisory warnings)`:""):` \u2717 ${s} artifact(s) failed schema validation`),s}function m1(){let e=require("os").homedir(),r=[],n=[];for(let i of[["npm",["root","-g"]],["pnpm",["root","-g"]]])try{let o=vD(i[0],i[1],{encoding:"utf8"});o.status===0&&o.stdout.trim()&&n.push({manager:i[0],dir:o.stdout.trim()})}catch{}let s=be.join(e,".nvm","versions","node");if(pe.existsSync(s))for(let i of pe.readdirSync(s)){let o=be.join(s,i,"lib","node_modules");pe.existsSync(o)&&!n.some(a=>a.dir===o)&&n.push({manager:`nvm/${i}`,dir:o})}for(let{manager:i,dir:o}of n)for(let a of["@hanzlaa","@hanzlahabib"]){let u=be.join(o,a);if(pe.existsSync(u)){for(let c of pe.readdirSync(u))if(c==="rcode"||c==="rcode"||c.startsWith("rcode")){let l="unknown";try{l=JSON.parse(pe.readFileSync(be.join(u,c,"package.json"),"utf8")).version}catch{}r.push({manager:i,scope:a,pkg:c,version:l,dir:be.join(u,c)})}}}return{count:r.length,installs:r}}function g1(t){if(t.count===0)return console.log(" \u2713 No global rcode installs found"),0;if(t.count===1){let e=t.installs[0];return console.log(` \u2713 Single global install: [${e.manager}] ${e.scope}/${e.pkg}@${e.version}`),0}console.log(` \u2717 ${t.count} global installs detected \u2014 this causes duplicate slash commands!`);for(let e of t.installs)console.log(` [${e.manager}] ${e.scope}/${e.pkg}@${e.version}`),console.log(` ${e.dir}`);return console.log(`
331
- Fix: rcode nuke --yes && npm install -g @hanzlaa/rcode`),1}qo.exports=function(e,{packageRoot:r}){let n=process.cwd();console.log(`
352
+ `),o=0;for(;o<i.length;){let a=i[o];if(!a.trim()||a.trim().startsWith("#")){o++;continue}let c=a.match(/^([A-Za-z0-9_-]+):(.*)$/);if(!c){o++;continue}let u=c[1].trim(),l=c[2].trim();if(l=l.replace(/\s+#.*$/,"").trim(),l===">"||l==="|"||l===">-"||l==="|-"){let d=[];for(o++;o<i.length;){let f=i[o];if(f.trim()===""){d.push(""),o++;continue}if(/^\s/.test(f)){d.push(f.trim()),o++;continue}break}s[u]=d.join(" ").replace(/\s+/g," ").trim();continue}if(l===""){let d=[],f=o+1;for(;f<i.length;){let g=i[f];if(g.trim()===""||g.trim().startsWith("#")){f++;continue}let m=g.match(/^\s+-\s+(.*)$/);if(!m)break;let y=m[1].trim();y.startsWith('"')&&y.endsWith('"')&&(y=y.slice(1,-1)),y.startsWith("'")&&y.endsWith("'")&&(y=y.slice(1,-1)),d.push(y),f++}if(d.length){s[u]=d,o=f;continue}s[u]="",o++;continue}l.startsWith('"')&&l.endsWith('"')&&(l=l.slice(1,-1)),l.startsWith("'")&&l.endsWith("'")&&(l=l.slice(1,-1)),s[u]=l,o++}return{frontmatter:s,body:n}}function gD(t){let r=(typeof t.description=="string"?t.description:"").match(/"[^"]+"/g)||[];return r.length>0?r.length:Array.isArray(t.triggers)?t.triggers.filter(n=>typeof n=="string"&&n.trim()).length:typeof t.triggers=="string"&&t.triggers.trim()?t.triggers.split(",").map(n=>n.trim()).filter(Boolean).length:0}var DD=ye.object({name:ye.string().min(1,"name is required"),description:ye.string().min(1,"description is required")}),n1=/not for|do not|does not|don't|never\b|audit-only|negative/i;function s1(t,e=""){let r=[],n=[],s=DD.safeParse(t||{});if(!s.success)for(let i of s.error.issues){let o=i.path.length?i.path.join("."):"(root)";r.push(`${o}: ${i.message}`)}if(t&&typeof t=="object"){let i=gD(t);i<5?r.push(`too few trigger phrases: found ${i}, need at least 5`):i>12&&n.push(`many trigger phrases: found ${i}, recommended max is 12`);let o=typeof t.description=="string"?t.description:"",a=typeof e=="string"?e:"";n1.test(o)||/##[^\n]*\bnot\b/i.test(a)||/\bdo not (use|include)\b/i.test(a)||/\bdon't touch\b/i.test(a)||r.push('missing negative-boundary clause (e.g. "Do NOT use for: ..." in the description or a "## Do NOT use" section)')}return{ok:r.length===0,errors:r,warnings:n}}var yD=ye.object({name:ye.string().min(1,"name is required").refine(t=>t.startsWith("rcode-"),'name must start with the "rcode-" prefix'),description:ye.string().min(1,"description is required"),color:ye.string().min(1,"color is required")});function o1(t){let e=[],r=yD.safeParse(t||{});if(!r.success)for(let n of r.error.issues){let s=n.path.length?n.path.join("."):"(root)";e.push(`${s}: ${n.message}`)}if(t&&typeof t=="object"){let n=t.tools;(Array.isArray(n)?n.length>0:typeof n=="string"&&n.trim().length>0)||e.push("tools is required (comma-separated string or array)")}else e.push("tools is required (comma-separated string or array)");return{ok:e.length===0,errors:e}}var vD=ye.object({version:ye.union([ye.string(),ye.number()]),project:ye.string().min(1),phases:ye.array(ye.any()),schema_version:ye.number(),current_phase:ye.union([ye.string(),ye.number()]).optional(),current_plan:ye.union([ye.string(),ye.number()]).optional(),current_sprint:ye.union([ye.string(),ye.number()]).nullable().optional(),velocity_history:ye.array(ye.any()).optional(),milestones:ye.array(ye.any()).optional()}).passthrough();function i1(t){let e=[],r=vD.safeParse(t||{});if(!r.success)for(let n of r.error.issues){let s=n.path.length?n.path.join("."):"(root)";e.push(`${s}: ${n.message}`)}return{ok:e.length===0,errors:e}}_D.exports={parseFrontmatter:r1,countTriggerPhrases:gD,skillFrontmatterSchema:DD,agentFrontmatterSchema:yD,stateSchema:vD,validateSkillFrontmatter:s1,validateAgentFrontmatter:o1,validateState:i1}});var wD=v((rT,Ho)=>{var pe=require("fs"),Ee=require("path"),{spawnSync:SD}=require("child_process"),{verifyInstall:a1,formatReport:c1}=is(),{checkStaleness:u1}=gu(),{homedir:l1}=hr(),{scanNamespaceDuplication:d1}=Lo(),{parseFrontmatter:Du,validateSkillFrontmatter:f1,validateAgentFrontmatter:h1}=bD();function yu(t){let e=[];if(!pe.existsSync(t))return e;for(let r of pe.readdirSync(t,{withFileTypes:!0})){let n=Ee.join(t,r.name);r.isDirectory()?e.push(...yu(n)):r.isFile()&&r.name==="SKILL.md"&&e.push(n)}return e}function p1(t){return pe.existsSync(t)?pe.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(".md")).map(e=>Ee.join(t,e.name)):[]}var m1=/not for|do not|does not|don't|never\b|audit-only|negative/i;function g1(t){let e=pe.readFileSync(t,"utf8"),{frontmatter:r,body:n}=Du(e),s=[];/^name:/m.test(e)||s.push("name"),/^description:/m.test(e)||s.push("description"),/^## Overview/m.test(e)||s.push("Overview section"),/^## Output Format/m.test(e)||s.push("Output Format"),/^## Examples/m.test(e)||s.push("Examples");let i=r["not-for"],o=Array.isArray(i)&&i.length>0,a=typeof r.description=="string"?r.description:"";return o||m1.test(a)||/##[^\n]*\bnot\b/i.test(n)||/\bdo not (use|include)\b/i.test(n)||s.push("negative-boundary clause"),s}function D1(t){try{return pe.accessSync(t,pe.constants.W_OK),!0}catch{return!1}}function Wo(t){let e=process.platform==="win32"?"where":"which";return SD(e,[t],{stdio:"ignore"}).status===0}function ED(t){let e=Array.isArray(t?.phases)?t.phases:[],r=e.filter(s=>s&&s.status==="executing");if(r.length===0)return[];let n=e.filter(s=>s&&s.status==="complete").map(s=>parseFloat(s.number)).filter(s=>!Number.isNaN(s)).reduce((s,i)=>Math.max(s,i),-1/0);return n===-1/0?[]:r.filter(s=>{let i=parseFloat(s.number);return!Number.isNaN(i)&&i<n})}function CD(t,e){let r=[],n=process.versions.node,s=parseInt(n.split(".")[0],10);r.push({label:"Node.js \u2265 18",status:s>=18?"ok":"fail",message:`v${n}${s<18?" \u2014 upgrade to 18 LTS or newer":""}`});let i=Ee.join(t,".rcode");pe.existsSync(i)?r.push({label:".rcode/ writable",status:D1(i)?"ok":"fail",message:i}):r.push({label:".rcode/ state",status:"warn",message:"not initialized in this directory (run `rcode install`)"});let o=Ee.join(e,"rcode/config/model-profiles.json");if(pe.existsSync(o))try{let a=JSON.parse(pe.readFileSync(o,"utf8")),c=["quality","balanced","budget","inherit"],u=Object.keys(a.profiles||a),l=c.filter(d=>!u.includes(d));l.length===0?r.push({label:"model-profiles.json",status:"ok",message:`${u.length} profiles (${u.join(", ")})`}):r.push({label:"model-profiles.json",status:"fail",message:`missing expected profiles: ${l.join(", ")}`})}catch(a){r.push({label:"model-profiles.json",status:"fail",message:`invalid JSON: ${a.message}`})}else r.push({label:"model-profiles.json",status:"fail",message:"missing from package"});r.push({label:"git CLI",status:Wo("git")?"ok":"warn",message:Wo("git")?"available":"not found (some features disabled)"}),r.push({label:"gh CLI",status:Wo("gh")?"ok":"warn",message:Wo("gh")?"available (github-sync ready)":"not found (github-sync unavailable)"});try{let a=d1(t,l1());a.totalCount>0?r.push({label:"Namespace duplication",status:"warn",message:`${a.totalCount} duplicate registration(s) \u2014 legacy skills: ${a.legacySkillCount}, legacy commands: ${a.legacyCommandCount}, legacy agents: ${a.legacyAgentCount}, unprefixed: ${a.unprefixedCount}, cross-scope: ${a.crossScopeCount}, legacy Codex commands: ${a.legacyCodexCommandCount} (run \`rcode migrate-namespace --yes\` or \`rcode update\`)`}):r.push({label:"Namespace duplication",status:"ok",message:"no duplicate rihal-*/rcode-* registrations found"})}catch(a){r.push({label:"Namespace duplication",status:"warn",message:`could not scan: ${a.message}`})}if(pe.existsSync(i)){let a=[],c=Ee.join(t,".claude/commands");if((pe.existsSync(c)&&pe.readdirSync(c).some(m=>m.startsWith("rcode-")&&m.endsWith(".md"))||pe.existsSync(Ee.join(t,".claude/skills")))&&a.push("claude"),pe.existsSync(Ee.join(t,".cursor/rules"))&&a.push("cursor"),pe.existsSync(Ee.join(t,".windsurf/rules"))&&a.push("windsurf"),pe.existsSync(Ee.join(t,".antigravity/agents"))&&a.push("antigravity"),a.length>0){let{reports:m,hasDrift:y}=a1(t,e,a);if(y)r.push({label:"Agent manifest",status:"fail",message:`drift detected across ${a.join(", ")}`,detail:c1(m)});else{let h=m.map(w=>`${w.editor}:${w.installedCount}`).join(" ");r.push({label:"Agent manifest",status:"ok",message:h})}}let l=u1(t);l.status==="fresh"?r.push({label:"Memory bank",status:"ok",message:"fresh"}):l.status==="never"?r.push({label:"Memory bank",status:"warn",message:"never initialized (run /rcode-init to populate)"}):r.push({label:"Memory bank",status:"warn",message:`STALE \u2014 ${l.reasons[0]}${l.reasons.length>1?` (+${l.reasons.length-1} more)`:""}`});let d=Ee.join(i,"data","intent-table.json");r.push({label:"intent-table.json",status:pe.existsSync(d)?"ok":"warn",message:pe.existsSync(d)?Ee.relative(t,d):"missing \u2014 run `npx @hanzlaa/rcode update` to sync .rcode/data/"});let f=Ee.join(i,"state.json");if(pe.existsSync(f))try{let m=JSON.parse(pe.readFileSync(f,"utf8")),y=ED(m);r.push({label:"Phase state",status:y.length>0?"warn":"ok",message:y.length>0?`${y.length} phase(s) stuck 'executing' while a later phase is complete: ${y.map(h=>h.number).join(", ")}`:"no stuck phases"})}catch(m){r.push({label:"Phase state",status:"warn",message:`state.json unreadable: ${m.message}`})}let g=Ee.join(i,"memory","INDEX.md");if(pe.existsSync(g)){let m=Math.floor((Date.now()-pe.statSync(g).mtimeMs)/864e5);r.push({label:"Memory INDEX.md",status:m>30?"warn":"ok",message:m>30?`STALE \u2014 last updated ${m}d ago (run /rcode-memory-update)`:`fresh \u2014 updated ${m}d ago`})}else r.push({label:"Memory INDEX.md",status:"warn",message:"missing (run /rcode-memory-init)"})}return r}function y1(t){let e=0;for(let r of t){let n=r.status==="ok"?"\u2713":r.status==="warn"?"\u26A0":"\u2717";console.log(` ${n} ${r.label.padEnd(22)} ${r.message}`),r.detail&&console.log(r.detail),r.status==="fail"&&e++}return e}function v1(t){let e=[Ee.join(t,"rcode/skills/agents"),Ee.join(t,"rcode/skills/actions")],r=0,n=0,s=[];for(let i of e){let o=yu(i);for(let a of o){r++;let c=g1(a);if(c.length>0){n++;let u=Ee.relative(t,a);s.push({file:u,missing:c})}}}if(s.length>0){console.log(` \u2717 ${n} / ${r} skills are non-compliant:
353
+ `);for(let i of s)console.log(` ${i.file}`),console.log(` missing: ${i.missing.join(", ")}`)}else console.log(` \u2713 All ${r} skills compliant with 5-component standard`);return n}function _1(t){let e=[Ee.join(t,"rcode/skills/agents"),Ee.join(t,"rcode/skills/actions")],r=0,n=0,s=0,i=0;for(let o of e)for(let a of yu(o)){r++;let{frontmatter:c,body:u}=Du(pe.readFileSync(a,"utf8")),l=f1(c,u),d=Ee.relative(t,a);if(!l.ok){s++,console.log(` \u2717 ${d}`);for(let f of l.errors)console.log(` ${f}`)}if(l.warnings&&l.warnings.length>0){i++;for(let f of l.warnings)console.log(` \u26A0 ${d}: ${f}`)}}for(let o of p1(Ee.join(t,"rcode/agents"))){n++;let{frontmatter:a}=Du(pe.readFileSync(o,"utf8")),c=h1(a);if(!c.ok){s++;let u=Ee.relative(t,o);console.log(` \u2717 ${u}`);for(let l of c.errors)console.log(` ${l}`)}}return console.log(s===0?` \u2713 ${r} skill + ${n} agent frontmatter blocks pass schema validation`+(i>0?` (${i} with advisory warnings)`:""):` \u2717 ${s} artifact(s) failed schema validation`),s}function b1(){let e=require("os").homedir(),r=[],n=[];for(let i of[["npm",["root","-g"]],["pnpm",["root","-g"]]])try{let o=SD(i[0],i[1],{encoding:"utf8"});o.status===0&&o.stdout.trim()&&n.push({manager:i[0],dir:o.stdout.trim()})}catch{}let s=Ee.join(e,".nvm","versions","node");if(pe.existsSync(s))for(let i of pe.readdirSync(s)){let o=Ee.join(s,i,"lib","node_modules");pe.existsSync(o)&&!n.some(a=>a.dir===o)&&n.push({manager:`nvm/${i}`,dir:o})}for(let{manager:i,dir:o}of n)for(let a of["@hanzlaa","@hanzlahabib"]){let c=Ee.join(o,a);if(pe.existsSync(c)){for(let u of pe.readdirSync(c))if(u==="rcode"||u==="rcode"||u.startsWith("rcode")){let l="unknown";try{l=JSON.parse(pe.readFileSync(Ee.join(c,u,"package.json"),"utf8")).version}catch{}r.push({manager:i,scope:a,pkg:u,version:l,dir:Ee.join(c,u)})}}}return{count:r.length,installs:r}}function S1(t){if(t.count===0)return console.log(" \u2713 No global rcode installs found"),0;if(t.count===1){let e=t.installs[0];return console.log(` \u2713 Single global install: [${e.manager}] ${e.scope}/${e.pkg}@${e.version}`),0}console.log(` \u2717 ${t.count} global installs detected \u2014 this causes duplicate slash commands!`);for(let e of t.installs)console.log(` [${e.manager}] ${e.scope}/${e.pkg}@${e.version}`),console.log(` ${e.dir}`);return console.log(`
354
+ Fix: rcode nuke --yes && npm install -g @hanzlaa/rcode`),1}Ho.exports=function(e,{packageRoot:r}){let n=process.cwd();console.log(`
332
355
  \u{1F54C} rcode \u2014 Doctor
333
- `),console.log("Preflight:");let s=ED(n,r),i=f1(s);console.log(`
334
- Duplicate installations:`);let o=m1(),a=g1(o);console.log(`
335
- Package compliance:`);let u=h1(r);console.log(`
336
- Artifact schema validation:`);let c=p1(r),l=i+u+a+c;console.log(),console.log(l===0?"\u2705 All checks passed.":`\u274C ${l} check(s) failed \u2014 see above.`),console.log(),process.exit(l>0?1:0)};qo.exports.findStuckExecutingPhases=_D;qo.exports.runPreflight=ED});var yc=v((JI,wD)=>{var Wo=require("fs"),Dc=require("path"),SD=["new-project","create-prd","discuss-phase","plan","execute-sprint","verify-phase","retrospective","ship"];wD.exports=function(e,{packageRoot:r}){let n=Dc.join(r,"rcode","workflows"),s=e[0];if(!s||s==="list"||s==="--list")return D1(n);if(s==="show"||s==="get"||s==="run"){let i=e[1];return i||(console.error("Usage: rcode workflow show <name>"),console.error(" rcode workflow list"),process.exit(1)),CD(n,i)}return CD(n,s)};function D1(t){let e=Wo.readdirSync(t).filter(s=>s.endsWith(".md")).map(s=>s.replace(/\.md$/,"")).sort(),r=SD.filter(s=>e.includes(s)),n=e.filter(s=>!SD.includes(s));console.log(`\u{1F54C} rcode lifecycle workflows
356
+ `),console.log("Preflight:");let s=CD(n,r),i=y1(s);console.log(`
357
+ Duplicate installations:`);let o=b1(),a=S1(o);console.log(`
358
+ Package compliance:`);let c=v1(r);console.log(`
359
+ Artifact schema validation:`);let u=_1(r),l=i+c+a+u;console.log(),console.log(l===0?"\u2705 All checks passed.":`\u274C ${l} check(s) failed \u2014 see above.`),console.log(),process.exit(l>0?1:0)};Ho.exports.findStuckExecutingPhases=ED;Ho.exports.runPreflight=CD});var _u=v((nT,$D)=>{var Zo=require("fs"),vu=require("path"),xD=["new-project","create-prd","discuss-phase","plan","execute-sprint","verify-phase","retrospective","ship"];$D.exports=function(e,{packageRoot:r}){let n=vu.join(r,"rcode","workflows"),s=e[0];if(!s||s==="list"||s==="--list")return E1(n);if(s==="show"||s==="get"||s==="run"){let i=e[1];return i||(console.error("Usage: rcode workflow show <name>"),console.error(" rcode workflow list"),process.exit(1)),kD(n,i)}return kD(n,s)};function E1(t){let e=Zo.readdirSync(t).filter(s=>s.endsWith(".md")).map(s=>s.replace(/\.md$/,"")).sort(),r=xD.filter(s=>e.includes(s)),n=e.filter(s=>!xD.includes(s));console.log(`\u{1F54C} rcode lifecycle workflows
337
360
  `),console.log("Core lifecycle (in order):"),r.forEach(s=>console.log(` rcode workflow show ${s}`)),n.length&&(console.log(`
338
361
  Other workflows:`),n.forEach(s=>console.log(` rcode workflow show ${s}`))),console.log(`
339
- Usage: rcode workflow show <name> \u2014 print the full workflow instructions`)}function CD(t,e){let r=e.startsWith("rcode-")?e.slice(6):e,n=[Dc.join(t,`${r}.md`),Dc.join(t,`${e}.md`)];for(let i of n)if(Wo.existsSync(i)){process.stdout.write(Wo.readFileSync(i,"utf8"));return}let s=Wo.readdirSync(t).filter(i=>i.endsWith(".md")).map(i=>i.replace(/\.md$/,"")).sort().join(", ");console.error(`Error: workflow '${e}' not found.`),console.error(`Available: ${s}`),process.exit(1)}});var Ec=v((KI,FD)=>{var ds=require("fs"),Zo=require("path");function y1(t){for(;t!==require("path").parse(t).root;){if(ds.existsSync(Zo.join(t,"package.json")))return t;t=Zo.dirname(t)}throw new Error("Could not find package root")}var v1=y1(__dirname),vc=Zo.join(v1,"rcode/config/model-profiles.json"),Ho=null;function fs(){if(Ho)return Ho;if(!ds.existsSync(vc))throw new Error(`Model profiles not found at ${vc}`);return Ho=JSON.parse(ds.readFileSync(vc,"utf8")),Ho}function $D(){let t=fs();return Object.keys(t.profiles)}function _c(t){let r=fs().profiles[t];if(!r)throw new Error(`Unknown profile '${t}'. Valid: ${$D().join(", ")}`);return r}function Uo(){return fs().default_profile}function kD(){return fs().model_aliases}function AD(t,e={}){let{profile:r=Uo(),overrides:n={}}=e;if(n[t])return xD(n[t]);let i=_c(r).agents[t];if(!i)throw new Error(`Agent '${t}' not mapped in profile '${r}'. Check rcode/config/model-profiles.json.`);return xD(i)}function xD(t){if(t==="inherit")return null;let e=kD();return e[t]!==void 0?e[t]:t}function _1(t){let e=_c(t),r={};for(let n of Object.keys(e.agents))r[n]=AD(n,{profile:t});return r}function E1(t){let e=Object.keys(t);if(e.length===0)return"(empty)";let r=Math.max(5,...e.map(o=>o.length)),n=Math.max(5,...Object.values(t).map(o=>(o??"inherit").length)),s="\u2500".repeat(r+2)+"\u253C"+"\u2500".repeat(n+2),i=" "+"Agent".padEnd(r)+" \u2502 "+"Model".padEnd(n)+`
362
+ Usage: rcode workflow show <name> \u2014 print the full workflow instructions`)}function kD(t,e){let r=e.startsWith("rcode-")?e.slice(6):e,n=[vu.join(t,`${r}.md`),vu.join(t,`${e}.md`)];for(let i of n)if(Zo.existsSync(i)){process.stdout.write(Zo.readFileSync(i,"utf8"));return}let s=Zo.readdirSync(t).filter(i=>i.endsWith(".md")).map(i=>i.replace(/\.md$/,"")).sort().join(", ");console.error(`Error: workflow '${e}' not found.`),console.error(`Available: ${s}`),process.exit(1)}});var Eu=v((sT,TD)=>{var hs=require("fs"),Vo=require("path");function C1(t){for(;t!==require("path").parse(t).root;){if(hs.existsSync(Vo.join(t,"package.json")))return t;t=Vo.dirname(t)}throw new Error("Could not find package root")}var w1=C1(__dirname),bu=Vo.join(w1,"rcode/config/model-profiles.json"),Uo=null;function ps(){if(Uo)return Uo;if(!hs.existsSync(bu))throw new Error(`Model profiles not found at ${bu}`);return Uo=JSON.parse(hs.readFileSync(bu,"utf8")),Uo}function FD(){let t=ps();return Object.keys(t.profiles)}function Su(t){let r=ps().profiles[t];if(!r)throw new Error(`Unknown profile '${t}'. Valid: ${FD().join(", ")}`);return r}function Go(){return ps().default_profile}function jD(){return ps().model_aliases}function ID(t,e={}){let{profile:r=Go(),overrides:n={}}=e;if(n[t])return AD(n[t]);let i=Su(r).agents[t];if(!i)throw new Error(`Agent '${t}' not mapped in profile '${r}'. Check rcode/config/model-profiles.json.`);return AD(i)}function AD(t){if(t==="inherit")return null;let e=jD();return e[t]!==void 0?e[t]:t}function x1(t){let e=Su(t),r={};for(let n of Object.keys(e.agents))r[n]=ID(n,{profile:t});return r}function k1(t){let e=Object.keys(t);if(e.length===0)return"(empty)";let r=Math.max(5,...e.map(o=>o.length)),n=Math.max(5,...Object.values(t).map(o=>(o??"inherit").length)),s="\u2500".repeat(r+2)+"\u253C"+"\u2500".repeat(n+2),i=" "+"Agent".padEnd(r)+" \u2502 "+"Model".padEnd(n)+`
340
363
  `;i+=s+`
341
364
  `;for(let[o,a]of Object.entries(t))i+=" "+o.padEnd(r)+" \u2502 "+(a??"inherit").padEnd(n)+`
342
- `;return i}function b1(t=process.cwd()){let e=Zo.join(t,".rcode","config.json");if(ds.existsSync(e))try{let r=JSON.parse(ds.readFileSync(e,"utf8"));return{profile:r.model_profile||Uo(),overrides:r.model_overrides||{}}}catch{console.warn("Warning: .rcode/config.json is invalid JSON. Using defaults.")}return{profile:Uo(),overrides:{}}}FD.exports={loadProfiles:fs,listProfiles:$D,getProfile:_c,getDefaultProfile:Uo,getModelAliases:kD,resolveModelForAgent:AD,getResolvedMapForProfile:_1,formatMapAsTable:E1,getProjectProfile:b1}});var gs=v((QI,RD)=>{var hs=require("fs"),ps=require("path"),{writeJsonAtomic:bc}=Jt(),{homedir:S1}=lr(),Sc=1,Cc={schema_version:Sc,installed_version:null,project_name:null,user_name:"Team",communication_language:"English",document_output_language:"English",output_folder:".rcode",planning_artifacts:".planning/phases",project_knowledge:".rcode/context",model_profile:"balanced",communication_mode:"guided"},Yo=new Set(["schema_version","installed_version","project_name","user_name","communication_language","document_output_language","output_folder","planning_artifacts","project_knowledge","model_profile","communication_mode"]),C1={profile:"model_profile","model-profile":"model_profile",language:"communication_language",user:"user_name",project:"project_name",output:"output_folder",planning:"planning_artifacts",knowledge:"project_knowledge"},Vo=new Set(["quality","balanced","budget","inherit"]),Go=new Set(["guided","yolo"]);function Xo(){return ps.join(S1(),".rcode","defaults.json")}function Jo(t){return ps.join(t,".rcode","config.json")}function jD(t){return ps.join(t,".rcode","config.yaml")}function ID(t){if(!hs.existsSync(t))return null;try{return JSON.parse(hs.readFileSync(t,"utf8"))}catch{return null}}function ms(){return ID(Xo())||{}}var w1={mode:"communication_mode"};function x1(t){if(!hs.existsSync(t))return null;try{let e={};for(let r of hs.readFileSync(t,"utf8").split(`
343
- `)){let n=r.match(/^([a-zA-Z_]+):\s*["']?([^"'\n#]+?)["']?\s*(?:#.*)?$/);if(!n)continue;let s=w1[n[1].trim()]||n[1].trim(),i=n[2].trim();e[s]=i==="true"?!0:i==="false"?!1:i}return Object.keys(e).length?e:null}catch{return null}}function wc(t){let e=ID(Jo(t));return e||x1(jD(t))||{}}function TD(t){let e={...Cc};e.project_name===null&&(e.project_name=ps.basename(t));let r=ms(),n=wc(t);return{...e,...r,...n}}function $1(t,e){return Yo.has(e)?TD(t)[e]:void 0}function k1(t,e={}){let r=Jo(t);if(hs.existsSync(r))return!1;let n=ms(),s=o=>e[o]!==void 0?e[o]:n[o]!==void 0?n[o]:Cc[o],i={schema_version:Sc,installed_version:e.installed_version||null,project_name:e.project_name||ps.basename(t),user_name:s("user_name"),communication_language:s("communication_language"),document_output_language:s("document_output_language"),output_folder:s("output_folder"),planning_artifacts:s("planning_artifacts"),project_knowledge:s("project_knowledge"),model_profile:s("model_profile")};return bc(r,i),!0}function A1(t){let r={...ms(),...t};bc(Xo(),r)}function F1(t,e,r,{scope:n="project"}={}){if(!Yo.has(e)){let a=C1[e.toLowerCase()]||zo(e,[...Yo]);return{ok:!1,error:`Unknown config key '${e}'`,suggestion:a}}if(e==="model_profile"&&!Vo.has(r))return{ok:!1,error:`Invalid model_profile '${r}' (valid: ${[...Vo].join(", ")})`,suggestion:zo(r,[...Vo])};if(e==="communication_mode"&&!Go.has(r))return{ok:!1,error:`Invalid communication_mode '${r}' (valid: ${[...Go].join(", ")})`,suggestion:zo(r,[...Go])};if(e==="schema_version"){let a=Number(r);if(Number.isNaN(a))return{ok:!1,error:"schema_version must be a number"};r=a}let s,i;n==="global"?(s=Xo(),i=ms()):(s=Jo(t),i=wc(t));let o={...i,[e]:r};return bc(s,o),{ok:!0,scope:n,target:s}}function zo(t,e){if(!t)return null;let r=t.toLowerCase(),n=null,s=1/0;for(let o of e){let a=j1(r,o.toLowerCase());a<s&&(s=a,n=o)}let i=Math.max(1,Math.floor(t.length/3));return s<=i?n:null}function j1(t,e){if(t===e)return 0;if(!t.length)return e.length;if(!e.length)return t.length;let r=new Array(e.length+1),n=new Array(e.length+1);for(let s=0;s<=e.length;s++)r[s]=s;for(let s=1;s<=t.length;s++){n[0]=s;for(let i=1;i<=e.length;i++){let o=t[s-1]===e[i-1]?0:1;n[i]=Math.min(n[i-1]+1,r[i]+1,r[i-1]+o)}for(let i=0;i<=e.length;i++)r[i]=n[i]}return r[e.length]}RD.exports={SCHEMA_VERSION:Sc,HARDCODED_DEFAULTS:Cc,VALID_CONFIG_KEYS:Yo,VALID_MODEL_PROFILES:Vo,VALID_COMMUNICATION_MODES:Go,loadConfig:TD,getConfigValue:$1,setConfigValue:F1,initProjectConfig:k1,writeUserDefaults:A1,loadUserDefaults:ms,loadProjectConfig:wc,userLevelPath:Xo,projectLevelPath:Jo,projectYamlPath:jD,suggestClosest:zo}});var OD=v((eT,PD)=>{var I1=require("fs"),T1=require("path"),{listProfiles:R1,getProfile:P1,getResolvedMapForProfile:O1,formatMapAsTable:N1,getProjectProfile:L1}=Ec(),{setConfigValue:B1,getConfigValue:M1}=gs();PD.exports=function(e){let r=process.cwd(),n=T1.join(r,".rcode");I1.existsSync(n)||(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first."),process.exit(1));let s=e[0],i=R1();if((s==="--help"||s==="-h")&&(console.log("Usage: rcode set-profile [<name>]"),console.log(),console.log(" rcode set-profile show current profile + available options"),console.log(" rcode set-profile <name> switch to profile <name>"),console.log(),console.log(`Available profiles: ${i.join(", ")}`),process.exit(0)),!s){let c=L1(r);if(console.log(`
344
- \u{1F54C} Current profile: ${c.profile}
345
- `),Object.keys(c.overrides).length>0){console.log(" Overrides:");for(let[l,d]of Object.entries(c.overrides))console.log(` ${l} \u2192 ${d}`);console.log()}console.log("Available profiles:");for(let l of i){let d=P1(l),f=l===c.profile?" \u2190 current":"";console.log(` \u2022 ${l}${f}`),console.log(` ${d.description}`)}console.log(`
346
- Usage: rcode set-profile <name>`);return}let o=M1(r,"model_profile")||"(default)",a=B1(r,"model_profile",s);a.ok||(console.error(`\u274C ${a.error}`),a.suggestion&&console.error(` Did you mean '${a.suggestion}'?`),console.error(` Available: ${i.join(", ")}`),process.exit(1)),console.log(`
365
+ `;return i}function $1(t=process.cwd()){let e=Vo.join(t,".rcode","config.json");if(hs.existsSync(e))try{let r=JSON.parse(hs.readFileSync(e,"utf8"));return{profile:r.model_profile||Go(),overrides:r.model_overrides||{}}}catch{console.warn("Warning: .rcode/config.json is invalid JSON. Using defaults.")}return{profile:Go(),overrides:{}}}TD.exports={loadProfiles:ps,listProfiles:FD,getProfile:Su,getDefaultProfile:Go,getModelAliases:jD,resolveModelForAgent:ID,getResolvedMapForProfile:x1,formatMapAsTable:k1,getProjectProfile:$1}});var ys=v((oT,ND)=>{var ms=require("fs"),gs=require("path"),{writeJsonAtomic:Cu}=Qt(),{homedir:A1}=hr(),wu=1,xu={schema_version:wu,installed_version:null,project_name:null,user_name:"Team",communication_language:"English",document_output_language:"English",output_folder:".rcode",planning_artifacts:".planning/phases",project_knowledge:".rcode/context",model_profile:"balanced",communication_mode:"guided"},Xo=new Set(["schema_version","installed_version","project_name","user_name","communication_language","document_output_language","output_folder","planning_artifacts","project_knowledge","model_profile","communication_mode"]),F1={profile:"model_profile","model-profile":"model_profile",language:"communication_language",user:"user_name",project:"project_name",output:"output_folder",planning:"planning_artifacts",knowledge:"project_knowledge"},zo=new Set(["quality","balanced","budget","inherit"]),Yo=new Set(["guided","yolo"]);function Ko(){return gs.join(A1(),".rcode","defaults.json")}function Qo(t){return gs.join(t,".rcode","config.json")}function RD(t){return gs.join(t,".rcode","config.yaml")}function PD(t){if(!ms.existsSync(t))return null;try{return JSON.parse(ms.readFileSync(t,"utf8"))}catch{return null}}function Ds(){return PD(Ko())||{}}var j1={mode:"communication_mode"};function I1(t){if(!ms.existsSync(t))return null;try{let e={};for(let r of ms.readFileSync(t,"utf8").split(`
366
+ `)){let n=r.match(/^([a-zA-Z_]+):\s*["']?([^"'\n#]+?)["']?\s*(?:#.*)?$/);if(!n)continue;let s=j1[n[1].trim()]||n[1].trim(),i=n[2].trim();e[s]=i==="true"?!0:i==="false"?!1:i}return Object.keys(e).length?e:null}catch{return null}}function ku(t){let e=PD(Qo(t));return e||I1(RD(t))||{}}function OD(t){let e={...xu};e.project_name===null&&(e.project_name=gs.basename(t));let r=Ds(),n=ku(t);return{...e,...r,...n}}function T1(t,e){return Xo.has(e)?OD(t)[e]:void 0}function R1(t,e={}){let r=Qo(t);if(ms.existsSync(r))return!1;let n=Ds(),s=o=>e[o]!==void 0?e[o]:n[o]!==void 0?n[o]:xu[o],i={schema_version:wu,installed_version:e.installed_version||null,project_name:e.project_name||gs.basename(t),user_name:s("user_name"),communication_language:s("communication_language"),document_output_language:s("document_output_language"),output_folder:s("output_folder"),planning_artifacts:s("planning_artifacts"),project_knowledge:s("project_knowledge"),model_profile:s("model_profile")};return Cu(r,i),!0}function P1(t){let r={...Ds(),...t};Cu(Ko(),r)}function O1(t,e,r,{scope:n="project"}={}){if(!Xo.has(e)){let a=F1[e.toLowerCase()]||Jo(e,[...Xo]);return{ok:!1,error:`Unknown config key '${e}'`,suggestion:a}}if(e==="model_profile"&&!zo.has(r))return{ok:!1,error:`Invalid model_profile '${r}' (valid: ${[...zo].join(", ")})`,suggestion:Jo(r,[...zo])};if(e==="communication_mode"&&!Yo.has(r))return{ok:!1,error:`Invalid communication_mode '${r}' (valid: ${[...Yo].join(", ")})`,suggestion:Jo(r,[...Yo])};if(e==="schema_version"){let a=Number(r);if(Number.isNaN(a))return{ok:!1,error:"schema_version must be a number"};r=a}let s,i;n==="global"?(s=Ko(),i=Ds()):(s=Qo(t),i=ku(t));let o={...i,[e]:r};return Cu(s,o),{ok:!0,scope:n,target:s}}function Jo(t,e){if(!t)return null;let r=t.toLowerCase(),n=null,s=1/0;for(let o of e){let a=N1(r,o.toLowerCase());a<s&&(s=a,n=o)}let i=Math.max(1,Math.floor(t.length/3));return s<=i?n:null}function N1(t,e){if(t===e)return 0;if(!t.length)return e.length;if(!e.length)return t.length;let r=new Array(e.length+1),n=new Array(e.length+1);for(let s=0;s<=e.length;s++)r[s]=s;for(let s=1;s<=t.length;s++){n[0]=s;for(let i=1;i<=e.length;i++){let o=t[s-1]===e[i-1]?0:1;n[i]=Math.min(n[i-1]+1,r[i]+1,r[i-1]+o)}for(let i=0;i<=e.length;i++)r[i]=n[i]}return r[e.length]}ND.exports={SCHEMA_VERSION:wu,HARDCODED_DEFAULTS:xu,VALID_CONFIG_KEYS:Xo,VALID_MODEL_PROFILES:zo,VALID_COMMUNICATION_MODES:Yo,loadConfig:OD,getConfigValue:T1,setConfigValue:O1,initProjectConfig:R1,writeUserDefaults:P1,loadUserDefaults:Ds,loadProjectConfig:ku,userLevelPath:Ko,projectLevelPath:Qo,projectYamlPath:RD,suggestClosest:Jo}});var BD=v((iT,LD)=>{var L1=require("fs"),B1=require("path"),{listProfiles:M1,getProfile:q1,getResolvedMapForProfile:W1,formatMapAsTable:H1,getProjectProfile:Z1}=Eu(),{setConfigValue:U1,getConfigValue:V1}=ys();LD.exports=function(e){let r=process.cwd(),n=B1.join(r,".rcode");L1.existsSync(n)||(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first."),process.exit(1));let s=e[0],i=M1();if((s==="--help"||s==="-h")&&(console.log("Usage: rcode set-profile [<name>]"),console.log(),console.log(" rcode set-profile show current profile + available options"),console.log(" rcode set-profile <name> switch to profile <name>"),console.log(),console.log(`Available profiles: ${i.join(", ")}`),process.exit(0)),!s){let u=Z1(r);if(console.log(`
367
+ \u{1F54C} Current profile: ${u.profile}
368
+ `),Object.keys(u.overrides).length>0){console.log(" Overrides:");for(let[l,d]of Object.entries(u.overrides))console.log(` ${l} \u2192 ${d}`);console.log()}console.log("Available profiles:");for(let l of i){let d=q1(l),f=l===u.profile?" \u2190 current":"";console.log(` \u2022 ${l}${f}`),console.log(` ${d.description}`)}console.log(`
369
+ Usage: rcode set-profile <name>`);return}let o=V1(r,"model_profile")||"(default)",a=U1(r,"model_profile",s);a.ok||(console.error(`\u274C ${a.error}`),a.suggestion&&console.error(` Did you mean '${a.suggestion}'?`),console.error(` Available: ${i.join(", ")}`),process.exit(1)),console.log(`
347
370
  \u2705 Profile changed: ${o} \u2192 ${s}
348
- `);let u=O1(s);console.log(N1(u)),console.log()}});var MD=v((tT,BD)=>{var q1=require("fs"),W1=require("path"),{loadConfig:ND,setConfigValue:H1,VALID_COMMUNICATION_MODES:xc}=gs(),LD={guided:`Ask questions, confirm at every major gate, halt at decision menus.
371
+ `);let c=W1(s);console.log(H1(c)),console.log()}});var HD=v((aT,WD)=>{var G1=require("fs"),z1=require("path"),{loadConfig:MD,setConfigValue:Y1,VALID_COMMUNICATION_MODES:$u}=ys(),qD={guided:`Ask questions, confirm at every major gate, halt at decision menus.
349
372
  Recommended for: first-time use, critical projects, new domains.`,yolo:`Skip menus, use sensible defaults, report decisions in the final summary.
350
373
  Destructive ops (github push, rm, force-push) STILL require
351
374
  explicit confirmation unless you also pass --force-yolo.
352
- Recommended for: experienced solo projects, prototypes, CI.`};BD.exports=function(e){let r=process.cwd(),n=W1.join(r,".rcode");q1.existsSync(n)||(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first."),process.exit(1));let s=e[0];if((s==="--help"||s==="-h")&&(console.log("Usage: rcode set-mode [<mode>]"),console.log(),console.log(" rcode set-mode show current mode + explanation"),console.log(" rcode set-mode <mode> switch to mode <mode>"),console.log(),console.log(`Available modes: ${[...xc].join(", ")}`),process.exit(0)),!s){let u=ND(r).communication_mode||"guided";console.log(`
353
- \u{1F54C} Communication mode: ${u}
354
- `);for(let c of xc)console.log(` \u2022 ${c}${c===u?" \u2190 current":""}`),console.log(` ${LD[c]}`),console.log();console.log(`Usage: rcode set-mode <${[...xc].join("|")}>`),console.log();return}let i=ND(r).communication_mode||"guided",o=H1(r,"communication_mode",s);o.ok||(console.error(`
375
+ Recommended for: experienced solo projects, prototypes, CI.`};WD.exports=function(e){let r=process.cwd(),n=z1.join(r,".rcode");G1.existsSync(n)||(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first."),process.exit(1));let s=e[0];if((s==="--help"||s==="-h")&&(console.log("Usage: rcode set-mode [<mode>]"),console.log(),console.log(" rcode set-mode show current mode + explanation"),console.log(" rcode set-mode <mode> switch to mode <mode>"),console.log(),console.log(`Available modes: ${[...$u].join(", ")}`),process.exit(0)),!s){let c=MD(r).communication_mode||"guided";console.log(`
376
+ \u{1F54C} Communication mode: ${c}
377
+ `);for(let u of $u)console.log(` \u2022 ${u}${u===c?" \u2190 current":""}`),console.log(` ${qD[u]}`),console.log();console.log(`Usage: rcode set-mode <${[...$u].join("|")}>`),console.log();return}let i=MD(r).communication_mode||"guided",o=Y1(r,"communication_mode",s);o.ok||(console.error(`
355
378
  \u274C ${o.error}`),o.suggestion&&console.error(` Did you mean '${o.suggestion}'?`),console.error(),process.exit(1)),console.log(`
356
- \u2705 Communication mode: ${i} \u2192 ${s}`),console.log(),console.log(` ${LD[s]}`),console.log(),s==="yolo"&&(console.log(" \u26A0 Note: destructive operations (github-sync, uninstall,"),console.log(" force push) still require explicit confirmation unless"),console.log(" --force-yolo / --yes is passed."),console.log())}});var VD=v((nT,UD)=>{var qD=require("fs"),WD=require("path"),{loadConfig:Z1,loadUserDefaults:U1,loadProjectConfig:V1,setConfigValue:G1,getConfigValue:z1,VALID_CONFIG_KEYS:$c,HARDCODED_DEFAULTS:rT,userLevelPath:HD,projectLevelPath:ZD}=gs();function Y1(t){let e={global:!1,list:!1,positional:[]};for(let r of t)r==="--global"||r==="-g"?e.global=!0:r==="--list"||r==="-l"?e.list=!0:e.positional.push(r);return e}function X1(t,e){let r=V1(t);if(e in r)return"project";let n=U1();return e in n?"user":"default"}function J1(t){let e=Z1(t),r=[...$c],n=Math.max(...r.map(i=>i.length)),s=Math.max(...r.map(i=>String(e[i]??"").length),5);console.log(`
379
+ \u2705 Communication mode: ${i} \u2192 ${s}`),console.log(),console.log(` ${qD[s]}`),console.log(),s==="yolo"&&(console.log(" \u26A0 Note: destructive operations (github-sync, uninstall,"),console.log(" force push) still require explicit confirmation unless"),console.log(" --force-yolo / --yes is passed."),console.log())}});var YD=v((uT,zD)=>{var ZD=require("fs"),UD=require("path"),{loadConfig:J1,loadUserDefaults:X1,loadProjectConfig:K1,setConfigValue:Q1,getConfigValue:eF,VALID_CONFIG_KEYS:Au,HARDCODED_DEFAULTS:cT,userLevelPath:VD,projectLevelPath:GD}=ys();function tF(t){let e={global:!1,list:!1,positional:[]};for(let r of t)r==="--global"||r==="-g"?e.global=!0:r==="--list"||r==="-l"?e.list=!0:e.positional.push(r);return e}function rF(t,e){let r=K1(t);if(e in r)return"project";let n=X1();return e in n?"user":"default"}function nF(t){let e=J1(t),r=[...Au],n=Math.max(...r.map(i=>i.length)),s=Math.max(...r.map(i=>String(e[i]??"").length),5);console.log(`
357
380
  \u{1F54C} rcode \u2014 configuration
358
- `),console.log(` Project: ${ZD(t)}`),console.log(` User: ${HD()}
359
- `),console.log(` ${"key".padEnd(n)} ${"value".padEnd(s)} source`),console.log(` ${"-".repeat(n)} ${"-".repeat(s)} ------`);for(let i of r){let o=e[i],a=X1(t,i);console.log(` ${i.padEnd(n)} ${String(o??"").padEnd(s)} ${a}`)}console.log()}UD.exports=function(e){let r=process.cwd(),n=Y1(e);if(n.positional.length===0||n.list){let s=WD.join(r,".rcode");!qD.existsSync(s)&&!n.global&&(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first, or use --global to manage user defaults."),process.exit(1)),J1(r);return}if(n.positional.length===1){let s=n.positional[0];$c.has(s)||(console.error(`\u274C Unknown config key '${s}'`),console.error(` Valid keys: ${[...$c].join(", ")}`),process.exit(1));let i=z1(r,s);console.log(i??"");return}if(n.positional.length===2){let[s,i]=n.positional,o=n.global?"global":"project";o==="project"&&!qD.existsSync(WD.join(r,".rcode"))&&(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first, or use --global."),process.exit(1));let a=G1(r,s,i,{scope:o});a.ok||(console.error(`\u274C ${a.error}`),a.suggestion&&console.error(` Did you mean '${a.suggestion}'?`),process.exit(1));let u=o==="global"?HD():ZD(r);console.log(`\u2705 ${s} = ${i} (${o}: ${u})`);return}console.error("\u274C Too many arguments."),console.error(" Usage: rcode config [--global] [key] [value]"),process.exit(1)}});var XD=v((oT,YD)=>{var cn=require("fs"),Ko=require("path"),{computeFingerprint:sT,writeFingerprint:K1,checkStaleness:GD,commitsBetween:Q1,STALE_THRESHOLDS:eF}=pc();function tF(t){let e={check:!1,refresh:!1,installHook:!1};for(let r of t)r==="--check"?e.check=!0:r==="--refresh"?e.refresh=!0:r==="--install-hook"?e.installHook=!0:(console.error(`Unknown flag: ${r}`),console.error("Usage: rcode context [--check|--refresh|--install-hook]"),process.exit(1));return e}function zD(t){cn.existsSync(Ko.join(t,".rcode"))||(console.error(`\u274C No .rcode/ directory found in ${t}`),console.error(" Run 'rcode install' first."),process.exit(1))}function rF(t){let e=GD(t),r=e.status==="fresh"?"\u2713":e.status==="stale"?"\u26A0":"\u2717",n=e.status.toUpperCase();if(console.log(`
381
+ `),console.log(` Project: ${GD(t)}`),console.log(` User: ${VD()}
382
+ `),console.log(` ${"key".padEnd(n)} ${"value".padEnd(s)} source`),console.log(` ${"-".repeat(n)} ${"-".repeat(s)} ------`);for(let i of r){let o=e[i],a=rF(t,i);console.log(` ${i.padEnd(n)} ${String(o??"").padEnd(s)} ${a}`)}console.log()}zD.exports=function(e){let r=process.cwd(),n=tF(e);if(n.positional.length===0||n.list){let s=UD.join(r,".rcode");!ZD.existsSync(s)&&!n.global&&(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first, or use --global to manage user defaults."),process.exit(1)),nF(r);return}if(n.positional.length===1){let s=n.positional[0];Au.has(s)||(console.error(`\u274C Unknown config key '${s}'`),console.error(` Valid keys: ${[...Au].join(", ")}`),process.exit(1));let i=eF(r,s);console.log(i??"");return}if(n.positional.length===2){let[s,i]=n.positional,o=n.global?"global":"project";o==="project"&&!ZD.existsSync(UD.join(r,".rcode"))&&(console.error(`\u274C No .rcode/ directory found in ${r}`),console.error(" Run 'rcode install' first, or use --global."),process.exit(1));let a=Q1(r,s,i,{scope:o});a.ok||(console.error(`\u274C ${a.error}`),a.suggestion&&console.error(` Did you mean '${a.suggestion}'?`),process.exit(1));let c=o==="global"?VD():GD(r);console.log(`\u2705 ${s} = ${i} (${o}: ${c})`);return}console.error("\u274C Too many arguments."),console.error(" Usage: rcode config [--global] [key] [value]"),process.exit(1)}});var QD=v((dT,KD)=>{var dn=require("fs"),ei=require("path"),{computeFingerprint:lT,writeFingerprint:sF,checkStaleness:JD,commitsBetween:oF,STALE_THRESHOLDS:iF}=gu();function aF(t){let e={check:!1,refresh:!1,installHook:!1};for(let r of t)r==="--check"?e.check=!0:r==="--refresh"?e.refresh=!0:r==="--install-hook"?e.installHook=!0:(console.error(`Unknown flag: ${r}`),console.error("Usage: rcode context [--check|--refresh|--install-hook]"),process.exit(1));return e}function XD(t){dn.existsSync(ei.join(t,".rcode"))||(console.error(`\u274C No .rcode/ directory found in ${t}`),console.error(" Run 'rcode install' first."),process.exit(1))}function cF(t){let e=JD(t),r=e.status==="fresh"?"\u2713":e.status==="stale"?"\u26A0":"\u2717",n=e.status.toUpperCase();if(console.log(`
360
383
  \u{1F9E0} Memory bank status: ${r} ${n}
361
- `),e.reasons.length>0){console.log(" Reasons:");for(let o of e.reasons)console.log(` \u2022 ${o}`);console.log()}console.log(" Context files:");let s=e.context_files.active?"\u2713":"\u2717",i=e.context_files.brief?"\u2713":"\u2717";if(console.log(` ${s} .rcode/context/active.md`),console.log(` ${i} .rcode/context/project-brief.md`),console.log(),e.stored){if(console.log(` Last init: ${e.stored.timestamp||"unknown"}`),e.stored.git_head){let o=e.stored.git_head.slice(0,7),a=e.stored.git_branch||"detached";console.log(` ${o} on ${a}`)}e.stored.manifest_name&&console.log(` ${e.stored.manifest_name} (${e.stored.manifest_hash})`)}else console.log(" Last init: (never)");if(console.log(` Current: ${e.current.timestamp}`),e.current.git_head){let o=e.current.git_head.slice(0,7),a=e.current.git_branch||"detached";console.log(` ${o} on ${a}`)}if(e.current.manifest_name&&console.log(` ${e.current.manifest_name} (${e.current.manifest_hash})`),e.stored?.git_head&&e.current.git_head){let o=Q1(t,e.stored.git_head,e.current.git_head);o!==null&&console.log(`
362
- Commits since init: ${o} (threshold: ${eF.commitsSinceInit})`)}console.log(),e.status!=="fresh"&&(console.log(" \u27A1 Refresh with: /rcode-init (in your editor)"),console.log())}function nF(t){zD(t);let e=K1(t);console.log(`
363
- \u2705 Fingerprint saved to .rcode/state.json`),console.log(` git: ${e.git_head?e.git_head.slice(0,7):"(no git)"}`),console.log(` manifest: ${e.manifest_name||"(none)"}`),console.log(` structure: ${e.structure_dirs.length} top-level dirs`),console.log()}function sF(t){let e=Ko.join(t,".git");cn.existsSync(e)||(console.error("\u274C Not a git repository (no .git/ found)."),console.error(" The post-commit hook requires git."),process.exit(1));let r=Ko.join(e,"hooks");cn.mkdirSync(r,{recursive:!0});let n=Ko.join(r,"post-commit"),s=`#!/bin/sh
384
+ `),e.reasons.length>0){console.log(" Reasons:");for(let o of e.reasons)console.log(` \u2022 ${o}`);console.log()}console.log(" Context files:");let s=e.context_files.active?"\u2713":"\u2717",i=e.context_files.brief?"\u2713":"\u2717";if(console.log(` ${s} .rcode/context/active.md`),console.log(` ${i} .rcode/context/project-brief.md`),console.log(),e.stored){if(console.log(` Last init: ${e.stored.timestamp||"unknown"}`),e.stored.git_head){let o=e.stored.git_head.slice(0,7),a=e.stored.git_branch||"detached";console.log(` ${o} on ${a}`)}e.stored.manifest_name&&console.log(` ${e.stored.manifest_name} (${e.stored.manifest_hash})`)}else console.log(" Last init: (never)");if(console.log(` Current: ${e.current.timestamp}`),e.current.git_head){let o=e.current.git_head.slice(0,7),a=e.current.git_branch||"detached";console.log(` ${o} on ${a}`)}if(e.current.manifest_name&&console.log(` ${e.current.manifest_name} (${e.current.manifest_hash})`),e.stored?.git_head&&e.current.git_head){let o=oF(t,e.stored.git_head,e.current.git_head);o!==null&&console.log(`
385
+ Commits since init: ${o} (threshold: ${iF.commitsSinceInit})`)}console.log(),e.status!=="fresh"&&(console.log(" \u27A1 Refresh with: /rcode-init (in your editor)"),console.log())}function uF(t){XD(t);let e=sF(t);console.log(`
386
+ \u2705 Fingerprint saved to .rcode/state.json`),console.log(` git: ${e.git_head?e.git_head.slice(0,7):"(no git)"}`),console.log(` manifest: ${e.manifest_name||"(none)"}`),console.log(` structure: ${e.structure_dirs.length} top-level dirs`),console.log()}function lF(t){let e=ei.join(t,".git");dn.existsSync(e)||(console.error("\u274C Not a git repository (no .git/ found)."),console.error(" The post-commit hook requires git."),process.exit(1));let r=ei.join(e,"hooks");dn.mkdirSync(r,{recursive:!0});let n=ei.join(r,"post-commit"),s=`#!/bin/sh
364
387
  # rcode \u2014 memory bank freshness check
365
388
  # Installed by: rcode context --install-hook
366
389
  # Non-blocking: prints a one-line warning if the memory bank is stale.
@@ -372,39 +395,39 @@ if command -v rcode >/dev/null 2>&1; then
372
395
  echo " $(echo "$output" | grep '\u2022' | head -1 | sed 's/^ *//')"
373
396
  fi
374
397
  fi
375
- `;if(cn.existsSync(n)){if(cn.readFileSync(n,"utf8").includes("rcode \u2014 memory bank freshness")){console.log(`\u2713 post-commit hook already installed at ${n}`);return}console.error(`\u274C A post-commit hook already exists at ${n}`),console.error(" Refusing to overwrite. Merge manually or remove the existing hook first."),process.exit(1)}cn.writeFileSync(n,s),cn.chmodSync(n,493),console.log(`\u2705 Installed post-commit hook at ${n}`),console.log(" After each commit, you'll see a warning if the memory bank goes stale."),console.log(` To remove: rm ${n}`)}YD.exports=function(e){let r=process.cwd(),n=tF(e);if(n.installHook){sF(r);return}if(n.refresh){nF(r);return}zD(r),rF(r),n.check&&GD(r).status!=="fresh"&&process.exit(1)}});var ey=v((iT,QD)=>{var{listProfiles:JD,getProfile:oF,resolveModelForAgent:KD,getResolvedMapForProfile:iF,formatMapAsTable:aF,getProjectProfile:uF}=Ec();function cF(t){let e={agent:null,profile:null};for(let r of t)r.startsWith("--profile=")?e.profile=r.slice(10):r.startsWith("--agent=")?e.agent=r.slice(8):r.startsWith("--")||(e.agent=r);return e}QD.exports=function(e){let r=cF(e),n=uF(),s=r.profile||n.profile;JD().includes(s)||(console.error(`\u274C Unknown profile '${s}'`),console.error(` Available: ${JD().join(", ")}`),process.exit(1));let i=oF(s);if(r.agent){try{let a=KD(r.agent,{profile:s,overrides:r.profile?{}:n.overrides});console.log(`${r.agent} (profile: ${s}) \u2192 ${a??"inherit (runtime picks)"}`)}catch(a){console.error(`\u274C ${a.message}`),process.exit(1)}return}console.log(`
398
+ `;if(dn.existsSync(n)){if(dn.readFileSync(n,"utf8").includes("rcode \u2014 memory bank freshness")){console.log(`\u2713 post-commit hook already installed at ${n}`);return}console.error(`\u274C A post-commit hook already exists at ${n}`),console.error(" Refusing to overwrite. Merge manually or remove the existing hook first."),process.exit(1)}dn.writeFileSync(n,s),dn.chmodSync(n,493),console.log(`\u2705 Installed post-commit hook at ${n}`),console.log(" After each commit, you'll see a warning if the memory bank goes stale."),console.log(` To remove: rm ${n}`)}KD.exports=function(e){let r=process.cwd(),n=aF(e);if(n.installHook){lF(r);return}if(n.refresh){uF(r);return}XD(r),cF(r),n.check&&JD(r).status!=="fresh"&&process.exit(1)}});var ny=v((fT,ry)=>{var{listProfiles:ey,getProfile:dF,resolveModelForAgent:ty,getResolvedMapForProfile:fF,formatMapAsTable:hF,getProjectProfile:pF}=Eu();function mF(t){let e={agent:null,profile:null};for(let r of t)r.startsWith("--profile=")?e.profile=r.slice(10):r.startsWith("--agent=")?e.agent=r.slice(8):r.startsWith("--")||(e.agent=r);return e}ry.exports=function(e){let r=mF(e),n=pF(),s=r.profile||n.profile;ey().includes(s)||(console.error(`\u274C Unknown profile '${s}'`),console.error(` Available: ${ey().join(", ")}`),process.exit(1));let i=dF(s);if(r.agent){try{let a=ty(r.agent,{profile:s,overrides:r.profile?{}:n.overrides});console.log(`${r.agent} (profile: ${s}) \u2192 ${a??"inherit (runtime picks)"}`)}catch(a){console.error(`\u274C ${a.message}`),process.exit(1)}return}console.log(`
376
399
  \u{1F54C} Profile: ${s}`),console.log(` ${i.description}
377
- `);let o=iF(s);if(!r.profile&&Object.keys(n.overrides).length>0){console.log(" Overrides applied:");for(let[a,u]of Object.entries(n.overrides)){let c=KD(a,{profile:s,overrides:n.overrides});o[a]=c,console.log(` ${a} \u2192 ${u} (resolved: ${c??"inherit"})`)}console.log()}console.log(aF(o))}});var ny=v((uT,ry)=>{var{execSync:aT,spawnSync:ty}=require("child_process");function lF(t){return t?t.replace(/\b(ghp_|ghs_|github_pat_)[A-Za-z0-9_]{10,}\b/g,"[REDACTED]").slice(0,2e3):""}function Xe(t,{input:e=null,allowFailure:r=!1}={}){let n=ty("gh",t,{encoding:"utf8",input:e,stdio:e?["pipe","pipe","pipe"]:["ignore","pipe","pipe"]});if(n.status!==0&&!r){let s=lF(n.stderr||n.stdout||"(no output)");throw new Error(`gh ${t.join(" ")} failed:
378
- ${s}`)}return{status:n.status,stdout:n.stdout||"",stderr:n.stderr||""}}function dF(){try{let t=Xe(["auth","status"],{allowFailure:!0});if(t.status!==0)return{authenticated:!1,error:t.stderr};let e=(t.stderr+t.stdout).match(/Logged in to github\.com account (\S+)/);return{authenticated:!0,account:e?e[1]:"unknown"}}catch(t){return{authenticated:!1,error:t.message}}}function fF(t=process.cwd()){try{let e=ty("gh",["repo","view","--json","owner,name,nameWithOwner,url"],{cwd:t,encoding:"utf8"});return e.status!==0?null:JSON.parse(e.stdout)}catch{return null}}function hF(t,e,r,{execute:n=!1,dryRun:s=!0}={}){if(s||!n)return console.log(` [dry-run] would ensure label: ${t} (${e})`),{dryRun:!0};let i=Xe(["label","list","--search",t,"--json","name"],{allowFailure:!0});if(i.status===0){let u;try{u=JSON.parse(i.stdout||"[]")}catch{u=[]}if(u.some(c=>c.name===t))return{existed:!0,name:t}}let o=["label","create",t,"--color",e];r&&o.push("--description",r);let a=Xe(o,{allowFailure:!0});return{created:a.status===0,name:t,error:a.status!==0?a.stderr:null}}function pF(t,e,r,{execute:n=!1,dryRun:s=!0,repo:i=null}={}){if(s||!n)return console.log(` [dry-run] would create milestone: "${t}"`),{dryRun:!0,title:t};let a=["api","--method","POST",`${i?`/repos/${i}`:"/repos/{owner}/{repo}"}/milestones`,"-f",`title=${t}`,"-f",`description=${e||""}`,"-f","state=open"];r&&a.push("-f",`due_on=${r}`);let u=Xe(a,{allowFailure:!0});if(u.status!==0)return{error:u.stderr};let c;try{c=JSON.parse(u.stdout)}catch{return{error:"failed to parse milestone response"}}return{created:!0,number:c.number,id:c.id,title:c.title,url:c.html_url}}function mF(t,{repo:e=null}={}){let r=["issue","view",String(t),"--json","number,title,body,labels,milestone,state,url"];e&&r.push("--repo",e);let n=Xe(r,{allowFailure:!0});if(n.status!==0)return{error:n.stderr};try{return JSON.parse(n.stdout)}catch{return{error:"failed to parse issue response"}}}function gF({title:t,body:e,labels:r=[],milestone:n=null,assignees:s=[]},{execute:i=!1,dryRun:o=!0,repo:a=null}={}){if(o||!i)return console.log(` [dry-run] would create issue: "${t}" (labels: ${r.join(",")})`),{dryRun:!0,title:t};let u=["issue","create","--title",t,"--body",e||""];for(let f of r)u.push("--label",f);n&&u.push("--milestone",String(n));for(let f of s)u.push("--assignee",f);a&&u.push("--repo",a);let c=Xe(u,{allowFailure:!0});if(c.status!==0)return{error:c.stderr};let l=c.stdout.trim(),d=l.match(/\/issues\/(\d+)/);return{created:!0,url:l,number:d?parseInt(d[1],10):null}}function DF(t,{title:e,body:r,addLabels:n,removeLabels:s,milestone:i,state:o},{execute:a=!1,dryRun:u=!0,repo:c=null}={}){if(u||!a){let f=[];return e!==void 0&&f.push("title"),r!==void 0&&f.push("body"),n&&n.length&&f.push(`+labels:${n.join(",")}`),s&&s.length&&f.push(`-labels:${s.join(",")}`),i!==void 0&&f.push("milestone"),o!==void 0&&f.push(`state:${o}`),console.log(` [dry-run] would update issue #${t} (${f.join(", ")})`),{dryRun:!0,number:t}}let l=[],d=["issue","edit",String(t)];if(c&&d.push("--repo",c),e!==void 0&&d.push("--title",e),r!==void 0&&d.push("--body",r),i!==void 0&&(i===null?d.push("--remove-milestone"):d.push("--milestone",String(i))),n&&n.length)for(let f of n)d.push("--add-label",f);if(s&&s.length)for(let f of s)d.push("--remove-label",f);if(d.length>3+(c?2:0)){let f=Xe(d,{allowFailure:!0});f.status!==0&&l.push(`edit: ${f.stderr}`)}if(o==="closed"){let f=["issue","close",String(t)];c&&f.push("--repo",c);let g=Xe(f,{allowFailure:!0});g.status!==0&&l.push(`close: ${g.stderr}`)}else if(o==="open"){let f=["issue","reopen",String(t)];c&&f.push("--repo",c);let g=Xe(f,{allowFailure:!0});g.status!==0&&l.push(`reopen: ${g.stderr}`)}return l.length>0?{error:l.join("; ")}:{updated:!0,number:t}}function yF(t,{title:e,description:r,state:n,dueDate:s},{execute:i=!1,dryRun:o=!0,repo:a=null}={}){if(o||!i)return console.log(` [dry-run] would update milestone #${t}`),{dryRun:!0,number:t};let c=["api","--method","PATCH",`${a?`/repos/${a}`:"/repos/{owner}/{repo}"}/milestones/${t}`];e!==void 0&&c.push("-f",`title=${e}`),r!==void 0&&c.push("-f",`description=${r}`),n!==void 0&&c.push("-f",`state=${n}`),s!==void 0&&(s===null?c.push("-f","due_on="):c.push("-f",`due_on=${s}`));let l=Xe(c,{allowFailure:!0});return l.status!==0?{error:l.stderr}:{updated:!0,number:t}}function vF(t,{execute:e=!0}={}){let r=Xe(["project","list","--owner",t,"--format","json"],{allowFailure:!0});if(r.status!==0)return null;try{return JSON.parse(r.stdout)}catch{return null}}function _F(t,e,{execute:r=!1,dryRun:n=!0}={}){if(n||!r)return console.log(` [dry-run] would create Project v2: "${e}" (owner: ${t})`),{dryRun:!0,title:e};let s=Xe(["project","create","--owner",t,"--title",e,"--format","json"],{allowFailure:!0});if(s.status!==0)return{error:s.stderr};try{return JSON.parse(s.stdout)}catch{return{error:"failed to parse project response"}}}function EF(t,e,r,{execute:n=!1,dryRun:s=!0}={}){if(s||!n)return console.log(` [dry-run] would add ${r} to project ${t}`),{dryRun:!0};let i=Xe(["project","item-add","--owner",e,String(t),"--url",r,"--format","json"],{allowFailure:!0});if(i.status!==0)return{error:i.stderr};try{return JSON.parse(i.stdout)}catch{return{error:"failed to parse project item response"}}}function bF(){try{let t=Xe(["api","rate_limit"],{allowFailure:!0});return t.status!==0?null:JSON.parse(t.stdout)}catch{return null}}ry.exports={runGh:Xe,checkAuth:dF,detectRepo:fF,ensureLabel:hF,createMilestone:pF,updateMilestone:yF,getIssue:mF,createIssue:gF,updateIssue:DF,listProjects:vF,createProject:_F,addIssueToProject:EF,getRateLimit:bF}});var uy=v((cT,ay)=>{var Yt=require("fs"),ln=require("path");function sy(t){let e=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return{};let r={};for(let n of e[1].split(/\r?\n/)){let s=n.match(/^([\w_-]+)\s*:\s*(.*)$/);s&&(r[s[1].trim()]=s[2].trim().replace(/^["']|["']$/g,""))}return r}function kc(t){let e=t.match(/^#\s+(.+)$/m);return e?e[1].trim():null}function SF(t,e,r,n){let s=[],i=/<task\b([^>]*)>([\s\S]*?)<\/task>/g,o,a=0;for(;o=i.exec(t);){a+=1;let u=o[1].match(/id="([^"]+)"/),c=o[1].match(/title="([^"]*)"/),l=o[2].match(/<title>([\s\S]*?)<\/title>/);s.push({id:u?u[1]:`${e}-task-${a}`,file:r,content:o[0],title:c&&c[1].trim()||l&&l[1].trim()||`Task ${a}`,parentEpic:null,sprintId:e,frontmatter:{},sourcePath:`${n}/${r}`})}if(s.length===0){let u=/^#{2,4}\s+(?:Story|Task)\s+([^\s—–-]+)\s*[—–-]\s*(.+?)\s*$/gm,c;for(;c=u.exec(t);)s.push({id:c[1].trim(),file:r,content:c[0],title:c[2].trim(),parentEpic:null,sprintId:e,frontmatter:{},sourcePath:`${n}/${r}`})}return s}function oy(t){let e=ln.join(t,".planning","phases");if(!Yt.existsSync(e))return[];let r=[];for(let n of Yt.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let s=n.name.match(/^(\d+)-/),i=s?s[1]:null,o=ln.join(e,n.name),a=`.planning/phases/${n.name}`,u=Yt.readdirSync(o).filter(l=>/-SPRINT\.md$/i.test(l)).sort((l,d)=>{let f=parseInt((l.match(/-(\d+)-SPRINT\.md$/i)||[])[1]||"0",10),g=parseInt((d.match(/-(\d+)-SPRINT\.md$/i)||[])[1]||"0",10);return f-g}),c=[];for(let l of u){let d=Yt.readFileSync(ln.join(o,l),"utf8"),f=l.match(/^(\d+)-(\d+)-SPRINT\.md$/i),g;f?g=`${parseInt(f[1],10)}.${parseInt(f[2],10)}`:g=sy(d).sprint||l.replace(/-SPRINT\.md$/i,""),c.push(...SF(d,g,l,a))}r.push({id:n.name,numericId:i,brief:null,sprints:null,sprintMap:{},stories:c,epics:[],noMilestone:!1})}return r}function iy(t){let e=ln.join(t,".planning","epics");if(!Yt.existsSync(e))return null;let r=[],n=Yt.readdirSync(e).filter(o=>/^EPIC-\d+\.md$/i.test(o));for(let o of n){let a=Yt.readFileSync(ln.join(e,o),"utf8"),u=o.match(/(\d+)/),c=u?parseInt(u[1],10):null,l=o.replace(/\.md$/i,"");r.push({id:l,file:o,epicNumber:c,content:a,title:kc(a)||l,frontmatter:{},sourcePath:`.planning/epics/${o}`})}let s=[],i=ln.join(e,"stories");if(Yt.existsSync(i)){let o=Yt.readdirSync(i).filter(a=>/^[\d.]+\.md$/.test(a));for(let a of o){let u=Yt.readFileSync(ln.join(i,a),"utf8"),c=a.replace(/\.md$/i,""),l=u.match(/\*\*Epic:\*\*\s*EPIC-(\d+)/i),d=null;if(l){let f=parseInt(l[1],10),g=r.find(m=>m.epicNumber===f);g&&(d=g.id)}s.push({id:c,file:a,content:u,title:kc(u)||c,parentEpic:d,sprintId:null,frontmatter:{},sourcePath:`.planning/epics/stories/${a}`})}}return r.length===0&&s.length===0?null:{id:"epics",numericId:null,brief:null,sprints:null,sprintMap:{},stories:s,epics:r,noMilestone:!0}}function CF(t){let e=oy(t),r=iy(t);return r&&e.push(r),e}function wF(t,e){if(!e.sprint&&!e.epic&&!e.story)return t;let r=t.map(n=>({...n,epics:[...n.epics],stories:[...n.stories]}));if(e.sprint){let n=e.sprint.replace(/-/g,".");for(let s of r){s.stories=s.stories.filter(o=>o.sprintId===e.sprint||o.sprintId===n);let i=new Set(s.stories.map(o=>o.parentEpic).filter(Boolean));s.epics=s.epics.filter(o=>i.has(o.id))}}if(e.epic)for(let n of r)n.epics=n.epics.filter(s=>s.id===e.epic),n.stories=n.stories.filter(s=>s.parentEpic===e.epic);if(e.story)for(let n of r){n.stories=n.stories.filter(i=>i.id===e.story);let s=new Set(n.stories.map(i=>i.parentEpic).filter(Boolean));n.epics=n.epics.filter(i=>s.has(i.id))}return r.filter(n=>n.epics.length>0||n.stories.length>0)}ay.exports={extractFrontmatter:sy,extractTitle:kc,discoverSprintTrackPhases:oy,discoverEpicTrackPhase:iy,discoverPhases:CF,applyGranularFilters:wF}});var ly=v((lT,cy)=>{var Qo=require("fs"),Ac=require("path"),xF=require("crypto"),Rt=ny(),{askText:$F,PromptAbortError:kF}=as(),{writeJsonAtomic:AF}=Jt(),{loadConfig:FF}=gs(),{discoverPhases:jF,applyGranularFilters:IF}=uy();function Rn(t){return xF.createHash("sha256").update(t||"").digest("hex").slice(0,12)}function TF(t){let e={execute:!1,dryRun:!0,repo:null,only:null,phase:null,sprint:null,epic:null,story:null,withLabels:!1,createProject:!1,yes:!1,forceYolo:!1,updateBody:!0,updateLabels:!0,updateMilestone:!0,updateState:!0};for(let r of t)r==="--execute"||r==="-e"?(e.execute=!0,e.dryRun=!1):r==="--dry-run"?(e.dryRun=!0,e.execute=!1):r==="--yes"||r==="-y"?e.yes=!0:r==="--force-yolo"?e.forceYolo=!0:r==="--with-labels"?e.withLabels=!0:r==="--project"?e.createProject=!0:r==="--no-update"?(e.updateBody=!1,e.updateLabels=!1,e.updateMilestone=!1,e.updateState=!1):r==="--no-update-body"?e.updateBody=!1:r==="--no-update-labels"?e.updateLabels=!1:r==="--no-close"?e.updateState=!1:r.startsWith("--repo=")?e.repo=r.slice(7):r.startsWith("--only=")?e.only=r.slice(7):r.startsWith("--phase=")?e.phase=r.slice(8):r.startsWith("--sprint=")?e.sprint=r.slice(9):r.startsWith("--epic=")?e.epic=r.slice(7):r.startsWith("--story=")&&(e.story=r.slice(8));return e.updateEnabled=e.updateBody||e.updateLabels||e.updateMilestone||e.updateState,e}function RF(t){let e=Ac.join(t,".rcode/state.json");if(!Qo.existsSync(e))return null;try{return JSON.parse(Qo.readFileSync(e,"utf8"))}catch{return null}}function PF(t){let e=Ac.join(t,".rcode/integrations/github-map.json");if(!Qo.existsSync(e))return{phases:{},epics:{},stories:{},project:null,labels:[]};try{return JSON.parse(Qo.readFileSync(e,"utf8"))}catch{return{phases:{},epics:{},stories:{},project:null,labels:[]}}}function Ds(t,e){let r=Ac.join(t,".rcode/integrations/github-map.json");AF(r,e)}function Re(t,e){return`${t}:${e}`}async function OF(t){let e=TF(t),r=process.cwd(),s=FF(r).communication_mode||"guided";console.log(`
379
- \u{1F54C} rcode \u2014 GitHub Sync`),console.log(` Mode: ${e.dryRun?"DRY-RUN (preview only, nothing is sent)":"EXECUTE"}`),console.log(` Comms mode: ${s}`),console.log(` Scope: ${e.only||"full (create + update existing)"}`),console.log(` Labels: ${e.withLabels?"will create/ensure taxonomy":"skipped (pass --with-labels to enable)"}`),e.updateEnabled||console.log(" Note: --no-update passed \u2192 create-only mode"),e.phase&&console.log(` Phase filter: ${e.phase}`),e.sprint&&console.log(` Sprint filter: ${e.sprint}`),e.epic&&console.log(` Epic filter: ${e.epic}`),e.story&&console.log(` Story filter: ${e.story}`),console.log();let i=Rt.checkAuth();i.authenticated||(console.error("\u274C gh CLI not authenticated."),console.error(" Run: gh auth login"),console.error(` Error: ${i.error||"unknown"}`),process.exit(1)),console.log(` \u2713 Authenticated as ${i.account}`);let o=e.repo;if(!o){let h=Rt.detectRepo(r);h||(console.error("\u274C Could not detect GitHub repo. Run from a git repo or pass --repo=owner/name"),process.exit(1)),o=h.nameWithOwner}console.log(` \u2713 Target repo: ${o}`);let a=RF(r);a||(console.error("\u274C No .rcode/state.json found. Run 'rcode install' first."),process.exit(1)),console.log(` \u2713 Project: ${a.project_name||"(unnamed)"}`);let u=jF(r);if(e.phase&&(u=u.filter(h=>h.id===e.phase||h.numericId===e.phase),u.length===0&&(console.error(`\u274C Phase '${e.phase}' not found.`),process.exit(1))),u=IF(u,e),u.length===0){if(e.sprint||e.epic||e.story){let h=e.sprint?`sprint '${e.sprint}'`:e.epic?`epic '${e.epic}'`:`story '${e.story}'`;console.error(`\u274C No items matched ${h}.`),console.error(" Check the filter value or run without filters to see available ids."),process.exit(1)}console.log("\u2139 No phases found in .planning/phases/ or epics in .planning/epics/ \u2014 nothing to sync."),console.log(" Run /rcode-plan or /rcode-create-epics-and-stories to get started."),process.exit(0)}console.log(` \u2713 Phases found: ${u.length}`);for(let h of u)console.log(` - ${h.id} (${h.epics.length} epics, ${h.stories.length} stories)`);let c=PF(r),l={phases:Object.keys(c.phases).length,epics:Object.keys(c.epics).length,stories:Object.keys(c.stories).length};l.phases+l.epics+l.stories>0&&console.log(` \u2139 Existing sync map: ${l.phases} phases, ${l.epics} epics, ${l.stories} stories`);let d={labels:e.withLabels?[{name:"epic",color:"6f42c1",description:"Strategic initiative spanning multiple sprints"},{name:"type:feature",color:"0e8a16",description:"New functionality"},{name:"type:task",color:"c5def5",description:"Development work"},{name:"type:bug",color:"d73a4a",description:"Something is broken"},{name:"type:docs",color:"0075ca",description:"Documentation"},{name:"priority:critical",color:"b60205",description:"Drop everything"},{name:"priority:high",color:"d93f0b",description:"Important for sprint"},{name:"priority:medium",color:"fbca04",description:"Standard priority"},{name:"priority:low",color:"0e8a16",description:"Nice to have"},{name:"status:backlog",color:"c5def5",description:"Not started"},{name:"status:todo",color:"0075ca",description:"Ready to start"},{name:"status:in-progress",color:"fbca04",description:"Currently working"},{name:"status:blocked",color:"d73a4a",description:"Cannot progress"},{name:"status:review",color:"6f42c1",description:"Code review needed"},{name:"status:done",color:"0e8a16",description:"Completed"},{name:"FE",color:"1e3a8a",description:"Frontend"},{name:"BE",color:"0e8a16",description:"Backend"},{name:"ML",color:"6f42c1",description:"Machine Learning"},{name:"API",color:"0075ca",description:"API / Backend services"},{name:"Design",color:"f59e0b",description:"UI/UX design work"},{name:"DevOps",color:"fbca04",description:"Infrastructure and deployment"},{name:"QA",color:"d73a4a",description:"Quality assurance"},{name:"Docs",color:"c5def5",description:"Documentation"}]:[],milestones:u.filter(h=>!h.noMilestone&&!c.phases[h.id]),epics:u.flatMap(h=>h.epics.filter(w=>!c.epics[Re(h.id,w.id)]).map(w=>({...w,phase:h.id}))),stories:u.flatMap(h=>h.stories.filter(w=>!c.stories[Re(h.id,w.id)]).map(w=>({...w,phase:h.id}))),updateEpics:e.updateEnabled?u.flatMap(h=>h.epics.filter(w=>c.epics[Re(h.id,w.id)]).map(w=>({...w,phase:h.id,issueNumber:c.epics[Re(h.id,w.id)].issue_number,lastSyncedAt:c.epics[Re(h.id,w.id)].synced_at,lastSyncedContentHash:c.epics[Re(h.id,w.id)].content_hash}))):[],updateStories:e.updateEnabled?u.flatMap(h=>h.stories.filter(w=>c.stories[Re(h.id,w.id)]).map(w=>({...w,phase:h.id,issueNumber:c.stories[Re(h.id,w.id)].issue_number,lastSyncedAt:c.stories[Re(h.id,w.id)].synced_at,lastSyncedContentHash:c.stories[Re(h.id,w.id)].content_hash}))):[]};console.log(`
380
- \u{1F4CB} Plan:`),e.withLabels&&(!e.only||e.only==="labels")&&console.log(` Labels to ensure: ${d.labels.length}`),(!e.only||e.only==="milestones")&&console.log(` Milestones to create: ${d.milestones.length}`),(!e.only||e.only==="epics")&&console.log(` Epics to create: ${d.epics.length}`),(!e.only||e.only==="stories")&&console.log(` Stories to create: ${d.stories.length}`),e.updateEnabled&&((!e.only||e.only==="epics")&&console.log(` Epics to check: ${d.updateEpics.length} (existing, will update if changed)`),(!e.only||e.only==="stories")&&console.log(` Stories to check: ${d.updateStories.length} (existing, will update if changed)`)),e.createProject&&console.log(` Project v2: will create "${a.project_name||o}"`),console.log();let f=s==="yolo"&&e.yes&&!e.forceYolo;if(e.execute&&(!e.yes||f)){f&&(console.log("\u26A0\uFE0F communication_mode=yolo does not auto-confirm GitHub mutations."),console.log(" Pass --force-yolo to skip this prompt, or answer interactively below."),console.log()),console.log(`\u26A0\uFE0F This will modify ${o} on GitHub.`);let h=d.labels.length+d.milestones.length+d.epics.length+d.stories.length;console.log(` Items to create: ${h}`),(e.sprint||e.epic||e.story)&&console.log(` Granular filter: ${e.sprint||e.epic||e.story}`),console.log();let w=await $F(" Proceed? Type 'yes' to continue: ",{default:"no",validate:C=>{let A=C.toLowerCase();return["yes","y","no","n"].includes(A)?!0:"Please type 'yes' to confirm, or 'no' to abort."}});["yes","y"].includes(w.toLowerCase())||(console.log(`
381
- \u274C Aborted by user. No changes made.`),process.exit(0)),console.log()}let m={labels:[],milestones:[],epics:[],stories:[],errors:[]},D={execute:e.execute,dryRun:e.dryRun,repo:o};if(e.withLabels&&(!e.only||e.only==="labels")){console.log(`
382
- \u{1F3F7}\uFE0F Labels`);for(let h of d.labels){let w=Rt.ensureLabel(h.name,h.color,h.description,D);m.labels.push(w),w.error?m.errors.push(`label ${h.name}: ${w.error}`):w.dryRun||(c.labels.includes(h.name)||c.labels.push(h.name),e.execute&&Ds(r,c),console.log(` \u2713 ${w.existed?"exists":"created"}: ${h.name}`))}}if(!e.only||e.only==="milestones"){console.log(`
400
+ `);let o=fF(s);if(!r.profile&&Object.keys(n.overrides).length>0){console.log(" Overrides applied:");for(let[a,c]of Object.entries(n.overrides)){let u=ty(a,{profile:s,overrides:n.overrides});o[a]=u,console.log(` ${a} \u2192 ${c} (resolved: ${u??"inherit"})`)}console.log()}console.log(hF(o))}});var iy=v((pT,oy)=>{var{execSync:hT,spawnSync:sy}=require("child_process");function gF(t){return t?t.replace(/\b(ghp_|ghs_|github_pat_)[A-Za-z0-9_]{10,}\b/g,"[REDACTED]").slice(0,2e3):""}function et(t,{input:e=null,allowFailure:r=!1}={}){let n=sy("gh",t,{encoding:"utf8",input:e,stdio:e?["pipe","pipe","pipe"]:["ignore","pipe","pipe"]});if(n.status!==0&&!r){let s=gF(n.stderr||n.stdout||"(no output)");throw new Error(`gh ${t.join(" ")} failed:
401
+ ${s}`)}return{status:n.status,stdout:n.stdout||"",stderr:n.stderr||""}}function DF(){try{let t=et(["auth","status"],{allowFailure:!0});if(t.status!==0)return{authenticated:!1,error:t.stderr};let e=(t.stderr+t.stdout).match(/Logged in to github\.com account (\S+)/);return{authenticated:!0,account:e?e[1]:"unknown"}}catch(t){return{authenticated:!1,error:t.message}}}function yF(t=process.cwd()){try{let e=sy("gh",["repo","view","--json","owner,name,nameWithOwner,url"],{cwd:t,encoding:"utf8"});return e.status!==0?null:JSON.parse(e.stdout)}catch{return null}}function vF(t,e,r,{execute:n=!1,dryRun:s=!0}={}){if(s||!n)return console.log(` [dry-run] would ensure label: ${t} (${e})`),{dryRun:!0};let i=et(["label","list","--search",t,"--json","name"],{allowFailure:!0});if(i.status===0){let c;try{c=JSON.parse(i.stdout||"[]")}catch{c=[]}if(c.some(u=>u.name===t))return{existed:!0,name:t}}let o=["label","create",t,"--color",e];r&&o.push("--description",r);let a=et(o,{allowFailure:!0});return{created:a.status===0,name:t,error:a.status!==0?a.stderr:null}}function _F(t,e,r,{execute:n=!1,dryRun:s=!0,repo:i=null}={}){if(s||!n)return console.log(` [dry-run] would create milestone: "${t}"`),{dryRun:!0,title:t};let a=["api","--method","POST",`${i?`/repos/${i}`:"/repos/{owner}/{repo}"}/milestones`,"-f",`title=${t}`,"-f",`description=${e||""}`,"-f","state=open"];r&&a.push("-f",`due_on=${r}`);let c=et(a,{allowFailure:!0});if(c.status!==0)return{error:c.stderr};let u;try{u=JSON.parse(c.stdout)}catch{return{error:"failed to parse milestone response"}}return{created:!0,number:u.number,id:u.id,title:u.title,url:u.html_url}}function bF(t,{repo:e=null}={}){let r=["issue","view",String(t),"--json","number,title,body,labels,milestone,state,url"];e&&r.push("--repo",e);let n=et(r,{allowFailure:!0});if(n.status!==0)return{error:n.stderr};try{return JSON.parse(n.stdout)}catch{return{error:"failed to parse issue response"}}}function SF({title:t,body:e,labels:r=[],milestone:n=null,assignees:s=[]},{execute:i=!1,dryRun:o=!0,repo:a=null}={}){if(o||!i)return console.log(` [dry-run] would create issue: "${t}" (labels: ${r.join(",")})`),{dryRun:!0,title:t};let c=["issue","create","--title",t,"--body",e||""];for(let f of r)c.push("--label",f);n&&c.push("--milestone",String(n));for(let f of s)c.push("--assignee",f);a&&c.push("--repo",a);let u=et(c,{allowFailure:!0});if(u.status!==0)return{error:u.stderr};let l=u.stdout.trim(),d=l.match(/\/issues\/(\d+)/);return{created:!0,url:l,number:d?parseInt(d[1],10):null}}function EF(t,{title:e,body:r,addLabels:n,removeLabels:s,milestone:i,state:o},{execute:a=!1,dryRun:c=!0,repo:u=null}={}){if(c||!a){let f=[];return e!==void 0&&f.push("title"),r!==void 0&&f.push("body"),n&&n.length&&f.push(`+labels:${n.join(",")}`),s&&s.length&&f.push(`-labels:${s.join(",")}`),i!==void 0&&f.push("milestone"),o!==void 0&&f.push(`state:${o}`),console.log(` [dry-run] would update issue #${t} (${f.join(", ")})`),{dryRun:!0,number:t}}let l=[],d=["issue","edit",String(t)];if(u&&d.push("--repo",u),e!==void 0&&d.push("--title",e),r!==void 0&&d.push("--body",r),i!==void 0&&(i===null?d.push("--remove-milestone"):d.push("--milestone",String(i))),n&&n.length)for(let f of n)d.push("--add-label",f);if(s&&s.length)for(let f of s)d.push("--remove-label",f);if(d.length>3+(u?2:0)){let f=et(d,{allowFailure:!0});f.status!==0&&l.push(`edit: ${f.stderr}`)}if(o==="closed"){let f=["issue","close",String(t)];u&&f.push("--repo",u);let g=et(f,{allowFailure:!0});g.status!==0&&l.push(`close: ${g.stderr}`)}else if(o==="open"){let f=["issue","reopen",String(t)];u&&f.push("--repo",u);let g=et(f,{allowFailure:!0});g.status!==0&&l.push(`reopen: ${g.stderr}`)}return l.length>0?{error:l.join("; ")}:{updated:!0,number:t}}function CF(t,{title:e,description:r,state:n,dueDate:s},{execute:i=!1,dryRun:o=!0,repo:a=null}={}){if(o||!i)return console.log(` [dry-run] would update milestone #${t}`),{dryRun:!0,number:t};let u=["api","--method","PATCH",`${a?`/repos/${a}`:"/repos/{owner}/{repo}"}/milestones/${t}`];e!==void 0&&u.push("-f",`title=${e}`),r!==void 0&&u.push("-f",`description=${r}`),n!==void 0&&u.push("-f",`state=${n}`),s!==void 0&&(s===null?u.push("-f","due_on="):u.push("-f",`due_on=${s}`));let l=et(u,{allowFailure:!0});return l.status!==0?{error:l.stderr}:{updated:!0,number:t}}function wF(t,{execute:e=!0}={}){let r=et(["project","list","--owner",t,"--format","json"],{allowFailure:!0});if(r.status!==0)return null;try{return JSON.parse(r.stdout)}catch{return null}}function xF(t,e,{execute:r=!1,dryRun:n=!0}={}){if(n||!r)return console.log(` [dry-run] would create Project v2: "${e}" (owner: ${t})`),{dryRun:!0,title:e};let s=et(["project","create","--owner",t,"--title",e,"--format","json"],{allowFailure:!0});if(s.status!==0)return{error:s.stderr};try{return JSON.parse(s.stdout)}catch{return{error:"failed to parse project response"}}}function kF(t,e,r,{execute:n=!1,dryRun:s=!0}={}){if(s||!n)return console.log(` [dry-run] would add ${r} to project ${t}`),{dryRun:!0};let i=et(["project","item-add","--owner",e,String(t),"--url",r,"--format","json"],{allowFailure:!0});if(i.status!==0)return{error:i.stderr};try{return JSON.parse(i.stdout)}catch{return{error:"failed to parse project item response"}}}function $F(){try{let t=et(["api","rate_limit"],{allowFailure:!0});return t.status!==0?null:JSON.parse(t.stdout)}catch{return null}}oy.exports={runGh:et,checkAuth:DF,detectRepo:yF,ensureLabel:vF,createMilestone:_F,updateMilestone:CF,getIssue:bF,createIssue:SF,updateIssue:EF,listProjects:wF,createProject:xF,addIssueToProject:kF,getRateLimit:$F}});var dy=v((mT,ly)=>{var Xt=require("fs"),fn=require("path");function ay(t){let e=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return{};let r={};for(let n of e[1].split(/\r?\n/)){let s=n.match(/^([\w_-]+)\s*:\s*(.*)$/);s&&(r[s[1].trim()]=s[2].trim().replace(/^["']|["']$/g,""))}return r}function Fu(t){let e=t.match(/^#\s+(.+)$/m);return e?e[1].trim():null}function AF(t,e,r,n){let s=[],i=/<task\b([^>]*)>([\s\S]*?)<\/task>/g,o,a=0;for(;o=i.exec(t);){a+=1;let c=o[1].match(/id="([^"]+)"/),u=o[1].match(/title="([^"]*)"/),l=o[2].match(/<title>([\s\S]*?)<\/title>/);s.push({id:c?c[1]:`${e}-task-${a}`,file:r,content:o[0],title:u&&u[1].trim()||l&&l[1].trim()||`Task ${a}`,parentEpic:null,sprintId:e,frontmatter:{},sourcePath:`${n}/${r}`})}if(s.length===0){let c=/^#{2,4}\s+(?:Story|Task)\s+([^\s—–-]+)\s*[—–-]\s*(.+?)\s*$/gm,u;for(;u=c.exec(t);)s.push({id:u[1].trim(),file:r,content:u[0],title:u[2].trim(),parentEpic:null,sprintId:e,frontmatter:{},sourcePath:`${n}/${r}`})}return s}function cy(t){let e=fn.join(t,".planning","phases");if(!Xt.existsSync(e))return[];let r=[];for(let n of Xt.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let s=n.name.match(/^(\d+)-/),i=s?s[1]:null,o=fn.join(e,n.name),a=`.planning/phases/${n.name}`,c=Xt.readdirSync(o).filter(l=>/-SPRINT\.md$/i.test(l)).sort((l,d)=>{let f=parseInt((l.match(/-(\d+)-SPRINT\.md$/i)||[])[1]||"0",10),g=parseInt((d.match(/-(\d+)-SPRINT\.md$/i)||[])[1]||"0",10);return f-g}),u=[];for(let l of c){let d=Xt.readFileSync(fn.join(o,l),"utf8"),f=l.match(/^(\d+)-(\d+)-SPRINT\.md$/i),g;f?g=`${parseInt(f[1],10)}.${parseInt(f[2],10)}`:g=ay(d).sprint||l.replace(/-SPRINT\.md$/i,""),u.push(...AF(d,g,l,a))}r.push({id:n.name,numericId:i,brief:null,sprints:null,sprintMap:{},stories:u,epics:[],noMilestone:!1})}return r}function uy(t){let e=fn.join(t,".planning","epics");if(!Xt.existsSync(e))return null;let r=[],n=Xt.readdirSync(e).filter(o=>/^EPIC-\d+\.md$/i.test(o));for(let o of n){let a=Xt.readFileSync(fn.join(e,o),"utf8"),c=o.match(/(\d+)/),u=c?parseInt(c[1],10):null,l=o.replace(/\.md$/i,"");r.push({id:l,file:o,epicNumber:u,content:a,title:Fu(a)||l,frontmatter:{},sourcePath:`.planning/epics/${o}`})}let s=[],i=fn.join(e,"stories");if(Xt.existsSync(i)){let o=Xt.readdirSync(i).filter(a=>/^[\d.]+\.md$/.test(a));for(let a of o){let c=Xt.readFileSync(fn.join(i,a),"utf8"),u=a.replace(/\.md$/i,""),l=c.match(/\*\*Epic:\*\*\s*EPIC-(\d+)/i),d=null;if(l){let f=parseInt(l[1],10),g=r.find(m=>m.epicNumber===f);g&&(d=g.id)}s.push({id:u,file:a,content:c,title:Fu(c)||u,parentEpic:d,sprintId:null,frontmatter:{},sourcePath:`.planning/epics/stories/${a}`})}}return r.length===0&&s.length===0?null:{id:"epics",numericId:null,brief:null,sprints:null,sprintMap:{},stories:s,epics:r,noMilestone:!0}}function FF(t){let e=cy(t),r=uy(t);return r&&e.push(r),e}function jF(t,e){if(!e.sprint&&!e.epic&&!e.story)return t;let r=t.map(n=>({...n,epics:[...n.epics],stories:[...n.stories]}));if(e.sprint){let n=e.sprint.replace(/-/g,".");for(let s of r){s.stories=s.stories.filter(o=>o.sprintId===e.sprint||o.sprintId===n);let i=new Set(s.stories.map(o=>o.parentEpic).filter(Boolean));s.epics=s.epics.filter(o=>i.has(o.id))}}if(e.epic)for(let n of r)n.epics=n.epics.filter(s=>s.id===e.epic),n.stories=n.stories.filter(s=>s.parentEpic===e.epic);if(e.story)for(let n of r){n.stories=n.stories.filter(i=>i.id===e.story);let s=new Set(n.stories.map(i=>i.parentEpic).filter(Boolean));n.epics=n.epics.filter(i=>s.has(i.id))}return r.filter(n=>n.epics.length>0||n.stories.length>0)}ly.exports={extractFrontmatter:ay,extractTitle:Fu,discoverSprintTrackPhases:cy,discoverEpicTrackPhase:uy,discoverPhases:FF,applyGranularFilters:jF}});var hy=v((gT,fy)=>{var ti=require("fs"),ju=require("path"),IF=require("crypto"),Ot=iy(),{askText:TF,PromptAbortError:RF}=us(),{writeJsonAtomic:PF}=Qt(),{loadConfig:OF}=ys(),{discoverPhases:NF,applyGranularFilters:LF}=dy();function On(t){return IF.createHash("sha256").update(t||"").digest("hex").slice(0,12)}function BF(t){let e={execute:!1,dryRun:!0,repo:null,only:null,phase:null,sprint:null,epic:null,story:null,withLabels:!1,createProject:!1,yes:!1,forceYolo:!1,updateBody:!0,updateLabels:!0,updateMilestone:!0,updateState:!0};for(let r of t)r==="--execute"||r==="-e"?(e.execute=!0,e.dryRun=!1):r==="--dry-run"?(e.dryRun=!0,e.execute=!1):r==="--yes"||r==="-y"?e.yes=!0:r==="--force-yolo"?e.forceYolo=!0:r==="--with-labels"?e.withLabels=!0:r==="--project"?e.createProject=!0:r==="--no-update"?(e.updateBody=!1,e.updateLabels=!1,e.updateMilestone=!1,e.updateState=!1):r==="--no-update-body"?e.updateBody=!1:r==="--no-update-labels"?e.updateLabels=!1:r==="--no-close"?e.updateState=!1:r.startsWith("--repo=")?e.repo=r.slice(7):r.startsWith("--only=")?e.only=r.slice(7):r.startsWith("--phase=")?e.phase=r.slice(8):r.startsWith("--sprint=")?e.sprint=r.slice(9):r.startsWith("--epic=")?e.epic=r.slice(7):r.startsWith("--story=")&&(e.story=r.slice(8));return e.updateEnabled=e.updateBody||e.updateLabels||e.updateMilestone||e.updateState,e}function MF(t){let e=ju.join(t,".rcode/state.json");if(!ti.existsSync(e))return null;try{return JSON.parse(ti.readFileSync(e,"utf8"))}catch{return null}}function qF(t){let e=ju.join(t,".rcode/integrations/github-map.json");if(!ti.existsSync(e))return{phases:{},epics:{},stories:{},project:null,labels:[]};try{return JSON.parse(ti.readFileSync(e,"utf8"))}catch{return{phases:{},epics:{},stories:{},project:null,labels:[]}}}function vs(t,e){let r=ju.join(t,".rcode/integrations/github-map.json");PF(r,e)}function Ne(t,e){return`${t}:${e}`}async function WF(t){let e=BF(t),r=process.cwd(),s=OF(r).communication_mode||"guided";console.log(`
402
+ \u{1F54C} rcode \u2014 GitHub Sync`),console.log(` Mode: ${e.dryRun?"DRY-RUN (preview only, nothing is sent)":"EXECUTE"}`),console.log(` Comms mode: ${s}`),console.log(` Scope: ${e.only||"full (create + update existing)"}`),console.log(` Labels: ${e.withLabels?"will create/ensure taxonomy":"skipped (pass --with-labels to enable)"}`),e.updateEnabled||console.log(" Note: --no-update passed \u2192 create-only mode"),e.phase&&console.log(` Phase filter: ${e.phase}`),e.sprint&&console.log(` Sprint filter: ${e.sprint}`),e.epic&&console.log(` Epic filter: ${e.epic}`),e.story&&console.log(` Story filter: ${e.story}`),console.log();let i=Ot.checkAuth();i.authenticated||(console.error("\u274C gh CLI not authenticated."),console.error(" Run: gh auth login"),console.error(` Error: ${i.error||"unknown"}`),process.exit(1)),console.log(` \u2713 Authenticated as ${i.account}`);let o=e.repo;if(!o){let h=Ot.detectRepo(r);h||(console.error("\u274C Could not detect GitHub repo. Run from a git repo or pass --repo=owner/name"),process.exit(1)),o=h.nameWithOwner}console.log(` \u2713 Target repo: ${o}`);let a=MF(r);a||(console.error("\u274C No .rcode/state.json found. Run 'rcode install' first."),process.exit(1)),console.log(` \u2713 Project: ${a.project_name||"(unnamed)"}`);let c=NF(r);if(e.phase&&(c=c.filter(h=>h.id===e.phase||h.numericId===e.phase),c.length===0&&(console.error(`\u274C Phase '${e.phase}' not found.`),process.exit(1))),c=LF(c,e),c.length===0){if(e.sprint||e.epic||e.story){let h=e.sprint?`sprint '${e.sprint}'`:e.epic?`epic '${e.epic}'`:`story '${e.story}'`;console.error(`\u274C No items matched ${h}.`),console.error(" Check the filter value or run without filters to see available ids."),process.exit(1)}console.log("\u2139 No phases found in .planning/phases/ or epics in .planning/epics/ \u2014 nothing to sync."),console.log(" Run /rcode-plan or /rcode-create-epics-and-stories to get started."),process.exit(0)}console.log(` \u2713 Phases found: ${c.length}`);for(let h of c)console.log(` - ${h.id} (${h.epics.length} epics, ${h.stories.length} stories)`);let u=qF(r),l={phases:Object.keys(u.phases).length,epics:Object.keys(u.epics).length,stories:Object.keys(u.stories).length};l.phases+l.epics+l.stories>0&&console.log(` \u2139 Existing sync map: ${l.phases} phases, ${l.epics} epics, ${l.stories} stories`);let d={labels:e.withLabels?[{name:"epic",color:"6f42c1",description:"Strategic initiative spanning multiple sprints"},{name:"type:feature",color:"0e8a16",description:"New functionality"},{name:"type:task",color:"c5def5",description:"Development work"},{name:"type:bug",color:"d73a4a",description:"Something is broken"},{name:"type:docs",color:"0075ca",description:"Documentation"},{name:"priority:critical",color:"b60205",description:"Drop everything"},{name:"priority:high",color:"d93f0b",description:"Important for sprint"},{name:"priority:medium",color:"fbca04",description:"Standard priority"},{name:"priority:low",color:"0e8a16",description:"Nice to have"},{name:"status:backlog",color:"c5def5",description:"Not started"},{name:"status:todo",color:"0075ca",description:"Ready to start"},{name:"status:in-progress",color:"fbca04",description:"Currently working"},{name:"status:blocked",color:"d73a4a",description:"Cannot progress"},{name:"status:review",color:"6f42c1",description:"Code review needed"},{name:"status:done",color:"0e8a16",description:"Completed"},{name:"FE",color:"1e3a8a",description:"Frontend"},{name:"BE",color:"0e8a16",description:"Backend"},{name:"ML",color:"6f42c1",description:"Machine Learning"},{name:"API",color:"0075ca",description:"API / Backend services"},{name:"Design",color:"f59e0b",description:"UI/UX design work"},{name:"DevOps",color:"fbca04",description:"Infrastructure and deployment"},{name:"QA",color:"d73a4a",description:"Quality assurance"},{name:"Docs",color:"c5def5",description:"Documentation"}]:[],milestones:c.filter(h=>!h.noMilestone&&!u.phases[h.id]),epics:c.flatMap(h=>h.epics.filter(w=>!u.epics[Ne(h.id,w.id)]).map(w=>({...w,phase:h.id}))),stories:c.flatMap(h=>h.stories.filter(w=>!u.stories[Ne(h.id,w.id)]).map(w=>({...w,phase:h.id}))),updateEpics:e.updateEnabled?c.flatMap(h=>h.epics.filter(w=>u.epics[Ne(h.id,w.id)]).map(w=>({...w,phase:h.id,issueNumber:u.epics[Ne(h.id,w.id)].issue_number,lastSyncedAt:u.epics[Ne(h.id,w.id)].synced_at,lastSyncedContentHash:u.epics[Ne(h.id,w.id)].content_hash}))):[],updateStories:e.updateEnabled?c.flatMap(h=>h.stories.filter(w=>u.stories[Ne(h.id,w.id)]).map(w=>({...w,phase:h.id,issueNumber:u.stories[Ne(h.id,w.id)].issue_number,lastSyncedAt:u.stories[Ne(h.id,w.id)].synced_at,lastSyncedContentHash:u.stories[Ne(h.id,w.id)].content_hash}))):[]};console.log(`
403
+ \u{1F4CB} Plan:`),e.withLabels&&(!e.only||e.only==="labels")&&console.log(` Labels to ensure: ${d.labels.length}`),(!e.only||e.only==="milestones")&&console.log(` Milestones to create: ${d.milestones.length}`),(!e.only||e.only==="epics")&&console.log(` Epics to create: ${d.epics.length}`),(!e.only||e.only==="stories")&&console.log(` Stories to create: ${d.stories.length}`),e.updateEnabled&&((!e.only||e.only==="epics")&&console.log(` Epics to check: ${d.updateEpics.length} (existing, will update if changed)`),(!e.only||e.only==="stories")&&console.log(` Stories to check: ${d.updateStories.length} (existing, will update if changed)`)),e.createProject&&console.log(` Project v2: will create "${a.project_name||o}"`),console.log();let f=s==="yolo"&&e.yes&&!e.forceYolo;if(e.execute&&(!e.yes||f)){f&&(console.log("\u26A0\uFE0F communication_mode=yolo does not auto-confirm GitHub mutations."),console.log(" Pass --force-yolo to skip this prompt, or answer interactively below."),console.log()),console.log(`\u26A0\uFE0F This will modify ${o} on GitHub.`);let h=d.labels.length+d.milestones.length+d.epics.length+d.stories.length;console.log(` Items to create: ${h}`),(e.sprint||e.epic||e.story)&&console.log(` Granular filter: ${e.sprint||e.epic||e.story}`),console.log();let w=await TF(" Proceed? Type 'yes' to continue: ",{default:"no",validate:C=>{let A=C.toLowerCase();return["yes","y","no","n"].includes(A)?!0:"Please type 'yes' to confirm, or 'no' to abort."}});["yes","y"].includes(w.toLowerCase())||(console.log(`
404
+ \u274C Aborted by user. No changes made.`),process.exit(0)),console.log()}let m={labels:[],milestones:[],epics:[],stories:[],errors:[]},y={execute:e.execute,dryRun:e.dryRun,repo:o};if(e.withLabels&&(!e.only||e.only==="labels")){console.log(`
405
+ \u{1F3F7}\uFE0F Labels`);for(let h of d.labels){let w=Ot.ensureLabel(h.name,h.color,h.description,y);m.labels.push(w),w.error?m.errors.push(`label ${h.name}: ${w.error}`):w.dryRun||(u.labels.includes(h.name)||u.labels.push(h.name),e.execute&&vs(r,u),console.log(` \u2713 ${w.existed?"exists":"created"}: ${h.name}`))}}if(!e.only||e.only==="milestones"){console.log(`
383
406
  \u{1F3AF} Milestones (phases)`);for(let h of d.milestones){let w=h.brief?h.brief.split(`
384
407
  `).slice(0,5).join(`
385
- `):"rcode phase",C=Rt.createMilestone(h.id,w,null,D);m.milestones.push({phase:h.id,...C}),C.error?m.errors.push(`milestone ${h.id}: ${C.error}`):C.dryRun||(c.phases[h.id]={milestone_number:C.number,milestone_id:C.id,url:C.url,synced_at:new Date().toISOString()},e.execute&&Ds(r,c),console.log(` \u2713 created: ${h.id} \u2192 milestone #${C.number}`))}}if(!e.only||e.only==="epics"){console.log(`
408
+ `):"rcode phase",C=Ot.createMilestone(h.id,w,null,y);m.milestones.push({phase:h.id,...C}),C.error?m.errors.push(`milestone ${h.id}: ${C.error}`):C.dryRun||(u.phases[h.id]={milestone_number:C.number,milestone_id:C.id,url:C.url,synced_at:new Date().toISOString()},e.execute&&vs(r,u),console.log(` \u2713 created: ${h.id} \u2192 milestone #${C.number}`))}}if(!e.only||e.only==="epics"){console.log(`
386
409
  \u{1F4E6} Epics`);for(let h of d.epics){let w=["## \u{1F3AF} Epic Vision","","_Strategic goal this Epic contributes to._","","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${h.phase}\``,`- **Source:** \`${h.sourcePath}\``,"- **Synced by:** rcode github-sync","","## \u{1F4DD} Child Stories","","_Child story issues will be appended here after they are created._"].join(`
387
- `),C=c.phases[h.phase]&&c.phases[h.phase].milestone_number,A=Rt.createIssue({title:`[Epic] ${h.title}`,body:w,labels:e.withLabels?["epic","priority:medium","status:backlog"]:[],milestone:C},D);m.epics.push({epic:h.id,...A}),A.error?m.errors.push(`epic ${h.id}: ${A.error}`):A.dryRun||(c.epics[Re(h.phase,h.id)]={issue_number:A.number,url:A.url,phase:h.phase,synced_at:new Date().toISOString(),content_hash:Rn(h.content),child_story_issues:[]},e.execute&&Ds(r,c),console.log(` \u2713 created: ${h.id} \u2192 #${A.number}`))}}if(!e.only||e.only==="stories"){console.log(`
388
- \u{1F4C4} Stories`);for(let h of d.stories){let w=h.parentEpic?c.epics[Re(h.phase,h.parentEpic)]:null,C=w?`- **Parent Epic:** #${w.issue_number} (Part of this epic)`:h.parentEpic?`- **Parent Epic:** \`${h.parentEpic}\` (not yet synced to GitHub)`:"- **Parent Epic:** (standalone \u2014 no parent epic)",A=h.sprintId?`- **Sprint:** \`${h.sprintId}\``:"- **Sprint:** (not assigned to a sprint)",T=["## \u{1F3AF} Problem Statement","","_Clear explanation of what this story solves._","","## \u2705 Acceptance Criteria","","- [ ] Given/When/Then flows documented in source","- [ ] Tests written and passing","- [ ] Code review complete","","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",C,A,`- **Phase:** \`${h.phase}\``,`- **Source:** \`${h.sourcePath}\``,"- **Synced by:** rcode github-sync","","> **Linking:** Reference this story in commits with `refs #{issue}`","> or close it via PR with `Closes #{issue}`."].join(`
389
- `),G=c.phases[h.phase]&&c.phases[h.phase].milestone_number,I=Rt.createIssue({title:h.title,body:T,labels:e.withLabels?["type:feature","priority:medium","status:backlog"]:[],milestone:G},D);m.stories.push({story:h.id,...I}),I.error?m.errors.push(`story ${h.id}: ${I.error}`):I.dryRun||(c.stories[Re(h.phase,h.id)]={issue_number:I.number,url:I.url,phase:h.phase,parent_epic:h.parentEpic||null,sprint_id:h.sprintId||null,synced_at:new Date().toISOString(),content_hash:Rn(h.content)},e.execute&&Ds(r,c),w&&(w.child_story_issues=w.child_story_issues||[],w.child_story_issues.includes(I.number)||w.child_story_issues.push(I.number)),console.log(` \u2713 created: ${h.id} \u2192 #${I.number}`))}}if(e.execute&&(!e.only||e.only==="epics"||e.only==="stories")){let h=Object.entries(c.epics).filter(([,w])=>w.child_story_issues&&w.child_story_issues.length>0);if(h.length>0){console.log(`
390
- \u{1F517} Linking stories \u2192 epics (task lists)`);for(let[w,C]of h){let A=C.child_story_issues.sort((P,E)=>P-E).map(P=>`- [ ] #${P}`).join(`
391
- `),T=Rt.getIssue(C.issue_number,{repo:o});if(T.error){m.errors.push(`link epic #${C.issue_number}: ${T.error}`);continue}let G=T.body||"",I,Z=/## 📝 Child Stories[\s\S]*?(?=\n## |$)/,F=`## \u{1F4DD} Child Stories
410
+ `),C=u.phases[h.phase]&&u.phases[h.phase].milestone_number,A=Ot.createIssue({title:`[Epic] ${h.title}`,body:w,labels:e.withLabels?["epic","priority:medium","status:backlog"]:[],milestone:C},y);m.epics.push({epic:h.id,...A}),A.error?m.errors.push(`epic ${h.id}: ${A.error}`):A.dryRun||(u.epics[Ne(h.phase,h.id)]={issue_number:A.number,url:A.url,phase:h.phase,synced_at:new Date().toISOString(),content_hash:On(h.content),child_story_issues:[]},e.execute&&vs(r,u),console.log(` \u2713 created: ${h.id} \u2192 #${A.number}`))}}if(!e.only||e.only==="stories"){console.log(`
411
+ \u{1F4C4} Stories`);for(let h of d.stories){let w=h.parentEpic?u.epics[Ne(h.phase,h.parentEpic)]:null,C=w?`- **Parent Epic:** #${w.issue_number} (Part of this epic)`:h.parentEpic?`- **Parent Epic:** \`${h.parentEpic}\` (not yet synced to GitHub)`:"- **Parent Epic:** (standalone \u2014 no parent epic)",A=h.sprintId?`- **Sprint:** \`${h.sprintId}\``:"- **Sprint:** (not assigned to a sprint)",T=["## \u{1F3AF} Problem Statement","","_Clear explanation of what this story solves._","","## \u2705 Acceptance Criteria","","- [ ] Given/When/Then flows documented in source","- [ ] Tests written and passing","- [ ] Code review complete","","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",C,A,`- **Phase:** \`${h.phase}\``,`- **Source:** \`${h.sourcePath}\``,"- **Synced by:** rcode github-sync","","> **Linking:** Reference this story in commits with `refs #{issue}`","> or close it via PR with `Closes #{issue}`."].join(`
412
+ `),G=u.phases[h.phase]&&u.phases[h.phase].milestone_number,I=Ot.createIssue({title:h.title,body:T,labels:e.withLabels?["type:feature","priority:medium","status:backlog"]:[],milestone:G},y);m.stories.push({story:h.id,...I}),I.error?m.errors.push(`story ${h.id}: ${I.error}`):I.dryRun||(u.stories[Ne(h.phase,h.id)]={issue_number:I.number,url:I.url,phase:h.phase,parent_epic:h.parentEpic||null,sprint_id:h.sprintId||null,synced_at:new Date().toISOString(),content_hash:On(h.content)},e.execute&&vs(r,u),w&&(w.child_story_issues=w.child_story_issues||[],w.child_story_issues.includes(I.number)||w.child_story_issues.push(I.number)),console.log(` \u2713 created: ${h.id} \u2192 #${I.number}`))}}if(e.execute&&(!e.only||e.only==="epics"||e.only==="stories")){let h=Object.entries(u.epics).filter(([,w])=>w.child_story_issues&&w.child_story_issues.length>0);if(h.length>0){console.log(`
413
+ \u{1F517} Linking stories \u2192 epics (task lists)`);for(let[w,C]of h){let A=C.child_story_issues.sort((R,b)=>R-b).map(R=>`- [ ] #${R}`).join(`
414
+ `),T=Ot.getIssue(C.issue_number,{repo:o});if(T.error){m.errors.push(`link epic #${C.issue_number}: ${T.error}`);continue}let G=T.body||"",I,Z=/## 📝 Child Stories[\s\S]*?(?=\n## |$)/,F=`## \u{1F4DD} Child Stories
392
415
 
393
416
  ${A}
394
417
  `;Z.test(G)?I=G.replace(Z,F):I=G.trimEnd()+`
395
418
 
396
- `+F;let W=Rt.updateIssue(C.issue_number,{body:I},D);W.error?m.errors.push(`update epic #${C.issue_number}: ${W.error}`):console.log(` \u2713 linked ${C.child_story_issues.length} stories \u2192 epic #${C.issue_number}`)}}}if(e.updateEnabled&&(!e.only||e.only==="epics")&&d.updateEpics.length>0){console.log(`
397
- \u{1F504} Update existing epics`);for(let h of d.updateEpics){let w=Rn(h.content);if(w===h.lastSyncedContentHash)continue;let C=["## \u{1F3AF} Epic Vision","",`_Strategic goal this Epic contributes to. Fill in from \`${h.sourcePath}\`._`,"","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${h.phase}\``,`- **Source:** \`${h.sourcePath}\``,`- **Last synced:** ${new Date().toISOString()}`].join(`
398
- `),A=Rt.updateIssue(h.issueNumber,{title:e.updateBody?`[Epic] ${h.title}`:void 0,body:e.updateBody?C:void 0},D);A.error?m.errors.push(`update epic #${h.issueNumber}: ${A.error}`):A.dryRun||(c.epics[Re(h.phase,h.id)].content_hash=w,c.epics[Re(h.phase,h.id)].updated_at=new Date().toISOString(),console.log(` \u2713 updated: #${h.issueNumber} (${h.id})`))}}if(e.updateEnabled&&(!e.only||e.only==="stories")&&d.updateStories.length>0){console.log(`
399
- \u{1F504} Update existing stories`);for(let h of d.updateStories){let w=Rn(h.content);if(w===h.lastSyncedContentHash)continue;let C=["## \u{1F3AF} Problem Statement","",`_From \`${h.sourcePath}\`._`,"","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${h.phase}\``,`- **Source:** \`${h.sourcePath}\``,`- **Last synced:** ${new Date().toISOString()}`].join(`
400
- `),A=Rt.updateIssue(h.issueNumber,{title:e.updateBody?h.title:void 0,body:e.updateBody?C:void 0},D);A.error?m.errors.push(`update story #${h.issueNumber}: ${A.error}`):A.dryRun||(c.stories[Re(h.phase,h.id)].content_hash=w,c.stories[Re(h.phase,h.id)].updated_at=new Date().toISOString(),console.log(` \u2713 updated: #${h.issueNumber} (${h.id})`))}}if(e.createProject&&(!e.only||e.only==="project")){console.log(`
401
- \u{1F4CA} Project v2`);let h=o.split("/")[0],w=a.project_name||o.split("/")[1],C=Rt.createProject(h,w,D);C.error?m.errors.push(`project: ${C.error}`):C.dryRun||(c.project={number:C.number,url:C.url,synced_at:new Date().toISOString()},console.log(` \u2713 created: Project v2 "${w}" \u2192 ${C.url}`))}if(e.execute&&(Ds(r,c),console.log(`
419
+ `+F;let W=Ot.updateIssue(C.issue_number,{body:I},y);W.error?m.errors.push(`update epic #${C.issue_number}: ${W.error}`):console.log(` \u2713 linked ${C.child_story_issues.length} stories \u2192 epic #${C.issue_number}`)}}}if(e.updateEnabled&&(!e.only||e.only==="epics")&&d.updateEpics.length>0){console.log(`
420
+ \u{1F504} Update existing epics`);for(let h of d.updateEpics){let w=On(h.content);if(w===h.lastSyncedContentHash)continue;let C=["## \u{1F3AF} Epic Vision","",`_Strategic goal this Epic contributes to. Fill in from \`${h.sourcePath}\`._`,"","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${h.phase}\``,`- **Source:** \`${h.sourcePath}\``,`- **Last synced:** ${new Date().toISOString()}`].join(`
421
+ `),A=Ot.updateIssue(h.issueNumber,{title:e.updateBody?`[Epic] ${h.title}`:void 0,body:e.updateBody?C:void 0},y);A.error?m.errors.push(`update epic #${h.issueNumber}: ${A.error}`):A.dryRun||(u.epics[Ne(h.phase,h.id)].content_hash=w,u.epics[Ne(h.phase,h.id)].updated_at=new Date().toISOString(),console.log(` \u2713 updated: #${h.issueNumber} (${h.id})`))}}if(e.updateEnabled&&(!e.only||e.only==="stories")&&d.updateStories.length>0){console.log(`
422
+ \u{1F504} Update existing stories`);for(let h of d.updateStories){let w=On(h.content);if(w===h.lastSyncedContentHash)continue;let C=["## \u{1F3AF} Problem Statement","",`_From \`${h.sourcePath}\`._`,"","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${h.phase}\``,`- **Source:** \`${h.sourcePath}\``,`- **Last synced:** ${new Date().toISOString()}`].join(`
423
+ `),A=Ot.updateIssue(h.issueNumber,{title:e.updateBody?h.title:void 0,body:e.updateBody?C:void 0},y);A.error?m.errors.push(`update story #${h.issueNumber}: ${A.error}`):A.dryRun||(u.stories[Ne(h.phase,h.id)].content_hash=w,u.stories[Ne(h.phase,h.id)].updated_at=new Date().toISOString(),console.log(` \u2713 updated: #${h.issueNumber} (${h.id})`))}}if(e.createProject&&(!e.only||e.only==="project")){console.log(`
424
+ \u{1F4CA} Project v2`);let h=o.split("/")[0],w=a.project_name||o.split("/")[1],C=Ot.createProject(h,w,y);C.error?m.errors.push(`project: ${C.error}`):C.dryRun||(u.project={number:C.number,url:C.url,synced_at:new Date().toISOString()},console.log(` \u2713 created: Project v2 "${w}" \u2192 ${C.url}`))}if(e.execute&&(vs(r,u),console.log(`
402
425
  \u{1F4BE} Sync map saved to .rcode/integrations/github-map.json`)),console.log(`
403
- \u{1F4CA} Summary`),console.log(` Labels: ${m.labels.length}`),console.log(` Milestones: ${m.milestones.length}`),console.log(` Epics: ${m.epics.length} created`),console.log(` Stories: ${m.stories.length} created`),e.updateEnabled){let h=d.updateEpics.filter(C=>Rn(C.content)!==C.lastSyncedContentHash).length,w=d.updateStories.filter(C=>Rn(C.content)!==C.lastSyncedContentHash).length;console.log(` Updated: ${h} epics, ${w} stories (content changed since last sync)`)}if(m.errors.length>0){console.log(` Errors: ${m.errors.length}`);for(let h of m.errors)console.log(` \u274C ${h}`)}e.dryRun?(console.log(`
426
+ \u{1F4CA} Summary`),console.log(` Labels: ${m.labels.length}`),console.log(` Milestones: ${m.milestones.length}`),console.log(` Epics: ${m.epics.length} created`),console.log(` Stories: ${m.stories.length} created`),e.updateEnabled){let h=d.updateEpics.filter(C=>On(C.content)!==C.lastSyncedContentHash).length,w=d.updateStories.filter(C=>On(C.content)!==C.lastSyncedContentHash).length;console.log(` Updated: ${h} epics, ${w} stories (content changed since last sync)`)}if(m.errors.length>0){console.log(` Errors: ${m.errors.length}`);for(let h of m.errors)console.log(` \u274C ${h}`)}e.dryRun?(console.log(`
404
427
  \u26A0\uFE0F This was a DRY-RUN. No changes were made to GitHub.`),console.log(" To actually apply these changes, run again with: --execute")):console.log(`
405
- \u2705 Sync complete. View on GitHub: https://github.com/${o}`)}cy.exports=function(e){OF(e).catch(r=>{r instanceof kF&&(console.log(`
428
+ \u2705 Sync complete. View on GitHub: https://github.com/${o}`)}fy.exports=function(e){WF(e).catch(r=>{r instanceof RF&&(console.log(`
406
429
  \u274C GitHub sync cancelled \u2014 ${r.message}.`),process.exit(0)),console.error(`
407
- \u274C GitHub sync failed:`,r.message),process.env.DEBUG&&console.error(r.stack),process.exit(1)})}});var fy=v((dT,dy)=>{dy.exports=function(e,{packageJson:r}){console.log(`
430
+ \u274C GitHub sync failed:`,r.message),process.env.DEBUG&&console.error(r.stack),process.exit(1)})}});var my=v((DT,py)=>{py.exports=function(e,{packageJson:r}){console.log(`
408
431
  \u{1F54C} rcode v${r.version} \u2014 Tiers
409
432
 
410
433
  Everything is organized into 4 tiers + a preview track. Start with \u{1F331} Starter.
@@ -443,8 +466,8 @@ Everything is organized into 4 tiers + a preview track. Start with \u{1F331} Sta
443
466
  See: docs/V2-PREVIEW.md
444
467
 
445
468
  Full detail: docs/TIERS.md
446
- `.trim())}});var ys=require("path"),dn=require("fs"),hy=ys.resolve(__dirname,".."),vs=JSON.parse(dn.readFileSync(ys.join(hy,"package.json"),"utf8")),NF={install:is(),init:is(),update:Tg(),uninstall:ic(),remove:ic(),nuke:Zg(),"migrate-namespace":Vg(),dashboard:cc(),serve:cc(),digest:Kg(),team:tD(),agent:oD(),doctor:bD(),workflow:yc(),plan:(t,e)=>Fc("plan",t,e),execute:(t,e)=>Fc("execute-sprint",t,e),ship:(t,e)=>Fc("ship",t,e),"set-profile":OD(),"set-mode":MD(),config:VD(),context:XD(),"show-model":ey(),"github-sync":ly(),tiers:fy(),version:()=>console.log(vs.version),help:py};function py(){console.log(`
447
- \u{1F54C} rcode v${vs.version}
469
+ `.trim())}});var _s=require("path"),hn=require("fs"),gy=_s.resolve(__dirname,".."),bs=JSON.parse(hn.readFileSync(_s.join(gy,"package.json"),"utf8")),HF={install:cs(),init:cs(),update:Og(),uninstall:cu(),remove:cu(),nuke:Gg(),"migrate-namespace":Yg(),dashboard:du(),serve:du(),digest:tD(),team:sD(),agent:cD(),doctor:wD(),workflow:_u(),plan:(t,e)=>Iu("plan",t,e),execute:(t,e)=>Iu("execute-sprint",t,e),ship:(t,e)=>Iu("ship",t,e),"set-profile":BD(),"set-mode":HD(),config:YD(),context:QD(),"show-model":ny(),"github-sync":hy(),tiers:my(),version:()=>console.log(bs.version),help:Dy};function Dy(){console.log(`
470
+ \u{1F54C} rcode v${bs.version}
448
471
  Context-aware AI team methodology. See tiers: \`rcode tiers\`
449
472
 
450
473
  Usage:
@@ -517,14 +540,14 @@ Getting started:
517
540
  rcode set-profile # choose model profile (quality | balanced | budget)
518
541
 
519
542
  Documentation: https://github.com/hanzlahabib/rcode
520
- `.trim())}function Fc(t,e,r){yc()(["show",t,...e],r);let n=e.includes("--auto")||e.includes("--run");console.log(`
543
+ `.trim())}function Iu(t,e,r){_u()(["show",t,...e],r);let n=e.includes("--auto")||e.includes("--run");console.log(`
521
544
  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`),console.log(`\u25B6 To run: paste the above into Claude Code as /${t==="execute-sprint"?"rcode-execute-sprint":`rcode-${t}`}`),console.log(" or pipe it directly: rcode "+(t==="execute-sprint"?"execute":t)+" | cld --model sonnet"),n&&console.log(`
522
- AUTO mode detected \u2014 in Claude Code run: /rcode-`+(t==="execute-sprint"?"execute-sprint":t)+" --auto (applies yolo defaults, skips confirmation prompts)")}function LF(){let e=require("os").homedir(),r=ys.join(e,".rcode"),n=ys.join(r,".welcome-shown");if(dn.existsSync(n))return;let s=ys.join(e,".claude","commands"),i=!1;try{i=dn.existsSync(s)&&dn.readdirSync(s).some(o=>o.startsWith("rcode-")&&o.endsWith(".md"))}catch{}if(i){console.log(`
523
- \u{1F54C} rcode v${vs.version} \u2014 first run detected.
524
- `),console.log(` \u2713 ${BF(s)} slash commands installed \u2192 ~/.claude/commands/`),console.log(" \u2713 All /rcode-* commands available in every Claude Code project."),console.log(`
545
+ AUTO mode detected \u2014 in Claude Code run: /rcode-`+(t==="execute-sprint"?"execute-sprint":t)+" --auto (applies yolo defaults, skips confirmation prompts)")}function ZF(){let e=require("os").homedir(),r=_s.join(e,".rcode"),n=_s.join(r,".welcome-shown");if(hn.existsSync(n))return;let s=_s.join(e,".claude","commands"),i=!1;try{i=hn.existsSync(s)&&hn.readdirSync(s).some(o=>o.startsWith("rcode-")&&o.endsWith(".md"))}catch{}if(i){console.log(`
546
+ \u{1F54C} rcode v${bs.version} \u2014 first run detected.
547
+ `),console.log(` \u2713 ${UF(s)} slash commands installed \u2192 ~/.claude/commands/`),console.log(" \u2713 All /rcode-* commands available in every Claude Code project."),console.log(`
525
548
  To set up a project: cd my-project && rcode install`),console.log(" Show all commands: rcode help"),console.log(` Diagnose issues: rcode doctor
526
- `);try{dn.mkdirSync(r,{recursive:!0}),dn.writeFileSync(n,`installed ${vs.version} at ${new Date().toISOString()}
527
- `)}catch{}}}function BF(t){try{return dn.readdirSync(t).filter(e=>e.startsWith("rcode-")&&e.endsWith(".md")).length}catch{return 0}}async function MF(){let[,,t="help",...e]=process.argv;(t==="--help"||t==="-h")&&(t="help"),(t==="--version"||t==="-v")&&(t="version"),LF();let r=NF[t];r||(console.error(`Unknown command: ${t}`),py(),process.exit(1));try{await r(e,{packageRoot:hy,packageJson:vs})}catch(n){console.error(`Error running '${t}':`,n.message),process.env.DEBUG&&console.error(n.stack),process.exit(1)}finally{try{as().closeSession()}catch{}}}MF();
549
+ `);try{hn.mkdirSync(r,{recursive:!0}),hn.writeFileSync(n,`installed ${bs.version} at ${new Date().toISOString()}
550
+ `)}catch{}}}function UF(t){try{return hn.readdirSync(t).filter(e=>e.startsWith("rcode-")&&e.endsWith(".md")).length}catch{return 0}}async function VF(){let[,,t="help",...e]=process.argv;(t==="--help"||t==="-h")&&(t="help"),(t==="--version"||t==="-v")&&(t="version"),ZF();let r=HF[t];r||(console.error(`Unknown command: ${t}`),Dy(),process.exit(1));try{await r(e,{packageRoot:gy,packageJson:bs})}catch(n){console.error(`Error running '${t}':`,n.message),process.env.DEBUG&&console.error(n.stack),process.exit(1)}finally{try{us().closeSession()}catch{}}}VF();
528
551
  /*! Bundled license information:
529
552
 
530
553
  is-extglob/index.js: