@hanzlaa/rcode 4.1.2 → 4.3.1

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 (70) hide show
  1. package/cli/install.js +176 -13
  2. package/cli/lib/config.cjs +4 -2
  3. package/cli/lib/fsutil.cjs +13 -2
  4. package/cli/lib/homedir.cjs +21 -0
  5. package/cli/lib/schemas.cjs +6 -1
  6. package/cli/nuke.js +13 -8
  7. package/cli/postinstall.js +14 -4
  8. package/cli/rcode-slash-router.cjs +118 -0
  9. package/cli/uninstall.js +59 -1
  10. package/cli/update.js +10 -5
  11. package/dist/rcode.js +234 -230
  12. package/package.json +1 -1
  13. package/rcode/references/auto-init-guard.md +2 -2
  14. package/rcode/references/output-format.md +5 -5
  15. package/rcode/skills/actions/2-plan/rcode-create-milestone/steps/step-10-complete.md +1 -1
  16. package/server/dashboard.js +33 -13
  17. package/server/lib/api.js +62 -4
  18. package/server/lib/html/client/agents-data.js +22 -18
  19. package/server/lib/html/client/app.js +3 -0
  20. package/server/lib/html/client/components/AgentCard.js +127 -0
  21. package/server/lib/html/client/components/App.js +104 -39
  22. package/server/lib/html/client/components/CommandPalette.js +133 -0
  23. package/server/lib/html/client/components/FileReader.js +116 -0
  24. package/server/lib/html/client/components/FilterChips.js +94 -0
  25. package/server/lib/html/client/components/NotifyCenter.js +117 -0
  26. package/server/lib/html/client/components/OrchPanel.js +80 -52
  27. package/server/lib/html/client/components/PhaseGraph.js +300 -0
  28. package/server/lib/html/client/components/RejectDialog.js +78 -0
  29. package/server/lib/html/client/components/RunnerPicker.js +190 -0
  30. package/server/lib/html/client/components/Sidebar.js +106 -61
  31. package/server/lib/html/client/components/StatusSummaryBar.js +76 -0
  32. package/server/lib/html/client/components/TaskPipeline.js +83 -0
  33. package/server/lib/html/client/components/Topbar.js +86 -39
  34. package/server/lib/html/client/components/dashboard/Blockers.js +57 -0
  35. package/server/lib/html/client/components/dashboard/CompletedTasks.js +47 -0
  36. package/server/lib/html/client/components/dashboard/CurrentPhase.js +107 -0
  37. package/server/lib/html/client/components/dashboard/InProgress.js +72 -0
  38. package/server/lib/html/client/components/dashboard/ProgressDonut.js +101 -0
  39. package/server/lib/html/client/components/dashboard/ProgressTimeline.js +101 -0
  40. package/server/lib/html/client/components/dashboard/ProjectHealth.js +80 -0
  41. package/server/lib/html/client/components/dashboard/RecentDecisions.js +57 -0
  42. package/server/lib/html/client/components/dashboard/Timeline.js +143 -0
  43. package/server/lib/html/client/components/shared.js +47 -11
  44. package/server/lib/html/client/filter-state.js +72 -0
  45. package/server/lib/html/client/icons-client.js +7 -0
  46. package/server/lib/html/client/notify.js +75 -0
  47. package/server/lib/html/client/orchestrator.js +168 -41
  48. package/server/lib/html/client/preact.js +13 -8
  49. package/server/lib/html/client/store.js +70 -6
  50. package/server/lib/html/client/util.js +78 -0
  51. package/server/lib/html/client/vendor/htm.js +1 -0
  52. package/server/lib/html/client/vendor/preact-hooks.js +2 -0
  53. package/server/lib/html/client/vendor/preact.js +2 -0
  54. package/server/lib/html/client/views/AgentsView.js +144 -51
  55. package/server/lib/html/client/views/FilesView.js +20 -103
  56. package/server/lib/html/client/views/KanbanView.js +40 -21
  57. package/server/lib/html/client/views/MemoryView.js +26 -9
  58. package/server/lib/html/client/views/MilestonesView.js +4 -4
  59. package/server/lib/html/client/views/OrchestrationView.js +154 -19
  60. package/server/lib/html/client/views/OverviewView.js +47 -239
  61. package/server/lib/html/client/views/PhasesView.js +50 -6
  62. package/server/lib/html/client/views/RoadmapView.js +6 -3
  63. package/server/lib/html/client/views/SprintsView.js +50 -6
  64. package/server/lib/html/client/views/TasksView.js +4 -3
  65. package/server/lib/html/client.js +21 -4
  66. package/server/lib/html/css.js +2761 -8
  67. package/server/lib/html/icons.js +7 -0
  68. package/server/lib/html/shell.js +10 -3
  69. package/server/lib/scanner.js +376 -39
  70. package/server/orchestrator.js +346 -7
package/dist/rcode.js CHANGED
@@ -1,125 +1,125 @@
1
1
  #!/usr/bin/env node
2
2
  /* rcode — built with esbuild. Source: github.com/hanzlahabib/rihal-code */
3
- var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Zt=_((YF,mc)=>{var PD=require("crypto"),ot=require("fs"),sn=require("path");function pc(t,e,r={}){let{encoding:n="utf8",mode:s}=r,i=sn.dirname(t);ot.mkdirSync(i,{recursive:!0});let o=sn.join(i,`.${sn.basename(t)}.tmp-${process.pid}-${PD.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 OD(t,e,r={}){let n=JSON.stringify(e,null,2)+`
4
- `;pc(t,n,r)}function ND(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=sn.resolve(e),s;try{s=ot.realpathSync(t)}catch(o){return{ok:!1,reason:`realpath: ${o.message}`}}let i=sn.relative(n,s);if(i.startsWith("..")||sn.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}`}}}mc.exports={writeFileAtomic:pc,writeJsonAtomic:OD,safeRmSync:ND}});var An=_((KF,Zo)=>{var gs=process||{},gc=gs.argv||[],ms=gs.env||{},LD=!(ms.NO_COLOR||gc.includes("--no-color"))&&(!!ms.FORCE_COLOR||gc.includes("--color")||gs.platform==="win32"||(gs.stdout||{}).isTTY&&ms.TERM!=="dumb"||!!ms.CI),BD=(t,e,r=t)=>n=>{let s=""+n,i=s.indexOf(e,t.length);return~i?t+MD(s,e,r,i)+e:t+s+e},MD=(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)},Dc=(t=LD)=>{let e=t?BD:()=>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")}};Zo.exports=Dc();Zo.exports.createColors=Dc});var _c=_(sr=>{"use strict";var yc=sr&&sr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sr,"__esModule",{value:!0});sr.symbols=sr.isTTY=void 0;var qD=yc(require("node:tty")),jt=yc(require("node:process")),WD=jt.default.env.CI||jt.default.env.WT_SESSION||jt.default.env.ConEmuTask==="{cmd::Cmder}"||jt.default.env.TERM_PROGRAM==="vscode"||jt.default.env.TERM==="xterm-256color"||jt.default.env.TERM==="alacritty",vc=qD.default.isatty(1)&&jt.default.env.TERM!=="dumb"&&!("CI"in jt.default.env);sr.isTTY=vc;var Fn=jt.default.platform!=="win32"?jt.default.env.TERM!=="linux":WD,HD={frames:vc?Fn?["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]:["-","\\","|","/"]:["-"],tick:Fn?"\u2714":"\u221A",cross:Fn?"\u2716":"\xD7",warn:Fn?"\u26A0":"!!",info:Fn?"\u2139":"i"};sr.symbols=HD});var bc=_(kn=>{"use strict";var ZD=kn&&kn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kn,"__esModule",{value:!0});kn.createSpinner=VD;var Ec=ZD(An()),It=_c();function UD(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 VD(t="",e={}){let r=0,n=e.interval||50,s=e.stream||process.stderr,i=e.frames&&e.frames.length?e.frames:It.symbols.frames,o=e.color||"yellow",a=!1,u=0,c,l=(b={})=>typeof b=="string"?b:b.text||t,d=(b={})=>typeof b=="string"?!1:!!b.update,f=(b={})=>typeof b=="string"||!b.color?o:b.color,g=(b={},I)=>typeof b=="string"||!b.mark?I:b.mark,m=()=>{process.on("SIGINT",C),process.on("SIGTERM",C)},D=()=>{process.off("SIGINT",C),process.off("SIGTERM",C)},h={reset(){return r=0,u=0,a=!1,clearTimeout(c),c=void 0,h},clear(){h.write("\x1B[1G");for(let b=0;b<u;b++)b>0&&h.write("\x1B[1A"),h.write("\x1B[2K\x1B[1G");return u=0,h},write(b,I=!1){return I&&It.isTTY&&h.clear(),s.write(b),h},render(){let b=`${Ec.default[o](i[r])} ${t}`;return It.isTTY?h.write("\x1B[?25l"):b+=`
6
- `,h.write(b,!0),It.isTTY&&(u=UD(b,s.columns)),h},spin(){return h.render(),r=++r%i.length,h},update(b){return typeof b=="string"?t=b:(t=b.text||t,i=b.frames&&b.frames.length?b.frames:i,n=b.interval||n,o=b.color||o),i.length-1<r&&(r=0),h},loop(){return It.isTTY&&(c=setTimeout(()=>h.loop(),n)),h.spin()},start(b={}){return c&&h.reset(),a=!0,m(),h.update({text:l(b),color:f(b)}).loop()},stop(b){a=!1,clearTimeout(c),c=void 0,D();let I=d(b),R=Ec.default[f(b)](g(b,i[r])),q=l(b);return h.write(b?`${R} ${q}${I?"":`
7
- `}`:"",!0),It.isTTY&&!I?h.write("\x1B[?25h"):h},success(b={}){return h.stop({text:l(b),mark:g(b,It.symbols.tick),color:"green",update:d(b)})},error(b={}){return h.stop({text:l(b),mark:g(b,It.symbols.cross),color:"red",update:d(b)})},warn(b={}){return h.stop({text:l(b),mark:g(b,It.symbols.warn),color:"yellow",update:d(b)})},info(b={}){return h.stop({text:l(b),mark:g(b,It.symbols.info),color:"blue",update:d(b)})},isSpinning(){return a}};function C(b){a&&h.stop(),process.exit(b==="SIGINT"?130:b==="SIGTERM"?143:1)}return h}});var Sc=_(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.splitWhen=on.flatten=void 0;function GD(t){return t.reduce((e,r)=>[].concat(e,r),[])}on.flatten=GD;function zD(t,e){let r=[[]],n=0;for(let s of t)e(s)?(n++,r[n]=[]):r[n].push(s);return r}on.splitWhen=zD});var Cc=_(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.isEnoentCodeError=void 0;function YD(t){return t.code==="ENOENT"}Ds.isEnoentCodeError=YD});var wc=_(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.createDirentFromStats=void 0;var Uo=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 KD(t,e){return new Uo(t,e)}ys.createDirentFromStats=KD});var Fc=_(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.convertPosixPathToPattern=Ae.convertWindowsPathToPattern=Ae.convertPathToPattern=Ae.escapePosixPath=Ae.escapeWindowsPath=Ae.escape=Ae.removeLeadingDotSegment=Ae.makeAbsolute=Ae.unixify=void 0;var XD=require("os"),JD=require("path"),xc=XD.platform()==="win32",QD=2,ey=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,ty=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,ry=/^\\\\([.?])/,ny=/\\(?![!()+@[\]{}])/g;function sy(t){return t.replace(/\\/g,"/")}Ae.unixify=sy;function oy(t,e){return JD.resolve(t,e)}Ae.makeAbsolute=oy;function iy(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(QD)}return t}Ae.removeLeadingDotSegment=iy;Ae.escape=xc?Vo:Go;function Vo(t){return t.replace(ty,"\\$2")}Ae.escapeWindowsPath=Vo;function Go(t){return t.replace(ey,"\\$2")}Ae.escapePosixPath=Go;Ae.convertPathToPattern=xc?$c:Ac;function $c(t){return Vo(t).replace(ry,"//$1").replace(ny,"/")}Ae.convertWindowsPathToPattern=$c;function Ac(t){return Go(t)}Ae.convertPosixPathToPattern=Ac});var jc=_((nk,kc)=>{kc.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 Rc=_((sk,Tc)=>{var ay=jc(),Ic={"{":"}","(":")","[":"]"},uy=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=Ic[a];if(u){var c=t.indexOf(u,e);c!==-1&&(e=c+1)}if(t[e]==="!")return!0}else e++}return!1},cy=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=Ic[r];if(n){var s=t.indexOf(n,e);s!==-1&&(e=s+1)}if(t[e]==="!")return!0}else e++}return!1};Tc.exports=function(e,r){if(typeof e!="string"||e==="")return!1;if(ay(e))return!0;var n=uy;return r&&r.strict===!1&&(n=cy),n(e)}});var Oc=_((ok,Pc)=>{"use strict";var ly=Rc(),dy=require("path").posix.dirname,fy=require("os").platform()==="win32",zo="/",hy=/\\/g,py=/[\{\[].*[\}\]]$/,my=/(^|[^\\])([\{\[]|\([^\)]+$)/,gy=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Pc.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&fy&&e.indexOf(zo)<0&&(e=e.replace(hy,zo)),py.test(e)&&(e+=zo),e+="a";do e=dy(e);while(ly(e)||my.test(e));return e.replace(gy,"$1")}});var vs=_(it=>{"use strict";it.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;it.find=(t,e)=>t.nodes.find(r=>r.type===e);it.exceedsLimit=(t,e,r=1,n)=>n===!1||!it.isInteger(t)||!it.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;it.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)};it.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;it.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;it.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;it.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);it.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=_((ak,Lc)=>{"use strict";var Nc=vs();Lc.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&Nc.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(i||o)&&Nc.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 Mc=_((uk,Bc)=>{"use strict";Bc.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var Yc=_((ck,zc)=>{"use strict";var qc=Mc(),xr=(t,e,r)=>{if(qc(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(qc(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(xr.cache.hasOwnProperty(u))return xr.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=Gc(t)||Gc(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=Wc(D,Math.abs(c),f,n),c=f.a=0}return l>=0&&(g=Wc(c,l,f,n)),f.negatives=m,f.positives=g,f.result=Dy(m,g,n),n.capture===!0?f.result=`(${f.result})`:n.wrap!==!1&&g.length+m.length>1&&(f.result=`(?:${f.result})`),xr.cache[u]=f,f.result};function Dy(t,e,r){let n=Yo(t,e,"-",!1,r)||[],s=Yo(e,t,"",!1,r)||[],i=Yo(t,e,"-?",!0,r)||[];return n.concat(i).concat(s).join("|")}function yy(t,e){let r=1,n=1,s=Zc(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=Zc(t,r);for(s=Uc(e+1,n)-1;t<s&&s<=e;)i.add(s),n+=1,s=Uc(e+1,n)-1;return i=[...i],i.sort(Ey),i}function vy(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=_y(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+=by(u,c,r):o++}return o&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function Wc(t,e,r,n){let s=yy(t,e),i=[],o=t,a;for(let u=0;u<s.length;u++){let c=s[u],l=vy(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+Vc(a.count),o=c+1;continue}r.isPadded&&(d=Sy(c,r,n)),l.string=d+l.pattern+Vc(l.count),i.push(l),o=c+1,a=l}return i}function Yo(t,e,r,n,s){let i=[];for(let o of t){let{string:a}=o;!n&&!Hc(e,"string",a)&&i.push(r+a),n&&Hc(e,"string",a)&&i.push(r+a)}return i}function _y(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function Ey(t,e){return t>e?1:e>t?-1:0}function Hc(t,e,r){return t.some(n=>n[e]===r)}function Zc(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function Uc(t,e){return t-t%Math.pow(10,e)}function Vc(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function by(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function Gc(t){return/^-?(0+)\d/.test(t)}function Sy(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}}`}}xr.cache={};xr.clearCache=()=>xr.cache={};zc.exports=xr});var Jo=_((lk,rl)=>{"use strict";var Cy=require("util"),Xc=Yc(),Kc=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),wy=t=>e=>t===!0?Number(e):String(e),Ko=t=>typeof t=="number"||typeof t=="string"&&t!=="",jn=t=>Number.isInteger(+t),Xo=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},xy=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,$y=(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},bs=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},Ay=(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=>bs(String(a),r)).join("|")),t.negatives.length&&(i=`-(${n}${t.negatives.map(a=>bs(String(a),r)).join("|")})`),s&&i?o=`${s}|${i}`:o=s||i,e.wrap?`(${n}${o})`:o},Jc=(t,e,r,n)=>{if(r)return Xc(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return`[${s}-${i}]`},Qc=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return Xc(t,e,r)},el=(...t)=>new RangeError("Invalid range arguments: "+Cy.inspect(...t)),tl=(t,e,r)=>{if(r.strictRanges===!0)throw el([t,e]);return[]},Fy=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},ky=(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=Xo(a)||Xo(u)||Xo(c),d=l?Math.max(a.length,u.length,c.length):0,f=l===!1&&xy(t,e,n)===!1,g=n.transform||wy(f);if(n.toRegex&&r===1)return Jc(bs(t,d),bs(e,d),!0,n);let m={negatives:[],positives:[]},D=b=>m[b<0?"negatives":"positives"].push(Math.abs(b)),h=[],C=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?D(s):h.push($y(g(s,C),d,f)),s=o?s-r:s+r,C++;return n.toRegex===!0?r>1?Ay(m,n,d):Qc(h,null,{wrap:!1,...n}):h},jy=(t,e,r=1,n={})=>{if(!jn(t)&&t.length>1||!jn(e)&&e.length>1)return tl(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 Jc(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?Qc(l,null,{wrap:!1,options:n}):l},Es=(t,e,r,n={})=>{if(e==null&&Ko(t))return[t];if(!Ko(t)||!Ko(e))return tl(t,e,n);if(typeof r=="function")return Es(t,e,1,{transform:r});if(Kc(r))return Es(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,jn(r)?jn(t)&&jn(e)?ky(t,e,r,s):jy(t,e,Math.max(Math.abs(r),1),s):r!=null&&!Kc(r)?Fy(r,s):Es(t,e,1,r)};rl.exports=Es});var ol=_((dk,sl)=>{"use strict";var Iy=Jo(),nl=vs(),Ty=(t,e={})=>{let r=(n,s={})=>{let i=nl.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=nl.reduce(n.nodes),d=Iy(...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)};sl.exports=Ty});var ul=_((fk,al)=>{"use strict";var Ry=Jo(),il=_s(),an=vs(),$r=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?an.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push($r(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?$r(s,i,r):s+i);return an.flatten(n)},Py=(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($r(a.pop(),il(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){a.push($r(a.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let d=an.reduce(s.nodes);if(an.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=Ry(...d,e);f.length===0&&(f=il(s,e)),a.push($r(a.pop(),f)),s.nodes=[];return}let u=an.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($r(a.pop(),c,u));continue}if(f.value&&f.type!=="open"){c.push($r(c.pop(),f.value));continue}f.nodes&&n(f,s)}return c};return an.flatten(n(t))};al.exports=Py});var ll=_((hk,cl)=>{"use strict";cl.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 ml=_((pk,pl)=>{"use strict";var Oy=_s(),{MAX_LENGTH:dl,CHAR_BACKSLASH:Qo,CHAR_BACKTICK:Ny,CHAR_COMMA:Ly,CHAR_DOT:By,CHAR_LEFT_PARENTHESES:My,CHAR_RIGHT_PARENTHESES:qy,CHAR_LEFT_CURLY_BRACE:Wy,CHAR_RIGHT_CURLY_BRACE:Hy,CHAR_LEFT_SQUARE_BRACKET:fl,CHAR_RIGHT_SQUARE_BRACKET:hl,CHAR_DOUBLE_QUOTE:Zy,CHAR_SINGLE_QUOTE:Uy,CHAR_NO_BREAK_SPACE:Vy,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Gy}=ll(),zy=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(dl,r.maxLength):dl;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===Gy||f===Vy)){if(f===Qo){m({type:"text",value:(e.keepEscaping?f:"")+g()});continue}if(f===hl){m({type:"text",value:"\\"+f});continue}if(f===fl){u++;let D;for(;l<c&&(D=g());){if(f+=D,D===fl){u++;continue}if(D===Qo){f+=g();continue}if(D===hl&&(u--,u===0))break}m({type:"text",value:f});continue}if(f===My){o=m({type:"paren",nodes:[]}),i.push(o),m({type:"text",value:f});continue}if(f===qy){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===Zy||f===Uy||f===Ny){let D=f,h;for(e.keepQuotes!==!0&&(f="");l<c&&(h=g());){if(h===Qo){f+=h+g();continue}if(h===D){e.keepQuotes===!0&&(f+=h);break}f+=h}m({type:"text",value:f});continue}if(f===Wy){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===Hy){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===Ly&&d>0){if(o.ranges>0){o.ranges=0;let D=o.nodes.shift();o.nodes=[D,{type:"text",value:Oy(o)}]}m({type:"comma",value:f}),o.commas++;continue}if(f===By&&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(C=>{C.nodes||(C.type==="open"&&(C.isOpen=!0),C.type==="close"&&(C.isClose=!0),C.nodes||(C.type="text"),C.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=zy});var yl=_((mk,Dl)=>{"use strict";var gl=_s(),Yy=ol(),Ky=ul(),Xy=ml(),rt=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=rt.create(n,e);Array.isArray(s)?r.push(...s):r.push(s)}else r=[].concat(rt.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};rt.parse=(t,e={})=>Xy(t,e);rt.stringify=(t,e={})=>gl(typeof t=="string"?rt.parse(t,e):t,e);rt.compile=(t,e={})=>(typeof t=="string"&&(t=rt.parse(t,e)),Yy(t,e));rt.expand=(t,e={})=>{typeof t=="string"&&(t=rt.parse(t,e));let r=Ky(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};rt.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?rt.compile(t,e):rt.expand(t,e);Dl.exports=rt});var In=_((gk,Sl)=>{"use strict";var Jy=require("path"),Tt="\\\\/",vl=`[^${Tt}]`,Qy=0,Ut="\\.",ev="\\+",tv="\\?",Ss="\\/",rv="(?=.)",_l="[^/]",ei=`(?:${Ss}|$)`,El=`(?:^|${Ss})`,ti=`${Ut}{1,2}${ei}`,nv=`(?!${Ut})`,sv=`(?!${El}${ti})`,ov=`(?!${Ut}{0,1}${ei})`,iv=`(?!${ti})`,av=`[^.${Ss}]`,uv=`${_l}*?`,bl={DOT_LITERAL:Ut,PLUS_LITERAL:ev,QMARK_LITERAL:tv,SLASH_LITERAL:Ss,ONE_CHAR:rv,QMARK:_l,END_ANCHOR:ei,DOTS_SLASH:ti,NO_DOT:nv,NO_DOTS:sv,NO_DOT_SLASH:ov,NO_DOTS_SLASH:iv,QMARK_NO_DOT:av,STAR:uv,START_ANCHOR:El},cv={...bl,SLASH_LITERAL:`[${Tt}]`,QMARK:vl,STAR:`${vl}*?`,DOTS_SLASH:`${Ut}{1,2}(?:[${Tt}]|$)`,NO_DOT:`(?!${Ut})`,NO_DOTS:`(?!(?:^|[${Tt}])${Ut}{1,2}(?:[${Tt}]|$))`,NO_DOT_SLASH:`(?!${Ut}{0,1}(?:[${Tt}]|$))`,NO_DOTS_SLASH:`(?!${Ut}{1,2}(?:[${Tt}]|$))`,QMARK_NO_DOT:`[^.${Tt}]`,START_ANCHOR:`(?:^|[${Tt}])`,END_ANCHOR:`(?:[${Tt}]|$)`},lv={__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"};Sl.exports={DEFAULT_MAX_EXTGLOB_RECURSION:Qy,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:lv,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:Jy.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?cv:bl}}});var Tn=_(ze=>{"use strict";var dv=require("path"),fv=process.platform==="win32",{REGEX_BACKSLASH:hv,REGEX_REMOVE_BACKSLASH:pv,REGEX_SPECIAL_CHARS:mv,REGEX_SPECIAL_CHARS_GLOBAL:gv}=In();ze.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);ze.hasRegexChars=t=>mv.test(t);ze.isRegexChar=t=>t.length===1&&ze.hasRegexChars(t);ze.escapeRegex=t=>t.replace(gv,"\\$1");ze.toPosixSlashes=t=>t.replace(hv,"/");ze.removeBackslashes=t=>t.replace(pv,e=>e==="\\"?"":e);ze.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};ze.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:fv===!0||dv.sep==="\\";ze.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?ze.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};ze.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};ze.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var jl=_((yk,kl)=>{"use strict";var Cl=Tn(),{CHAR_ASTERISK:ri,CHAR_AT:Dv,CHAR_BACKWARD_SLASH:Rn,CHAR_COMMA:yv,CHAR_DOT:ni,CHAR_EXCLAMATION_MARK:si,CHAR_FORWARD_SLASH:Fl,CHAR_LEFT_CURLY_BRACE:oi,CHAR_LEFT_PARENTHESES:ii,CHAR_LEFT_SQUARE_BRACKET:vv,CHAR_PLUS:_v,CHAR_QUESTION_MARK:wl,CHAR_RIGHT_CURLY_BRACE:Ev,CHAR_RIGHT_PARENTHESES:xl,CHAR_RIGHT_SQUARE_BRACKET:bv}=In(),$l=t=>t===Fl||t===Rn,Al=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Sv=(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,C=!1,b=!1,I=!1,R=!1,q=!1,j=0,P,k,M={value:"",depth:0,isGlob:!1},re=()=>c>=n,$=()=>u.charCodeAt(c+1),ae=()=>(P=k,u.charCodeAt(++c));for(;c<n;){k=ae();let fe;if(k===Rn){b=M.backslashes=!0,k=ae(),k===oi&&(C=!0);continue}if(C===!0||k===oi){for(j++;re()!==!0&&(k=ae());){if(k===Rn){b=M.backslashes=!0,ae();continue}if(k===oi){j++;continue}if(C!==!0&&k===ni&&(k=ae())===ni){if(f=M.isBrace=!0,m=M.isGlob=!0,q=!0,s===!0)continue;break}if(C!==!0&&k===yv){if(f=M.isBrace=!0,m=M.isGlob=!0,q=!0,s===!0)continue;break}if(k===Ev&&(j--,j===0)){C=!1,f=M.isBrace=!0,q=!0;break}}if(s===!0)continue;break}if(k===Fl){if(i.push(c),o.push(M),M={value:"",depth:0,isGlob:!1},q===!0)continue;if(P===ni&&c===l+1){l+=2;continue}d=c+1;continue}if(r.noext!==!0&&(k===_v||k===Dv||k===ri||k===wl||k===si)===!0&&$()===ii){if(m=M.isGlob=!0,D=M.isExtglob=!0,q=!0,k===si&&c===l&&(R=!0),s===!0){for(;re()!==!0&&(k=ae());){if(k===Rn){b=M.backslashes=!0,k=ae();continue}if(k===xl){m=M.isGlob=!0,q=!0;break}}continue}break}if(k===ri){if(P===ri&&(h=M.isGlobstar=!0),m=M.isGlob=!0,q=!0,s===!0)continue;break}if(k===wl){if(m=M.isGlob=!0,q=!0,s===!0)continue;break}if(k===vv){for(;re()!==!0&&(fe=ae());){if(fe===Rn){b=M.backslashes=!0,ae();continue}if(fe===bv){g=M.isBracket=!0,m=M.isGlob=!0,q=!0;break}}if(s===!0)continue;break}if(r.nonegate!==!0&&k===si&&c===l){I=M.negated=!0,l++;continue}if(r.noparen!==!0&&k===ii){if(m=M.isGlob=!0,s===!0){for(;re()!==!0&&(k=ae());){if(k===ii){b=M.backslashes=!0,k=ae();continue}if(k===xl){q=!0;break}}continue}break}if(m===!0){if(q=!0,s===!0)continue;break}}r.noext===!0&&(D=!1,m=!1);let X=u,ne="",x="";l>0&&(ne=u.slice(0,l),u=u.slice(l),d-=l),X&&m===!0&&d>0?(X=u.slice(0,d),x=u.slice(d)):m===!0?(X="",x=u):X=u,X&&X!==""&&X!=="/"&&X!==u&&$l(X.charCodeAt(X.length-1))&&(X=X.slice(0,-1)),r.unescape===!0&&(x&&(x=Cl.removeBackslashes(x)),X&&b===!0&&(X=Cl.removeBackslashes(X)));let A={prefix:ne,input:t,start:l,base:X,glob:x,isBrace:f,isBracket:g,isGlob:m,isExtglob:D,isGlobstar:h,negated:I,negatedExtglob:R};if(r.tokens===!0&&(A.maxDepth=0,$l(k)||o.push(M),A.tokens=o),r.parts===!0||r.tokens===!0){let fe;for(let se=0;se<i.length;se++){let Se=fe?fe+1:l,tt=i[se],Ie=t.slice(Se,tt);r.tokens&&(se===0&&l!==0?(o[se].isPrefix=!0,o[se].value=ne):o[se].value=Ie,Al(o[se]),A.maxDepth+=o[se].depth),(se!==0||Ie!=="")&&a.push(Ie),fe=tt}if(fe&&fe+1<t.length){let se=t.slice(fe+1);a.push(se),r.tokens&&(o[o.length-1].value=se,Al(o[o.length-1]),A.maxDepth+=o[o.length-1].depth)}A.slashes=i,A.parts=a}return A};kl.exports=Sv});var Ol=_((vk,Pl)=>{"use strict";var Pn=In(),Te=Tn(),{MAX_LENGTH:Cs,POSIX_REGEX_SOURCE:Cv,REGEX_NON_SPECIAL_CHARS:wv,REGEX_SPECIAL_CHARS_BACKREF:xv,REPLACEMENTS:Il}=Pn,$v=(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=>Te.escapeRegex(s)).join("..")}return r},un=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Tl=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},Av=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},Rl=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Av(e))return e.replace(/\\(.)/g,"$1")},Fv=t=>{let e=t.map(Rl).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},ai=(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}}}}},kv=t=>{let e=0,r=[];for(;e<t.length;){let s=ai(t.slice(e),!1);if(!s||s.type!=="*")return;let i=Tl(s.body).map(a=>a.trim());if(i.length!==1)return;let o=Rl(i[0]);if(!o||o.length!==1)return;r.push(o),e+=s.end+1}return r.length<1?void 0:`${r.length===1?Te.escapeRegex(r[0]):`[${r.map(s=>Te.escapeRegex(s)).join("")}]`}*`},jv=t=>{let e=0,r=t.trim(),n=ai(r);for(;n;)e++,r=n.body.trim(),n=ai(r);return e},Iv=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Pn.DEFAULT_MAX_EXTGLOB_RECURSION,n=Tl(t).map(s=>s.trim());if(n.length>1&&(n.some(s=>s==="")||n.some(s=>/^[*?]+$/.test(s))||Fv(n)))return{risky:!0};for(let s of n){let i=kv(s);if(i)return{risky:!0,safeOutput:i};if(jv(s)>r)return{risky:!0}}return{risky:!1}},ui=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Il[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Cs,r.maxLength):Cs,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=Te.isWindows(e),c=Pn.globChars(u),l=Pn.extglobChars(c),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:D,NO_DOT:h,NO_DOT_SLASH:C,NO_DOTS_SLASH:b,QMARK:I,QMARK_NO_DOT:R,STAR:q,START_ANCHOR:j}=c,P=L=>`(${a}(?:(?!${j}${L.dot?D:d}).)*?)`,k=r.dot?"":h,M=r.dot?I:R,re=r.bash===!0?P(r):q;r.capture&&(re=`(${re})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let $={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=Te.removePrefix(t,$),s=t.length;let ae=[],X=[],ne=[],x=i,A,fe=()=>$.index===s-1,se=$.peek=(L=1)=>t[$.index+L],Se=$.advance=()=>t[++$.index]||"",tt=()=>t.slice($.index+1),Ie=(L="",F=0)=>{$.consumed+=L,$.index+=F},Dt=L=>{$.output+=L.output!=null?L.output:L.value,Ie(L.value)},tr=()=>{let L=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Se(),$.start++,L++;return L%2===0?!1:($.negated=!0,$.start++,!0)},wr=L=>{$[L]++,ne.push(L)},yt=L=>{$[L]--,ne.pop()},oe=L=>{if(x.type==="globstar"){let F=$.braces>0&&(L.type==="comma"||L.type==="brace"),w=L.extglob===!0||ae.length&&(L.type==="pipe"||L.type==="paren");L.type!=="slash"&&L.type!=="paren"&&!F&&!w&&($.output=$.output.slice(0,-x.output.length),x.type="star",x.value="*",x.output=re,$.output+=x.output)}if(ae.length&&L.type!=="paren"&&(ae[ae.length-1].inner+=L.value),(L.value||L.output)&&Dt(L),x&&x.type==="text"&&L.type==="text"){x.value+=L.value,x.output=(x.output||"")+L.value;return}L.prev=x,o.push(L),x=L},nn=(L,F)=>{let w={...l[F],conditions:1,inner:""};w.prev=x,w.parens=$.parens,w.output=$.output,w.startIndex=$.index,w.tokensIndex=o.length;let T=(r.capture?"(":"")+w.open;wr("parens"),oe({type:L,value:F,output:$.output?"":m}),oe({type:"paren",extglob:!0,value:Se(),output:T}),ae.push(w)},Ho=L=>{let F=t.slice(L.startIndex,$.index+1),w=t.slice(L.startIndex+2,$.index),T=Iv(w,r);if((L.type==="plus"||L.type==="star")&&T.risky){let Q=T.safeOutput?(L.output?"":m)+(r.capture?`(${T.safeOutput})`:T.safeOutput):void 0,pe=o[L.tokensIndex];pe.type="text",pe.value=F,pe.output=Q||Te.escapeRegex(F);for(let De=L.tokensIndex+1;De<o.length;De++)o[De].value="",o[De].output="",delete o[De].suffix;$.output=L.output+pe.output,$.backtrack=!0,oe({type:"paren",extglob:!0,value:A,output:""}),yt("parens");return}let B=L.close+(r.capture?")":""),U;if(L.type==="negate"){let Q=re;if(L.inner&&L.inner.length>1&&L.inner.includes("/")&&(Q=P(r)),(Q!==re||fe()||/^\)+$/.test(tt()))&&(B=L.close=`)$))${Q}`),L.inner.includes("*")&&(U=tt())&&/^\.[^\\/.]+$/.test(U)){let pe=ui(U,{...e,fastpaths:!1}).output;B=L.close=`)${pe})${Q})`}L.prev.type==="bos"&&($.negatedExtglob=!0)}oe({type:"paren",extglob:!0,value:A,output:B}),yt("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let L=!1,F=t.replace(xv,(w,T,B,U,Q,pe)=>U==="\\"?(L=!0,w):U==="?"?T?T+U+(Q?I.repeat(Q.length):""):pe===0?M+(Q?I.repeat(Q.length):""):I.repeat(B.length):U==="."?d.repeat(B.length):U==="*"?T?T+U+(Q?re:""):re:T?w:`\\${w}`);return L===!0&&(r.unescape===!0?F=F.replace(/\\/g,""):F=F.replace(/\\+/g,w=>w.length%2===0?"\\\\":w?"\\":"")),F===t&&r.contains===!0?($.output=t,$):($.output=Te.wrapOutput(F,$,e),$)}for(;!fe();){if(A=Se(),A==="\0")continue;if(A==="\\"){let w=se();if(w==="/"&&r.bash!==!0||w==="."||w===";")continue;if(!w){A+="\\",oe({type:"text",value:A});continue}let T=/^\\+/.exec(tt()),B=0;if(T&&T[0].length>2&&(B=T[0].length,$.index+=B,B%2!==0&&(A+="\\")),r.unescape===!0?A=Se():A+=Se(),$.brackets===0){oe({type:"text",value:A});continue}}if($.brackets>0&&(A!=="]"||x.value==="["||x.value==="[^")){if(r.posix!==!1&&A===":"){let w=x.value.slice(1);if(w.includes("[")&&(x.posix=!0,w.includes(":"))){let T=x.value.lastIndexOf("["),B=x.value.slice(0,T),U=x.value.slice(T+2),Q=Cv[U];if(Q){x.value=B+Q,$.backtrack=!0,Se(),!i.output&&o.indexOf(x)===1&&(i.output=m);continue}}}(A==="["&&se()!==":"||A==="-"&&se()==="]")&&(A=`\\${A}`),A==="]"&&(x.value==="["||x.value==="[^")&&(A=`\\${A}`),r.posix===!0&&A==="!"&&x.value==="["&&(A="^"),x.value+=A,Dt({value:A});continue}if($.quotes===1&&A!=='"'){A=Te.escapeRegex(A),x.value+=A,Dt({value:A});continue}if(A==='"'){$.quotes=$.quotes===1?0:1,r.keepQuotes===!0&&oe({type:"text",value:A});continue}if(A==="("){wr("parens"),oe({type:"paren",value:A});continue}if(A===")"){if($.parens===0&&r.strictBrackets===!0)throw new SyntaxError(un("opening","("));let w=ae[ae.length-1];if(w&&$.parens===w.parens+1){Ho(ae.pop());continue}oe({type:"paren",value:A,output:$.parens?")":"\\)"}),yt("parens");continue}if(A==="["){if(r.nobracket===!0||!tt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(un("closing","]"));A=`\\${A}`}else wr("brackets");oe({type:"bracket",value:A});continue}if(A==="]"){if(r.nobracket===!0||x&&x.type==="bracket"&&x.value.length===1){oe({type:"text",value:A,output:`\\${A}`});continue}if($.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(un("opening","["));oe({type:"text",value:A,output:`\\${A}`});continue}yt("brackets");let w=x.value.slice(1);if(x.posix!==!0&&w[0]==="^"&&!w.includes("/")&&(A=`/${A}`),x.value+=A,Dt({value:A}),r.literalBrackets===!1||Te.hasRegexChars(w))continue;let T=Te.escapeRegex(x.value);if($.output=$.output.slice(0,-x.value.length),r.literalBrackets===!0){$.output+=T,x.value=T;continue}x.value=`(${a}${T}|${x.value})`,$.output+=x.value;continue}if(A==="{"&&r.nobrace!==!0){wr("braces");let w={type:"brace",value:A,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};X.push(w),oe(w);continue}if(A==="}"){let w=X[X.length-1];if(r.nobrace===!0||!w){oe({type:"text",value:A,output:A});continue}let T=")";if(w.dots===!0){let B=o.slice(),U=[];for(let Q=B.length-1;Q>=0&&(o.pop(),B[Q].type!=="brace");Q--)B[Q].type!=="dots"&&U.unshift(B[Q].value);T=$v(U,r),$.backtrack=!0}if(w.comma!==!0&&w.dots!==!0){let B=$.output.slice(0,w.outputIndex),U=$.tokens.slice(w.tokensIndex);w.value=w.output="\\{",A=T="\\}",$.output=B;for(let Q of U)$.output+=Q.output||Q.value}oe({type:"brace",value:A,output:T}),yt("braces"),X.pop();continue}if(A==="|"){ae.length>0&&ae[ae.length-1].conditions++,oe({type:"text",value:A});continue}if(A===","){let w=A,T=X[X.length-1];T&&ne[ne.length-1]==="braces"&&(T.comma=!0,w="|"),oe({type:"comma",value:A,output:w});continue}if(A==="/"){if(x.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",o.pop(),x=i;continue}oe({type:"slash",value:A,output:g});continue}if(A==="."){if($.braces>0&&x.type==="dot"){x.value==="."&&(x.output=d);let w=X[X.length-1];x.type="dots",x.output+=A,x.value+=A,w.dots=!0;continue}if($.braces+$.parens===0&&x.type!=="bos"&&x.type!=="slash"){oe({type:"text",value:A,output:d});continue}oe({type:"dot",value:A,output:d});continue}if(A==="?"){if(!(x&&x.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){nn("qmark",A);continue}if(x&&x.type==="paren"){let T=se(),B=A;if(T==="<"&&!Te.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(x.value==="("&&!/[!=<:]/.test(T)||T==="<"&&!/<([!=]|\w+>)/.test(tt()))&&(B=`\\${A}`),oe({type:"text",value:A,output:B});continue}if(r.dot!==!0&&(x.type==="slash"||x.type==="bos")){oe({type:"qmark",value:A,output:R});continue}oe({type:"qmark",value:A,output:I});continue}if(A==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){nn("negate",A);continue}if(r.nonegate!==!0&&$.index===0){tr();continue}}if(A==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){nn("plus",A);continue}if(x&&x.value==="("||r.regex===!1){oe({type:"plus",value:A,output:f});continue}if(x&&(x.type==="bracket"||x.type==="paren"||x.type==="brace")||$.parens>0){oe({type:"plus",value:A});continue}oe({type:"plus",value:f});continue}if(A==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){oe({type:"at",extglob:!0,value:A,output:""});continue}oe({type:"text",value:A});continue}if(A!=="*"){(A==="$"||A==="^")&&(A=`\\${A}`);let w=wv.exec(tt());w&&(A+=w[0],$.index+=w[0].length),oe({type:"text",value:A});continue}if(x&&(x.type==="globstar"||x.star===!0)){x.type="star",x.star=!0,x.value+=A,x.output=re,$.backtrack=!0,$.globstar=!0,Ie(A);continue}let L=tt();if(r.noextglob!==!0&&/^\([^?]/.test(L)){nn("star",A);continue}if(x.type==="star"){if(r.noglobstar===!0){Ie(A);continue}let w=x.prev,T=w.prev,B=w.type==="slash"||w.type==="bos",U=T&&(T.type==="star"||T.type==="globstar");if(r.bash===!0&&(!B||L[0]&&L[0]!=="/")){oe({type:"star",value:A,output:""});continue}let Q=$.braces>0&&(w.type==="comma"||w.type==="brace"),pe=ae.length&&(w.type==="pipe"||w.type==="paren");if(!B&&w.type!=="paren"&&!Q&&!pe){oe({type:"star",value:A,output:""});continue}for(;L.slice(0,3)==="/**";){let De=t[$.index+4];if(De&&De!=="/")break;L=L.slice(3),Ie("/**",3)}if(w.type==="bos"&&fe()){x.type="globstar",x.value+=A,x.output=P(r),$.output=x.output,$.globstar=!0,Ie(A);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&!U&&fe()){$.output=$.output.slice(0,-(w.output+x.output).length),w.output=`(?:${w.output}`,x.type="globstar",x.output=P(r)+(r.strictSlashes?")":"|$)"),x.value+=A,$.globstar=!0,$.output+=w.output+x.output,Ie(A);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&L[0]==="/"){let De=L[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(w.output+x.output).length),w.output=`(?:${w.output}`,x.type="globstar",x.output=`${P(r)}${g}|${g}${De})`,x.value+=A,$.output+=w.output+x.output,$.globstar=!0,Ie(A+Se()),oe({type:"slash",value:"/",output:""});continue}if(w.type==="bos"&&L[0]==="/"){x.type="globstar",x.value+=A,x.output=`(?:^|${g}|${P(r)}${g})`,$.output=x.output,$.globstar=!0,Ie(A+Se()),oe({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-x.output.length),x.type="globstar",x.output=P(r),x.value+=A,$.output+=x.output,$.globstar=!0,Ie(A);continue}let F={type:"star",value:A,output:re};if(r.bash===!0){F.output=".*?",(x.type==="bos"||x.type==="slash")&&(F.output=k+F.output),oe(F);continue}if(x&&(x.type==="bracket"||x.type==="paren")&&r.regex===!0){F.output=A,oe(F);continue}($.index===$.start||x.type==="slash"||x.type==="dot")&&(x.type==="dot"?($.output+=C,x.output+=C):r.dot===!0?($.output+=b,x.output+=b):($.output+=k,x.output+=k),se()!=="*"&&($.output+=m,x.output+=m)),oe(F)}for(;$.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(un("closing","]"));$.output=Te.escapeLast($.output,"["),yt("brackets")}for(;$.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(un("closing",")"));$.output=Te.escapeLast($.output,"("),yt("parens")}for(;$.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(un("closing","}"));$.output=Te.escapeLast($.output,"{"),yt("braces")}if(r.strictSlashes!==!0&&(x.type==="star"||x.type==="bracket")&&oe({type:"maybe_slash",value:"",output:`${g}?`}),$.backtrack===!0){$.output="";for(let L of $.tokens)$.output+=L.output!=null?L.output:L.value,L.suffix&&($.output+=L.suffix)}return $};ui.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Cs,r.maxLength):Cs,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=Il[t]||t;let i=Te.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}=Pn.globChars(i),D=r.dot?d:l,h=r.dot?f:l,C=r.capture?"":"?:",b={negated:!1,prefix:""},I=r.bash===!0?".*?":g;r.capture&&(I=`(${I})`);let R=k=>k.noglobstar===!0?I:`(${C}(?:(?!${m}${k.dot?c:o}).)*?)`,q=k=>{switch(k){case"*":return`${D}${u}${I}`;case".*":return`${o}${u}${I}`;case"*.*":return`${D}${I}${o}${u}${I}`;case"*/*":return`${D}${I}${a}${u}${h}${I}`;case"**":return D+R(r);case"**/*":return`(?:${D}${R(r)}${a})?${h}${u}${I}`;case"**/*.*":return`(?:${D}${R(r)}${a})?${h}${I}${o}${u}${I}`;case"**/.*":return`(?:${D}${R(r)}${a})?${o}${u}${I}`;default:{let M=/^(.*?)\.(\w+)$/.exec(k);if(!M)return;let re=q(M[1]);return re?re+o+M[2]:void 0}}},j=Te.removePrefix(t,b),P=q(j);return P&&r.strictSlashes!==!0&&(P+=`${a}?`),P};Pl.exports=ui});var Ll=_((_k,Nl)=>{"use strict";var Tv=require("path"),Rv=jl(),ci=Ol(),li=Tn(),Pv=In(),Ov=t=>t&&typeof t=="object"&&!Array.isArray(t),we=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(f=>we(f,e,r));return f=>{for(let g of l){let m=g(f);if(m)return m}return!1}}let n=Ov(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=li.isWindows(e),o=n?we.compileRe(t,e):we.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=we(s.ignore,l,r)}let c=(l,d=!1)=>{let{isMatch:f,match:g,output:m}=we.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};we.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?li.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=we.matchBase(t,e,r,s):a=e.exec(u)),{isMatch:!!a,match:a,output:u}};we.matchBase=(t,e,r,n=li.isWindows(r))=>(e instanceof RegExp?e:we.makeRe(e,r)).test(Tv.basename(t));we.isMatch=(t,e,r)=>we(e,r)(t);we.parse=(t,e)=>Array.isArray(t)?t.map(r=>we.parse(r,e)):ci(t,{...e,fastpaths:!1});we.scan=(t,e)=>Rv(t,e);we.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=we.toRegex(a,e);return n===!0&&(u.state=t),u};we.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=ci.fastpaths(t,e)),s.output||(s=ci(t,e)),we.compileRe(s,e,r,n)};we.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/$^/}};we.constants=Pv;Nl.exports=we});var Ml=_((Ek,Bl)=>{"use strict";Bl.exports=Ll()});var Vl=_((bk,Ul)=>{"use strict";var Wl=require("util"),Hl=yl(),Rt=Ml(),di=Tn(),ql=t=>t===""||t==="./",Zl=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},_e=(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=Rt(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};_e.match=_e;_e.matcher=(t,e)=>Rt(t,e);_e.isMatch=(t,e,r)=>Rt(e,r)(t);_e.any=_e.isMatch;_e.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(_e(t,e,{...r,onResult:i}));for(let a of s)o.has(a)||n.add(a);return[...n]};_e.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Wl.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>_e.contains(t,n,r));if(typeof e=="string"){if(ql(t)||ql(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return _e.isMatch(t,e,{...r,contains:!0})};_e.matchKeys=(t,e,r)=>{if(!di.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=_e(Object.keys(t),e,r),s={};for(let i of n)s[i]=t[i];return s};_e.some=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let i=Rt(String(s),r);if(n.some(o=>i(o)))return!0}return!1};_e.every=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let i=Rt(String(s),r);if(!n.every(o=>i(o)))return!1}return!0};_e.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Wl.inspect(t)}"`);return[].concat(e).every(n=>Rt(n,r)(t))};_e.capture=(t,e,r)=>{let n=di.isWindows(r),i=Rt.makeRe(String(t),{...r,capture:!0}).exec(n?di.toPosixSlashes(e):e);if(i)return i.slice(1).map(o=>o===void 0?"":o)};_e.makeRe=(...t)=>Rt.makeRe(...t);_e.scan=(...t)=>Rt.scan(...t);_e.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let s of Hl(String(n),e))r.push(Rt.parse(s,e));return r};_e.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!Zl(t)?[t]:Hl(t,e)};_e.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return _e.braces(t,{...e,expand:!0})};_e.hasBraces=Zl;Ul.exports=_e});var rd=_(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.isAbsolute=ee.partitionAbsoluteAndRelative=ee.removeDuplicateSlashes=ee.matchAny=ee.convertPatternsToRe=ee.makeRe=ee.getPatternParts=ee.expandBraceExpansion=ee.expandPatternsWithBraceExpansion=ee.isAffectDepthOfReadingPattern=ee.endsWithSlashGlobStar=ee.hasGlobStar=ee.getBaseDirectory=ee.isPatternRelatedToParentDirectory=ee.getPatternsOutsideCurrentDirectory=ee.getPatternsInsideCurrentDirectory=ee.getPositivePatterns=ee.getNegativePatterns=ee.isPositivePattern=ee.isNegativePattern=ee.convertToNegativePattern=ee.convertToPositivePattern=ee.isDynamicPattern=ee.isStaticPattern=void 0;var Gl=require("path"),Nv=Oc(),fi=Vl(),zl="**",Lv="\\",Bv=/[*?]|^!/,Mv=/\[[^[]*]/,qv=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,Wv=/[!*+?@]\([^(]*\)/,Hv=/,|\.\./,Zv=/(?!^)\/{2,}/g;function Yl(t,e={}){return!Kl(t,e)}ee.isStaticPattern=Yl;function Kl(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(Lv)||Bv.test(t)||Mv.test(t)||qv.test(t)||e.extglob!==!1&&Wv.test(t)||e.braceExpansion!==!1&&Uv(t))}ee.isDynamicPattern=Kl;function Uv(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 Hv.test(n)}function Vv(t){return ws(t)?t.slice(1):t}ee.convertToPositivePattern=Vv;function Gv(t){return"!"+t}ee.convertToNegativePattern=Gv;function ws(t){return t.startsWith("!")&&t[1]!=="("}ee.isNegativePattern=ws;function Xl(t){return!ws(t)}ee.isPositivePattern=Xl;function zv(t){return t.filter(ws)}ee.getNegativePatterns=zv;function Yv(t){return t.filter(Xl)}ee.getPositivePatterns=Yv;function Kv(t){return t.filter(e=>!hi(e))}ee.getPatternsInsideCurrentDirectory=Kv;function Xv(t){return t.filter(hi)}ee.getPatternsOutsideCurrentDirectory=Xv;function hi(t){return t.startsWith("..")||t.startsWith("./..")}ee.isPatternRelatedToParentDirectory=hi;function Jv(t){return Nv(t,{flipBackslashes:!1})}ee.getBaseDirectory=Jv;function Qv(t){return t.includes(zl)}ee.hasGlobStar=Qv;function Jl(t){return t.endsWith("/"+zl)}ee.endsWithSlashGlobStar=Jl;function e_(t){let e=Gl.basename(t);return Jl(t)||Yl(e)}ee.isAffectDepthOfReadingPattern=e_;function t_(t){return t.reduce((e,r)=>e.concat(Ql(r)),[])}ee.expandPatternsWithBraceExpansion=t_;function Ql(t){let e=fi.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}ee.expandBraceExpansion=Ql;function r_(t,e){let{parts:r}=fi.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}ee.getPatternParts=r_;function ed(t,e){return fi.makeRe(t,e)}ee.makeRe=ed;function n_(t,e){return t.map(r=>ed(r,e))}ee.convertPatternsToRe=n_;function s_(t,e){return e.some(r=>r.test(t))}ee.matchAny=s_;function o_(t){return t.replace(Zv,"/")}ee.removeDuplicateSlashes=o_;function i_(t){let e=[],r=[];for(let n of t)td(n)?e.push(n):r.push(n);return[e,r]}ee.partitionAbsoluteAndRelative=i_;function td(t){return Gl.isAbsolute(t)}ee.isAbsolute=td});var id=_((Ck,od)=>{"use strict";var a_=require("stream"),nd=a_.PassThrough,u_=Array.prototype.slice;od.exports=c_;function c_(){let t=[],e=u_.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=nd(n);function a(){for(let l=0,d=arguments.length;l<d;l++)t.push(sd(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(C){o.emit("error",C)}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 sd(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=sd(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(nd(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var ud=_(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.merge=void 0;var l_=id();function d_(t){let e=l_(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>ad(t)),e.once("end",()=>ad(t)),e}xs.merge=d_;function ad(t){t.forEach(e=>e.emit("close"))}});var cd=_(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.isEmpty=cn.isString=void 0;function f_(t){return typeof t=="string"}cn.isString=f_;function h_(t){return t===""}cn.isEmpty=h_});var Vt=_(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.string=Re.stream=Re.pattern=Re.path=Re.fs=Re.errno=Re.array=void 0;var p_=Sc();Re.array=p_;var m_=Cc();Re.errno=m_;var g_=wc();Re.fs=g_;var D_=Fc();Re.path=D_;var y_=rd();Re.pattern=y_;var v_=ud();Re.stream=v_;var __=cd();Re.string=__});var hd=_(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.convertPatternGroupToTask=Pe.convertPatternGroupsToTasks=Pe.groupPatternsByBaseDirectory=Pe.getNegativePatternsAsPositive=Pe.getPositivePatterns=Pe.convertPatternsToTasks=Pe.generate=void 0;var vt=Vt();function E_(t,e){let r=ld(t,e),n=ld(e.ignore,e),s=dd(r),i=fd(r,n),o=s.filter(l=>vt.pattern.isStaticPattern(l,e)),a=s.filter(l=>vt.pattern.isDynamicPattern(l,e)),u=pi(o,i,!1),c=pi(a,i,!0);return u.concat(c)}Pe.generate=E_;function ld(t,e){let r=t;return e.braceExpansion&&(r=vt.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>vt.pattern.removeDuplicateSlashes(n))}function pi(t,e,r){let n=[],s=vt.pattern.getPatternsOutsideCurrentDirectory(t),i=vt.pattern.getPatternsInsideCurrentDirectory(t),o=mi(s),a=mi(i);return n.push(...gi(o,e,r)),"."in a?n.push(Di(".",i,e,r)):n.push(...gi(a,e,r)),n}Pe.convertPatternsToTasks=pi;function dd(t){return vt.pattern.getPositivePatterns(t)}Pe.getPositivePatterns=dd;function fd(t,e){return vt.pattern.getNegativePatterns(t).concat(e).map(vt.pattern.convertToPositivePattern)}Pe.getNegativePatternsAsPositive=fd;function mi(t){let e={};return t.reduce((r,n)=>{let s=vt.pattern.getBaseDirectory(n);return s in r?r[s].push(n):r[s]=[n],r},e)}Pe.groupPatternsByBaseDirectory=mi;function gi(t,e,r){return Object.keys(t).map(n=>Di(n,t[n],e,r))}Pe.convertPatternGroupsToTasks=gi;function Di(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(vt.pattern.convertToNegativePattern))}}Pe.convertPatternGroupToTask=Di});var md=_($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.read=void 0;function b_(t,e,r){e.fs.lstat(t,(n,s)=>{if(n!==null){pd(r,n);return}if(!s.isSymbolicLink()||!e.followSymbolicLink){yi(r,s);return}e.fs.stat(t,(i,o)=>{if(i!==null){if(e.throwErrorOnBrokenSymbolicLink){pd(r,i);return}yi(r,s);return}e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),yi(r,o)})})}$s.read=b_;function pd(t,e){t(e)}function yi(t,e){t(null,e)}});var gd=_(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.read=void 0;function S_(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}}As.read=S_});var Dd=_(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.createFileSystemAdapter=or.FILE_SYSTEM_ADAPTER=void 0;var Fs=require("fs");or.FILE_SYSTEM_ADAPTER={lstat:Fs.lstat,stat:Fs.stat,lstatSync:Fs.lstatSync,statSync:Fs.statSync};function C_(t){return t===void 0?or.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},or.FILE_SYSTEM_ADAPTER),t)}or.createFileSystemAdapter=C_});var yd=_(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});var w_=Dd(),vi=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=w_.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}};_i.default=vi});var Ar=_(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.statSync=ir.stat=ir.Settings=void 0;var vd=md(),x_=gd(),Ei=yd();ir.Settings=Ei.default;function $_(t,e,r){if(typeof e=="function"){vd.read(t,bi(),e);return}vd.read(t,bi(e),r)}ir.stat=$_;function A_(t,e){let r=bi(e);return x_.read(t,r)}ir.statSync=A_;function bi(t={}){return t instanceof Ei.default?t:new Ei.default(t)}});var bd=_((Rk,Ed)=>{var _d;Ed.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(_d||(_d=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var Cd=_((Pk,Sd)=>{Sd.exports=k_;var F_=bd();function k_(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?F_(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 Si=_(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var ks=process.versions.node.split(".");if(ks[0]===void 0||ks[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var wd=Number.parseInt(ks[0],10),j_=Number.parseInt(ks[1],10),xd=10,I_=10,T_=wd>xd,R_=wd===xd&&j_>=I_;js.IS_SUPPORT_READDIR_WITH_FILE_TYPES=T_||R_});var $d=_(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.createDirentFromStats=void 0;var Ci=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 P_(t,e){return new Ci(t,e)}Is.createDirentFromStats=P_});var wi=_(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.fs=void 0;var O_=$d();Ts.fs=O_});var xi=_(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.joinPathSegments=void 0;function N_(t,e,r){return t.endsWith(r)?t+e:t+r+e}Rs.joinPathSegments=N_});var Td=_(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.readdir=ar.readdirWithFileTypes=ar.read=void 0;var L_=Ar(),Ad=Cd(),B_=Si(),Fd=wi(),kd=xi();function M_(t,e,r){if(!e.stats&&B_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){jd(t,e,r);return}Id(t,e,r)}ar.read=M_;function jd(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,s)=>{if(n!==null){Ps(r,n);return}let i=s.map(a=>({dirent:a,name:a.name,path:kd.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){$i(r,i);return}let o=i.map(a=>q_(a,e));Ad(o,(a,u)=>{if(a!==null){Ps(r,a);return}$i(r,u)})})}ar.readdirWithFileTypes=jd;function q_(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=Fd.fs.createDirentFromStats(t.name,s),r(null,t)})}}function Id(t,e,r){e.fs.readdir(t,(n,s)=>{if(n!==null){Ps(r,n);return}let i=s.map(o=>{let a=kd.joinPathSegments(t,o,e.pathSegmentSeparator);return u=>{L_.stat(a,e.fsStatSettings,(c,l)=>{if(c!==null){u(c);return}let d={name:o,path:a,dirent:Fd.fs.createDirentFromStats(o,l)};e.stats&&(d.stats=l),u(null,d)})}});Ad(i,(o,a)=>{if(o!==null){Ps(r,o);return}$i(r,a)})})}ar.readdir=Id;function Ps(t,e){t(e)}function $i(t,e){t(null,e)}});var Ld=_(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.readdir=ur.readdirWithFileTypes=ur.read=void 0;var W_=Ar(),H_=Si(),Rd=wi(),Pd=xi();function Z_(t,e){return!e.stats&&H_.IS_SUPPORT_READDIR_WITH_FILE_TYPES?Od(t,e):Nd(t,e)}ur.read=Z_;function Od(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let s={dirent:n,name:n.name,path:Pd.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(s.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let i=e.fs.statSync(s.path);s.dirent=Rd.fs.createDirentFromStats(s.name,i)}catch(i){if(e.throwErrorOnBrokenSymbolicLink)throw i}return s})}ur.readdirWithFileTypes=Od;function Nd(t,e){return e.fs.readdirSync(t).map(n=>{let s=Pd.joinPathSegments(t,n,e.pathSegmentSeparator),i=W_.statSync(s,e.fsStatSettings),o={name:n,path:s,dirent:Rd.fs.createDirentFromStats(n,i)};return e.stats&&(o.stats=i),o})}ur.readdir=Nd});var Bd=_(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.createFileSystemAdapter=cr.FILE_SYSTEM_ADAPTER=void 0;var ln=require("fs");cr.FILE_SYSTEM_ADAPTER={lstat:ln.lstat,stat:ln.stat,lstatSync:ln.lstatSync,statSync:ln.statSync,readdir:ln.readdir,readdirSync:ln.readdirSync};function U_(t){return t===void 0?cr.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},cr.FILE_SYSTEM_ADAPTER),t)}cr.createFileSystemAdapter=U_});var Md=_(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});var V_=require("path"),G_=Ar(),z_=Bd(),Ai=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=z_.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,V_.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new G_.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};Fi.default=Ai});var Os=_(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.Settings=lr.scandirSync=lr.scandir=void 0;var qd=Td(),Y_=Ld(),ki=Md();lr.Settings=ki.default;function K_(t,e,r){if(typeof e=="function"){qd.read(t,ji(),e);return}qd.read(t,ji(e),r)}lr.scandir=K_;function X_(t,e){let r=ji(e);return Y_.read(t,r)}lr.scandirSync=X_;function ji(t={}){return t instanceof ki.default?t:new ki.default(t)}});var Hd=_((Uk,Wd)=>{"use strict";function J_(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}}Wd.exports=J_});var Ud=_((Vk,Ii)=>{"use strict";var Q_=Hd();function Zd(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=Q_(e0),s=null,i=null,o=0,a=null,u={push:D,drain:Ye,saturated:Ye,pause:l,paused:!1,get concurrency(){return r},set concurrency(j){if(!(j>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=j,!u.paused)for(;s&&o<r;)o++,C()},running:c,resume:g,idle:m,length:d,getQueue:f,unshift:h,empty:Ye,kill:b,killAndDrain:I,error:q,abort:R};return u;function c(){return o}function l(){u.paused=!0}function d(){for(var j=s,P=0;j;)j=j.next,P++;return P}function f(){for(var j=s,P=[];j;)P.push(j.value),j=j.next;return P}function g(){if(u.paused){if(u.paused=!1,s===null){o++,C();return}for(;s&&o<r;)o++,C()}}function m(){return o===0&&u.length()===0}function D(j,P){var k=n.get();k.context=t,k.release=C,k.value=j,k.callback=P||Ye,k.errorHandler=a,o>=r||u.paused?i?(i.next=k,i=k):(s=k,i=k,u.saturated()):(o++,e.call(t,k.value,k.worked))}function h(j,P){var k=n.get();k.context=t,k.release=C,k.value=j,k.callback=P||Ye,k.errorHandler=a,o>=r||u.paused?s?(k.next=s,s=k):(s=k,i=k,u.saturated()):(o++,e.call(t,k.value,k.worked))}function C(j){j&&n.release(j);var P=s;P&&o<=r?u.paused?o--:(i===s&&(i=null),s=P.next,P.next=null,e.call(t,P.value,P.worked),i===null&&u.empty()):--o===0&&u.drain()}function b(){s=null,i=null,u.drain=Ye}function I(){s=null,i=null,u.drain(),u.drain=Ye}function R(){var j=s;for(s=null,i=null;j;){var P=j.next,k=j.callback,M=j.errorHandler,re=j.value,$=j.context;j.value=null,j.callback=Ye,j.errorHandler=null,M&&M(new Error("abort"),re),k.call($,new Error("abort")),j.release(j),j=P}u.drain=Ye}function q(j){a=j}}function Ye(){}function e0(){this.value=null,this.callback=Ye,this.next=null,this.release=Ye,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=Ye,t.errorHandler&&i(r,o),s.call(t.context,r,n),t.release(t)}}function t0(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=Zd(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(Ye),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(Ye),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}}Ii.exports=Zd;Ii.exports.promise=t0});var Ns=_(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.joinPathSegments=Pt.replacePathSegmentSeparator=Pt.isAppliedFilter=Pt.isFatalError=void 0;function r0(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}Pt.isFatalError=r0;function n0(t,e){return t===null||t(e)}Pt.isAppliedFilter=n0;function s0(t,e){return t.split(/[/\\]/).join(e)}Pt.replacePathSegmentSeparator=s0;function o0(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}Pt.joinPathSegments=o0});var Pi=_(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});var i0=Ns(),Ti=class{constructor(e,r){this._root=e,this._settings=r,this._root=i0.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};Ri.default=Ti});var Li=_(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});var a0=require("events"),u0=Os(),c0=Ud(),Ls=Ns(),l0=Pi(),Oi=class extends l0.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=u0.scandir,this._emitter=new a0.EventEmitter,this._queue=c0(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||!Ls.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=Ls.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Ls.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&Ls.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};Ni.default=Oi});var Vd=_(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});var d0=Li(),Bi=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new d0.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{f0(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{h0(e,this._storage)}),this._reader.read()}};Mi.default=Bi;function f0(t,e){t(e)}function h0(t,e){t(null,e)}});var Gd=_(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});var p0=require("stream"),m0=Li(),qi=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new m0.default(this._root,this._settings),this._stream=new p0.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}};Wi.default=qi});var zd=_(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});var g0=Os(),Bs=Ns(),D0=Pi(),Hi=class extends D0.default{constructor(){super(...arguments),this._scandir=g0.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(Bs.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=Bs.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Bs.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&Bs.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};Zi.default=Hi});var Yd=_(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});var y0=zd(),Ui=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new y0.default(this._root,this._settings)}read(){return this._reader.read()}};Vi.default=Ui});var Kd=_(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});var v0=require("path"),_0=Os(),Gi=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,v0.sep),this.fsScandirSettings=new _0.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}};zi.default=Gi});var qs=_(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.Settings=Ot.walkStream=Ot.walkSync=Ot.walk=void 0;var Xd=Vd(),E0=Gd(),b0=Yd(),Yi=Kd();Ot.Settings=Yi.default;function S0(t,e,r){if(typeof e=="function"){new Xd.default(t,Ms()).read(e);return}new Xd.default(t,Ms(e)).read(r)}Ot.walk=S0;function C0(t,e){let r=Ms(e);return new b0.default(t,r).read()}Ot.walkSync=C0;function w0(t,e){let r=Ms(e);return new E0.default(t,r).read()}Ot.walkStream=w0;function Ms(t={}){return t instanceof Yi.default?t:new Yi.default(t)}});var Ws=_(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});var x0=require("path"),$0=Ar(),Jd=Vt(),Ki=class{constructor(e){this._settings=e,this._fsStatSettings=new $0.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return x0.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:Jd.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!Jd.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};Xi.default=Ki});var ea=_(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var A0=require("stream"),F0=Ar(),k0=qs(),j0=Ws(),Ji=class extends j0.default{constructor(){super(...arguments),this._walkStream=k0.walkStream,this._stat=F0.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),s=new A0.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))})}};Qi.default=Ji});var Qd=_(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var I0=qs(),T0=Ws(),R0=ea(),ta=class extends T0.default{constructor(){super(...arguments),this._walkAsync=I0.walk,this._readerStream=new R0.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))})}};ra.default=ta});var ef=_(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});var On=Vt(),na=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 On.pattern.getPatternParts(e,this._micromatchOptions).map(n=>On.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:On.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return On.array.splitWhen(e,r=>r.dynamic&&On.pattern.hasGlobStar(r.pattern))}};sa.default=na});var tf=_(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});var P0=ef(),oa=class extends P0.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}};ia.default=oa});var rf=_(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var Hs=Vt(),O0=tf(),aa=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 O0.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(Hs.pattern.isAffectDepthOfReadingPattern);return Hs.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,s){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=Hs.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!Hs.pattern.matchAny(e,r)}};ua.default=aa});var nf=_(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});var dr=Vt(),ca=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,s]=dr.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:dr.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:dr.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:dr.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return o=>this._filter(o,i)}_filter(e,r){let n=dr.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=dr.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(s,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let s=dr.pattern.matchAny(e,r);return!s&&n?dr.pattern.matchAny(e+"/",r):s}};la.default=ca});var sf=_(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var N0=Vt(),da=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return N0.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};fa.default=da});var af=_(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var of=Vt(),ha=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=of.path.makeAbsolute(this._settings.cwd,r),r=of.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};pa.default=ha});var Zs=_(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var L0=require("path"),B0=rf(),M0=nf(),q0=sf(),W0=af(),ma=class{constructor(e){this._settings=e,this.errorFilter=new q0.default(this._settings),this.entryFilter=new M0.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new B0.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new W0.default(this._settings)}_getRootDirectory(e){return L0.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}}};ga.default=ma});var uf=_(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});var H0=Qd(),Z0=Zs(),Da=class extends Z0.default{constructor(){super(...arguments),this._reader=new H0.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)}};ya.default=Da});var cf=_(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var U0=require("stream"),V0=ea(),G0=Zs(),va=class extends G0.default{constructor(){super(...arguments),this._reader=new V0.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),s=this.api(r,e,n),i=new U0.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)}};_a.default=va});var lf=_(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var z0=Ar(),Y0=qs(),K0=Ws(),Ea=class extends K0.default{constructor(){super(...arguments),this._walkSync=Y0.walkSync,this._statSync=z0.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)}};ba.default=Ea});var df=_(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});var X0=lf(),J0=Zs(),Sa=class extends J0.default{constructor(){super(...arguments),this._reader=new X0.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)}};Ca.default=Sa});var ff=_(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var dn=require("fs"),Q0=require("os"),eE=Math.max(Q0.cpus().length,1);fn.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:dn.lstat,lstatSync:dn.lstatSync,stat:dn.stat,statSync:dn.statSync,readdir:dn.readdir,readdirSync:dn.readdirSync};var wa=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,eE),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({},fn.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};fn.default=wa});var mf=_((Dj,pf)=>{"use strict";var hf=hd(),tE=uf(),rE=cf(),nE=df(),xa=ff(),at=Vt();async function $a(t,e){_t(t);let r=Aa(t,tE.default,e),n=await Promise.all(r);return at.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(c,l){_t(c);let d=Aa(c,nE.default,l);return at.array.flatten(d)}t.sync=e;function r(c,l){_t(c);let d=Aa(c,rE.default,l);return at.stream.merge(d)}t.stream=r;function n(c,l){_t(c);let d=[].concat(c),f=new xa.default(l);return hf.generate(d,f)}t.generateTasks=n;function s(c,l){_t(c);let d=new xa.default(l);return at.pattern.isDynamicPattern(c,d)}t.isDynamicPattern=s;function i(c){return _t(c),at.path.escape(c)}t.escapePath=i;function o(c){return _t(c),at.path.convertPathToPattern(c)}t.convertPathToPattern=o;let a;(function(c){function l(f){return _t(f),at.path.escapePosixPath(f)}c.escapePath=l;function d(f){return _t(f),at.path.convertPosixPathToPattern(f)}c.convertPathToPattern=d})(a=t.posix||(t.posix={}));let u;(function(c){function l(f){return _t(f),at.path.escapeWindowsPath(f)}c.escapePath=l;function d(f){return _t(f),at.path.convertWindowsPathToPattern(f)}c.convertPathToPattern=d})(u=t.win32||(t.win32={}))})($a||($a={}));function Aa(t,e,r){let n=[].concat(t),s=new xa.default(r),i=hf.generate(n,s),o=new e(s);return i.map(o.read,o)}function _t(t){if(![].concat(t).every(n=>at.string.isString(n)&&!at.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}pf.exports=$a});var Nn=_(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.getParsedType=ye.ZodParsedType=ye.objectUtil=ye.util=void 0;var Fa;(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})(Fa||(ye.util=Fa={}));var gf;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(gf||(ye.objectUtil=gf={}));ye.ZodParsedType=Fa.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var sE=t=>{switch(typeof t){case"undefined":return ye.ZodParsedType.undefined;case"string":return ye.ZodParsedType.string;case"number":return Number.isNaN(t)?ye.ZodParsedType.nan:ye.ZodParsedType.number;case"boolean":return ye.ZodParsedType.boolean;case"function":return ye.ZodParsedType.function;case"bigint":return ye.ZodParsedType.bigint;case"symbol":return ye.ZodParsedType.symbol;case"object":return Array.isArray(t)?ye.ZodParsedType.array:t===null?ye.ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ye.ZodParsedType.promise:typeof Map<"u"&&t instanceof Map?ye.ZodParsedType.map:typeof Set<"u"&&t instanceof Set?ye.ZodParsedType.set:typeof Date<"u"&&t instanceof Date?ye.ZodParsedType.date:ye.ZodParsedType.object;default:return ye.ZodParsedType.unknown}};ye.getParsedType=sE});var Us=_(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.ZodError=fr.quotelessJson=fr.ZodIssueCode=void 0;var Df=Nn();fr.ZodIssueCode=Df.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 oE=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");fr.quotelessJson=oE;var Ln=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,Df.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()}};fr.ZodError=Ln;Ln.create=t=>new Ln(t)});var ja=_(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var Oe=Us(),Fr=Nn(),iE=(t,e)=>{let r;switch(t.code){case Oe.ZodIssueCode.invalid_type:t.received===Fr.ZodParsedType.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Oe.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Fr.util.jsonStringifyReplacer)}`;break;case Oe.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${Fr.util.joinValues(t.keys,", ")}`;break;case Oe.ZodIssueCode.invalid_union:r="Invalid input";break;case Oe.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Fr.util.joinValues(t.options)}`;break;case Oe.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${Fr.util.joinValues(t.options)}, received '${t.received}'`;break;case Oe.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case Oe.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case Oe.ZodIssueCode.invalid_date:r="Invalid date";break;case Oe.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}"`:Fr.util.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Oe.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 Oe.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 Oe.ZodIssueCode.custom:r="Invalid input";break;case Oe.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case Oe.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Oe.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=e.defaultError,Fr.util.assertNever(t)}return{message:r}};ka.default=iE});var Vs=_(hr=>{"use strict";var aE=hr&&hr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hr,"__esModule",{value:!0});hr.defaultErrorMap=void 0;hr.setErrorMap=uE;hr.getErrorMap=cE;var yf=aE(ja());hr.defaultErrorMap=yf.default;var vf=yf.default;function uE(t){vf=t}function cE(){return vf}});var Ta=_(me=>{"use strict";var lE=me&&me.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(me,"__esModule",{value:!0});me.isAsync=me.isValid=me.isDirty=me.isAborted=me.OK=me.DIRTY=me.INVALID=me.ParseStatus=me.EMPTY_PATH=me.makeIssue=void 0;me.addIssueToContext=hE;var dE=Vs(),_f=lE(ja()),fE=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}};me.makeIssue=fE;me.EMPTY_PATH=[];function hE(t,e){let r=(0,dE.getErrorMap)(),n=(0,me.makeIssue)({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===_f.default?void 0:_f.default].filter(s=>!!s)});t.common.issues.push(n)}var Ia=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 me.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 me.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}}};me.ParseStatus=Ia;me.INVALID=Object.freeze({status:"aborted"});var pE=t=>({status:"dirty",value:t});me.DIRTY=pE;var mE=t=>({status:"valid",value:t});me.OK=mE;var gE=t=>t.status==="aborted";me.isAborted=gE;var DE=t=>t.status==="dirty";me.isDirty=DE;var yE=t=>t.status==="valid";me.isValid=yE;var vE=t=>typeof Promise<"u"&&t instanceof Promise;me.isAsync=vE});var bf=_(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0})});var Cf=_(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.errorUtil=void 0;var Sf;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Sf||(Gs.errorUtil=Sf={}))});var Of=_(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.discriminatedUnion=E.date=E.boolean=E.bigint=E.array=E.any=E.coerce=E.ZodFirstPartyTypeKind=E.late=E.ZodSchema=E.Schema=E.ZodReadonly=E.ZodPipeline=E.ZodBranded=E.BRAND=E.ZodNaN=E.ZodCatch=E.ZodDefault=E.ZodNullable=E.ZodOptional=E.ZodTransformer=E.ZodEffects=E.ZodPromise=E.ZodNativeEnum=E.ZodEnum=E.ZodLiteral=E.ZodLazy=E.ZodFunction=E.ZodSet=E.ZodMap=E.ZodRecord=E.ZodTuple=E.ZodIntersection=E.ZodDiscriminatedUnion=E.ZodUnion=E.ZodObject=E.ZodArray=E.ZodVoid=E.ZodNever=E.ZodUnknown=E.ZodAny=E.ZodNull=E.ZodUndefined=E.ZodSymbol=E.ZodDate=E.ZodBoolean=E.ZodBigInt=E.ZodNumber=E.ZodString=E.ZodType=void 0;E.NEVER=E.void=E.unknown=E.union=E.undefined=E.tuple=E.transformer=E.symbol=E.string=E.strictObject=E.set=E.record=E.promise=E.preprocess=E.pipeline=E.ostring=E.optional=E.onumber=E.oboolean=E.object=E.number=E.nullable=E.null=E.never=E.nativeEnum=E.nan=E.map=E.literal=E.lazy=E.intersection=E.instanceof=E.function=E.enum=E.effect=void 0;E.datetimeRegex=Ff;E.custom=jf;var O=Us(),zs=Vs(),K=Cf(),S=Ta(),N=Nn(),ct=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}},wf=(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 ue(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 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 S.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,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,N.getParsedType)(e)},s=this._parseSync({data:e,path:n.path,parent:n});return wf(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,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,N.getParsedType)(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await((0,S.isAsync)(s)?s:Promise.resolve(s));return wf(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 nt({schema:this,typeName:te.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 ut.create(this,this._def)}nullable(){return Lt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yt.create(this)}promise(){return gr.create(this,this._def)}or(e){return Or.create([this,e],this._def)}and(e){return Nr.create(this,e,this._def)}transform(e){return new nt({...ue(this._def),schema:this,typeName:te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Wr({...ue(this._def),innerType:this,defaultValue:r,typeName:te.ZodDefault})}brand(){return new Bn({typeName:te.ZodBranded,type:this,...ue(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Hr({...ue(this._def),innerType:this,catchValue:r,typeName:te.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Mn.create(this,e)}readonly(){return Zr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};E.ZodType=ce;E.Schema=ce;E.ZodSchema=ce;var _E=/^c[^\s-]{8,}$/i,EE=/^[0-9a-z]+$/,bE=/^[0-9A-HJKMNP-TV-Z]{26}$/i,SE=/^[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,CE=/^[a-z0-9_-]{21}$/i,wE=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,xE=/^[-+]?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)?)??$/,$E=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,AE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ra,FE=/^(?:(?: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])$/,kE=/^(?:(?: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])$/,jE=/^(([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]))$/,IE=/^(([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])$/,TE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,RE=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$f="((\\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])))",PE=new RegExp(`^${$f}$`);function Af(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 OE(t){return new RegExp(`^${Af(t)}$`)}function Ff(t){let e=`${$f}T${Af(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 NE(t,e){return!!((e==="v4"||!e)&&FE.test(t)||(e==="v6"||!e)&&jE.test(t))}function LE(t,e){if(!wE.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 BE(t,e){return!!((e==="v4"||!e)&&kE.test(t)||(e==="v6"||!e)&&IE.test(t))}var pr=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,S.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:N.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")$E.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")Ra||(Ra=new RegExp(AE,"u")),Ra.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")SE.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")CE.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")_E.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")EE.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")bE.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"?Ff(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"?PE.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"?OE(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"?xE.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"?NE(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"?LE(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"?BE(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"?TE.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"?RE.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,S.addIssueToContext)(s,{validation:"base64url",code:O.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: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}};E.ZodString=pr;pr.create=t=>new pr({checks:[],typeName:te.ZodString,coerce:t?.coerce??!1,...ue(t)});function ME(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 kr=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,S.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.number,received:i.parsedType}),S.INVALID}let n,s=new S.ParseStatus;for(let i of this._def.checks)i.kind==="int"?N.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"?ME(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()):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)}};E.ZodNumber=kr;kr.create=t=>new kr({checks:[],typeName:te.ZodNumber,coerce:t?.coerce||!1,...ue(t)});var jr=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 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()):N.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:N.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}};E.ZodBigInt=jr;jr.create=t=>new jr({checks:[],typeName:te.ZodBigInt,coerce:t?.coerce??!1,...ue(t)});var Ir=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,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.boolean,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};E.ZodBoolean=Ir;Ir.create=t=>new Ir({typeName:te.ZodBoolean,coerce:t?.coerce||!1,...ue(t)});var Tr=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,S.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:N.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()):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}};E.ZodDate=Tr;Tr.create=t=>new Tr({checks:[],coerce:t?.coerce||!1,typeName:te.ZodDate,...ue(t)});var pn=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.symbol,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};E.ZodSymbol=pn;pn.create=t=>new pn({typeName:te.ZodSymbol,...ue(t)});var Rr=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.undefined,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};E.ZodUndefined=Rr;Rr.create=t=>new Rr({typeName:te.ZodUndefined,...ue(t)});var Pr=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.null,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};E.ZodNull=Pr;Pr.create=t=>new Pr({typeName:te.ZodNull,...ue(t)});var mr=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,S.OK)(e.data)}};E.ZodAny=mr;mr.create=t=>new mr({typeName:te.ZodAny,...ue(t)});var zt=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,S.OK)(e.data)}};E.ZodUnknown=zt;zt.create=t=>new zt({typeName:te.ZodUnknown,...ue(t)});var Et=class extends ce{_parse(e){let r=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.never,received:r.parsedType}),S.INVALID}};E.ZodNever=Et;Et.create=t=>new Et({typeName:te.ZodNever,...ue(t)});var mn=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.void,received:n.parsedType}),S.INVALID}return(0,S.OK)(e.data)}};E.ZodVoid=mn;mn.create=t=>new mn({typeName:te.ZodVoid,...ue(t)});var Yt=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,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:N.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 ct(r,o,r.path,a)))).then(o=>S.ParseStatus.mergeArray(n,o));let i=[...r.data].map((o,a)=>s.type._parseSync(new ct(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)}};E.ZodArray=Yt;Yt.create=(t,e)=>new Yt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:te.ZodArray,...ue(e)});function hn(t){if(t instanceof Ke){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ut.create(hn(n))}return new Ke({...t._def,shape:()=>e})}else return t instanceof Yt?new Yt({...t._def,type:hn(t.element)}):t instanceof ut?ut.create(hn(t.unwrap())):t instanceof Lt?Lt.create(hn(t.unwrap())):t instanceof Nt?Nt.create(t.items.map(e=>hn(e))):t}var Ke=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 c=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(c,{code:O.ZodIssueCode.invalid_type,expected:N.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 Et&&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 ct(s,d,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof Et){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 ct(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:te.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 hn(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 ut;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return kf(N.util.objectKeys(this.shape))}};E.ZodObject=Ke;Ke.create=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strip",catchall:Et.create(),typeName:te.ZodObject,...ue(e)});Ke.strictCreate=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strict",catchall:Et.create(),typeName:te.ZodObject,...ue(e)});Ke.lazycreate=(t,e)=>new Ke({shape:t,unknownKeys:"strip",catchall:Et.create(),typeName:te.ZodObject,...ue(e)});var Or=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 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}};E.ZodUnion=Or;Or.create=(t,e)=>new Or({options:t,typeName:te.ZodUnion,...ue(e)});var Gt=t=>t instanceof Lr?Gt(t.schema):t instanceof nt?Gt(t.innerType()):t instanceof Br?[t.value]:t instanceof Mr?t.options:t instanceof qr?N.util.objectValues(t.enum):t instanceof Wr?Gt(t._def.innerType):t instanceof Rr?[void 0]:t instanceof Pr?[null]:t instanceof ut?[void 0,...Gt(t.unwrap())]:t instanceof Lt?[null,...Gt(t.unwrap())]:t instanceof Bn||t instanceof Zr?Gt(t.unwrap()):t instanceof Hr?Gt(t._def.innerType):[],Ys=class t extends ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==N.ZodParsedType.object)return(0,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:N.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=Gt(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:te.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...ue(n)})}};E.ZodDiscriminatedUnion=Ys;function Pa(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 u=Pa(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.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],u=Pa(o,a);if(!u.valid)return{valid:!1};s.push(u.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 Nr=class extends ce{_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=Pa(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}))}};E.ZodIntersection=Nr;Nr.create=(t,e,r)=>new Nr({left:t,right:e,typeName:te.ZodIntersection,...ue(r)});var Nt=class t extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==N.ZodParsedType.array)return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.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 ct(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})}};E.ZodTuple=Nt;Nt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nt({items:t,typeName:te.ZodTuple,rest:null,...ue(e)})};var Ks=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,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.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 ct(n,a,n.path,a)),value:o._parse(new ct(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 ce?new t({keyType:e,valueType:r,typeName:te.ZodRecord,...ue(n)}):new t({keyType:pr.create(),valueType:e,typeName:te.ZodRecord,...ue(r)})}};E.ZodRecord=Ks;var gn=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,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.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 ct(n,a,n.path,[c,"key"])),value:i._parse(new ct(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}}}};E.ZodMap=gn;gn.create=(t,e,r)=>new gn({valueType:e,keyType:t,typeName:te.ZodMap,...ue(r)});var Dn=class t extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==N.ZodParsedType.set)return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.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 ct(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)}};E.ZodSet=Dn;Dn.create=(t,e)=>new Dn({valueType:t,minSize:null,maxSize:null,typeName:te.ZodSet,...ue(e)});var Xs=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,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:N.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,zs.getErrorMap)(),zs.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,zs.getErrorMap)(),zs.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 gr){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:Nt.create(e).rest(zt.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||Nt.create([]).rest(zt.create()),returns:r||zt.create(),typeName:te.ZodFunction,...ue(n)})}};E.ZodFunction=Xs;var Lr=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})}};E.ZodLazy=Lr;Lr.create=(t,e)=>new Lr({getter:t,typeName:te.ZodLazy,...ue(e)});var Br=class extends ce{_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}};E.ZodLiteral=Br;Br.create=(t,e)=>new Br({value:t,typeName:te.ZodLiteral,...ue(e)});function kf(t,e){return new Mr({values:t,typeName:te.ZodEnum,...ue(e)})}var Mr=class t extends ce{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,S.addIssueToContext)(r,{expected:N.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})}};E.ZodEnum=Mr;Mr.create=kf;var qr=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,S.addIssueToContext)(n,{expected:N.util.joinValues(s),received:n.parsedType,code:O.ZodIssueCode.invalid_type}),S.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,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}};E.ZodNativeEnum=qr;qr.create=(t,e)=>new qr({values:t,typeName:te.ZodNativeEnum,...ue(e)});var gr=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,S.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.promise,received:r.parsedType}),S.INVALID;let n=r.parsedType===N.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})))}};E.ZodPromise=gr;gr.create=(t,e)=>new gr({type:t,typeName:te.ZodPromise,...ue(e)});var nt=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===te.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);N.util.assertNever(s)}};E.ZodEffects=nt;E.ZodTransformer=nt;nt.create=(t,e,r)=>new nt({schema:t,typeName:te.ZodEffects,effect:e,...ue(r)});nt.createWithPreprocess=(t,e,r)=>new nt({schema:e,effect:{type:"preprocess",transform:t},typeName:te.ZodEffects,...ue(r)});var ut=class extends ce{_parse(e){return this._getType(e)===N.ZodParsedType.undefined?(0,S.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};E.ZodOptional=ut;ut.create=(t,e)=>new ut({innerType:t,typeName:te.ZodOptional,...ue(e)});var Lt=class extends ce{_parse(e){return this._getType(e)===N.ZodParsedType.null?(0,S.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};E.ZodNullable=Lt;Lt.create=(t,e)=>new Lt({innerType:t,typeName:te.ZodNullable,...ue(e)});var Wr=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}};E.ZodDefault=Wr;Wr.create=(t,e)=>new Wr({innerType:t,typeName:te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ue(e)});var Hr=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,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}};E.ZodCatch=Hr;Hr.create=(t,e)=>new Hr({innerType:t,typeName:te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ue(e)});var yn=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return(0,S.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.nan,received:n.parsedType}),S.INVALID}return{status:"valid",value:e.data}}};E.ZodNaN=yn;yn.create=t=>new yn({typeName:te.ZodNaN,...ue(t)});E.BRAND=Symbol("zod_brand");var Bn=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}};E.ZodBranded=Bn;var Mn=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"?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:te.ZodPipeline})}};E.ZodPipeline=Mn;var Zr=class extends ce{_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}};E.ZodReadonly=Zr;Zr.create=(t,e)=>new Zr({innerType:t,typeName:te.ZodReadonly,...ue(e)});function xf(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function jf(t,e={},r){return t?mr.create().superRefine((n,s)=>{let i=t(n);if(i instanceof Promise)return i.then(o=>{if(!o){let a=xf(e,n),u=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:u})}});if(!i){let o=xf(e,n),a=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:a})}}):mr.create()}E.late={object:Ke.lazycreate};var te;(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"})(te||(E.ZodFirstPartyTypeKind=te={}));var qE=(t,e={message:`Input not instance of ${t.name}`})=>jf(r=>r instanceof t,e);E.instanceof=qE;var If=pr.create;E.string=If;var Tf=kr.create;E.number=Tf;var WE=yn.create;E.nan=WE;var HE=jr.create;E.bigint=HE;var Rf=Ir.create;E.boolean=Rf;var ZE=Tr.create;E.date=ZE;var UE=pn.create;E.symbol=UE;var VE=Rr.create;E.undefined=VE;var GE=Pr.create;E.null=GE;var zE=mr.create;E.any=zE;var YE=zt.create;E.unknown=YE;var KE=Et.create;E.never=KE;var XE=mn.create;E.void=XE;var JE=Yt.create;E.array=JE;var QE=Ke.create;E.object=QE;var eb=Ke.strictCreate;E.strictObject=eb;var tb=Or.create;E.union=tb;var rb=Ys.create;E.discriminatedUnion=rb;var nb=Nr.create;E.intersection=nb;var sb=Nt.create;E.tuple=sb;var ob=Ks.create;E.record=ob;var ib=gn.create;E.map=ib;var ab=Dn.create;E.set=ab;var ub=Xs.create;E.function=ub;var cb=Lr.create;E.lazy=cb;var lb=Br.create;E.literal=lb;var db=Mr.create;E.enum=db;var fb=qr.create;E.nativeEnum=fb;var hb=gr.create;E.promise=hb;var Pf=nt.create;E.effect=Pf;E.transformer=Pf;var pb=ut.create;E.optional=pb;var mb=Lt.create;E.nullable=mb;var gb=nt.createWithPreprocess;E.preprocess=gb;var Db=Mn.create;E.pipeline=Db;var yb=()=>If().optional();E.ostring=yb;var vb=()=>Tf().optional();E.onumber=vb;var _b=()=>Rf().optional();E.oboolean=_b;E.coerce={string:(t=>pr.create({...t,coerce:!0})),number:(t=>kr.create({...t,coerce:!0})),boolean:(t=>Ir.create({...t,coerce:!0})),bigint:(t=>jr.create({...t,coerce:!0})),date:(t=>Tr.create({...t,coerce:!0}))};E.NEVER=S.INVALID});var Oa=_(lt=>{"use strict";var Eb=lt&&lt.__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]})),vn=lt&&lt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Eb(e,t,r)};Object.defineProperty(lt,"__esModule",{value:!0});vn(Vs(),lt);vn(Ta(),lt);vn(bf(),lt);vn(Nn(),lt);vn(Of(),lt);vn(Us(),lt)});var Na=_(Xe=>{"use strict";var Nf=Xe&&Xe.__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]})),bb=Xe&&Xe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Sb=Xe&&Xe.__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)&&Nf(e,t,r);return bb(e,t),e},Cb=Xe&&Xe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Nf(e,t,r)};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.z=void 0;var Lf=Sb(Oa());Xe.z=Lf;Cb(Oa(),Xe);Xe.default=Lf});var qn=_((Aj,Bf)=>{"use strict";var wb="2.0.0",xb=Number.MAX_SAFE_INTEGER||9007199254740991,$b=16,Ab=250,Fb=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Bf.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:$b,MAX_SAFE_BUILD_LENGTH:Ab,MAX_SAFE_INTEGER:xb,RELEASE_TYPES:Fb,SEMVER_SPEC_VERSION:wb,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Wn=_((Fj,Mf)=>{"use strict";var kb=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Mf.exports=kb});var _n=_((Bt,qf)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:La,MAX_SAFE_BUILD_LENGTH:jb,MAX_LENGTH:Ib}=qn(),Tb=Wn();Bt=qf.exports={};var Rb=Bt.re=[],Pb=Bt.safeRe=[],W=Bt.src=[],Ob=Bt.safeSrc=[],H=Bt.t={},Nb=0,Ba="[a-zA-Z0-9-]",Lb=[["\\s",1],["\\d",Ib],[Ba,jb]],Bb=t=>{for(let[e,r]of Lb)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ie=(t,e,r)=>{let n=Bb(e),s=Nb++;Tb(t,s,e),H[t]=s,W[s]=e,Ob[s]=n,Rb[s]=new RegExp(e,r?"g":void 0),Pb[s]=new RegExp(n,r?"g":void 0)};ie("NUMERICIDENTIFIER","0|[1-9]\\d*");ie("NUMERICIDENTIFIERLOOSE","\\d+");ie("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ba}*`);ie("MAINVERSION",`(${W[H.NUMERICIDENTIFIER]})\\.(${W[H.NUMERICIDENTIFIER]})\\.(${W[H.NUMERICIDENTIFIER]})`);ie("MAINVERSIONLOOSE",`(${W[H.NUMERICIDENTIFIERLOOSE]})\\.(${W[H.NUMERICIDENTIFIERLOOSE]})\\.(${W[H.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASEIDENTIFIER",`(?:${W[H.NONNUMERICIDENTIFIER]}|${W[H.NUMERICIDENTIFIER]})`);ie("PRERELEASEIDENTIFIERLOOSE",`(?:${W[H.NONNUMERICIDENTIFIER]}|${W[H.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASE",`(?:-(${W[H.PRERELEASEIDENTIFIER]}(?:\\.${W[H.PRERELEASEIDENTIFIER]})*))`);ie("PRERELEASELOOSE",`(?:-?(${W[H.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${W[H.PRERELEASEIDENTIFIERLOOSE]})*))`);ie("BUILDIDENTIFIER",`${Ba}+`);ie("BUILD",`(?:\\+(${W[H.BUILDIDENTIFIER]}(?:\\.${W[H.BUILDIDENTIFIER]})*))`);ie("FULLPLAIN",`v?${W[H.MAINVERSION]}${W[H.PRERELEASE]}?${W[H.BUILD]}?`);ie("FULL",`^${W[H.FULLPLAIN]}$`);ie("LOOSEPLAIN",`[v=\\s]*${W[H.MAINVERSIONLOOSE]}${W[H.PRERELEASELOOSE]}?${W[H.BUILD]}?`);ie("LOOSE",`^${W[H.LOOSEPLAIN]}$`);ie("GTLT","((?:<|>)?=?)");ie("XRANGEIDENTIFIERLOOSE",`${W[H.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ie("XRANGEIDENTIFIER",`${W[H.NUMERICIDENTIFIER]}|x|X|\\*`);ie("XRANGEPLAIN",`[v=\\s]*(${W[H.XRANGEIDENTIFIER]})(?:\\.(${W[H.XRANGEIDENTIFIER]})(?:\\.(${W[H.XRANGEIDENTIFIER]})(?:${W[H.PRERELEASE]})?${W[H.BUILD]}?)?)?`);ie("XRANGEPLAINLOOSE",`[v=\\s]*(${W[H.XRANGEIDENTIFIERLOOSE]})(?:\\.(${W[H.XRANGEIDENTIFIERLOOSE]})(?:\\.(${W[H.XRANGEIDENTIFIERLOOSE]})(?:${W[H.PRERELEASELOOSE]})?${W[H.BUILD]}?)?)?`);ie("XRANGE",`^${W[H.GTLT]}\\s*${W[H.XRANGEPLAIN]}$`);ie("XRANGELOOSE",`^${W[H.GTLT]}\\s*${W[H.XRANGEPLAINLOOSE]}$`);ie("COERCEPLAIN",`(^|[^\\d])(\\d{1,${La}})(?:\\.(\\d{1,${La}}))?(?:\\.(\\d{1,${La}}))?`);ie("COERCE",`${W[H.COERCEPLAIN]}(?:$|[^\\d])`);ie("COERCEFULL",W[H.COERCEPLAIN]+`(?:${W[H.PRERELEASE]})?(?:${W[H.BUILD]})?(?:$|[^\\d])`);ie("COERCERTL",W[H.COERCE],!0);ie("COERCERTLFULL",W[H.COERCEFULL],!0);ie("LONETILDE","(?:~>?)");ie("TILDETRIM",`(\\s*)${W[H.LONETILDE]}\\s+`,!0);Bt.tildeTrimReplace="$1~";ie("TILDE",`^${W[H.LONETILDE]}${W[H.XRANGEPLAIN]}$`);ie("TILDELOOSE",`^${W[H.LONETILDE]}${W[H.XRANGEPLAINLOOSE]}$`);ie("LONECARET","(?:\\^)");ie("CARETTRIM",`(\\s*)${W[H.LONECARET]}\\s+`,!0);Bt.caretTrimReplace="$1^";ie("CARET",`^${W[H.LONECARET]}${W[H.XRANGEPLAIN]}$`);ie("CARETLOOSE",`^${W[H.LONECARET]}${W[H.XRANGEPLAINLOOSE]}$`);ie("COMPARATORLOOSE",`^${W[H.GTLT]}\\s*(${W[H.LOOSEPLAIN]})$|^$`);ie("COMPARATOR",`^${W[H.GTLT]}\\s*(${W[H.FULLPLAIN]})$|^$`);ie("COMPARATORTRIM",`(\\s*)${W[H.GTLT]}\\s*(${W[H.LOOSEPLAIN]}|${W[H.XRANGEPLAIN]})`,!0);Bt.comparatorTrimReplace="$1$2$3";ie("HYPHENRANGE",`^\\s*(${W[H.XRANGEPLAIN]})\\s+-\\s+(${W[H.XRANGEPLAIN]})\\s*$`);ie("HYPHENRANGELOOSE",`^\\s*(${W[H.XRANGEPLAINLOOSE]})\\s+-\\s+(${W[H.XRANGEPLAINLOOSE]})\\s*$`);ie("STAR","(<|>)?=?\\s*\\*");ie("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ie("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Js=_((kj,Wf)=>{"use strict";var Mb=Object.freeze({loose:!0}),qb=Object.freeze({}),Wb=t=>t?typeof t!="object"?Mb:t:qb;Wf.exports=Wb});var Ma=_((jj,Uf)=>{"use strict";var Hf=/^[0-9]+$/,Zf=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=Hf.test(t),n=Hf.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Hb=(t,e)=>Zf(e,t);Uf.exports={compareIdentifiers:Zf,rcompareIdentifiers:Hb}});var Ne=_((Ij,Gf)=>{"use strict";var Qs=Wn(),{MAX_LENGTH:Vf,MAX_SAFE_INTEGER:eo}=qn(),{safeRe:to,t:ro}=_n(),Zb=Js(),{compareIdentifiers:qa}=Ma(),Wa=class t{constructor(e,r){if(r=Zb(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>Vf)throw new TypeError(`version is longer than ${Vf} characters`);Qs("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?to[ro.LOOSE]:to[ro.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>eo||this.major<0)throw new TypeError("Invalid major version");if(this.minor>eo||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>eo||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<eo)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(Qs("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(Qs("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(Qs("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?to[ro.PRERELEASELOOSE]:to[ro.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}};Gf.exports=Wa});var Ur=_((Tj,Yf)=>{"use strict";var zf=Ne(),Ub=(t,e,r=!1)=>{if(t instanceof zf)return t;try{return new zf(t,e)}catch(n){if(!r)return null;throw n}};Yf.exports=Ub});var Xf=_((Rj,Kf)=>{"use strict";var Vb=Ur(),Gb=(t,e)=>{let r=Vb(t,e);return r?r.version:null};Kf.exports=Gb});var Qf=_((Pj,Jf)=>{"use strict";var zb=Ur(),Yb=(t,e)=>{let r=zb(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};Jf.exports=Yb});var rh=_((Oj,th)=>{"use strict";var eh=Ne(),Kb=(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}};th.exports=Kb});var oh=_((Nj,sh)=>{"use strict";var nh=Ur(),Xb=(t,e)=>{let r=nh(t,null,!0),n=nh(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"};sh.exports=Xb});var ah=_((Lj,ih)=>{"use strict";var Jb=Ne(),Qb=(t,e)=>new Jb(t,e).major;ih.exports=Qb});var ch=_((Bj,uh)=>{"use strict";var eS=Ne(),tS=(t,e)=>new eS(t,e).minor;uh.exports=tS});var dh=_((Mj,lh)=>{"use strict";var rS=Ne(),nS=(t,e)=>new rS(t,e).patch;lh.exports=nS});var hh=_((qj,fh)=>{"use strict";var sS=Ur(),oS=(t,e)=>{let r=sS(t,e);return r&&r.prerelease.length?r.prerelease:null};fh.exports=oS});var dt=_((Wj,mh)=>{"use strict";var ph=Ne(),iS=(t,e,r)=>new ph(t,r).compare(new ph(e,r));mh.exports=iS});var Dh=_((Hj,gh)=>{"use strict";var aS=dt(),uS=(t,e,r)=>aS(e,t,r);gh.exports=uS});var vh=_((Zj,yh)=>{"use strict";var cS=dt(),lS=(t,e)=>cS(t,e,!0);yh.exports=lS});var no=_((Uj,Eh)=>{"use strict";var _h=Ne(),dS=(t,e,r)=>{let n=new _h(t,r),s=new _h(e,r);return n.compare(s)||n.compareBuild(s)};Eh.exports=dS});var Sh=_((Vj,bh)=>{"use strict";var fS=no(),hS=(t,e)=>t.sort((r,n)=>fS(r,n,e));bh.exports=hS});var wh=_((Gj,Ch)=>{"use strict";var pS=no(),mS=(t,e)=>t.sort((r,n)=>pS(n,r,e));Ch.exports=mS});var Hn=_((zj,xh)=>{"use strict";var gS=dt(),DS=(t,e,r)=>gS(t,e,r)>0;xh.exports=DS});var so=_((Yj,$h)=>{"use strict";var yS=dt(),vS=(t,e,r)=>yS(t,e,r)<0;$h.exports=vS});var Ha=_((Kj,Ah)=>{"use strict";var _S=dt(),ES=(t,e,r)=>_S(t,e,r)===0;Ah.exports=ES});var Za=_((Xj,Fh)=>{"use strict";var bS=dt(),SS=(t,e,r)=>bS(t,e,r)!==0;Fh.exports=SS});var oo=_((Jj,kh)=>{"use strict";var CS=dt(),wS=(t,e,r)=>CS(t,e,r)>=0;kh.exports=wS});var io=_((Qj,jh)=>{"use strict";var xS=dt(),$S=(t,e,r)=>xS(t,e,r)<=0;jh.exports=$S});var Ua=_((e2,Ih)=>{"use strict";var AS=Ha(),FS=Za(),kS=Hn(),jS=oo(),IS=so(),TS=io(),RS=(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 AS(t,r,n);case"!=":return FS(t,r,n);case">":return kS(t,r,n);case">=":return jS(t,r,n);case"<":return IS(t,r,n);case"<=":return TS(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Ih.exports=RS});var Rh=_((t2,Th)=>{"use strict";var PS=Ne(),OS=Ur(),{safeRe:ao,t:uo}=_n(),NS=(t,e)=>{if(t instanceof PS)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?ao[uo.COERCEFULL]:ao[uo.COERCE]);else{let u=e.includePrerelease?ao[uo.COERCERTLFULL]:ao[uo.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 OS(`${n}.${s}.${i}${o}${a}`,e)};Th.exports=NS});var Oh=_((r2,Ph)=>{"use strict";var Va=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}};Ph.exports=Va});var ft=_((n2,Mh)=>{"use strict";var LS=/\s+/g,Ga=class t{constructor(e,r){if(r=MS(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof za)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(LS," "),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=>!Lh(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&&GS(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&&US)|(this.options.loose&&VS))+":"+e,s=Nh.get(n);if(s)return s;let i=this.options.loose,o=i?He[Le.HYPHENRANGELOOSE]:He[Le.HYPHENRANGE];e=e.replace(o,nC(this.options.includePrerelease)),Ee("hyphen replace",e),e=e.replace(He[Le.COMPARATORTRIM],WS),Ee("comparator trim",e),e=e.replace(He[Le.TILDETRIM],HS),Ee("tilde trim",e),e=e.replace(He[Le.CARETTRIM],ZS),Ee("caret trim",e);let a=e.split(" ").map(d=>zS(d,this.options)).join(" ").split(/\s+/).map(d=>rC(d,this.options));i&&(a=a.filter(d=>(Ee("loose invalid filter",d,this.options),!!d.match(He[Le.COMPARATORLOOSE])))),Ee("range list",a);let u=new Map,c=a.map(d=>new za(d,this.options));for(let d of c){if(Lh(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return Nh.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Bh(n,r)&&e.set.some(s=>Bh(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 qS(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(sC(this.set[r],e,this.options))return!0;return!1}};Mh.exports=Ga;var BS=Oh(),Nh=new BS,MS=Js(),za=Zn(),Ee=Wn(),qS=Ne(),{safeRe:He,t:Le,comparatorTrimReplace:WS,tildeTrimReplace:HS,caretTrimReplace:ZS}=_n(),{FLAG_INCLUDE_PRERELEASE:US,FLAG_LOOSE:VS}=qn(),Lh=t=>t.value==="<0.0.0-0",GS=t=>t.value==="",Bh=(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},zS=(t,e)=>(t=t.replace(He[Le.BUILD],""),Ee("comp",t,e),t=XS(t,e),Ee("caret",t),t=YS(t,e),Ee("tildes",t),t=QS(t,e),Ee("xrange",t),t=tC(t,e),Ee("stars",t),t),Ze=t=>!t||t.toLowerCase()==="x"||t==="*",YS=(t,e)=>t.trim().split(/\s+/).map(r=>KS(r,e)).join(" "),KS=(t,e)=>{let r=e.loose?He[Le.TILDELOOSE]:He[Le.TILDE];return t.replace(r,(n,s,i,o,a)=>{Ee("tilde",t,n,s,i,o,a);let u;return Ze(s)?u="":Ze(i)?u=`>=${s}.0.0 <${+s+1}.0.0-0`:Ze(o)?u=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:a?(Ee("replaceTilde pr",a),u=`>=${s}.${i}.${o}-${a} <${s}.${+i+1}.0-0`):u=`>=${s}.${i}.${o} <${s}.${+i+1}.0-0`,Ee("tilde return",u),u})},XS=(t,e)=>t.trim().split(/\s+/).map(r=>JS(r,e)).join(" "),JS=(t,e)=>{Ee("caret",t,e);let r=e.loose?He[Le.CARETLOOSE]:He[Le.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(s,i,o,a,u)=>{Ee("caret",t,s,i,o,a,u);let c;return Ze(i)?c="":Ze(o)?c=`>=${i}.0.0${n} <${+i+1}.0.0-0`:Ze(a)?i==="0"?c=`>=${i}.${o}.0${n} <${i}.${+o+1}.0-0`:c=`>=${i}.${o}.0${n} <${+i+1}.0.0-0`:u?(Ee("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`):(Ee("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`),Ee("caret return",c),c})},QS=(t,e)=>(Ee("replaceXRanges",t,e),t.split(/\s+/).map(r=>eC(r,e)).join(" ")),eC=(t,e)=>{t=t.trim();let r=e.loose?He[Le.XRANGELOOSE]:He[Le.XRANGE];return t.replace(r,(n,s,i,o,a,u)=>{Ee("xRange",t,n,s,i,o,a,u);let c=Ze(i),l=c||Ze(o),d=l||Ze(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`),Ee("xRange return",n),n})},tC=(t,e)=>(Ee("replaceStars",t,e),t.trim().replace(He[Le.STAR],"")),rC=(t,e)=>(Ee("replaceGTE0",t,e),t.trim().replace(He[e.includePrerelease?Le.GTE0PRE:Le.GTE0],"")),nC=t=>(e,r,n,s,i,o,a,u,c,l,d,f)=>(Ze(n)?r="":Ze(s)?r=`>=${n}.0.0${t?"-0":""}`:Ze(i)?r=`>=${n}.${s}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ze(c)?u="":Ze(l)?u=`<${+c+1}.0.0-0`:Ze(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()),sC=(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(Ee(t[n].semver),t[n].semver!==za.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 Zn=_((s2,Vh)=>{"use strict";var Un=Symbol("SemVer ANY"),Xa=class t{static get ANY(){return Un}constructor(e,r){if(r=qh(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Ka("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Un?this.value="":this.value=this.operator+this.semver.version,Ka("comp",this)}parse(e){let r=this.options.loose?Wh[Hh.COMPARATORLOOSE]:Wh[Hh.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 Zh(n[2],this.options.loose):this.semver=Un}toString(){return this.value}test(e){if(Ka("Comparator.test",e,this.options.loose),this.semver===Un||e===Un)return!0;if(typeof e=="string")try{e=new Zh(e,this.options)}catch{return!1}return Ya(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 Uh(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Uh(this.value,r).test(e.semver):(r=qh(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("=")||Ya(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ya(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Vh.exports=Xa;var qh=Js(),{safeRe:Wh,t:Hh}=_n(),Ya=Ua(),Ka=Wn(),Zh=Ne(),Uh=ft()});var Vn=_((o2,Gh)=>{"use strict";var oC=ft(),iC=(t,e,r)=>{try{e=new oC(e,r)}catch{return!1}return e.test(t)};Gh.exports=iC});var Yh=_((i2,zh)=>{"use strict";var aC=ft(),uC=(t,e)=>new aC(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));zh.exports=uC});var Xh=_((a2,Kh)=>{"use strict";var cC=Ne(),lC=ft(),dC=(t,e,r)=>{let n=null,s=null,i=null;try{i=new lC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new cC(n,r))}),n};Kh.exports=dC});var Qh=_((u2,Jh)=>{"use strict";var fC=Ne(),hC=ft(),pC=(t,e,r)=>{let n=null,s=null,i=null;try{i=new hC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new fC(n,r))}),n};Jh.exports=pC});var rp=_((c2,tp)=>{"use strict";var Ja=Ne(),mC=ft(),ep=Hn(),gC=(t,e)=>{t=new mC(t,e);let r=new Ja("0.0.0");if(t.test(r)||(r=new Ja("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 Ja(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};tp.exports=gC});var sp=_((l2,np)=>{"use strict";var DC=ft(),yC=(t,e)=>{try{return new DC(t,e).range||"*"}catch{return null}};np.exports=yC});var co=_((d2,up)=>{"use strict";var vC=Ne(),ap=Zn(),{ANY:_C}=ap,EC=ft(),bC=Vn(),op=Hn(),ip=so(),SC=io(),CC=oo(),wC=(t,e,r,n)=>{t=new vC(t,n),e=new EC(e,n);let s,i,o,a,u;switch(r){case">":s=op,i=SC,o=ip,a=">",u=">=";break;case"<":s=ip,i=CC,o=op,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(bC(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===_C&&(g=new ap(">=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};up.exports=wC});var lp=_((f2,cp)=>{"use strict";var xC=co(),$C=(t,e,r)=>xC(t,e,">",r);cp.exports=$C});var fp=_((h2,dp)=>{"use strict";var AC=co(),FC=(t,e,r)=>AC(t,e,"<",r);dp.exports=FC});var mp=_((p2,pp)=>{"use strict";var hp=ft(),kC=(t,e,r)=>(t=new hp(t,r),e=new hp(e,r),t.intersects(e,r));pp.exports=kC});var Dp=_((m2,gp)=>{"use strict";var jC=Vn(),IC=dt();gp.exports=(t,e,r)=>{let n=[],s=null,i=null,o=t.sort((l,d)=>IC(l,d,r));for(let l of o)jC(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 Sp=_((g2,bp)=>{"use strict";var yp=ft(),eu=Zn(),{ANY:Qa}=eu,Gn=Vn(),tu=dt(),TC=(t,e,r={})=>{if(t===e)return!0;t=new yp(t,r),e=new yp(e,r);let n=!1;e:for(let s of t.set){for(let i of e.set){let o=PC(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},RC=[new eu(">=0.0.0-0")],vp=[new eu(">=0.0.0")],PC=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Qa){if(e.length===1&&e[0].semver===Qa)return!0;r.includePrerelease?t=RC:t=vp}if(e.length===1&&e[0].semver===Qa){if(r.includePrerelease)return!0;e=vp}let n=new Set,s,i;for(let g of t)g.operator===">"||g.operator===">="?s=_p(s,g,r):g.operator==="<"||g.operator==="<="?i=Ep(i,g,r):n.add(g.semver);if(n.size>1)return null;let o;if(s&&i){if(o=tu(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&&!Gn(g,String(s),r)||i&&!Gn(g,String(i),r))return null;for(let m of e)if(!Gn(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=_p(s,g,r),a===g&&a!==s)return!1}else if(s.operator===">="&&!Gn(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=Ep(i,g,r),u===g&&u!==i)return!1}else if(i.operator==="<="&&!Gn(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)},_p=(t,e,r)=>{if(!t)return e;let n=tu(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Ep=(t,e,r)=>{if(!t)return e;let n=tu(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};bp.exports=TC});var $p=_((D2,xp)=>{"use strict";var ru=_n(),Cp=qn(),OC=Ne(),wp=Ma(),NC=Ur(),LC=Xf(),BC=Qf(),MC=rh(),qC=oh(),WC=ah(),HC=ch(),ZC=dh(),UC=hh(),VC=dt(),GC=Dh(),zC=vh(),YC=no(),KC=Sh(),XC=wh(),JC=Hn(),QC=so(),ew=Ha(),tw=Za(),rw=oo(),nw=io(),sw=Ua(),ow=Rh(),iw=Zn(),aw=ft(),uw=Vn(),cw=Yh(),lw=Xh(),dw=Qh(),fw=rp(),hw=sp(),pw=co(),mw=lp(),gw=fp(),Dw=mp(),yw=Dp(),vw=Sp();xp.exports={parse:NC,valid:LC,clean:BC,inc:MC,diff:qC,major:WC,minor:HC,patch:ZC,prerelease:UC,compare:VC,rcompare:GC,compareLoose:zC,compareBuild:YC,sort:KC,rsort:XC,gt:JC,lt:QC,eq:ew,neq:tw,gte:rw,lte:nw,cmp:sw,coerce:ow,Comparator:iw,Range:aw,satisfies:uw,toComparators:cw,maxSatisfying:lw,minSatisfying:dw,minVersion:fw,validRange:hw,outside:pw,gtr:mw,ltr:gw,intersects:Dw,simplifyRange:yw,subset:vw,SemVer:OC,re:ru.re,src:ru.src,tokens:ru.t,SEMVER_SPEC_VERSION:Cp.SEMVER_SPEC_VERSION,RELEASE_TYPES:Cp.RELEASE_TYPES,compareIdentifiers:wp.compareIdentifiers,rcompareIdentifiers:wp.rcompareIdentifiers}});var Kt=_(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});var _w=(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(R){if(R=i.postProcess(R,n),s){setTimeout(function(){s(R)},0);return}else return R},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,C=1/0,b=function(){for(var R=Math.max(h,-l);R<=Math.min(C,l);R+=2){var q=void 0,j=m[R-1],P=m[R+1];j&&(m[R-1]=void 0);var k=!1;if(P){var M=P.oldPos-R;k=P&&0<=M&&M<u}var re=j&&j.oldPos+1<c;if(!k&&!re){m[R]=void 0;continue}if(!re||k&&j.oldPos<P.oldPos?q=i.addToPath(P,!0,!1,0,n):q=i.addToPath(j,!1,!0,1,n),D=i.extractCommon(q,r,e,R,n),q.oldPos+1>=c&&D+1>=u)return a(i.buildValues(q.lastComponent,r,e))||!0;m[R]=q,q.oldPos+1>=c&&(C=Math.min(C,R-1)),D+1>=u&&(h=Math.max(h,R+1))}l++};if(s)(function R(){setTimeout(function(){if(l>d||Date.now()>g)return s(void 0);b()||R()},0)})();else for(;l<=d&&Date.now()<=g;){var I=b();if(I)return I}},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})();nu.default=_w});var Ap=_(Dr=>{"use strict";var Ew=Dr&&Dr.__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(Dr,"__esModule",{value:!0});Dr.characterDiff=void 0;Dr.diffChars=Cw;var bw=Kt(),Sw=(function(t){Ew(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(bw.default);Dr.characterDiff=new Sw;function Cw(t,e,r){return Dr.characterDiff.diff(t,e,r)}});var ou=_(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.longestCommonPrefix=ww;Ue.longestCommonSuffix=xw;Ue.replacePrefix=Fp;Ue.replaceSuffix=kp;Ue.removePrefix=$w;Ue.removeSuffix=Aw;Ue.maximumOverlap=Fw;Ue.hasOnlyWinLineEndings=jw;Ue.hasOnlyUnixLineEndings=Iw;Ue.segment=jp;Ue.trailingWs=Ip;Ue.leadingWs=Tp;Ue.leadingAndTrailingWs=su;function ww(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 xw(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 Fp(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 kp(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 $w(t,e){return Fp(t,e,"")}function Aw(t,e){return kp(t,e,"")}function Fw(t,e){return e.slice(0,kw(t,e))}function kw(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 jw(t){return t.includes(`\r
3
+ var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var zt=v((cF,Ec)=>{var UD=require("crypto"),nt=require("fs"),sn=require("path");function _c(t,e,r={}){let{encoding:n="utf8",mode:s}=r,i=sn.dirname(t);nt.mkdirSync(i,{recursive:!0});let o=sn.join(i,`.${sn.basename(t)}.tmp-${process.pid}-${UD.randomBytes(8).toString("hex")}`),a;try{a=nt.openSync(o,"wx",s??420),nt.writeSync(a,e,0,n),nt.fsyncSync(a),nt.closeSync(a),a=null,nt.renameSync(o,t)}catch(u){if(a!=null)try{nt.closeSync(a)}catch{}try{nt.unlinkSync(o)}catch{}throw u}}function VD(t,e,r={}){let n=JSON.stringify(e,null,2)+`
4
+ `;_c(t,n,r)}function GD(t,e){let r;try{r=nt.lstatSync(t)}catch(o){return o.code==="ENOENT"?{ok:!0,reason:"missing"}:{ok:!1,reason:`lstat: ${o.message}`}}if(r.isSymbolicLink())try{return nt.unlinkSync(t),{ok:!0,reason:"symlink-unlinked"}}catch(o){return{ok:!1,reason:`unlink: ${o.message}`}}let n;try{n=nt.realpathSync(e)}catch{n=sn.resolve(e)}let s;try{s=nt.realpathSync(t)}catch(o){return{ok:!1,reason:`realpath: ${o.message}`}}let i=sn.relative(n,s);if(i.startsWith("..")||sn.isAbsolute(i))return{ok:!1,reason:"outside-root"};try{return nt.rmSync(s,{recursive:!0,force:!0}),{ok:!0}}catch(o){return{ok:!1,reason:`rmSync: ${o.message}`}}}Ec.exports={writeFileAtomic:_c,writeJsonAtomic:VD,safeRmSync:GD}});var An=v((lF,Sc)=>{"use strict";var zD=require("os");function YD(){return process.env.HOME||zD.homedir()}Sc.exports={homedir:YD}});var kn=v((dF,Uo)=>{var Ds=process||{},bc=Ds.argv||[],gs=Ds.env||{},JD=!(gs.NO_COLOR||bc.includes("--no-color"))&&(!!gs.FORCE_COLOR||bc.includes("--color")||Ds.platform==="win32"||(Ds.stdout||{}).isTTY&&gs.TERM!=="dumb"||!!gs.CI),XD=(t,e,r=t)=>n=>{let s=""+n,i=s.indexOf(e,t.length);return~i?t+KD(s,e,r,i)+e:t+s+e},KD=(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)},Cc=(t=JD)=>{let e=t?XD:()=>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")}};Uo.exports=Cc();Uo.exports.createColors=Cc});var $c=v(ar=>{"use strict";var wc=ar&&ar.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ar,"__esModule",{value:!0});ar.symbols=ar.isTTY=void 0;var QD=wc(require("node:tty")),Tt=wc(require("node:process")),ey=Tt.default.env.CI||Tt.default.env.WT_SESSION||Tt.default.env.ConEmuTask==="{cmd::Cmder}"||Tt.default.env.TERM_PROGRAM==="vscode"||Tt.default.env.TERM==="xterm-256color"||Tt.default.env.TERM==="alacritty",xc=QD.default.isatty(1)&&Tt.default.env.TERM!=="dumb"&&!("CI"in Tt.default.env);ar.isTTY=xc;var Fn=Tt.default.platform!=="win32"?Tt.default.env.TERM!=="linux":ey,ty={frames:xc?Fn?["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]:["-","\\","|","/"]:["-"],tick:Fn?"\u2714":"\u221A",cross:Fn?"\u2716":"\xD7",warn:Fn?"\u26A0":"!!",info:Fn?"\u2139":"i"};ar.symbols=ty});var kc=v(jn=>{"use strict";var ry=jn&&jn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jn,"__esModule",{value:!0});jn.createSpinner=sy;var Ac=ry(kn()),Rt=$c();function ny(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 sy(t="",e={}){let r=0,n=e.interval||50,s=e.stream||process.stderr,i=e.frames&&e.frames.length?e.frames:Rt.symbols.frames,o=e.color||"yellow",a=!1,u=0,c,l=(S={})=>typeof S=="string"?S:S.text||t,d=(S={})=>typeof S=="string"?!1:!!S.update,f=(S={})=>typeof S=="string"||!S.color?o:S.color,g=(S={},I)=>typeof S=="string"||!S.mark?I:S.mark,m=()=>{process.on("SIGINT",C),process.on("SIGTERM",C)},y=()=>{process.off("SIGINT",C),process.off("SIGTERM",C)},p={reset(){return r=0,u=0,a=!1,clearTimeout(c),c=void 0,p},clear(){p.write("\x1B[1G");for(let S=0;S<u;S++)S>0&&p.write("\x1B[1A"),p.write("\x1B[2K\x1B[1G");return u=0,p},write(S,I=!1){return I&&Rt.isTTY&&p.clear(),s.write(S),p},render(){let S=`${Ac.default[o](i[r])} ${t}`;return Rt.isTTY?p.write("\x1B[?25l"):S+=`
6
+ `,p.write(S,!0),Rt.isTTY&&(u=ny(S,s.columns)),p},spin(){return p.render(),r=++r%i.length,p},update(S){return typeof S=="string"?t=S:(t=S.text||t,i=S.frames&&S.frames.length?S.frames:i,n=S.interval||n,o=S.color||o),i.length-1<r&&(r=0),p},loop(){return Rt.isTTY&&(c=setTimeout(()=>p.loop(),n)),p.spin()},start(S={}){return c&&p.reset(),a=!0,m(),p.update({text:l(S),color:f(S)}).loop()},stop(S){a=!1,clearTimeout(c),c=void 0,y();let I=d(S),P=Ac.default[f(S)](g(S,i[r])),W=l(S);return p.write(S?`${P} ${W}${I?"":`
7
+ `}`:"",!0),Rt.isTTY&&!I?p.write("\x1B[?25h"):p},success(S={}){return p.stop({text:l(S),mark:g(S,Rt.symbols.tick),color:"green",update:d(S)})},error(S={}){return p.stop({text:l(S),mark:g(S,Rt.symbols.cross),color:"red",update:d(S)})},warn(S={}){return p.stop({text:l(S),mark:g(S,Rt.symbols.warn),color:"yellow",update:d(S)})},info(S={}){return p.stop({text:l(S),mark:g(S,Rt.symbols.info),color:"blue",update:d(S)})},isSpinning(){return a}};function C(S){a&&p.stop(),process.exit(S==="SIGINT"?130:S==="SIGTERM"?143:1)}return p}});var Fc=v(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.splitWhen=on.flatten=void 0;function oy(t){return t.reduce((e,r)=>[].concat(e,r),[])}on.flatten=oy;function iy(t,e){let r=[[]],n=0;for(let s of t)e(s)?(n++,r[n]=[]):r[n].push(s);return r}on.splitWhen=iy});var jc=v(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.isEnoentCodeError=void 0;function ay(t){return t.code==="ENOENT"}ys.isEnoentCodeError=ay});var Ic=v(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.createDirentFromStats=void 0;var Vo=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 uy(t,e){return new Vo(t,e)}vs.createDirentFromStats=uy});var Oc=v(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.convertPosixPathToPattern=Ae.convertWindowsPathToPattern=Ae.convertPathToPattern=Ae.escapePosixPath=Ae.escapeWindowsPath=Ae.escape=Ae.removeLeadingDotSegment=Ae.makeAbsolute=Ae.unixify=void 0;var cy=require("os"),ly=require("path"),Tc=cy.platform()==="win32",dy=2,fy=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,hy=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,py=/^\\\\([.?])/,my=/\\(?![!()+@[\]{}])/g;function gy(t){return t.replace(/\\/g,"/")}Ae.unixify=gy;function Dy(t,e){return ly.resolve(t,e)}Ae.makeAbsolute=Dy;function yy(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(dy)}return t}Ae.removeLeadingDotSegment=yy;Ae.escape=Tc?Go:zo;function Go(t){return t.replace(hy,"\\$2")}Ae.escapeWindowsPath=Go;function zo(t){return t.replace(fy,"\\$2")}Ae.escapePosixPath=zo;Ae.convertPathToPattern=Tc?Rc:Pc;function Rc(t){return Go(t).replace(py,"//$1").replace(my,"/")}Ae.convertWindowsPathToPattern=Rc;function Pc(t){return zo(t)}Ae.convertPosixPathToPattern=Pc});var Lc=v((yF,Nc)=>{Nc.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 qc=v((vF,Mc)=>{var vy=Lc(),Bc={"{":"}","(":")","[":"]"},_y=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=Bc[a];if(u){var c=t.indexOf(u,e);c!==-1&&(e=c+1)}if(t[e]==="!")return!0}else e++}return!1},Ey=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=Bc[r];if(n){var s=t.indexOf(n,e);s!==-1&&(e=s+1)}if(t[e]==="!")return!0}else e++}return!1};Mc.exports=function(e,r){if(typeof e!="string"||e==="")return!1;if(vy(e))return!0;var n=_y;return r&&r.strict===!1&&(n=Ey),n(e)}});var Hc=v((_F,Wc)=>{"use strict";var Sy=qc(),by=require("path").posix.dirname,Cy=require("os").platform()==="win32",Yo="/",wy=/\\/g,xy=/[\{\[].*[\}\]]$/,$y=/(^|[^\\])([\{\[]|\([^\)]+$)/,Ay=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Wc.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Cy&&e.indexOf(Yo)<0&&(e=e.replace(wy,Yo)),xy.test(e)&&(e+=Yo),e+="a";do e=by(e);while(Sy(e)||$y.test(e));return e.replace(Ay,"$1")}});var _s=v(ut=>{"use strict";ut.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;ut.find=(t,e)=>t.nodes.find(r=>r.type===e);ut.exceedsLimit=(t,e,r=1,n)=>n===!1||!ut.isInteger(t)||!ut.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;ut.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)};ut.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;ut.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;ut.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;ut.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);ut.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 Es=v((SF,Uc)=>{"use strict";var Zc=_s();Uc.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&Zc.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(i||o)&&Zc.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 Gc=v((bF,Vc)=>{"use strict";Vc.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var rl=v((CF,tl)=>{"use strict";var zc=Gc(),Ar=(t,e,r)=>{if(zc(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(zc(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(Ar.cache.hasOwnProperty(u))return Ar.cache[u].result;let c=Math.min(t,e),l=Math.max(t,e);if(Math.abs(c-l)===1){let y=t+"|"+e;return n.capture?`(${y})`:n.wrap===!1?y:`(?:${y})`}let d=el(t)||el(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 y=l<0?Math.abs(l):1;m=Yc(y,Math.abs(c),f,n),c=f.a=0}return l>=0&&(g=Yc(c,l,f,n)),f.negatives=m,f.positives=g,f.result=ky(m,g,n),n.capture===!0?f.result=`(${f.result})`:n.wrap!==!1&&g.length+m.length>1&&(f.result=`(?:${f.result})`),Ar.cache[u]=f,f.result};function ky(t,e,r){let n=Jo(t,e,"-",!1,r)||[],s=Jo(e,t,"",!1,r)||[],i=Jo(t,e,"-?",!0,r)||[];return n.concat(i).concat(s).join("|")}function Fy(t,e){let r=1,n=1,s=Xc(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=Xc(t,r);for(s=Kc(e+1,n)-1;t<s&&s<=e;)i.add(s),n+=1,s=Kc(e+1,n)-1;return i=[...i],i.sort(Ty),i}function jy(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=Iy(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+=Ry(u,c,r):o++}return o&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[o],digits:s}}function Yc(t,e,r,n){let s=Fy(t,e),i=[],o=t,a;for(let u=0;u<s.length;u++){let c=s[u],l=jy(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+Qc(a.count),o=c+1;continue}r.isPadded&&(d=Py(c,r,n)),l.string=d+l.pattern+Qc(l.count),i.push(l),o=c+1,a=l}return i}function Jo(t,e,r,n,s){let i=[];for(let o of t){let{string:a}=o;!n&&!Jc(e,"string",a)&&i.push(r+a),n&&Jc(e,"string",a)&&i.push(r+a)}return i}function Iy(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function Ty(t,e){return t>e?1:e>t?-1:0}function Jc(t,e,r){return t.some(n=>n[e]===r)}function Xc(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function Kc(t,e){return t-t%Math.pow(10,e)}function Qc(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function Ry(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function el(t){return/^-?(0+)\d/.test(t)}function Py(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}}`}}Ar.cache={};Ar.clearCache=()=>Ar.cache={};tl.exports=Ar});var Qo=v((wF,cl)=>{"use strict";var Oy=require("util"),sl=rl(),nl=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Ny=t=>e=>t===!0?Number(e):String(e),Xo=t=>typeof t=="number"||typeof t=="string"&&t!=="",In=t=>Number.isInteger(+t),Ko=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},Ly=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,By=(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},bs=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},My=(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=>bs(String(a),r)).join("|")),t.negatives.length&&(i=`-(${n}${t.negatives.map(a=>bs(String(a),r)).join("|")})`),s&&i?o=`${s}|${i}`:o=s||i,e.wrap?`(${n}${o})`:o},ol=(t,e,r,n)=>{if(r)return sl(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return`[${s}-${i}]`},il=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return sl(t,e,r)},al=(...t)=>new RangeError("Invalid range arguments: "+Oy.inspect(...t)),ul=(t,e,r)=>{if(r.strictRanges===!0)throw al([t,e]);return[]},qy=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},Wy=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw al([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=Ko(a)||Ko(u)||Ko(c),d=l?Math.max(a.length,u.length,c.length):0,f=l===!1&&Ly(t,e,n)===!1,g=n.transform||Ny(f);if(n.toRegex&&r===1)return ol(bs(t,d),bs(e,d),!0,n);let m={negatives:[],positives:[]},y=S=>m[S<0?"negatives":"positives"].push(Math.abs(S)),p=[],C=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?y(s):p.push(By(g(s,C),d,f)),s=o?s-r:s+r,C++;return n.toRegex===!0?r>1?My(m,n,d):il(p,null,{wrap:!1,...n}):p},Hy=(t,e,r=1,n={})=>{if(!In(t)&&t.length>1||!In(e)&&e.length>1)return ul(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 ol(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?il(l,null,{wrap:!1,options:n}):l},Ss=(t,e,r,n={})=>{if(e==null&&Xo(t))return[t];if(!Xo(t)||!Xo(e))return ul(t,e,n);if(typeof r=="function")return Ss(t,e,1,{transform:r});if(nl(r))return Ss(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,In(r)?In(t)&&In(e)?Wy(t,e,r,s):Hy(t,e,Math.max(Math.abs(r),1),s):r!=null&&!nl(r)?qy(r,s):Ss(t,e,1,r)};cl.exports=Ss});var fl=v((xF,dl)=>{"use strict";var Zy=Qo(),ll=_s(),Uy=(t,e={})=>{let r=(n,s={})=>{let i=ll.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=ll.reduce(n.nodes),d=Zy(...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)};dl.exports=Uy});var ml=v(($F,pl)=>{"use strict";var Vy=Qo(),hl=Es(),an=_s(),kr=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?an.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(kr(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?kr(s,i,r):s+i);return an.flatten(n)},Gy=(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(kr(a.pop(),hl(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){a.push(kr(a.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let d=an.reduce(s.nodes);if(an.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=Vy(...d,e);f.length===0&&(f=hl(s,e)),a.push(kr(a.pop(),f)),s.nodes=[];return}let u=an.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(kr(a.pop(),c,u));continue}if(f.value&&f.type!=="open"){c.push(kr(c.pop(),f.value));continue}f.nodes&&n(f,s)}return c};return an.flatten(n(t))};pl.exports=Gy});var Dl=v((AF,gl)=>{"use strict";gl.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 Sl=v((kF,El)=>{"use strict";var zy=Es(),{MAX_LENGTH:yl,CHAR_BACKSLASH:ei,CHAR_BACKTICK:Yy,CHAR_COMMA:Jy,CHAR_DOT:Xy,CHAR_LEFT_PARENTHESES:Ky,CHAR_RIGHT_PARENTHESES:Qy,CHAR_LEFT_CURLY_BRACE:ev,CHAR_RIGHT_CURLY_BRACE:tv,CHAR_LEFT_SQUARE_BRACKET:vl,CHAR_RIGHT_SQUARE_BRACKET:_l,CHAR_DOUBLE_QUOTE:rv,CHAR_SINGLE_QUOTE:nv,CHAR_NO_BREAK_SPACE:sv,CHAR_ZERO_WIDTH_NOBREAK_SPACE:ov}=Dl(),iv=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(yl,r.maxLength):yl;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=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<c;)if(o=i[i.length-1],f=g(),!(f===ov||f===sv)){if(f===ei){m({type:"text",value:(e.keepEscaping?f:"")+g()});continue}if(f===_l){m({type:"text",value:"\\"+f});continue}if(f===vl){u++;let y;for(;l<c&&(y=g());){if(f+=y,y===vl){u++;continue}if(y===ei){f+=g();continue}if(y===_l&&(u--,u===0))break}m({type:"text",value:f});continue}if(f===Ky){o=m({type:"paren",nodes:[]}),i.push(o),m({type:"text",value:f});continue}if(f===Qy){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===rv||f===nv||f===Yy){let y=f,p;for(e.keepQuotes!==!0&&(f="");l<c&&(p=g());){if(p===ei){f+=p+g();continue}if(p===y){e.keepQuotes===!0&&(f+=p);break}f+=p}m({type:"text",value:f});continue}if(f===ev){d++;let p={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(p),i.push(o),m({type:"open",value:f});continue}if(f===tv){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===Jy&&d>0){if(o.ranges>0){o.ranges=0;let y=o.nodes.shift();o.nodes=[y,{type:"text",value:zy(o)}]}m({type:"comma",value:f}),o.commas++;continue}if(f===Xy&&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 p=y[y.length-1];p.value+=a.value+f,a=p,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(C=>{C.nodes||(C.type==="open"&&(C.isOpen=!0),C.type==="close"&&(C.isClose=!0),C.nodes||(C.type="text"),C.invalid=!0)});let y=i[i.length-1],p=y.nodes.indexOf(o);y.nodes.splice(p,1,...o.nodes)}while(i.length>0);return m({type:"eos"}),s};El.exports=iv});var wl=v((FF,Cl)=>{"use strict";var bl=Es(),av=fl(),uv=ml(),cv=Sl(),st=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=st.create(n,e);Array.isArray(s)?r.push(...s):r.push(s)}else r=[].concat(st.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};st.parse=(t,e={})=>cv(t,e);st.stringify=(t,e={})=>bl(typeof t=="string"?st.parse(t,e):t,e);st.compile=(t,e={})=>(typeof t=="string"&&(t=st.parse(t,e)),av(t,e));st.expand=(t,e={})=>{typeof t=="string"&&(t=st.parse(t,e));let r=uv(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};st.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?st.compile(t,e):st.expand(t,e);Cl.exports=st});var Tn=v((jF,Fl)=>{"use strict";var lv=require("path"),Pt="\\\\/",xl=`[^${Pt}]`,dv=0,Yt="\\.",fv="\\+",hv="\\?",Cs="\\/",pv="(?=.)",$l="[^/]",ti=`(?:${Cs}|$)`,Al=`(?:^|${Cs})`,ri=`${Yt}{1,2}${ti}`,mv=`(?!${Yt})`,gv=`(?!${Al}${ri})`,Dv=`(?!${Yt}{0,1}${ti})`,yv=`(?!${ri})`,vv=`[^.${Cs}]`,_v=`${$l}*?`,kl={DOT_LITERAL:Yt,PLUS_LITERAL:fv,QMARK_LITERAL:hv,SLASH_LITERAL:Cs,ONE_CHAR:pv,QMARK:$l,END_ANCHOR:ti,DOTS_SLASH:ri,NO_DOT:mv,NO_DOTS:gv,NO_DOT_SLASH:Dv,NO_DOTS_SLASH:yv,QMARK_NO_DOT:vv,STAR:_v,START_ANCHOR:Al},Ev={...kl,SLASH_LITERAL:`[${Pt}]`,QMARK:xl,STAR:`${xl}*?`,DOTS_SLASH:`${Yt}{1,2}(?:[${Pt}]|$)`,NO_DOT:`(?!${Yt})`,NO_DOTS:`(?!(?:^|[${Pt}])${Yt}{1,2}(?:[${Pt}]|$))`,NO_DOT_SLASH:`(?!${Yt}{0,1}(?:[${Pt}]|$))`,NO_DOTS_SLASH:`(?!${Yt}{1,2}(?:[${Pt}]|$))`,QMARK_NO_DOT:`[^.${Pt}]`,START_ANCHOR:`(?:^|[${Pt}])`,END_ANCHOR:`(?:[${Pt}]|$)`},Sv={__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"};Fl.exports={DEFAULT_MAX_EXTGLOB_RECURSION:dv,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Sv,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:lv.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?Ev:kl}}});var Rn=v(Ye=>{"use strict";var bv=require("path"),Cv=process.platform==="win32",{REGEX_BACKSLASH:wv,REGEX_REMOVE_BACKSLASH:xv,REGEX_SPECIAL_CHARS:$v,REGEX_SPECIAL_CHARS_GLOBAL:Av}=Tn();Ye.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Ye.hasRegexChars=t=>$v.test(t);Ye.isRegexChar=t=>t.length===1&&Ye.hasRegexChars(t);Ye.escapeRegex=t=>t.replace(Av,"\\$1");Ye.toPosixSlashes=t=>t.replace(wv,"/");Ye.removeBackslashes=t=>t.replace(xv,e=>e==="\\"?"":e);Ye.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Ye.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:Cv===!0||bv.sep==="\\";Ye.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Ye.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Ye.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Ye.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var Ll=v((TF,Nl)=>{"use strict";var jl=Rn(),{CHAR_ASTERISK:ni,CHAR_AT:kv,CHAR_BACKWARD_SLASH:Pn,CHAR_COMMA:Fv,CHAR_DOT:si,CHAR_EXCLAMATION_MARK:oi,CHAR_FORWARD_SLASH:Ol,CHAR_LEFT_CURLY_BRACE:ii,CHAR_LEFT_PARENTHESES:ai,CHAR_LEFT_SQUARE_BRACKET:jv,CHAR_PLUS:Iv,CHAR_QUESTION_MARK:Il,CHAR_RIGHT_CURLY_BRACE:Tv,CHAR_RIGHT_PARENTHESES:Tl,CHAR_RIGHT_SQUARE_BRACKET:Rv}=Tn(),Rl=t=>t===Ol||t===Pn,Pl=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Pv=(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,y=!1,p=!1,C=!1,S=!1,I=!1,P=!1,W=!1,F=0,R,j,M={value:"",depth:0,isGlob:!1},re=()=>c>=n,$=()=>u.charCodeAt(c+1),ae=()=>(R=j,u.charCodeAt(++c));for(;c<n;){j=ae();let fe;if(j===Pn){S=M.backslashes=!0,j=ae(),j===ii&&(C=!0);continue}if(C===!0||j===ii){for(F++;re()!==!0&&(j=ae());){if(j===Pn){S=M.backslashes=!0,ae();continue}if(j===ii){F++;continue}if(C!==!0&&j===si&&(j=ae())===si){if(f=M.isBrace=!0,m=M.isGlob=!0,W=!0,s===!0)continue;break}if(C!==!0&&j===Fv){if(f=M.isBrace=!0,m=M.isGlob=!0,W=!0,s===!0)continue;break}if(j===Tv&&(F--,F===0)){C=!1,f=M.isBrace=!0,W=!0;break}}if(s===!0)continue;break}if(j===Ol){if(i.push(c),o.push(M),M={value:"",depth:0,isGlob:!1},W===!0)continue;if(R===si&&c===l+1){l+=2;continue}d=c+1;continue}if(r.noext!==!0&&(j===Iv||j===kv||j===ni||j===Il||j===oi)===!0&&$()===ai){if(m=M.isGlob=!0,y=M.isExtglob=!0,W=!0,j===oi&&c===l&&(P=!0),s===!0){for(;re()!==!0&&(j=ae());){if(j===Pn){S=M.backslashes=!0,j=ae();continue}if(j===Tl){m=M.isGlob=!0,W=!0;break}}continue}break}if(j===ni){if(R===ni&&(p=M.isGlobstar=!0),m=M.isGlob=!0,W=!0,s===!0)continue;break}if(j===Il){if(m=M.isGlob=!0,W=!0,s===!0)continue;break}if(j===jv){for(;re()!==!0&&(fe=ae());){if(fe===Pn){S=M.backslashes=!0,ae();continue}if(fe===Rv){g=M.isBracket=!0,m=M.isGlob=!0,W=!0;break}}if(s===!0)continue;break}if(r.nonegate!==!0&&j===oi&&c===l){I=M.negated=!0,l++;continue}if(r.noparen!==!0&&j===ai){if(m=M.isGlob=!0,s===!0){for(;re()!==!0&&(j=ae());){if(j===ai){S=M.backslashes=!0,j=ae();continue}if(j===Tl){W=!0;break}}continue}break}if(m===!0){if(W=!0,s===!0)continue;break}}r.noext===!0&&(y=!1,m=!1);let X=u,ne="",x="";l>0&&(ne=u.slice(0,l),u=u.slice(l),d-=l),X&&m===!0&&d>0?(X=u.slice(0,d),x=u.slice(d)):m===!0?(X="",x=u):X=u,X&&X!==""&&X!=="/"&&X!==u&&Rl(X.charCodeAt(X.length-1))&&(X=X.slice(0,-1)),r.unescape===!0&&(x&&(x=jl.removeBackslashes(x)),X&&S===!0&&(X=jl.removeBackslashes(X)));let A={prefix:ne,input:t,start:l,base:X,glob:x,isBrace:f,isBracket:g,isGlob:m,isExtglob:y,isGlobstar:p,negated:I,negatedExtglob:P};if(r.tokens===!0&&(A.maxDepth=0,Rl(j)||o.push(M),A.tokens=o),r.parts===!0||r.tokens===!0){let fe;for(let se=0;se<i.length;se++){let be=fe?fe+1:l,rt=i[se],Ie=t.slice(be,rt);r.tokens&&(se===0&&l!==0?(o[se].isPrefix=!0,o[se].value=ne):o[se].value=Ie,Pl(o[se]),A.maxDepth+=o[se].depth),(se!==0||Ie!=="")&&a.push(Ie),fe=rt}if(fe&&fe+1<t.length){let se=t.slice(fe+1);a.push(se),r.tokens&&(o[o.length-1].value=se,Pl(o[o.length-1]),A.maxDepth+=o[o.length-1].depth)}A.slashes=i,A.parts=a}return A};Nl.exports=Pv});var Hl=v((RF,Wl)=>{"use strict";var On=Tn(),Te=Rn(),{MAX_LENGTH:ws,POSIX_REGEX_SOURCE:Ov,REGEX_NON_SPECIAL_CHARS:Nv,REGEX_SPECIAL_CHARS_BACKREF:Lv,REPLACEMENTS:Bl}=On,Bv=(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=>Te.escapeRegex(s)).join("..")}return r},un=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Ml=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},Mv=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},ql=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Mv(e))return e.replace(/\\(.)/g,"$1")},qv=t=>{let e=t.map(ql).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},ui=(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}}}}},Wv=t=>{let e=0,r=[];for(;e<t.length;){let s=ui(t.slice(e),!1);if(!s||s.type!=="*")return;let i=Ml(s.body).map(a=>a.trim());if(i.length!==1)return;let o=ql(i[0]);if(!o||o.length!==1)return;r.push(o),e+=s.end+1}return r.length<1?void 0:`${r.length===1?Te.escapeRegex(r[0]):`[${r.map(s=>Te.escapeRegex(s)).join("")}]`}*`},Hv=t=>{let e=0,r=t.trim(),n=ui(r);for(;n;)e++,r=n.body.trim(),n=ui(r);return e},Zv=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:On.DEFAULT_MAX_EXTGLOB_RECURSION,n=Ml(t).map(s=>s.trim());if(n.length>1&&(n.some(s=>s==="")||n.some(s=>/^[*?]+$/.test(s))||qv(n)))return{risky:!0};for(let s of n){let i=Wv(s);if(i)return{risky:!0,safeOutput:i};if(Hv(s)>r)return{risky:!0}}return{risky:!1}},ci=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Bl[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(ws,r.maxLength):ws,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=Te.isWindows(e),c=On.globChars(u),l=On.extglobChars(c),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:y,NO_DOT:p,NO_DOT_SLASH:C,NO_DOTS_SLASH:S,QMARK:I,QMARK_NO_DOT:P,STAR:W,START_ANCHOR:F}=c,R=B=>`(${a}(?:(?!${F}${B.dot?y:d}).)*?)`,j=r.dot?"":p,M=r.dot?I:P,re=r.bash===!0?R(r):W;r.capture&&(re=`(${re})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let $={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=Te.removePrefix(t,$),s=t.length;let ae=[],X=[],ne=[],x=i,A,fe=()=>$.index===s-1,se=$.peek=(B=1)=>t[$.index+B],be=$.advance=()=>t[++$.index]||"",rt=()=>t.slice($.index+1),Ie=(B="",k=0)=>{$.consumed+=B,$.index+=k},vt=B=>{$.output+=B.output!=null?B.output:B.value,Ie(B.value)},sr=()=>{let B=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)be(),$.start++,B++;return B%2===0?!1:($.negated=!0,$.start++,!0)},$r=B=>{$[B]++,ne.push(B)},_t=B=>{$[B]--,ne.pop()},oe=B=>{if(x.type==="globstar"){let k=$.braces>0&&(B.type==="comma"||B.type==="brace"),w=B.extglob===!0||ae.length&&(B.type==="pipe"||B.type==="paren");B.type!=="slash"&&B.type!=="paren"&&!k&&!w&&($.output=$.output.slice(0,-x.output.length),x.type="star",x.value="*",x.output=re,$.output+=x.output)}if(ae.length&&B.type!=="paren"&&(ae[ae.length-1].inner+=B.value),(B.value||B.output)&&vt(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},nn=(B,k)=>{let w={...l[k],conditions:1,inner:""};w.prev=x,w.parens=$.parens,w.output=$.output,w.startIndex=$.index,w.tokensIndex=o.length;let T=(r.capture?"(":"")+w.open;$r("parens"),oe({type:B,value:k,output:$.output?"":m}),oe({type:"paren",extglob:!0,value:be(),output:T}),ae.push(w)},Zo=B=>{let k=t.slice(B.startIndex,$.index+1),w=t.slice(B.startIndex+2,$.index),T=Zv(w,r);if((B.type==="plus"||B.type==="star")&&T.risky){let Q=T.safeOutput?(B.output?"":m)+(r.capture?`(${T.safeOutput})`:T.safeOutput):void 0,pe=o[B.tokensIndex];pe.type="text",pe.value=k,pe.output=Q||Te.escapeRegex(k);for(let De=B.tokensIndex+1;De<o.length;De++)o[De].value="",o[De].output="",delete o[De].suffix;$.output=B.output+pe.output,$.backtrack=!0,oe({type:"paren",extglob:!0,value:A,output:""}),_t("parens");return}let L=B.close+(r.capture?")":""),U;if(B.type==="negate"){let Q=re;if(B.inner&&B.inner.length>1&&B.inner.includes("/")&&(Q=R(r)),(Q!==re||fe()||/^\)+$/.test(rt()))&&(L=B.close=`)$))${Q}`),B.inner.includes("*")&&(U=rt())&&/^\.[^\\/.]+$/.test(U)){let pe=ci(U,{...e,fastpaths:!1}).output;L=B.close=`)${pe})${Q})`}B.prev.type==="bos"&&($.negatedExtglob=!0)}oe({type:"paren",extglob:!0,value:A,output:L}),_t("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let B=!1,k=t.replace(Lv,(w,T,L,U,Q,pe)=>U==="\\"?(B=!0,w):U==="?"?T?T+U+(Q?I.repeat(Q.length):""):pe===0?M+(Q?I.repeat(Q.length):""):I.repeat(L.length):U==="."?d.repeat(L.length):U==="*"?T?T+U+(Q?re:""):re:T?w:`\\${w}`);return B===!0&&(r.unescape===!0?k=k.replace(/\\/g,""):k=k.replace(/\\+/g,w=>w.length%2===0?"\\\\":w?"\\":"")),k===t&&r.contains===!0?($.output=t,$):($.output=Te.wrapOutput(k,$,e),$)}for(;!fe();){if(A=be(),A==="\0")continue;if(A==="\\"){let w=se();if(w==="/"&&r.bash!==!0||w==="."||w===";")continue;if(!w){A+="\\",oe({type:"text",value:A});continue}let T=/^\\+/.exec(rt()),L=0;if(T&&T[0].length>2&&(L=T[0].length,$.index+=L,L%2!==0&&(A+="\\")),r.unescape===!0?A=be():A+=be(),$.brackets===0){oe({type:"text",value:A});continue}}if($.brackets>0&&(A!=="]"||x.value==="["||x.value==="[^")){if(r.posix!==!1&&A===":"){let w=x.value.slice(1);if(w.includes("[")&&(x.posix=!0,w.includes(":"))){let T=x.value.lastIndexOf("["),L=x.value.slice(0,T),U=x.value.slice(T+2),Q=Ov[U];if(Q){x.value=L+Q,$.backtrack=!0,be(),!i.output&&o.indexOf(x)===1&&(i.output=m);continue}}}(A==="["&&se()!==":"||A==="-"&&se()==="]")&&(A=`\\${A}`),A==="]"&&(x.value==="["||x.value==="[^")&&(A=`\\${A}`),r.posix===!0&&A==="!"&&x.value==="["&&(A="^"),x.value+=A,vt({value:A});continue}if($.quotes===1&&A!=='"'){A=Te.escapeRegex(A),x.value+=A,vt({value:A});continue}if(A==='"'){$.quotes=$.quotes===1?0:1,r.keepQuotes===!0&&oe({type:"text",value:A});continue}if(A==="("){$r("parens"),oe({type:"paren",value:A});continue}if(A===")"){if($.parens===0&&r.strictBrackets===!0)throw new SyntaxError(un("opening","("));let w=ae[ae.length-1];if(w&&$.parens===w.parens+1){Zo(ae.pop());continue}oe({type:"paren",value:A,output:$.parens?")":"\\)"}),_t("parens");continue}if(A==="["){if(r.nobracket===!0||!rt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(un("closing","]"));A=`\\${A}`}else $r("brackets");oe({type:"bracket",value:A});continue}if(A==="]"){if(r.nobracket===!0||x&&x.type==="bracket"&&x.value.length===1){oe({type:"text",value:A,output:`\\${A}`});continue}if($.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(un("opening","["));oe({type:"text",value:A,output:`\\${A}`});continue}_t("brackets");let w=x.value.slice(1);if(x.posix!==!0&&w[0]==="^"&&!w.includes("/")&&(A=`/${A}`),x.value+=A,vt({value:A}),r.literalBrackets===!1||Te.hasRegexChars(w))continue;let T=Te.escapeRegex(x.value);if($.output=$.output.slice(0,-x.value.length),r.literalBrackets===!0){$.output+=T,x.value=T;continue}x.value=`(${a}${T}|${x.value})`,$.output+=x.value;continue}if(A==="{"&&r.nobrace!==!0){$r("braces");let w={type:"brace",value:A,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};X.push(w),oe(w);continue}if(A==="}"){let w=X[X.length-1];if(r.nobrace===!0||!w){oe({type:"text",value:A,output:A});continue}let T=")";if(w.dots===!0){let L=o.slice(),U=[];for(let Q=L.length-1;Q>=0&&(o.pop(),L[Q].type!=="brace");Q--)L[Q].type!=="dots"&&U.unshift(L[Q].value);T=Bv(U,r),$.backtrack=!0}if(w.comma!==!0&&w.dots!==!0){let L=$.output.slice(0,w.outputIndex),U=$.tokens.slice(w.tokensIndex);w.value=w.output="\\{",A=T="\\}",$.output=L;for(let Q of U)$.output+=Q.output||Q.value}oe({type:"brace",value:A,output:T}),_t("braces"),X.pop();continue}if(A==="|"){ae.length>0&&ae[ae.length-1].conditions++,oe({type:"text",value:A});continue}if(A===","){let w=A,T=X[X.length-1];T&&ne[ne.length-1]==="braces"&&(T.comma=!0,w="|"),oe({type:"comma",value:A,output:w});continue}if(A==="/"){if(x.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",o.pop(),x=i;continue}oe({type:"slash",value:A,output:g});continue}if(A==="."){if($.braces>0&&x.type==="dot"){x.value==="."&&(x.output=d);let w=X[X.length-1];x.type="dots",x.output+=A,x.value+=A,w.dots=!0;continue}if($.braces+$.parens===0&&x.type!=="bos"&&x.type!=="slash"){oe({type:"text",value:A,output:d});continue}oe({type:"dot",value:A,output:d});continue}if(A==="?"){if(!(x&&x.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){nn("qmark",A);continue}if(x&&x.type==="paren"){let T=se(),L=A;if(T==="<"&&!Te.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(x.value==="("&&!/[!=<:]/.test(T)||T==="<"&&!/<([!=]|\w+>)/.test(rt()))&&(L=`\\${A}`),oe({type:"text",value:A,output:L});continue}if(r.dot!==!0&&(x.type==="slash"||x.type==="bos")){oe({type:"qmark",value:A,output:P});continue}oe({type:"qmark",value:A,output:I});continue}if(A==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){nn("negate",A);continue}if(r.nonegate!==!0&&$.index===0){sr();continue}}if(A==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){nn("plus",A);continue}if(x&&x.value==="("||r.regex===!1){oe({type:"plus",value:A,output:f});continue}if(x&&(x.type==="bracket"||x.type==="paren"||x.type==="brace")||$.parens>0){oe({type:"plus",value:A});continue}oe({type:"plus",value:f});continue}if(A==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){oe({type:"at",extglob:!0,value:A,output:""});continue}oe({type:"text",value:A});continue}if(A!=="*"){(A==="$"||A==="^")&&(A=`\\${A}`);let w=Nv.exec(rt());w&&(A+=w[0],$.index+=w[0].length),oe({type:"text",value:A});continue}if(x&&(x.type==="globstar"||x.star===!0)){x.type="star",x.star=!0,x.value+=A,x.output=re,$.backtrack=!0,$.globstar=!0,Ie(A);continue}let B=rt();if(r.noextglob!==!0&&/^\([^?]/.test(B)){nn("star",A);continue}if(x.type==="star"){if(r.noglobstar===!0){Ie(A);continue}let w=x.prev,T=w.prev,L=w.type==="slash"||w.type==="bos",U=T&&(T.type==="star"||T.type==="globstar");if(r.bash===!0&&(!L||B[0]&&B[0]!=="/")){oe({type:"star",value:A,output:""});continue}let Q=$.braces>0&&(w.type==="comma"||w.type==="brace"),pe=ae.length&&(w.type==="pipe"||w.type==="paren");if(!L&&w.type!=="paren"&&!Q&&!pe){oe({type:"star",value:A,output:""});continue}for(;B.slice(0,3)==="/**";){let De=t[$.index+4];if(De&&De!=="/")break;B=B.slice(3),Ie("/**",3)}if(w.type==="bos"&&fe()){x.type="globstar",x.value+=A,x.output=R(r),$.output=x.output,$.globstar=!0,Ie(A);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&!U&&fe()){$.output=$.output.slice(0,-(w.output+x.output).length),w.output=`(?:${w.output}`,x.type="globstar",x.output=R(r)+(r.strictSlashes?")":"|$)"),x.value+=A,$.globstar=!0,$.output+=w.output+x.output,Ie(A);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&B[0]==="/"){let De=B[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(w.output+x.output).length),w.output=`(?:${w.output}`,x.type="globstar",x.output=`${R(r)}${g}|${g}${De})`,x.value+=A,$.output+=w.output+x.output,$.globstar=!0,Ie(A+be()),oe({type:"slash",value:"/",output:""});continue}if(w.type==="bos"&&B[0]==="/"){x.type="globstar",x.value+=A,x.output=`(?:^|${g}|${R(r)}${g})`,$.output=x.output,$.globstar=!0,Ie(A+be()),oe({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-x.output.length),x.type="globstar",x.output=R(r),x.value+=A,$.output+=x.output,$.globstar=!0,Ie(A);continue}let k={type:"star",value:A,output:re};if(r.bash===!0){k.output=".*?",(x.type==="bos"||x.type==="slash")&&(k.output=j+k.output),oe(k);continue}if(x&&(x.type==="bracket"||x.type==="paren")&&r.regex===!0){k.output=A,oe(k);continue}($.index===$.start||x.type==="slash"||x.type==="dot")&&(x.type==="dot"?($.output+=C,x.output+=C):r.dot===!0?($.output+=S,x.output+=S):($.output+=j,x.output+=j),se()!=="*"&&($.output+=m,x.output+=m)),oe(k)}for(;$.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(un("closing","]"));$.output=Te.escapeLast($.output,"["),_t("brackets")}for(;$.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(un("closing",")"));$.output=Te.escapeLast($.output,"("),_t("parens")}for(;$.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(un("closing","}"));$.output=Te.escapeLast($.output,"{"),_t("braces")}if(r.strictSlashes!==!0&&(x.type==="star"||x.type==="bracket")&&oe({type:"maybe_slash",value:"",output:`${g}?`}),$.backtrack===!0){$.output="";for(let B of $.tokens)$.output+=B.output!=null?B.output:B.value,B.suffix&&($.output+=B.suffix)}return $};ci.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(ws,r.maxLength):ws,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=Bl[t]||t;let i=Te.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}=On.globChars(i),y=r.dot?d:l,p=r.dot?f:l,C=r.capture?"":"?:",S={negated:!1,prefix:""},I=r.bash===!0?".*?":g;r.capture&&(I=`(${I})`);let P=j=>j.noglobstar===!0?I:`(${C}(?:(?!${m}${j.dot?c:o}).)*?)`,W=j=>{switch(j){case"*":return`${y}${u}${I}`;case".*":return`${o}${u}${I}`;case"*.*":return`${y}${I}${o}${u}${I}`;case"*/*":return`${y}${I}${a}${u}${p}${I}`;case"**":return y+P(r);case"**/*":return`(?:${y}${P(r)}${a})?${p}${u}${I}`;case"**/*.*":return`(?:${y}${P(r)}${a})?${p}${I}${o}${u}${I}`;case"**/.*":return`(?:${y}${P(r)}${a})?${o}${u}${I}`;default:{let M=/^(.*?)\.(\w+)$/.exec(j);if(!M)return;let re=W(M[1]);return re?re+o+M[2]:void 0}}},F=Te.removePrefix(t,S),R=W(F);return R&&r.strictSlashes!==!0&&(R+=`${a}?`),R};Wl.exports=ci});var Ul=v((PF,Zl)=>{"use strict";var Uv=require("path"),Vv=Ll(),li=Hl(),di=Rn(),Gv=Tn(),zv=t=>t&&typeof t=="object"&&!Array.isArray(t),we=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(f=>we(f,e,r));return f=>{for(let g of l){let m=g(f);if(m)return m}return!1}}let n=zv(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=di.isWindows(e),o=n?we.compileRe(t,e):we.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=we(s.ignore,l,r)}let c=(l,d=!1)=>{let{isMatch:f,match:g,output:m}=we.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):u(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&&(c.state=a),c};we.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?di.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=we.matchBase(t,e,r,s):a=e.exec(u)),{isMatch:!!a,match:a,output:u}};we.matchBase=(t,e,r,n=di.isWindows(r))=>(e instanceof RegExp?e:we.makeRe(e,r)).test(Uv.basename(t));we.isMatch=(t,e,r)=>we(e,r)(t);we.parse=(t,e)=>Array.isArray(t)?t.map(r=>we.parse(r,e)):li(t,{...e,fastpaths:!1});we.scan=(t,e)=>Vv(t,e);we.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=we.toRegex(a,e);return n===!0&&(u.state=t),u};we.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=li.fastpaths(t,e)),s.output||(s=li(t,e)),we.compileRe(s,e,r,n)};we.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/$^/}};we.constants=Gv;Zl.exports=we});var Gl=v((OF,Vl)=>{"use strict";Vl.exports=Ul()});var Ql=v((NF,Kl)=>{"use strict";var Yl=require("util"),Jl=wl(),Ot=Gl(),fi=Rn(),zl=t=>t===""||t==="./",Xl=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},_e=(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=Ot(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};_e.match=_e;_e.matcher=(t,e)=>Ot(t,e);_e.isMatch=(t,e,r)=>Ot(e,r)(t);_e.any=_e.isMatch;_e.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(_e(t,e,{...r,onResult:i}));for(let a of s)o.has(a)||n.add(a);return[...n]};_e.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Yl.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>_e.contains(t,n,r));if(typeof e=="string"){if(zl(t)||zl(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return _e.isMatch(t,e,{...r,contains:!0})};_e.matchKeys=(t,e,r)=>{if(!fi.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=_e(Object.keys(t),e,r),s={};for(let i of n)s[i]=t[i];return s};_e.some=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let i=Ot(String(s),r);if(n.some(o=>i(o)))return!0}return!1};_e.every=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let i=Ot(String(s),r);if(!n.every(o=>i(o)))return!1}return!0};_e.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Yl.inspect(t)}"`);return[].concat(e).every(n=>Ot(n,r)(t))};_e.capture=(t,e,r)=>{let n=fi.isWindows(r),i=Ot.makeRe(String(t),{...r,capture:!0}).exec(n?fi.toPosixSlashes(e):e);if(i)return i.slice(1).map(o=>o===void 0?"":o)};_e.makeRe=(...t)=>Ot.makeRe(...t);_e.scan=(...t)=>Ot.scan(...t);_e.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let s of Jl(String(n),e))r.push(Ot.parse(s,e));return r};_e.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!Xl(t)?[t]:Jl(t,e)};_e.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return _e.braces(t,{...e,expand:!0})};_e.hasBraces=Xl;Kl.exports=_e});var cd=v(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.isAbsolute=ee.partitionAbsoluteAndRelative=ee.removeDuplicateSlashes=ee.matchAny=ee.convertPatternsToRe=ee.makeRe=ee.getPatternParts=ee.expandBraceExpansion=ee.expandPatternsWithBraceExpansion=ee.isAffectDepthOfReadingPattern=ee.endsWithSlashGlobStar=ee.hasGlobStar=ee.getBaseDirectory=ee.isPatternRelatedToParentDirectory=ee.getPatternsOutsideCurrentDirectory=ee.getPatternsInsideCurrentDirectory=ee.getPositivePatterns=ee.getNegativePatterns=ee.isPositivePattern=ee.isNegativePattern=ee.convertToNegativePattern=ee.convertToPositivePattern=ee.isDynamicPattern=ee.isStaticPattern=void 0;var ed=require("path"),Yv=Hc(),hi=Ql(),td="**",Jv="\\",Xv=/[*?]|^!/,Kv=/\[[^[]*]/,Qv=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,e_=/[!*+?@]\([^(]*\)/,t_=/,|\.\./,r_=/(?!^)\/{2,}/g;function rd(t,e={}){return!nd(t,e)}ee.isStaticPattern=rd;function nd(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(Jv)||Xv.test(t)||Kv.test(t)||Qv.test(t)||e.extglob!==!1&&e_.test(t)||e.braceExpansion!==!1&&n_(t))}ee.isDynamicPattern=nd;function n_(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 t_.test(n)}function s_(t){return xs(t)?t.slice(1):t}ee.convertToPositivePattern=s_;function o_(t){return"!"+t}ee.convertToNegativePattern=o_;function xs(t){return t.startsWith("!")&&t[1]!=="("}ee.isNegativePattern=xs;function sd(t){return!xs(t)}ee.isPositivePattern=sd;function i_(t){return t.filter(xs)}ee.getNegativePatterns=i_;function a_(t){return t.filter(sd)}ee.getPositivePatterns=a_;function u_(t){return t.filter(e=>!pi(e))}ee.getPatternsInsideCurrentDirectory=u_;function c_(t){return t.filter(pi)}ee.getPatternsOutsideCurrentDirectory=c_;function pi(t){return t.startsWith("..")||t.startsWith("./..")}ee.isPatternRelatedToParentDirectory=pi;function l_(t){return Yv(t,{flipBackslashes:!1})}ee.getBaseDirectory=l_;function d_(t){return t.includes(td)}ee.hasGlobStar=d_;function od(t){return t.endsWith("/"+td)}ee.endsWithSlashGlobStar=od;function f_(t){let e=ed.basename(t);return od(t)||rd(e)}ee.isAffectDepthOfReadingPattern=f_;function h_(t){return t.reduce((e,r)=>e.concat(id(r)),[])}ee.expandPatternsWithBraceExpansion=h_;function id(t){let e=hi.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}ee.expandBraceExpansion=id;function p_(t,e){let{parts:r}=hi.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}ee.getPatternParts=p_;function ad(t,e){return hi.makeRe(t,e)}ee.makeRe=ad;function m_(t,e){return t.map(r=>ad(r,e))}ee.convertPatternsToRe=m_;function g_(t,e){return e.some(r=>r.test(t))}ee.matchAny=g_;function D_(t){return t.replace(r_,"/")}ee.removeDuplicateSlashes=D_;function y_(t){let e=[],r=[];for(let n of t)ud(n)?e.push(n):r.push(n);return[e,r]}ee.partitionAbsoluteAndRelative=y_;function ud(t){return ed.isAbsolute(t)}ee.isAbsolute=ud});var hd=v((BF,fd)=>{"use strict";var v_=require("stream"),ld=v_.PassThrough,__=Array.prototype.slice;fd.exports=E_;function E_(){let t=[],e=__.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=ld(n);function a(){for(let l=0,d=arguments.length;l<d;l++)t.push(dd(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 y(){m.removeListener("merge2UnpipeEnd",y),m.removeListener("end",y),i&&m.removeListener("error",p),f()}function p(C){o.emit("error",C)}if(m._readableState.endEmitted)return f();m.on("merge2UnpipeEnd",y),m.on("end",y),i&&m.on("error",p),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 dd(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=dd(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(ld(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var md=v($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.merge=void 0;var S_=hd();function b_(t){let e=S_(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>pd(t)),e.once("end",()=>pd(t)),e}$s.merge=b_;function pd(t){t.forEach(e=>e.emit("close"))}});var gd=v(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.isEmpty=cn.isString=void 0;function C_(t){return typeof t=="string"}cn.isString=C_;function w_(t){return t===""}cn.isEmpty=w_});var Jt=v(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.string=Re.stream=Re.pattern=Re.path=Re.fs=Re.errno=Re.array=void 0;var x_=Fc();Re.array=x_;var $_=jc();Re.errno=$_;var A_=Ic();Re.fs=A_;var k_=Oc();Re.path=k_;var F_=cd();Re.pattern=F_;var j_=md();Re.stream=j_;var I_=gd();Re.string=I_});var _d=v(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.convertPatternGroupToTask=Pe.convertPatternGroupsToTasks=Pe.groupPatternsByBaseDirectory=Pe.getNegativePatternsAsPositive=Pe.getPositivePatterns=Pe.convertPatternsToTasks=Pe.generate=void 0;var Et=Jt();function T_(t,e){let r=Dd(t,e),n=Dd(e.ignore,e),s=yd(r),i=vd(r,n),o=s.filter(l=>Et.pattern.isStaticPattern(l,e)),a=s.filter(l=>Et.pattern.isDynamicPattern(l,e)),u=mi(o,i,!1),c=mi(a,i,!0);return u.concat(c)}Pe.generate=T_;function Dd(t,e){let r=t;return e.braceExpansion&&(r=Et.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Et.pattern.removeDuplicateSlashes(n))}function mi(t,e,r){let n=[],s=Et.pattern.getPatternsOutsideCurrentDirectory(t),i=Et.pattern.getPatternsInsideCurrentDirectory(t),o=gi(s),a=gi(i);return n.push(...Di(o,e,r)),"."in a?n.push(yi(".",i,e,r)):n.push(...Di(a,e,r)),n}Pe.convertPatternsToTasks=mi;function yd(t){return Et.pattern.getPositivePatterns(t)}Pe.getPositivePatterns=yd;function vd(t,e){return Et.pattern.getNegativePatterns(t).concat(e).map(Et.pattern.convertToPositivePattern)}Pe.getNegativePatternsAsPositive=vd;function gi(t){let e={};return t.reduce((r,n)=>{let s=Et.pattern.getBaseDirectory(n);return s in r?r[s].push(n):r[s]=[n],r},e)}Pe.groupPatternsByBaseDirectory=gi;function Di(t,e,r){return Object.keys(t).map(n=>yi(n,t[n],e,r))}Pe.convertPatternGroupsToTasks=Di;function yi(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(Et.pattern.convertToNegativePattern))}}Pe.convertPatternGroupToTask=yi});var Sd=v(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.read=void 0;function R_(t,e,r){e.fs.lstat(t,(n,s)=>{if(n!==null){Ed(r,n);return}if(!s.isSymbolicLink()||!e.followSymbolicLink){vi(r,s);return}e.fs.stat(t,(i,o)=>{if(i!==null){if(e.throwErrorOnBrokenSymbolicLink){Ed(r,i);return}vi(r,s);return}e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),vi(r,o)})})}As.read=R_;function Ed(t,e){t(e)}function vi(t,e){t(null,e)}});var bd=v(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.read=void 0;function P_(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}}ks.read=P_});var Cd=v(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.createFileSystemAdapter=ur.FILE_SYSTEM_ADAPTER=void 0;var Fs=require("fs");ur.FILE_SYSTEM_ADAPTER={lstat:Fs.lstat,stat:Fs.stat,lstatSync:Fs.lstatSync,statSync:Fs.statSync};function O_(t){return t===void 0?ur.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},ur.FILE_SYSTEM_ADAPTER),t)}ur.createFileSystemAdapter=O_});var wd=v(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});var N_=Cd(),_i=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=N_.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}};Ei.default=_i});var Fr=v(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.statSync=cr.stat=cr.Settings=void 0;var xd=Sd(),L_=bd(),Si=wd();cr.Settings=Si.default;function B_(t,e,r){if(typeof e=="function"){xd.read(t,bi(),e);return}xd.read(t,bi(e),r)}cr.stat=B_;function M_(t,e){let r=bi(e);return L_.read(t,r)}cr.statSync=M_;function bi(t={}){return t instanceof Si.default?t:new Si.default(t)}});var kd=v((YF,Ad)=>{var $d;Ad.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>($d||($d=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var jd=v((JF,Fd)=>{Fd.exports=W_;var q_=kd();function W_(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?q_(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 Ci=v(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var js=process.versions.node.split(".");if(js[0]===void 0||js[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var Id=Number.parseInt(js[0],10),H_=Number.parseInt(js[1],10),Td=10,Z_=10,U_=Id>Td,V_=Id===Td&&H_>=Z_;Is.IS_SUPPORT_READDIR_WITH_FILE_TYPES=U_||V_});var Rd=v(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.createDirentFromStats=void 0;var wi=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 G_(t,e){return new wi(t,e)}Ts.createDirentFromStats=G_});var xi=v(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.fs=void 0;var z_=Rd();Rs.fs=z_});var $i=v(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.joinPathSegments=void 0;function Y_(t,e,r){return t.endsWith(r)?t+e:t+r+e}Ps.joinPathSegments=Y_});var Md=v(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.readdir=lr.readdirWithFileTypes=lr.read=void 0;var J_=Fr(),Pd=jd(),X_=Ci(),Od=xi(),Nd=$i();function K_(t,e,r){if(!e.stats&&X_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){Ld(t,e,r);return}Bd(t,e,r)}lr.read=K_;function Ld(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,s)=>{if(n!==null){Os(r,n);return}let i=s.map(a=>({dirent:a,name:a.name,path:Nd.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){Ai(r,i);return}let o=i.map(a=>Q_(a,e));Pd(o,(a,u)=>{if(a!==null){Os(r,a);return}Ai(r,u)})})}lr.readdirWithFileTypes=Ld;function Q_(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=Od.fs.createDirentFromStats(t.name,s),r(null,t)})}}function Bd(t,e,r){e.fs.readdir(t,(n,s)=>{if(n!==null){Os(r,n);return}let i=s.map(o=>{let a=Nd.joinPathSegments(t,o,e.pathSegmentSeparator);return u=>{J_.stat(a,e.fsStatSettings,(c,l)=>{if(c!==null){u(c);return}let d={name:o,path:a,dirent:Od.fs.createDirentFromStats(o,l)};e.stats&&(d.stats=l),u(null,d)})}});Pd(i,(o,a)=>{if(o!==null){Os(r,o);return}Ai(r,a)})})}lr.readdir=Bd;function Os(t,e){t(e)}function Ai(t,e){t(null,e)}});var Ud=v(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.readdir=dr.readdirWithFileTypes=dr.read=void 0;var e0=Fr(),t0=Ci(),qd=xi(),Wd=$i();function r0(t,e){return!e.stats&&t0.IS_SUPPORT_READDIR_WITH_FILE_TYPES?Hd(t,e):Zd(t,e)}dr.read=r0;function Hd(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let s={dirent:n,name:n.name,path:Wd.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(s.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let i=e.fs.statSync(s.path);s.dirent=qd.fs.createDirentFromStats(s.name,i)}catch(i){if(e.throwErrorOnBrokenSymbolicLink)throw i}return s})}dr.readdirWithFileTypes=Hd;function Zd(t,e){return e.fs.readdirSync(t).map(n=>{let s=Wd.joinPathSegments(t,n,e.pathSegmentSeparator),i=e0.statSync(s,e.fsStatSettings),o={name:n,path:s,dirent:qd.fs.createDirentFromStats(n,i)};return e.stats&&(o.stats=i),o})}dr.readdir=Zd});var Vd=v(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.createFileSystemAdapter=fr.FILE_SYSTEM_ADAPTER=void 0;var ln=require("fs");fr.FILE_SYSTEM_ADAPTER={lstat:ln.lstat,stat:ln.stat,lstatSync:ln.lstatSync,statSync:ln.statSync,readdir:ln.readdir,readdirSync:ln.readdirSync};function n0(t){return t===void 0?fr.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},fr.FILE_SYSTEM_ADAPTER),t)}fr.createFileSystemAdapter=n0});var Gd=v(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});var s0=require("path"),o0=Fr(),i0=Vd(),ki=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=i0.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,s0.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new o0.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};Fi.default=ki});var Ns=v(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.Settings=hr.scandirSync=hr.scandir=void 0;var zd=Md(),a0=Ud(),ji=Gd();hr.Settings=ji.default;function u0(t,e,r){if(typeof e=="function"){zd.read(t,Ii(),e);return}zd.read(t,Ii(e),r)}hr.scandir=u0;function c0(t,e){let r=Ii(e);return a0.read(t,r)}hr.scandirSync=c0;function Ii(t={}){return t instanceof ji.default?t:new ji.default(t)}});var Jd=v((ij,Yd)=>{"use strict";function l0(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}}Yd.exports=l0});var Kd=v((aj,Ti)=>{"use strict";var d0=Jd();function Xd(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=d0(f0),s=null,i=null,o=0,a=null,u={push:y,drain:Je,saturated:Je,pause:l,paused:!1,get concurrency(){return r},set concurrency(F){if(!(F>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=F,!u.paused)for(;s&&o<r;)o++,C()},running:c,resume:g,idle:m,length:d,getQueue:f,unshift:p,empty:Je,kill:S,killAndDrain:I,error:W,abort:P};return u;function c(){return o}function l(){u.paused=!0}function d(){for(var F=s,R=0;F;)F=F.next,R++;return R}function f(){for(var F=s,R=[];F;)R.push(F.value),F=F.next;return R}function g(){if(u.paused){if(u.paused=!1,s===null){o++,C();return}for(;s&&o<r;)o++,C()}}function m(){return o===0&&u.length()===0}function y(F,R){var j=n.get();j.context=t,j.release=C,j.value=F,j.callback=R||Je,j.errorHandler=a,o>=r||u.paused?i?(i.next=j,i=j):(s=j,i=j,u.saturated()):(o++,e.call(t,j.value,j.worked))}function p(F,R){var j=n.get();j.context=t,j.release=C,j.value=F,j.callback=R||Je,j.errorHandler=a,o>=r||u.paused?s?(j.next=s,s=j):(s=j,i=j,u.saturated()):(o++,e.call(t,j.value,j.worked))}function C(F){F&&n.release(F);var R=s;R&&o<=r?u.paused?o--:(i===s&&(i=null),s=R.next,R.next=null,e.call(t,R.value,R.worked),i===null&&u.empty()):--o===0&&u.drain()}function S(){s=null,i=null,u.drain=Je}function I(){s=null,i=null,u.drain(),u.drain=Je}function P(){var F=s;for(s=null,i=null;F;){var R=F.next,j=F.callback,M=F.errorHandler,re=F.value,$=F.context;F.value=null,F.callback=Je,F.errorHandler=null,M&&M(new Error("abort"),re),j.call($,new Error("abort")),F.release(F),F=R}u.drain=Je}function W(F){a=F}}function Je(){}function f0(){this.value=null,this.callback=Je,this.next=null,this.release=Je,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=Je,t.errorHandler&&i(r,o),s.call(t.context,r,n),t.release(t)}}function h0(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=Xd(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,y){if(m){g(m);return}f(y)})});return d.catch(Je),d}function u(l){var d=new Promise(function(f,g){o(l,function(m,y){if(m){g(m);return}f(y)})});return d.catch(Je),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}}Ti.exports=Xd;Ti.exports.promise=h0});var Ls=v(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.joinPathSegments=Nt.replacePathSegmentSeparator=Nt.isAppliedFilter=Nt.isFatalError=void 0;function p0(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}Nt.isFatalError=p0;function m0(t,e){return t===null||t(e)}Nt.isAppliedFilter=m0;function g0(t,e){return t.split(/[/\\]/).join(e)}Nt.replacePathSegmentSeparator=g0;function D0(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}Nt.joinPathSegments=D0});var Oi=v(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});var y0=Ls(),Ri=class{constructor(e,r){this._root=e,this._settings=r,this._root=y0.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};Pi.default=Ri});var Bi=v(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});var v0=require("events"),_0=Ns(),E0=Kd(),Bs=Ls(),S0=Oi(),Ni=class extends S0.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=_0.scandir,this._emitter=new v0.EventEmitter,this._queue=E0(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||!Bs.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=Bs.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Bs.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&Bs.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};Li.default=Ni});var Qd=v(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});var b0=Bi(),Mi=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new b0.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{C0(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{w0(e,this._storage)}),this._reader.read()}};qi.default=Mi;function C0(t,e){t(e)}function w0(t,e){t(null,e)}});var ef=v(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});var x0=require("stream"),$0=Bi(),Wi=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new $0.default(this._root,this._settings),this._stream=new x0.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}};Hi.default=Wi});var tf=v(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});var A0=Ns(),Ms=Ls(),k0=Oi(),Zi=class extends k0.default{constructor(){super(...arguments),this._scandir=A0.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(Ms.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=Ms.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Ms.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&Ms.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};Ui.default=Zi});var rf=v(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});var F0=tf(),Vi=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new F0.default(this._root,this._settings)}read(){return this._reader.read()}};Gi.default=Vi});var nf=v(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});var j0=require("path"),I0=Ns(),zi=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,j0.sep),this.fsScandirSettings=new I0.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}};Yi.default=zi});var Ws=v(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.Settings=Lt.walkStream=Lt.walkSync=Lt.walk=void 0;var sf=Qd(),T0=ef(),R0=rf(),Ji=nf();Lt.Settings=Ji.default;function P0(t,e,r){if(typeof e=="function"){new sf.default(t,qs()).read(e);return}new sf.default(t,qs(e)).read(r)}Lt.walk=P0;function O0(t,e){let r=qs(e);return new R0.default(t,r).read()}Lt.walkSync=O0;function N0(t,e){let r=qs(e);return new T0.default(t,r).read()}Lt.walkStream=N0;function qs(t={}){return t instanceof Ji.default?t:new Ji.default(t)}});var Hs=v(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});var L0=require("path"),B0=Fr(),of=Jt(),Xi=class{constructor(e){this._settings=e,this._fsStatSettings=new B0.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return L0.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:of.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!of.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};Ki.default=Xi});var ta=v(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});var M0=require("stream"),q0=Fr(),W0=Ws(),H0=Hs(),Qi=class extends H0.default{constructor(){super(...arguments),this._walkStream=W0.walkStream,this._stat=q0.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),s=new M0.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))})}};ea.default=Qi});var af=v(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var Z0=Ws(),U0=Hs(),V0=ta(),ra=class extends U0.default{constructor(){super(...arguments),this._walkAsync=Z0.walk,this._readerStream=new V0.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))})}};na.default=ra});var uf=v(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});var Nn=Jt(),sa=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 Nn.pattern.getPatternParts(e,this._micromatchOptions).map(n=>Nn.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Nn.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return Nn.array.splitWhen(e,r=>r.dynamic&&Nn.pattern.hasGlobStar(r.pattern))}};oa.default=sa});var cf=v(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});var G0=uf(),ia=class extends G0.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}};aa.default=ia});var lf=v(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});var Zs=Jt(),z0=cf(),ua=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 z0.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(Zs.pattern.isAffectDepthOfReadingPattern);return Zs.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,s){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=Zs.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!Zs.pattern.matchAny(e,r)}};ca.default=ua});var df=v(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});var pr=Jt(),la=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,s]=pr.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:pr.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:pr.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:pr.pattern.convertPatternsToRe(s,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return o=>this._filter(o,i)}_filter(e,r){let n=pr.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=pr.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(s,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let s=pr.pattern.matchAny(e,r);return!s&&n?pr.pattern.matchAny(e+"/",r):s}};da.default=la});var ff=v(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});var Y0=Jt(),fa=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return Y0.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};ha.default=fa});var pf=v(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});var hf=Jt(),pa=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=hf.path.makeAbsolute(this._settings.cwd,r),r=hf.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};ma.default=pa});var Us=v(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});var J0=require("path"),X0=lf(),K0=df(),Q0=ff(),eE=pf(),ga=class{constructor(e){this._settings=e,this.errorFilter=new Q0.default(this._settings),this.entryFilter=new K0.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new X0.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new eE.default(this._settings)}_getRootDirectory(e){return J0.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}}};Da.default=ga});var mf=v(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var tE=af(),rE=Us(),ya=class extends rE.default{constructor(){super(...arguments),this._reader=new tE.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)}};va.default=ya});var gf=v(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var nE=require("stream"),sE=ta(),oE=Us(),_a=class extends oE.default{constructor(){super(...arguments),this._reader=new sE.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),s=this.api(r,e,n),i=new nE.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)}};Ea.default=_a});var Df=v(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var iE=Fr(),aE=Ws(),uE=Hs(),Sa=class extends uE.default{constructor(){super(...arguments),this._walkSync=aE.walkSync,this._statSync=iE.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)}};ba.default=Sa});var yf=v(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});var cE=Df(),lE=Us(),Ca=class extends lE.default{constructor(){super(...arguments),this._reader=new cE.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)}};wa.default=Ca});var vf=v(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var dn=require("fs"),dE=require("os"),fE=Math.max(dE.cpus().length,1);fn.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:dn.lstat,lstatSync:dn.lstatSync,stat:dn.stat,statSync:dn.statSync,readdir:dn.readdir,readdirSync:dn.readdirSync};var xa=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,fE),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({},fn.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};fn.default=xa});var Sf=v((Ij,Ef)=>{"use strict";var _f=_d(),hE=mf(),pE=gf(),mE=yf(),$a=vf(),ct=Jt();async function Aa(t,e){St(t);let r=ka(t,hE.default,e),n=await Promise.all(r);return ct.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(c,l){St(c);let d=ka(c,mE.default,l);return ct.array.flatten(d)}t.sync=e;function r(c,l){St(c);let d=ka(c,pE.default,l);return ct.stream.merge(d)}t.stream=r;function n(c,l){St(c);let d=[].concat(c),f=new $a.default(l);return _f.generate(d,f)}t.generateTasks=n;function s(c,l){St(c);let d=new $a.default(l);return ct.pattern.isDynamicPattern(c,d)}t.isDynamicPattern=s;function i(c){return St(c),ct.path.escape(c)}t.escapePath=i;function o(c){return St(c),ct.path.convertPathToPattern(c)}t.convertPathToPattern=o;let a;(function(c){function l(f){return St(f),ct.path.escapePosixPath(f)}c.escapePath=l;function d(f){return St(f),ct.path.convertPosixPathToPattern(f)}c.convertPathToPattern=d})(a=t.posix||(t.posix={}));let u;(function(c){function l(f){return St(f),ct.path.escapeWindowsPath(f)}c.escapePath=l;function d(f){return St(f),ct.path.convertWindowsPathToPattern(f)}c.convertPathToPattern=d})(u=t.win32||(t.win32={}))})(Aa||(Aa={}));function ka(t,e,r){let n=[].concat(t),s=new $a.default(r),i=_f.generate(n,s),o=new e(s);return i.map(o.read,o)}function St(t){if(![].concat(t).every(n=>ct.string.isString(n)&&!ct.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}Ef.exports=Aa});var Ln=v(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.getParsedType=ye.ZodParsedType=ye.objectUtil=ye.util=void 0;var Fa;(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})(Fa||(ye.util=Fa={}));var bf;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(bf||(ye.objectUtil=bf={}));ye.ZodParsedType=Fa.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var gE=t=>{switch(typeof t){case"undefined":return ye.ZodParsedType.undefined;case"string":return ye.ZodParsedType.string;case"number":return Number.isNaN(t)?ye.ZodParsedType.nan:ye.ZodParsedType.number;case"boolean":return ye.ZodParsedType.boolean;case"function":return ye.ZodParsedType.function;case"bigint":return ye.ZodParsedType.bigint;case"symbol":return ye.ZodParsedType.symbol;case"object":return Array.isArray(t)?ye.ZodParsedType.array:t===null?ye.ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ye.ZodParsedType.promise:typeof Map<"u"&&t instanceof Map?ye.ZodParsedType.map:typeof Set<"u"&&t instanceof Set?ye.ZodParsedType.set:typeof Date<"u"&&t instanceof Date?ye.ZodParsedType.date:ye.ZodParsedType.object;default:return ye.ZodParsedType.unknown}};ye.getParsedType=gE});var Vs=v(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.ZodError=mr.quotelessJson=mr.ZodIssueCode=void 0;var Cf=Ln();mr.ZodIssueCode=Cf.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 DE=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");mr.quotelessJson=DE;var Bn=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,Cf.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()}};mr.ZodError=Bn;Bn.create=t=>new Bn(t)});var Ia=v(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});var Oe=Vs(),jr=Ln(),yE=(t,e)=>{let r;switch(t.code){case Oe.ZodIssueCode.invalid_type:t.received===jr.ZodParsedType.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Oe.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,jr.util.jsonStringifyReplacer)}`;break;case Oe.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${jr.util.joinValues(t.keys,", ")}`;break;case Oe.ZodIssueCode.invalid_union:r="Invalid input";break;case Oe.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${jr.util.joinValues(t.options)}`;break;case Oe.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${jr.util.joinValues(t.options)}, received '${t.received}'`;break;case Oe.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case Oe.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case Oe.ZodIssueCode.invalid_date:r="Invalid date";break;case Oe.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}"`:jr.util.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Oe.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 Oe.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 Oe.ZodIssueCode.custom:r="Invalid input";break;case Oe.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case Oe.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Oe.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=e.defaultError,jr.util.assertNever(t)}return{message:r}};ja.default=yE});var Gs=v(gr=>{"use strict";var vE=gr&&gr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gr,"__esModule",{value:!0});gr.defaultErrorMap=void 0;gr.setErrorMap=_E;gr.getErrorMap=EE;var wf=vE(Ia());gr.defaultErrorMap=wf.default;var xf=wf.default;function _E(t){xf=t}function EE(){return xf}});var Ra=v(me=>{"use strict";var SE=me&&me.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(me,"__esModule",{value:!0});me.isAsync=me.isValid=me.isDirty=me.isAborted=me.OK=me.DIRTY=me.INVALID=me.ParseStatus=me.EMPTY_PATH=me.makeIssue=void 0;me.addIssueToContext=wE;var bE=Gs(),$f=SE(Ia()),CE=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}};me.makeIssue=CE;me.EMPTY_PATH=[];function wE(t,e){let r=(0,bE.getErrorMap)(),n=(0,me.makeIssue)({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===$f.default?void 0:$f.default].filter(s=>!!s)});t.common.issues.push(n)}var Ta=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 me.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 me.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}}};me.ParseStatus=Ta;me.INVALID=Object.freeze({status:"aborted"});var xE=t=>({status:"dirty",value:t});me.DIRTY=xE;var $E=t=>({status:"valid",value:t});me.OK=$E;var AE=t=>t.status==="aborted";me.isAborted=AE;var kE=t=>t.status==="dirty";me.isDirty=kE;var FE=t=>t.status==="valid";me.isValid=FE;var jE=t=>typeof Promise<"u"&&t instanceof Promise;me.isAsync=jE});var kf=v(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0})});var jf=v(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.errorUtil=void 0;var Ff;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Ff||(zs.errorUtil=Ff={}))});var Hf=v(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.discriminatedUnion=E.date=E.boolean=E.bigint=E.array=E.any=E.coerce=E.ZodFirstPartyTypeKind=E.late=E.ZodSchema=E.Schema=E.ZodReadonly=E.ZodPipeline=E.ZodBranded=E.BRAND=E.ZodNaN=E.ZodCatch=E.ZodDefault=E.ZodNullable=E.ZodOptional=E.ZodTransformer=E.ZodEffects=E.ZodPromise=E.ZodNativeEnum=E.ZodEnum=E.ZodLiteral=E.ZodLazy=E.ZodFunction=E.ZodSet=E.ZodMap=E.ZodRecord=E.ZodTuple=E.ZodIntersection=E.ZodDiscriminatedUnion=E.ZodUnion=E.ZodObject=E.ZodArray=E.ZodVoid=E.ZodNever=E.ZodUnknown=E.ZodAny=E.ZodNull=E.ZodUndefined=E.ZodSymbol=E.ZodDate=E.ZodBoolean=E.ZodBigInt=E.ZodNumber=E.ZodString=E.ZodType=void 0;E.NEVER=E.void=E.unknown=E.union=E.undefined=E.tuple=E.transformer=E.symbol=E.string=E.strictObject=E.set=E.record=E.promise=E.preprocess=E.pipeline=E.ostring=E.optional=E.onumber=E.oboolean=E.object=E.number=E.nullable=E.null=E.never=E.nativeEnum=E.nan=E.map=E.literal=E.lazy=E.intersection=E.instanceof=E.function=E.enum=E.effect=void 0;E.datetimeRegex=Of;E.custom=Lf;var O=Vs(),Ys=Gs(),J=jf(),b=Ra(),N=Ln(),dt=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}},If=(t,e)=>{if((0,b.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 ue(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 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 b.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,b.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 If(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,b.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,b.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,b.isAsync)(s)?s:Promise.resolve(s));return If(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 ot({schema:this,typeName:te.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 lt.create(this,this._def)}nullable(){return Mt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qt.create(this)}promise(){return vr.create(this,this._def)}or(e){return Lr.create([this,e],this._def)}and(e){return Br.create(this,e,this._def)}transform(e){return new ot({...ue(this._def),schema:this,typeName:te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Zr({...ue(this._def),innerType:this,defaultValue:r,typeName:te.ZodDefault})}brand(){return new Mn({typeName:te.ZodBranded,type:this,...ue(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ur({...ue(this._def),innerType:this,catchValue:r,typeName:te.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return qn.create(this,e)}readonly(){return Vr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};E.ZodType=ce;E.Schema=ce;E.ZodSchema=ce;var IE=/^c[^\s-]{8,}$/i,TE=/^[0-9a-z]+$/,RE=/^[0-9A-HJKMNP-TV-Z]{26}$/i,PE=/^[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,OE=/^[a-z0-9_-]{21}$/i,NE=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,LE=/^[-+]?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)?)??$/,BE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ME="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Pa,qE=/^(?:(?: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])$/,WE=/^(?:(?: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])$/,HE=/^(([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]))$/,ZE=/^(([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])$/,UE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,VE=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Rf="((\\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])))",GE=new RegExp(`^${Rf}$`);function Pf(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 zE(t){return new RegExp(`^${Pf(t)}$`)}function Of(t){let e=`${Rf}T${Pf(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 YE(t,e){return!!((e==="v4"||!e)&&qE.test(t)||(e==="v6"||!e)&&HE.test(t))}function JE(t,e){if(!NE.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 XE(t,e){return!!((e==="v4"||!e)&&WE.test(t)||(e==="v6"||!e)&&ZE.test(t))}var Dr=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,b.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.string,received:i.parsedType}),b.INVALID}let n=new b.ParseStatus,s;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),(0,b.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,b.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,b.addIssueToContext)(s,{code:O.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&(0,b.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")BE.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{validation:"email",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Pa||(Pa=new RegExp(ME,"u")),Pa.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{validation:"emoji",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")PE.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{validation:"uuid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")OE.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{validation:"nanoid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")IE.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{validation:"cuid",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")TE.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{validation:"cuid2",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")RE.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.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,b.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,b.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,b.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,b.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,b.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Of(i).test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?GE.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?zE(i).test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{code:O.ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?LE.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{validation:"duration",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?YE(e.data,i.version)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{validation:"ip",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?JE(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{validation:"jwt",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?XE(e.data,i.version)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{validation:"cidr",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?UE.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{validation:"base64",code:O.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?VE.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,b.addIssueToContext)(s,{validation:"base64url",code:O.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:O.ZodIssueCode.invalid_string,...J.errorUtil.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...J.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...J.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...J.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...J.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...J.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...J.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...J.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...J.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...J.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...J.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...J.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...J.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...J.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,...J.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,...J.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...J.errorUtil.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...J.errorUtil.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...J.errorUtil.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...J.errorUtil.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...J.errorUtil.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...J.errorUtil.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...J.errorUtil.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...J.errorUtil.errToObj(r)})}nonempty(e){return this.min(1,J.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}};E.ZodString=Dr;Dr.create=t=>new Dr({checks:[],typeName:te.ZodString,coerce:t?.coerce??!1,...ue(t)});function KE(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 Ir=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,b.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.number,received:i.parsedType}),b.INVALID}let n,s=new b.ParseStatus;for(let i of this._def.checks)i.kind==="int"?N.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,b.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,b.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,b.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"?KE(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),(0,b.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,b.addIssueToContext)(n,{code:O.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,J.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,J.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,J.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,J.errorUtil.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:J.errorUtil.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:J.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:J.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:J.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:J.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:J.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:J.errorUtil.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:J.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:J.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:J.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)}};E.ZodNumber=Ir;Ir.create=t=>new Ir({checks:[],typeName:te.ZodNumber,coerce:t?.coerce||!1,...ue(t)});var Tr=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 b.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,b.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,b.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,b.addIssueToContext)(n,{code:O.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,b.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.bigint,received:r.parsedType}),b.INVALID}gte(e,r){return this.setLimit("min",e,!0,J.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,J.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,J.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,J.errorUtil.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:J.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:J.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:J.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:J.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:J.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:J.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}};E.ZodBigInt=Tr;Tr.create=t=>new Tr({checks:[],typeName:te.ZodBigInt,coerce:t?.coerce??!1,...ue(t)});var Rr=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,b.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.boolean,received:n.parsedType}),b.INVALID}return(0,b.OK)(e.data)}};E.ZodBoolean=Rr;Rr.create=t=>new Rr({typeName:te.ZodBoolean,coerce:t?.coerce||!1,...ue(t)});var Pr=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,b.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.date,received:i.parsedType}),b.INVALID}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return(0,b.addIssueToContext)(i,{code:O.ZodIssueCode.invalid_date}),b.INVALID}let n=new b.ParseStatus,s;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),(0,b.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,b.addIssueToContext)(s,{code:O.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:J.errorUtil.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:J.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}};E.ZodDate=Pr;Pr.create=t=>new Pr({checks:[],coerce:t?.coerce||!1,typeName:te.ZodDate,...ue(t)});var pn=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,b.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.symbol,received:n.parsedType}),b.INVALID}return(0,b.OK)(e.data)}};E.ZodSymbol=pn;pn.create=t=>new pn({typeName:te.ZodSymbol,...ue(t)});var Or=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,b.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.undefined,received:n.parsedType}),b.INVALID}return(0,b.OK)(e.data)}};E.ZodUndefined=Or;Or.create=t=>new Or({typeName:te.ZodUndefined,...ue(t)});var Nr=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,b.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.null,received:n.parsedType}),b.INVALID}return(0,b.OK)(e.data)}};E.ZodNull=Nr;Nr.create=t=>new Nr({typeName:te.ZodNull,...ue(t)});var yr=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,b.OK)(e.data)}};E.ZodAny=yr;yr.create=t=>new yr({typeName:te.ZodAny,...ue(t)});var Kt=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,b.OK)(e.data)}};E.ZodUnknown=Kt;Kt.create=t=>new Kt({typeName:te.ZodUnknown,...ue(t)});var bt=class extends ce{_parse(e){let r=this._getOrReturnCtx(e);return(0,b.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.never,received:r.parsedType}),b.INVALID}};E.ZodNever=bt;bt.create=t=>new bt({typeName:te.ZodNever,...ue(t)});var mn=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,b.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.void,received:n.parsedType}),b.INVALID}return(0,b.OK)(e.data)}};E.ZodVoid=mn;mn.create=t=>new mn({typeName:te.ZodVoid,...ue(t)});var Qt=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,b.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.array,received:r.parsedType}),b.INVALID;if(s.exactLength!==null){let o=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(o||a)&&((0,b.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,b.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,b.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 dt(r,o,r.path,a)))).then(o=>b.ParseStatus.mergeArray(n,o));let i=[...r.data].map((o,a)=>s.type._parseSync(new dt(r,o,r.path,a)));return b.ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:J.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:J.errorUtil.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:J.errorUtil.toString(r)}})}nonempty(e){return this.min(1,e)}};E.ZodArray=Qt;Qt.create=(t,e)=>new Qt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:te.ZodArray,...ue(e)});function hn(t){if(t instanceof Xe){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=lt.create(hn(n))}return new Xe({...t._def,shape:()=>e})}else return t instanceof Qt?new Qt({...t._def,type:hn(t.element)}):t instanceof lt?lt.create(hn(t.unwrap())):t instanceof Mt?Mt.create(hn(t.unwrap())):t instanceof Bt?Bt.create(t.items.map(e=>hn(e))):t}var Xe=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 c=this._getOrReturnCtx(e);return(0,b.addIssueToContext)(c,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.object,received:c.parsedType}),b.INVALID}let{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof bt&&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 dt(s,d,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof bt){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,b.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 dt(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=>b.ParseStatus.mergeObjectSync(n,c)):b.ParseStatus.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return J.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:J.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:te.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 hn(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 lt;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return Nf(N.util.objectKeys(this.shape))}};E.ZodObject=Xe;Xe.create=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strip",catchall:bt.create(),typeName:te.ZodObject,...ue(e)});Xe.strictCreate=(t,e)=>new Xe({shape:()=>t,unknownKeys:"strict",catchall:bt.create(),typeName:te.ZodObject,...ue(e)});Xe.lazycreate=(t,e)=>new Xe({shape:t,unknownKeys:"strip",catchall:bt.create(),typeName:te.ZodObject,...ue(e)});var Lr=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 O.ZodError(a.ctx.common.issues));return(0,b.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_union,unionErrors:o}),b.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,b.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_union,unionErrors:a}),b.INVALID}}get options(){return this._def.options}};E.ZodUnion=Lr;Lr.create=(t,e)=>new Lr({options:t,typeName:te.ZodUnion,...ue(e)});var Xt=t=>t instanceof Mr?Xt(t.schema):t instanceof ot?Xt(t.innerType()):t instanceof qr?[t.value]:t instanceof Wr?t.options:t instanceof Hr?N.util.objectValues(t.enum):t instanceof Zr?Xt(t._def.innerType):t instanceof Or?[void 0]:t instanceof Nr?[null]:t instanceof lt?[void 0,...Xt(t.unwrap())]:t instanceof Mt?[null,...Xt(t.unwrap())]:t instanceof Mn||t instanceof Vr?Xt(t.unwrap()):t instanceof Ur?Xt(t._def.innerType):[],Js=class t extends ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==N.ZodParsedType.object)return(0,b.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.object,received:r.parsedType}),b.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,b.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),b.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=Xt(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:te.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...ue(n)})}};E.ZodDiscriminatedUnion=Js;function Oa(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 u=Oa(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.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],u=Oa(o,a);if(!u.valid)return{valid:!1};s.push(u.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 Br=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=(i,o)=>{if((0,b.isAborted)(i)||(0,b.isAborted)(o))return b.INVALID;let a=Oa(i.value,o.value);return a.valid?(((0,b.isDirty)(i)||(0,b.isDirty)(o))&&r.dirty(),{status:r.value,value:a.data}):((0,b.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_intersection_types}),b.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}))}};E.ZodIntersection=Br;Br.create=(t,e,r)=>new Br({left:t,right:e,typeName:te.ZodIntersection,...ue(r)});var Bt=class t extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==N.ZodParsedType.array)return(0,b.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.array,received:n.parsedType}),b.INVALID;if(n.data.length<this._def.items.length)return(0,b.addIssueToContext)(n,{code:O.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,b.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 dt(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>b.ParseStatus.mergeArray(r,o)):b.ParseStatus.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};E.ZodTuple=Bt;Bt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bt({items:t,typeName:te.ZodTuple,rest:null,...ue(e)})};var Xs=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,b.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.object,received:n.parsedType}),b.INVALID;let s=[],i=this._def.keyType,o=this._def.valueType;for(let a in n.data)s.push({key:i._parse(new dt(n,a,n.path,a)),value:o._parse(new dt(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?b.ParseStatus.mergeObjectAsync(r,s):b.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:te.ZodRecord,...ue(n)}):new t({keyType:Dr.create(),valueType:e,typeName:te.ZodRecord,...ue(r)})}};E.ZodRecord=Xs;var gn=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,b.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.map,received:n.parsedType}),b.INVALID;let s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,u],c)=>({key:s._parse(new dt(n,a,n.path,[c,"key"])),value:i._parse(new dt(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 b.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 b.INVALID;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};E.ZodMap=gn;gn.create=(t,e,r)=>new gn({valueType:e,keyType:t,typeName:te.ZodMap,...ue(r)});var Dn=class t extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==N.ZodParsedType.set)return(0,b.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.set,received:n.parsedType}),b.INVALID;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&((0,b.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,b.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 b.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 dt(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:J.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:J.errorUtil.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};E.ZodSet=Dn;Dn.create=(t,e)=>new Dn({valueType:t,minSize:null,maxSize:null,typeName:te.ZodSet,...ue(e)});var Ks=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,b.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.function,received:r.parsedType}),b.INVALID;function n(a,u){return(0,b.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,Ys.getErrorMap)(),Ys.defaultErrorMap].filter(c=>!!c),issueData:{code:O.ZodIssueCode.invalid_arguments,argumentsError:u}})}function s(a,u){return(0,b.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,Ys.getErrorMap)(),Ys.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 vr){let a=this;return(0,b.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,b.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:Bt.create(e).rest(Kt.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||Bt.create([]).rest(Kt.create()),returns:r||Kt.create(),typeName:te.ZodFunction,...ue(n)})}};E.ZodFunction=Ks;var Mr=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})}};E.ZodLazy=Mr;Mr.create=(t,e)=>new Mr({getter:t,typeName:te.ZodLazy,...ue(e)});var qr=class extends ce{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return(0,b.addIssueToContext)(r,{received:r.data,code:O.ZodIssueCode.invalid_literal,expected:this._def.value}),b.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}};E.ZodLiteral=qr;qr.create=(t,e)=>new qr({value:t,typeName:te.ZodLiteral,...ue(e)});function Nf(t,e){return new Wr({values:t,typeName:te.ZodEnum,...ue(e)})}var Wr=class t extends ce{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,b.addIssueToContext)(r,{expected:N.util.joinValues(n),received:r.parsedType,code:O.ZodIssueCode.invalid_type}),b.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,b.addIssueToContext)(r,{received:r.data,code:O.ZodIssueCode.invalid_enum_value,options:n}),b.INVALID}return(0,b.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})}};E.ZodEnum=Wr;Wr.create=Nf;var Hr=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,b.addIssueToContext)(n,{expected:N.util.joinValues(s),received:n.parsedType,code:O.ZodIssueCode.invalid_type}),b.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,b.addIssueToContext)(n,{received:n.data,code:O.ZodIssueCode.invalid_enum_value,options:s}),b.INVALID}return(0,b.OK)(e.data)}get enum(){return this._def.values}};E.ZodNativeEnum=Hr;Hr.create=(t,e)=>new Hr({values:t,typeName:te.ZodNativeEnum,...ue(e)});var vr=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,b.addIssueToContext)(r,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.promise,received:r.parsedType}),b.INVALID;let n=r.parsedType===N.ZodParsedType.promise?r.data:Promise.resolve(r.data);return(0,b.OK)(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};E.ZodPromise=vr;vr.create=(t,e)=>new vr({type:t,typeName:te.ZodPromise,...ue(e)});var ot=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===te.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,b.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 b.INVALID;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?b.INVALID:u.status==="dirty"||r.value==="dirty"?(0,b.DIRTY)(u.value):u});{if(r.value==="aborted")return b.INVALID;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?b.INVALID:a.status==="dirty"||r.value==="dirty"?(0,b.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"?b.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"?b.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,b.isValid)(o))return b.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,b.isValid)(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):b.INVALID);N.util.assertNever(s)}};E.ZodEffects=ot;E.ZodTransformer=ot;ot.create=(t,e,r)=>new ot({schema:t,typeName:te.ZodEffects,effect:e,...ue(r)});ot.createWithPreprocess=(t,e,r)=>new ot({schema:e,effect:{type:"preprocess",transform:t},typeName:te.ZodEffects,...ue(r)});var lt=class extends ce{_parse(e){return this._getType(e)===N.ZodParsedType.undefined?(0,b.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};E.ZodOptional=lt;lt.create=(t,e)=>new lt({innerType:t,typeName:te.ZodOptional,...ue(e)});var Mt=class extends ce{_parse(e){return this._getType(e)===N.ZodParsedType.null?(0,b.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};E.ZodNullable=Mt;Mt.create=(t,e)=>new Mt({innerType:t,typeName:te.ZodNullable,...ue(e)});var Zr=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}};E.ZodDefault=Zr;Zr.create=(t,e)=>new Zr({innerType:t,typeName:te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ue(e)});var Ur=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,b.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}};E.ZodCatch=Ur;Ur.create=(t,e)=>new Ur({innerType:t,typeName:te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ue(e)});var yn=class extends ce{_parse(e){if(this._getType(e)!==N.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return(0,b.addIssueToContext)(n,{code:O.ZodIssueCode.invalid_type,expected:N.ZodParsedType.nan,received:n.parsedType}),b.INVALID}return{status:"valid",value:e.data}}};E.ZodNaN=yn;yn.create=t=>new yn({typeName:te.ZodNaN,...ue(t)});E.BRAND=Symbol("zod_brand");var Mn=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}};E.ZodBranded=Mn;var qn=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"?b.INVALID:i.status==="dirty"?(r.dirty(),(0,b.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"?b.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:te.ZodPipeline})}};E.ZodPipeline=qn;var Vr=class extends ce{_parse(e){let r=this._def.innerType._parse(e),n=s=>((0,b.isValid)(s)&&(s.value=Object.freeze(s.value)),s);return(0,b.isAsync)(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};E.ZodReadonly=Vr;Vr.create=(t,e)=>new Vr({innerType:t,typeName:te.ZodReadonly,...ue(e)});function Tf(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Lf(t,e={},r){return t?yr.create().superRefine((n,s)=>{let i=t(n);if(i instanceof Promise)return i.then(o=>{if(!o){let a=Tf(e,n),u=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:u})}});if(!i){let o=Tf(e,n),a=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:a})}}):yr.create()}E.late={object:Xe.lazycreate};var te;(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"})(te||(E.ZodFirstPartyTypeKind=te={}));var QE=(t,e={message:`Input not instance of ${t.name}`})=>Lf(r=>r instanceof t,e);E.instanceof=QE;var Bf=Dr.create;E.string=Bf;var Mf=Ir.create;E.number=Mf;var eS=yn.create;E.nan=eS;var tS=Tr.create;E.bigint=tS;var qf=Rr.create;E.boolean=qf;var rS=Pr.create;E.date=rS;var nS=pn.create;E.symbol=nS;var sS=Or.create;E.undefined=sS;var oS=Nr.create;E.null=oS;var iS=yr.create;E.any=iS;var aS=Kt.create;E.unknown=aS;var uS=bt.create;E.never=uS;var cS=mn.create;E.void=cS;var lS=Qt.create;E.array=lS;var dS=Xe.create;E.object=dS;var fS=Xe.strictCreate;E.strictObject=fS;var hS=Lr.create;E.union=hS;var pS=Js.create;E.discriminatedUnion=pS;var mS=Br.create;E.intersection=mS;var gS=Bt.create;E.tuple=gS;var DS=Xs.create;E.record=DS;var yS=gn.create;E.map=yS;var vS=Dn.create;E.set=vS;var _S=Ks.create;E.function=_S;var ES=Mr.create;E.lazy=ES;var SS=qr.create;E.literal=SS;var bS=Wr.create;E.enum=bS;var CS=Hr.create;E.nativeEnum=CS;var wS=vr.create;E.promise=wS;var Wf=ot.create;E.effect=Wf;E.transformer=Wf;var xS=lt.create;E.optional=xS;var $S=Mt.create;E.nullable=$S;var AS=ot.createWithPreprocess;E.preprocess=AS;var kS=qn.create;E.pipeline=kS;var FS=()=>Bf().optional();E.ostring=FS;var jS=()=>Mf().optional();E.onumber=jS;var IS=()=>qf().optional();E.oboolean=IS;E.coerce={string:(t=>Dr.create({...t,coerce:!0})),number:(t=>Ir.create({...t,coerce:!0})),boolean:(t=>Rr.create({...t,coerce:!0})),bigint:(t=>Tr.create({...t,coerce:!0})),date:(t=>Pr.create({...t,coerce:!0}))};E.NEVER=b.INVALID});var Na=v(ft=>{"use strict";var TS=ft&&ft.__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]})),vn=ft&&ft.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TS(e,t,r)};Object.defineProperty(ft,"__esModule",{value:!0});vn(Gs(),ft);vn(Ra(),ft);vn(kf(),ft);vn(Ln(),ft);vn(Hf(),ft);vn(Vs(),ft)});var La=v(Ke=>{"use strict";var Zf=Ke&&Ke.__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]})),RS=Ke&&Ke.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PS=Ke&&Ke.__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)&&Zf(e,t,r);return RS(e,t),e},OS=Ke&&Ke.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zf(e,t,r)};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.z=void 0;var Uf=PS(Na());Ke.z=Uf;OS(Na(),Ke);Ke.default=Uf});var Wn=v((Hj,Vf)=>{"use strict";var NS="2.0.0",LS=Number.MAX_SAFE_INTEGER||9007199254740991,BS=16,MS=250,qS=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Vf.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:BS,MAX_SAFE_BUILD_LENGTH:MS,MAX_SAFE_INTEGER:LS,RELEASE_TYPES:qS,SEMVER_SPEC_VERSION:NS,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Hn=v((Zj,Gf)=>{"use strict";var WS=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Gf.exports=WS});var _n=v((qt,zf)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Ba,MAX_SAFE_BUILD_LENGTH:HS,MAX_LENGTH:ZS}=Wn(),US=Hn();qt=zf.exports={};var VS=qt.re=[],GS=qt.safeRe=[],H=qt.src=[],zS=qt.safeSrc=[],Z=qt.t={},YS=0,Ma="[a-zA-Z0-9-]",JS=[["\\s",1],["\\d",ZS],[Ma,HS]],XS=t=>{for(let[e,r]of JS)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ie=(t,e,r)=>{let n=XS(e),s=YS++;US(t,s,e),Z[t]=s,H[s]=e,zS[s]=n,VS[s]=new RegExp(e,r?"g":void 0),GS[s]=new RegExp(n,r?"g":void 0)};ie("NUMERICIDENTIFIER","0|[1-9]\\d*");ie("NUMERICIDENTIFIERLOOSE","\\d+");ie("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ma}*`);ie("MAINVERSION",`(${H[Z.NUMERICIDENTIFIER]})\\.(${H[Z.NUMERICIDENTIFIER]})\\.(${H[Z.NUMERICIDENTIFIER]})`);ie("MAINVERSIONLOOSE",`(${H[Z.NUMERICIDENTIFIERLOOSE]})\\.(${H[Z.NUMERICIDENTIFIERLOOSE]})\\.(${H[Z.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASEIDENTIFIER",`(?:${H[Z.NONNUMERICIDENTIFIER]}|${H[Z.NUMERICIDENTIFIER]})`);ie("PRERELEASEIDENTIFIERLOOSE",`(?:${H[Z.NONNUMERICIDENTIFIER]}|${H[Z.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASE",`(?:-(${H[Z.PRERELEASEIDENTIFIER]}(?:\\.${H[Z.PRERELEASEIDENTIFIER]})*))`);ie("PRERELEASELOOSE",`(?:-?(${H[Z.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${H[Z.PRERELEASEIDENTIFIERLOOSE]})*))`);ie("BUILDIDENTIFIER",`${Ma}+`);ie("BUILD",`(?:\\+(${H[Z.BUILDIDENTIFIER]}(?:\\.${H[Z.BUILDIDENTIFIER]})*))`);ie("FULLPLAIN",`v?${H[Z.MAINVERSION]}${H[Z.PRERELEASE]}?${H[Z.BUILD]}?`);ie("FULL",`^${H[Z.FULLPLAIN]}$`);ie("LOOSEPLAIN",`[v=\\s]*${H[Z.MAINVERSIONLOOSE]}${H[Z.PRERELEASELOOSE]}?${H[Z.BUILD]}?`);ie("LOOSE",`^${H[Z.LOOSEPLAIN]}$`);ie("GTLT","((?:<|>)?=?)");ie("XRANGEIDENTIFIERLOOSE",`${H[Z.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ie("XRANGEIDENTIFIER",`${H[Z.NUMERICIDENTIFIER]}|x|X|\\*`);ie("XRANGEPLAIN",`[v=\\s]*(${H[Z.XRANGEIDENTIFIER]})(?:\\.(${H[Z.XRANGEIDENTIFIER]})(?:\\.(${H[Z.XRANGEIDENTIFIER]})(?:${H[Z.PRERELEASE]})?${H[Z.BUILD]}?)?)?`);ie("XRANGEPLAINLOOSE",`[v=\\s]*(${H[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${H[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${H[Z.XRANGEIDENTIFIERLOOSE]})(?:${H[Z.PRERELEASELOOSE]})?${H[Z.BUILD]}?)?)?`);ie("XRANGE",`^${H[Z.GTLT]}\\s*${H[Z.XRANGEPLAIN]}$`);ie("XRANGELOOSE",`^${H[Z.GTLT]}\\s*${H[Z.XRANGEPLAINLOOSE]}$`);ie("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ba}})(?:\\.(\\d{1,${Ba}}))?(?:\\.(\\d{1,${Ba}}))?`);ie("COERCE",`${H[Z.COERCEPLAIN]}(?:$|[^\\d])`);ie("COERCEFULL",H[Z.COERCEPLAIN]+`(?:${H[Z.PRERELEASE]})?(?:${H[Z.BUILD]})?(?:$|[^\\d])`);ie("COERCERTL",H[Z.COERCE],!0);ie("COERCERTLFULL",H[Z.COERCEFULL],!0);ie("LONETILDE","(?:~>?)");ie("TILDETRIM",`(\\s*)${H[Z.LONETILDE]}\\s+`,!0);qt.tildeTrimReplace="$1~";ie("TILDE",`^${H[Z.LONETILDE]}${H[Z.XRANGEPLAIN]}$`);ie("TILDELOOSE",`^${H[Z.LONETILDE]}${H[Z.XRANGEPLAINLOOSE]}$`);ie("LONECARET","(?:\\^)");ie("CARETTRIM",`(\\s*)${H[Z.LONECARET]}\\s+`,!0);qt.caretTrimReplace="$1^";ie("CARET",`^${H[Z.LONECARET]}${H[Z.XRANGEPLAIN]}$`);ie("CARETLOOSE",`^${H[Z.LONECARET]}${H[Z.XRANGEPLAINLOOSE]}$`);ie("COMPARATORLOOSE",`^${H[Z.GTLT]}\\s*(${H[Z.LOOSEPLAIN]})$|^$`);ie("COMPARATOR",`^${H[Z.GTLT]}\\s*(${H[Z.FULLPLAIN]})$|^$`);ie("COMPARATORTRIM",`(\\s*)${H[Z.GTLT]}\\s*(${H[Z.LOOSEPLAIN]}|${H[Z.XRANGEPLAIN]})`,!0);qt.comparatorTrimReplace="$1$2$3";ie("HYPHENRANGE",`^\\s*(${H[Z.XRANGEPLAIN]})\\s+-\\s+(${H[Z.XRANGEPLAIN]})\\s*$`);ie("HYPHENRANGELOOSE",`^\\s*(${H[Z.XRANGEPLAINLOOSE]})\\s+-\\s+(${H[Z.XRANGEPLAINLOOSE]})\\s*$`);ie("STAR","(<|>)?=?\\s*\\*");ie("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ie("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Qs=v((Uj,Yf)=>{"use strict";var KS=Object.freeze({loose:!0}),QS=Object.freeze({}),eb=t=>t?typeof t!="object"?KS:t:QS;Yf.exports=eb});var qa=v((Vj,Kf)=>{"use strict";var Jf=/^[0-9]+$/,Xf=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=Jf.test(t),n=Jf.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},tb=(t,e)=>Xf(e,t);Kf.exports={compareIdentifiers:Xf,rcompareIdentifiers:tb}});var Ne=v((Gj,eh)=>{"use strict";var eo=Hn(),{MAX_LENGTH:Qf,MAX_SAFE_INTEGER:to}=Wn(),{safeRe:ro,t:no}=_n(),rb=Qs(),{compareIdentifiers:Wa}=qa(),Ha=class t{constructor(e,r){if(r=rb(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>Qf)throw new TypeError(`version is longer than ${Qf} characters`);eo("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?ro[no.LOOSE]:ro[no.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>to||this.major<0)throw new TypeError("Invalid major version");if(this.minor>to||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>to||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<to)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(eo("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(eo("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 Wa(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(eo("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 Wa(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?ro[no.PRERELEASELOOSE]:ro[no.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]),Wa(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}};eh.exports=Ha});var Gr=v((zj,rh)=>{"use strict";var th=Ne(),nb=(t,e,r=!1)=>{if(t instanceof th)return t;try{return new th(t,e)}catch(n){if(!r)return null;throw n}};rh.exports=nb});var sh=v((Yj,nh)=>{"use strict";var sb=Gr(),ob=(t,e)=>{let r=sb(t,e);return r?r.version:null};nh.exports=ob});var ih=v((Jj,oh)=>{"use strict";var ib=Gr(),ab=(t,e)=>{let r=ib(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};oh.exports=ab});var ch=v((Xj,uh)=>{"use strict";var ah=Ne(),ub=(t,e,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new ah(t instanceof ah?t.version:t,r).inc(e,n,s).version}catch{return null}};uh.exports=ub});var fh=v((Kj,dh)=>{"use strict";var lh=Gr(),cb=(t,e)=>{let r=lh(t,null,!0),n=lh(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"};dh.exports=cb});var ph=v((Qj,hh)=>{"use strict";var lb=Ne(),db=(t,e)=>new lb(t,e).major;hh.exports=db});var gh=v((e2,mh)=>{"use strict";var fb=Ne(),hb=(t,e)=>new fb(t,e).minor;mh.exports=hb});var yh=v((t2,Dh)=>{"use strict";var pb=Ne(),mb=(t,e)=>new pb(t,e).patch;Dh.exports=mb});var _h=v((r2,vh)=>{"use strict";var gb=Gr(),Db=(t,e)=>{let r=gb(t,e);return r&&r.prerelease.length?r.prerelease:null};vh.exports=Db});var ht=v((n2,Sh)=>{"use strict";var Eh=Ne(),yb=(t,e,r)=>new Eh(t,r).compare(new Eh(e,r));Sh.exports=yb});var Ch=v((s2,bh)=>{"use strict";var vb=ht(),_b=(t,e,r)=>vb(e,t,r);bh.exports=_b});var xh=v((o2,wh)=>{"use strict";var Eb=ht(),Sb=(t,e)=>Eb(t,e,!0);wh.exports=Sb});var so=v((i2,Ah)=>{"use strict";var $h=Ne(),bb=(t,e,r)=>{let n=new $h(t,r),s=new $h(e,r);return n.compare(s)||n.compareBuild(s)};Ah.exports=bb});var Fh=v((a2,kh)=>{"use strict";var Cb=so(),wb=(t,e)=>t.sort((r,n)=>Cb(r,n,e));kh.exports=wb});var Ih=v((u2,jh)=>{"use strict";var xb=so(),$b=(t,e)=>t.sort((r,n)=>xb(n,r,e));jh.exports=$b});var Zn=v((c2,Th)=>{"use strict";var Ab=ht(),kb=(t,e,r)=>Ab(t,e,r)>0;Th.exports=kb});var oo=v((l2,Rh)=>{"use strict";var Fb=ht(),jb=(t,e,r)=>Fb(t,e,r)<0;Rh.exports=jb});var Za=v((d2,Ph)=>{"use strict";var Ib=ht(),Tb=(t,e,r)=>Ib(t,e,r)===0;Ph.exports=Tb});var Ua=v((f2,Oh)=>{"use strict";var Rb=ht(),Pb=(t,e,r)=>Rb(t,e,r)!==0;Oh.exports=Pb});var io=v((h2,Nh)=>{"use strict";var Ob=ht(),Nb=(t,e,r)=>Ob(t,e,r)>=0;Nh.exports=Nb});var ao=v((p2,Lh)=>{"use strict";var Lb=ht(),Bb=(t,e,r)=>Lb(t,e,r)<=0;Lh.exports=Bb});var Va=v((m2,Bh)=>{"use strict";var Mb=Za(),qb=Ua(),Wb=Zn(),Hb=io(),Zb=oo(),Ub=ao(),Vb=(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 Mb(t,r,n);case"!=":return qb(t,r,n);case">":return Wb(t,r,n);case">=":return Hb(t,r,n);case"<":return Zb(t,r,n);case"<=":return Ub(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Bh.exports=Vb});var qh=v((g2,Mh)=>{"use strict";var Gb=Ne(),zb=Gr(),{safeRe:uo,t:co}=_n(),Yb=(t,e)=>{if(t instanceof Gb)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?uo[co.COERCEFULL]:uo[co.COERCE]);else{let u=e.includePrerelease?uo[co.COERCERTLFULL]:uo[co.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 zb(`${n}.${s}.${i}${o}${a}`,e)};Mh.exports=Yb});var Hh=v((D2,Wh)=>{"use strict";var Ga=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}};Wh.exports=Ga});var pt=v((y2,Gh)=>{"use strict";var Jb=/\s+/g,za=class t{constructor(e,r){if(r=Kb(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Ya)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(Jb," "),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=>!Uh(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&&oC(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&&nC)|(this.options.loose&&sC))+":"+e,s=Zh.get(n);if(s)return s;let i=this.options.loose,o=i?He[Le.HYPHENRANGELOOSE]:He[Le.HYPHENRANGE];e=e.replace(o,mC(this.options.includePrerelease)),Ee("hyphen replace",e),e=e.replace(He[Le.COMPARATORTRIM],eC),Ee("comparator trim",e),e=e.replace(He[Le.TILDETRIM],tC),Ee("tilde trim",e),e=e.replace(He[Le.CARETTRIM],rC),Ee("caret trim",e);let a=e.split(" ").map(d=>iC(d,this.options)).join(" ").split(/\s+/).map(d=>pC(d,this.options));i&&(a=a.filter(d=>(Ee("loose invalid filter",d,this.options),!!d.match(He[Le.COMPARATORLOOSE])))),Ee("range list",a);let u=new Map,c=a.map(d=>new Ya(d,this.options));for(let d of c){if(Uh(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return Zh.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Vh(n,r)&&e.set.some(s=>Vh(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 Qb(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(gC(this.set[r],e,this.options))return!0;return!1}};Gh.exports=za;var Xb=Hh(),Zh=new Xb,Kb=Qs(),Ya=Un(),Ee=Hn(),Qb=Ne(),{safeRe:He,t:Le,comparatorTrimReplace:eC,tildeTrimReplace:tC,caretTrimReplace:rC}=_n(),{FLAG_INCLUDE_PRERELEASE:nC,FLAG_LOOSE:sC}=Wn(),Uh=t=>t.value==="<0.0.0-0",oC=t=>t.value==="",Vh=(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},iC=(t,e)=>(t=t.replace(He[Le.BUILD],""),Ee("comp",t,e),t=cC(t,e),Ee("caret",t),t=aC(t,e),Ee("tildes",t),t=dC(t,e),Ee("xrange",t),t=hC(t,e),Ee("stars",t),t),Ze=t=>!t||t.toLowerCase()==="x"||t==="*",aC=(t,e)=>t.trim().split(/\s+/).map(r=>uC(r,e)).join(" "),uC=(t,e)=>{let r=e.loose?He[Le.TILDELOOSE]:He[Le.TILDE];return t.replace(r,(n,s,i,o,a)=>{Ee("tilde",t,n,s,i,o,a);let u;return Ze(s)?u="":Ze(i)?u=`>=${s}.0.0 <${+s+1}.0.0-0`:Ze(o)?u=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:a?(Ee("replaceTilde pr",a),u=`>=${s}.${i}.${o}-${a} <${s}.${+i+1}.0-0`):u=`>=${s}.${i}.${o} <${s}.${+i+1}.0-0`,Ee("tilde return",u),u})},cC=(t,e)=>t.trim().split(/\s+/).map(r=>lC(r,e)).join(" "),lC=(t,e)=>{Ee("caret",t,e);let r=e.loose?He[Le.CARETLOOSE]:He[Le.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(s,i,o,a,u)=>{Ee("caret",t,s,i,o,a,u);let c;return Ze(i)?c="":Ze(o)?c=`>=${i}.0.0${n} <${+i+1}.0.0-0`:Ze(a)?i==="0"?c=`>=${i}.${o}.0${n} <${i}.${+o+1}.0-0`:c=`>=${i}.${o}.0${n} <${+i+1}.0.0-0`:u?(Ee("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`):(Ee("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`),Ee("caret return",c),c})},dC=(t,e)=>(Ee("replaceXRanges",t,e),t.split(/\s+/).map(r=>fC(r,e)).join(" ")),fC=(t,e)=>{t=t.trim();let r=e.loose?He[Le.XRANGELOOSE]:He[Le.XRANGE];return t.replace(r,(n,s,i,o,a,u)=>{Ee("xRange",t,n,s,i,o,a,u);let c=Ze(i),l=c||Ze(o),d=l||Ze(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`),Ee("xRange return",n),n})},hC=(t,e)=>(Ee("replaceStars",t,e),t.trim().replace(He[Le.STAR],"")),pC=(t,e)=>(Ee("replaceGTE0",t,e),t.trim().replace(He[e.includePrerelease?Le.GTE0PRE:Le.GTE0],"")),mC=t=>(e,r,n,s,i,o,a,u,c,l,d,f)=>(Ze(n)?r="":Ze(s)?r=`>=${n}.0.0${t?"-0":""}`:Ze(i)?r=`>=${n}.${s}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ze(c)?u="":Ze(l)?u=`<${+c+1}.0.0-0`:Ze(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()),gC=(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(Ee(t[n].semver),t[n].semver!==Ya.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 Un=v((v2,Qh)=>{"use strict";var Vn=Symbol("SemVer ANY"),Ka=class t{static get ANY(){return Vn}constructor(e,r){if(r=zh(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Xa("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Vn?this.value="":this.value=this.operator+this.semver.version,Xa("comp",this)}parse(e){let r=this.options.loose?Yh[Jh.COMPARATORLOOSE]:Yh[Jh.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 Xh(n[2],this.options.loose):this.semver=Vn}toString(){return this.value}test(e){if(Xa("Comparator.test",e,this.options.loose),this.semver===Vn||e===Vn)return!0;if(typeof e=="string")try{e=new Xh(e,this.options)}catch{return!1}return Ja(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 Kh(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Kh(this.value,r).test(e.semver):(r=zh(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("=")||Ja(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ja(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Qh.exports=Ka;var zh=Qs(),{safeRe:Yh,t:Jh}=_n(),Ja=Va(),Xa=Hn(),Xh=Ne(),Kh=pt()});var Gn=v((_2,ep)=>{"use strict";var DC=pt(),yC=(t,e,r)=>{try{e=new DC(e,r)}catch{return!1}return e.test(t)};ep.exports=yC});var rp=v((E2,tp)=>{"use strict";var vC=pt(),_C=(t,e)=>new vC(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));tp.exports=_C});var sp=v((S2,np)=>{"use strict";var EC=Ne(),SC=pt(),bC=(t,e,r)=>{let n=null,s=null,i=null;try{i=new SC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new EC(n,r))}),n};np.exports=bC});var ip=v((b2,op)=>{"use strict";var CC=Ne(),wC=pt(),xC=(t,e,r)=>{let n=null,s=null,i=null;try{i=new wC(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new CC(n,r))}),n};op.exports=xC});var cp=v((C2,up)=>{"use strict";var Qa=Ne(),$C=pt(),ap=Zn(),AC=(t,e)=>{t=new $C(t,e);let r=new Qa("0.0.0");if(t.test(r)||(r=new Qa("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 Qa(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||ap(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||ap(r,i))&&(r=i)}return r&&t.test(r)?r:null};up.exports=AC});var dp=v((w2,lp)=>{"use strict";var kC=pt(),FC=(t,e)=>{try{return new kC(t,e).range||"*"}catch{return null}};lp.exports=FC});var lo=v((x2,mp)=>{"use strict";var jC=Ne(),pp=Un(),{ANY:IC}=pp,TC=pt(),RC=Gn(),fp=Zn(),hp=oo(),PC=ao(),OC=io(),NC=(t,e,r,n)=>{t=new jC(t,n),e=new TC(e,n);let s,i,o,a,u;switch(r){case">":s=fp,i=PC,o=hp,a=">",u=">=";break;case"<":s=hp,i=OC,o=fp,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(RC(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===IC&&(g=new pp(">=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};mp.exports=NC});var Dp=v(($2,gp)=>{"use strict";var LC=lo(),BC=(t,e,r)=>LC(t,e,">",r);gp.exports=BC});var vp=v((A2,yp)=>{"use strict";var MC=lo(),qC=(t,e,r)=>MC(t,e,"<",r);yp.exports=qC});var Sp=v((k2,Ep)=>{"use strict";var _p=pt(),WC=(t,e,r)=>(t=new _p(t,r),e=new _p(e,r),t.intersects(e,r));Ep.exports=WC});var Cp=v((F2,bp)=>{"use strict";var HC=Gn(),ZC=ht();bp.exports=(t,e,r)=>{let n=[],s=null,i=null,o=t.sort((l,d)=>ZC(l,d,r));for(let l of o)HC(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 Fp=v((j2,kp)=>{"use strict";var wp=pt(),tu=Un(),{ANY:eu}=tu,zn=Gn(),ru=ht(),UC=(t,e,r={})=>{if(t===e)return!0;t=new wp(t,r),e=new wp(e,r);let n=!1;e:for(let s of t.set){for(let i of e.set){let o=GC(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},VC=[new tu(">=0.0.0-0")],xp=[new tu(">=0.0.0")],GC=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===eu){if(e.length===1&&e[0].semver===eu)return!0;r.includePrerelease?t=VC:t=xp}if(e.length===1&&e[0].semver===eu){if(r.includePrerelease)return!0;e=xp}let n=new Set,s,i;for(let g of t)g.operator===">"||g.operator===">="?s=$p(s,g,r):g.operator==="<"||g.operator==="<="?i=Ap(i,g,r):n.add(g.semver);if(n.size>1)return null;let o;if(s&&i){if(o=ru(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&&!zn(g,String(s),r)||i&&!zn(g,String(i),r))return null;for(let m of e)if(!zn(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=$p(s,g,r),a===g&&a!==s)return!1}else if(s.operator===">="&&!zn(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=Ap(i,g,r),u===g&&u!==i)return!1}else if(i.operator==="<="&&!zn(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)},$p=(t,e,r)=>{if(!t)return e;let n=ru(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Ap=(t,e,r)=>{if(!t)return e;let n=ru(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};kp.exports=UC});var Rp=v((I2,Tp)=>{"use strict";var nu=_n(),jp=Wn(),zC=Ne(),Ip=qa(),YC=Gr(),JC=sh(),XC=ih(),KC=ch(),QC=fh(),ew=ph(),tw=gh(),rw=yh(),nw=_h(),sw=ht(),ow=Ch(),iw=xh(),aw=so(),uw=Fh(),cw=Ih(),lw=Zn(),dw=oo(),fw=Za(),hw=Ua(),pw=io(),mw=ao(),gw=Va(),Dw=qh(),yw=Un(),vw=pt(),_w=Gn(),Ew=rp(),Sw=sp(),bw=ip(),Cw=cp(),ww=dp(),xw=lo(),$w=Dp(),Aw=vp(),kw=Sp(),Fw=Cp(),jw=Fp();Tp.exports={parse:YC,valid:JC,clean:XC,inc:KC,diff:QC,major:ew,minor:tw,patch:rw,prerelease:nw,compare:sw,rcompare:ow,compareLoose:iw,compareBuild:aw,sort:uw,rsort:cw,gt:lw,lt:dw,eq:fw,neq:hw,gte:pw,lte:mw,cmp:gw,coerce:Dw,Comparator:yw,Range:vw,satisfies:_w,toComparators:Ew,maxSatisfying:Sw,minSatisfying:bw,minVersion:Cw,validRange:ww,outside:xw,gtr:$w,ltr:Aw,intersects:kw,simplifyRange:Fw,subset:jw,SemVer:zC,re:nu.re,src:nu.src,tokens:nu.t,SEMVER_SPEC_VERSION:jp.SEMVER_SPEC_VERSION,RELEASE_TYPES:jp.RELEASE_TYPES,compareIdentifiers:Ip.compareIdentifiers,rcompareIdentifiers:Ip.rcompareIdentifiers}});var er=v(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});var Iw=(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(P){if(P=i.postProcess(P,n),s){setTimeout(function(){s(P)},0);return}else return P},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}],y=this.extractCommon(m[0],r,e,0,n);if(m[0].oldPos+1>=c&&y+1>=u)return a(this.buildValues(m[0].lastComponent,r,e));var p=-1/0,C=1/0,S=function(){for(var P=Math.max(p,-l);P<=Math.min(C,l);P+=2){var W=void 0,F=m[P-1],R=m[P+1];F&&(m[P-1]=void 0);var j=!1;if(R){var M=R.oldPos-P;j=R&&0<=M&&M<u}var re=F&&F.oldPos+1<c;if(!j&&!re){m[P]=void 0;continue}if(!re||j&&F.oldPos<R.oldPos?W=i.addToPath(R,!0,!1,0,n):W=i.addToPath(F,!1,!0,1,n),y=i.extractCommon(W,r,e,P,n),W.oldPos+1>=c&&y+1>=u)return a(i.buildValues(W.lastComponent,r,e))||!0;m[P]=W,W.oldPos+1>=c&&(C=Math.min(C,P-1)),y+1>=u&&(p=Math.max(p,P+1))}l++};if(s)(function P(){setTimeout(function(){if(l>d||Date.now()>g)return s(void 0);S()||P()},0)})();else for(;l<=d&&Date.now()<=g;){var I=S();if(I)return I}},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})();su.default=Iw});var Pp=v(_r=>{"use strict";var Tw=_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.characterDiff=void 0;_r.diffChars=Ow;var Rw=er(),Pw=(function(t){Tw(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Rw.default);_r.characterDiff=new Pw;function Ow(t,e,r){return _r.characterDiff.diff(t,e,r)}});var iu=v(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.longestCommonPrefix=Nw;Ue.longestCommonSuffix=Lw;Ue.replacePrefix=Op;Ue.replaceSuffix=Np;Ue.removePrefix=Bw;Ue.removeSuffix=Mw;Ue.maximumOverlap=qw;Ue.hasOnlyWinLineEndings=Hw;Ue.hasOnlyUnixLineEndings=Zw;Ue.segment=Lp;Ue.trailingWs=Bp;Ue.leadingWs=Mp;Ue.leadingAndTrailingWs=ou;function Nw(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 Lw(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 Op(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 Np(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 Bw(t,e){return Op(t,e,"")}function Mw(t,e){return Np(t,e,"")}function qw(t,e){return e.slice(0,Ww(t,e))}function Ww(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 Hw(t){return t.includes(`\r
9
9
  `)&&!t.startsWith(`
10
- `)&&!t.match(/[^\r]\n/)}function Iw(t){return!t.includes(`\r
10
+ `)&&!t.match(/[^\r]\n/)}function Zw(t){return!t.includes(`\r
11
11
  `)&&t.includes(`
12
- `)}function jp(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 Ip(t,e){if(e)return su(t,e)[1];var r;for(r=t.length-1;r>=0&&t[r].match(/\s/);r--);return t.substring(r+1)}function Tp(t,e){if(e)return su(t,e)[0];var r=t.match(/^\s*/);return r?r[0]:""}function su(t,e){if(!e)return[Tp(t),Ip(t)];if(e.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');var r=jp(t,e),n=r[0],s=r[r.length-1],i=/\s/.test(n)?n:"",o=/\s/.test(s)?s:"";return[i,o]}});var Lp=_(ht=>{"use strict";var Pp=ht&&ht.__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(ht,"__esModule",{value:!0});ht.wordsWithSpaceDiff=ht.wordDiff=void 0;ht.diffWords=Pw;ht.diffWordsWithSpace=Np;var Op=Kt(),he=ou(),lo="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}",Tw=new RegExp("[".concat(lo,"]+|\\s+|[^").concat(lo,"]"),"ug"),Rw=(function(t){Pp(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,he.segment)(r,i)}else s=r.match(Tw)||[];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)&&Rp(s,o,i,a,n.intlSegmenter),s=a,i=null,o=null)}),(i||o)&&Rp(s,o,i,null,n.intlSegmenter),r},e})(Op.default);ht.wordDiff=new Rw;function Pw(t,e,r){return r?.ignoreWhitespace!=null&&!r.ignoreWhitespace?Np(t,e,r):ht.wordDiff.diff(t,e,r)}function Rp(t,e,r,n,s){if(e&&r){var i=(0,he.leadingAndTrailingWs)(e.value,s),o=i[0],a=i[1],u=(0,he.leadingAndTrailingWs)(r.value,s),c=u[0],l=u[1];if(t){var d=(0,he.longestCommonPrefix)(o,c);t.value=(0,he.replaceSuffix)(t.value,c,d),e.value=(0,he.removePrefix)(e.value,d),r.value=(0,he.removePrefix)(r.value,d)}if(n){var f=(0,he.longestCommonSuffix)(a,l);n.value=(0,he.replacePrefix)(n.value,l,f),e.value=(0,he.removeSuffix)(e.value,f),r.value=(0,he.removeSuffix)(r.value,f)}}else if(r){if(t){var g=(0,he.leadingWs)(r.value,s);r.value=r.value.substring(g.length)}if(n){var g=(0,he.leadingWs)(n.value,s);n.value=n.value.substring(g.length)}}else if(t&&n){var m=(0,he.leadingWs)(n.value,s),D=(0,he.leadingAndTrailingWs)(e.value,s),h=D[0],C=D[1],b=(0,he.longestCommonPrefix)(m,h);e.value=(0,he.removePrefix)(e.value,b);var I=(0,he.longestCommonSuffix)((0,he.removePrefix)(m,b),C);e.value=(0,he.removeSuffix)(e.value,I),n.value=(0,he.replacePrefix)(n.value,m,I),t.value=(0,he.replaceSuffix)(t.value,m,m.slice(0,m.length-I.length))}else if(n){var R=(0,he.leadingWs)(n.value,s),q=(0,he.trailingWs)(e.value,s),j=(0,he.maximumOverlap)(q,R);e.value=(0,he.removeSuffix)(e.value,j)}else if(t){var P=(0,he.trailingWs)(t.value,s),k=(0,he.leadingWs)(e.value,s),j=(0,he.maximumOverlap)(P,k);e.value=(0,he.removePrefix)(e.value,j)}}var Ow=(function(t){Pp(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(lo,"]+|[^\\S\\n\\r]+|[^").concat(lo,"]"),"ug");return r.match(n)||[]},e})(Op.default);ht.wordsWithSpaceDiff=new Ow;function Np(t,e,r){return ht.wordsWithSpaceDiff.diff(t,e,r)}});var Bp=_(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.generateOptions=Nw;function Nw(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 fo=_(bt=>{"use strict";var Lw=bt&&bt.__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(bt,"__esModule",{value:!0});bt.lineDiff=void 0;bt.diffLines=Ww;bt.diffTrimmedLines=Hw;bt.tokenize=Mp;var Bw=Kt(),Mw=Bp(),qw=(function(t){Lw(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.tokenize=Mp,r}return e.prototype.equals=function(r,n,s){return s.ignoreWhitespace?((!s.newlineIsToken||!r.includes(`
12
+ `)}function Lp(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 Bp(t,e){if(e)return ou(t,e)[1];var r;for(r=t.length-1;r>=0&&t[r].match(/\s/);r--);return t.substring(r+1)}function Mp(t,e){if(e)return ou(t,e)[0];var r=t.match(/^\s*/);return r?r[0]:""}function ou(t,e){if(!e)return[Mp(t),Bp(t)];if(e.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');var r=Lp(t,e),n=r[0],s=r[r.length-1],i=/\s/.test(n)?n:"",o=/\s/.test(s)?s:"";return[i,o]}});var Up=v(mt=>{"use strict";var Wp=mt&&mt.__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(mt,"__esModule",{value:!0});mt.wordsWithSpaceDiff=mt.wordDiff=void 0;mt.diffWords=Gw;mt.diffWordsWithSpace=Zp;var Hp=er(),he=iu(),fo="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}",Uw=new RegExp("[".concat(fo,"]+|\\s+|[^").concat(fo,"]"),"ug"),Vw=(function(t){Wp(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,he.segment)(r,i)}else s=r.match(Uw)||[];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)&&qp(s,o,i,a,n.intlSegmenter),s=a,i=null,o=null)}),(i||o)&&qp(s,o,i,null,n.intlSegmenter),r},e})(Hp.default);mt.wordDiff=new Vw;function Gw(t,e,r){return r?.ignoreWhitespace!=null&&!r.ignoreWhitespace?Zp(t,e,r):mt.wordDiff.diff(t,e,r)}function qp(t,e,r,n,s){if(e&&r){var i=(0,he.leadingAndTrailingWs)(e.value,s),o=i[0],a=i[1],u=(0,he.leadingAndTrailingWs)(r.value,s),c=u[0],l=u[1];if(t){var d=(0,he.longestCommonPrefix)(o,c);t.value=(0,he.replaceSuffix)(t.value,c,d),e.value=(0,he.removePrefix)(e.value,d),r.value=(0,he.removePrefix)(r.value,d)}if(n){var f=(0,he.longestCommonSuffix)(a,l);n.value=(0,he.replacePrefix)(n.value,l,f),e.value=(0,he.removeSuffix)(e.value,f),r.value=(0,he.removeSuffix)(r.value,f)}}else if(r){if(t){var g=(0,he.leadingWs)(r.value,s);r.value=r.value.substring(g.length)}if(n){var g=(0,he.leadingWs)(n.value,s);n.value=n.value.substring(g.length)}}else if(t&&n){var m=(0,he.leadingWs)(n.value,s),y=(0,he.leadingAndTrailingWs)(e.value,s),p=y[0],C=y[1],S=(0,he.longestCommonPrefix)(m,p);e.value=(0,he.removePrefix)(e.value,S);var I=(0,he.longestCommonSuffix)((0,he.removePrefix)(m,S),C);e.value=(0,he.removeSuffix)(e.value,I),n.value=(0,he.replacePrefix)(n.value,m,I),t.value=(0,he.replaceSuffix)(t.value,m,m.slice(0,m.length-I.length))}else if(n){var P=(0,he.leadingWs)(n.value,s),W=(0,he.trailingWs)(e.value,s),F=(0,he.maximumOverlap)(W,P);e.value=(0,he.removeSuffix)(e.value,F)}else if(t){var R=(0,he.trailingWs)(t.value,s),j=(0,he.leadingWs)(e.value,s),F=(0,he.maximumOverlap)(R,j);e.value=(0,he.removePrefix)(e.value,F)}}var zw=(function(t){Wp(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(fo,"]+|[^\\S\\n\\r]+|[^").concat(fo,"]"),"ug");return r.match(n)||[]},e})(Hp.default);mt.wordsWithSpaceDiff=new zw;function Zp(t,e,r){return mt.wordsWithSpaceDiff.diff(t,e,r)}});var Vp=v(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.generateOptions=Yw;function Yw(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 ho=v(Ct=>{"use strict";var Jw=Ct&&Ct.__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(Ct,"__esModule",{value:!0});Ct.lineDiff=void 0;Ct.diffLines=ex;Ct.diffTrimmedLines=tx;Ct.tokenize=Gp;var Xw=er(),Kw=Vp(),Qw=(function(t){Jw(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.tokenize=Gp,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})(Bw.default);bt.lineDiff=new qw;function Ww(t,e,r){return bt.lineDiff.diff(t,e,r)}function Hw(t,e,r){return r=(0,Mw.generateOptions)(r,{ignoreWhitespace:!0}),bt.lineDiff.diff(t,e,r)}function Mp(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 qp=_(yr=>{"use strict";var Zw=yr&&yr.__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(yr,"__esModule",{value:!0});yr.sentenceDiff=void 0;yr.diffSentences=zw;var Uw=Kt();function Vw(t){return t=="."||t=="!"||t=="?"}var Gw=(function(t){Zw(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(Vw(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})(Uw.default);yr.sentenceDiff=new Gw;function zw(t,e,r){return yr.sentenceDiff.diff(t,e,r)}});var Wp=_(vr=>{"use strict";var Yw=vr&&vr.__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(vr,"__esModule",{value:!0});vr.cssDiff=void 0;vr.diffCss=Jw;var Kw=Kt(),Xw=(function(t){Yw(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){return r.split(/([{}:;,]|\s+)/)},e})(Kw.default);vr.cssDiff=new Xw;function Jw(t,e,r){return vr.cssDiff.diff(t,e,r)}});var Hp=_(Xt=>{"use strict";var Qw=Xt&&Xt.__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(Xt,"__esModule",{value:!0});Xt.jsonDiff=void 0;Xt.diffJson=nx;Xt.canonicalize=ho;var ex=Kt(),tx=fo(),rx=(function(t){Qw(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.tokenize=tx.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(ho(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})(ex.default);Xt.jsonDiff=new rx;function nx(t,e,r){return Xt.jsonDiff.diff(t,e,r)}function ho(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]=ho(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]=ho(t[u],e,r,n,u);e.pop(),r.pop()}else o=t;return o}});var Zp=_(_r=>{"use strict";var sx=_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=ax;var ox=Kt(),ix=(function(t){sx(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})(ox.default);_r.arrayDiff=new ix;function ax(t,e,r){return _r.arrayDiff.diff(t,e,r)}});var Gp=_(Er=>{"use strict";var Mt=Er&&Er.__assign||function(){return Mt=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},Mt.apply(this,arguments)};Object.defineProperty(Er,"__esModule",{value:!0});Er.unixToWin=Up;Er.winToUnix=Vp;Er.isUnix=ux;Er.isWin=cx;function Up(t){return Array.isArray(t)?t.map(function(e){return Up(e)}):Mt(Mt({},t),{hunks:t.hunks.map(function(e){return Mt(Mt({},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 Vp(t){return Array.isArray(t)?t.map(function(e){return Vp(e)}):Mt(Mt({},t),{hunks:t.hunks.map(function(e){return Mt(Mt({},e),{lines:e.lines.map(function(r){return r.endsWith("\r")?r.substring(0,r.length-1):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.startsWith("\\")&&n.endsWith("\r")})})})}function cx(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 uu=_(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.parsePatch=lx;function lx(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 zp=_(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.default=dx;function dx(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 Jp=_(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.applyPatch=Xp;mo.applyPatches=px;var Yp=ou(),po=Gp(),Kp=uu(),fx=zp();function Xp(t,e,r){r===void 0&&(r={});var n;if(typeof e=="string"?n=(0,Kp.parsePatch)(e):Array.isArray(e)?n=e:n=[e],n.length>1)throw new Error("applyPatch only works with a single input.");return hx(t,n[0],r)}function hx(t,e,r){r===void 0&&(r={}),(r.autoConvertLineEndings||r.autoConvertLineEndings==null)&&((0,Yp.hasOnlyWinLineEndings)(t)&&(0,po.isUnix)(e)?e=(0,po.unixToWin)(e):(0,Yp.hasOnlyUnixLineEndings)(t)&&(0,po.isWin)(e)&&(e=(0,po.winToUnix)(e)));var n=t.split(`
18
- `),s=e.hunks,i=r.compareLine||(function(k,M,re,$){return M===$}),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(k,M,re,$,ae,X,ne){$===void 0&&($=0),ae===void 0&&(ae=!0),X===void 0&&(X=[]),ne===void 0&&(ne=0);for(var x=0,A=!1;$<k.length;$++){var fe=k[$],se=fe.length>0?fe[0]:" ",Se=fe.length>0?fe.substr(1):fe;if(se==="-")if(i(M+1,n[M],se,Se))M++,x=0;else return!re||n[M]==null?null:(X[ne]=n[M],g(k,M+1,re-1,$,!1,X,ne+1));if(se==="+"){if(!ae)return null;X[ne]=Se,ne++,x=0,A=!0}if(se===" ")if(x++,X[ne]=n[M],i(M+1,n[M],se,Se))ne++,ae=!0,A=!1,M++;else return A||!re?null:n[M]&&(g(k,M+1,re-1,$+1,!1,X,ne+1)||g(k,M+1,re-1,$,!1,X,ne+1))||g(k,M,re-1,$+1,!1,X,ne)}return ne-=x,M-=x,X.length=ne,{patchedLines:X,oldLineLastI:M-1}}for(var m=[],D=0,d=0;d<s.length;d++){for(var h=s[d],C=void 0,b=n.length-h.oldLines+o,I=void 0,R=0;R<=o;R++){I=h.oldStart+D-1;for(var q=(0,fx.default)(I,a,b);I!==void 0&&(C=g(h.lines,I,R),!C);I=q());if(C)break}if(!C)return!1;for(var j=a;j<I;j++)m.push(n[j]);for(var P=0;P<C.patchedLines.length;P++){var f=C.patchedLines[P];m.push(f)}a=C.oldLineLastI+1,D=I+1-h.oldStart}for(var d=a;d<n.length;d++)m.push(n[d]);return m.join(`
19
- `)}function px(t,e){var r=typeof t=="string"?(0,Kp.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=Xp(a,i,e);e.patched(i,u,function(c){if(c)return e.complete(c);s()})})}s()}});var em=_(zn=>{"use strict";var go=zn&&zn.__assign||function(){return go=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},go.apply(this,arguments)};Object.defineProperty(zn,"__esModule",{value:!0});zn.reversePatch=Qp;function Qp(t){return Array.isArray(t)?t.map(function(e){return Qp(e)}).reverse():go(go({},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 nm=_(Ve=>{"use strict";var En=Ve&&Ve.__assign||function(){return En=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},En.apply(this,arguments)};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.OMIT_HEADERS=Ve.FILE_HEADERS_ONLY=Ve.INCLUDE_HEADERS=void 0;Ve.structuredPatch=lu;Ve.formatPatch=Do;Ve.createTwoFilesPatch=rm;Ve.createPatch=mx;var tm=fo();Ve.INCLUDE_HEADERS={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};Ve.FILE_HEADERS_ONLY={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0};Ve.OMIT_HEADERS={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1};function lu(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,tm.diffLines)(r,n,En(En({},a),{callback:function(d){var f=l(d);c(f)}}))}else return l((0,tm.diffLines)(r,n,a));function l(d){if(!d)return;d.push({value:"",lines:[]});function f(se){return se.map(function(Se){return" "+Se})}for(var g=[],m=0,D=0,h=[],C=1,b=1,I=0;I<d.length;I++){var R=d[I],q=R.lines||gx(R.value);if(R.lines=q,R.added||R.removed){if(!m){var j=d[I-1];m=C,D=b,j&&(h=u>0?f(j.lines.slice(-u)):[],m-=h.length,D-=h.length)}for(var P=0,k=q;P<k.length;P++){var M=k[P];h.push((R.added?"+":"-")+M)}R.added?b+=q.length:C+=q.length}else{if(m)if(q.length<=u*2&&I<d.length-2)for(var re=0,$=f(q);re<$.length;re++){var M=$[re];h.push(M)}else{for(var ae=Math.min(q.length,u),X=0,ne=f(q.slice(0,ae));X<ne.length;X++){var M=ne[X];h.push(M)}var x={oldStart:m,oldLines:C-m+ae,newStart:D,newLines:b-D+ae,lines:h};g.push(x),m=0,D=0,h=[]}C+=q.length,b+=q.length}}for(var A=0,fe=g;A<fe.length;A++)for(var x=fe[A],I=0;I<x.lines.length;I++)x.lines[I].endsWith(`
20
- `)?x.lines[I]=x.lines[I].slice(0,-1):(x.lines.splice(I+1,0,"\"),I++);return{oldFileName:t,newFileName:e,oldHeader:s,newHeader:i,hunks:g}}}function Do(t,e){if(e||(e=Ve.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 Do(u,e)}).join(`
16
+ `)&&(n=n.slice(0,-1))),t.prototype.equals.call(this,r,n,s)},e})(Xw.default);Ct.lineDiff=new Qw;function ex(t,e,r){return Ct.lineDiff.diff(t,e,r)}function tx(t,e,r){return r=(0,Kw.generateOptions)(r,{ignoreWhitespace:!0}),Ct.lineDiff.diff(t,e,r)}function Gp(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 zp=v(Er=>{"use strict";var rx=Er&&Er.__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(Er,"__esModule",{value:!0});Er.sentenceDiff=void 0;Er.diffSentences=ix;var nx=er();function sx(t){return t=="."||t=="!"||t=="?"}var ox=(function(t){rx(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(sx(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})(nx.default);Er.sentenceDiff=new ox;function ix(t,e,r){return Er.sentenceDiff.diff(t,e,r)}});var Yp=v(Sr=>{"use strict";var ax=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.cssDiff=void 0;Sr.diffCss=lx;var ux=er(),cx=(function(t){ax(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.tokenize=function(r){return r.split(/([{}:;,]|\s+)/)},e})(ux.default);Sr.cssDiff=new cx;function lx(t,e,r){return Sr.cssDiff.diff(t,e,r)}});var Jp=v(tr=>{"use strict";var dx=tr&&tr.__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(tr,"__esModule",{value:!0});tr.jsonDiff=void 0;tr.diffJson=mx;tr.canonicalize=po;var fx=er(),hx=ho(),px=(function(t){dx(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.tokenize=hx.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(po(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})(fx.default);tr.jsonDiff=new px;function mx(t,e,r){return tr.jsonDiff.diff(t,e,r)}function po(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]=po(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]=po(t[u],e,r,n,u);e.pop(),r.pop()}else o=t;return o}});var Xp=v(br=>{"use strict";var gx=br&&br.__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(br,"__esModule",{value:!0});br.arrayDiff=void 0;br.diffArrays=vx;var Dx=er(),yx=(function(t){gx(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})(Dx.default);br.arrayDiff=new yx;function vx(t,e,r){return br.arrayDiff.diff(t,e,r)}});var em=v(Cr=>{"use strict";var Wt=Cr&&Cr.__assign||function(){return Wt=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},Wt.apply(this,arguments)};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.unixToWin=Kp;Cr.winToUnix=Qp;Cr.isUnix=_x;Cr.isWin=Ex;function Kp(t){return Array.isArray(t)?t.map(function(e){return Kp(e)}):Wt(Wt({},t),{hunks:t.hunks.map(function(e){return Wt(Wt({},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 Qp(t){return Array.isArray(t)?t.map(function(e){return Qp(e)}):Wt(Wt({},t),{hunks:t.hunks.map(function(e){return Wt(Wt({},e),{lines:e.lines.map(function(r){return r.endsWith("\r")?r.substring(0,r.length-1):r})})})})}function _x(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 Ex(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 cu=v(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.parsePatch=Sx;function Sx(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 tm=v(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.default=bx;function bx(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 om=v(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.applyPatch=sm;go.applyPatches=xx;var rm=iu(),mo=em(),nm=cu(),Cx=tm();function sm(t,e,r){r===void 0&&(r={});var n;if(typeof e=="string"?n=(0,nm.parsePatch)(e):Array.isArray(e)?n=e:n=[e],n.length>1)throw new Error("applyPatch only works with a single input.");return wx(t,n[0],r)}function wx(t,e,r){r===void 0&&(r={}),(r.autoConvertLineEndings||r.autoConvertLineEndings==null)&&((0,rm.hasOnlyWinLineEndings)(t)&&(0,mo.isUnix)(e)?e=(0,mo.unixToWin)(e):(0,rm.hasOnlyUnixLineEndings)(t)&&(0,mo.isWin)(e)&&(e=(0,mo.winToUnix)(e)));var n=t.split(`
18
+ `),s=e.hunks,i=r.compareLine||(function(j,M,re,$){return M===$}),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(j,M,re,$,ae,X,ne){$===void 0&&($=0),ae===void 0&&(ae=!0),X===void 0&&(X=[]),ne===void 0&&(ne=0);for(var x=0,A=!1;$<j.length;$++){var fe=j[$],se=fe.length>0?fe[0]:" ",be=fe.length>0?fe.substr(1):fe;if(se==="-")if(i(M+1,n[M],se,be))M++,x=0;else return!re||n[M]==null?null:(X[ne]=n[M],g(j,M+1,re-1,$,!1,X,ne+1));if(se==="+"){if(!ae)return null;X[ne]=be,ne++,x=0,A=!0}if(se===" ")if(x++,X[ne]=n[M],i(M+1,n[M],se,be))ne++,ae=!0,A=!1,M++;else return A||!re?null:n[M]&&(g(j,M+1,re-1,$+1,!1,X,ne+1)||g(j,M+1,re-1,$,!1,X,ne+1))||g(j,M,re-1,$+1,!1,X,ne)}return ne-=x,M-=x,X.length=ne,{patchedLines:X,oldLineLastI:M-1}}for(var m=[],y=0,d=0;d<s.length;d++){for(var p=s[d],C=void 0,S=n.length-p.oldLines+o,I=void 0,P=0;P<=o;P++){I=p.oldStart+y-1;for(var W=(0,Cx.default)(I,a,S);I!==void 0&&(C=g(p.lines,I,P),!C);I=W());if(C)break}if(!C)return!1;for(var F=a;F<I;F++)m.push(n[F]);for(var R=0;R<C.patchedLines.length;R++){var f=C.patchedLines[R];m.push(f)}a=C.oldLineLastI+1,y=I+1-p.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,nm.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=sm(a,i,e);e.patched(i,u,function(c){if(c)return e.complete(c);s()})})}s()}});var am=v(Yn=>{"use strict";var Do=Yn&&Yn.__assign||function(){return Do=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},Do.apply(this,arguments)};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.reversePatch=im;function im(t){return Array.isArray(t)?t.map(function(e){return im(e)}).reverse():Do(Do({},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 lm=v(Ve=>{"use strict";var En=Ve&&Ve.__assign||function(){return En=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},En.apply(this,arguments)};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.OMIT_HEADERS=Ve.FILE_HEADERS_ONLY=Ve.INCLUDE_HEADERS=void 0;Ve.structuredPatch=du;Ve.formatPatch=yo;Ve.createTwoFilesPatch=cm;Ve.createPatch=$x;var um=ho();Ve.INCLUDE_HEADERS={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};Ve.FILE_HEADERS_ONLY={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0};Ve.OMIT_HEADERS={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1};function du(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,um.diffLines)(r,n,En(En({},a),{callback:function(d){var f=l(d);c(f)}}))}else return l((0,um.diffLines)(r,n,a));function l(d){if(!d)return;d.push({value:"",lines:[]});function f(se){return se.map(function(be){return" "+be})}for(var g=[],m=0,y=0,p=[],C=1,S=1,I=0;I<d.length;I++){var P=d[I],W=P.lines||Ax(P.value);if(P.lines=W,P.added||P.removed){if(!m){var F=d[I-1];m=C,y=S,F&&(p=u>0?f(F.lines.slice(-u)):[],m-=p.length,y-=p.length)}for(var R=0,j=W;R<j.length;R++){var M=j[R];p.push((P.added?"+":"-")+M)}P.added?S+=W.length:C+=W.length}else{if(m)if(W.length<=u*2&&I<d.length-2)for(var re=0,$=f(W);re<$.length;re++){var M=$[re];p.push(M)}else{for(var ae=Math.min(W.length,u),X=0,ne=f(W.slice(0,ae));X<ne.length;X++){var M=ne[X];p.push(M)}var x={oldStart:m,oldLines:C-m+ae,newStart:y,newLines:S-y+ae,lines:p};g.push(x),m=0,y=0,p=[]}C+=W.length,S+=W.length}}for(var A=0,fe=g;A<fe.length;A++)for(var x=fe[A],I=0;I<x.lines.length;I++)x.lines[I].endsWith(`
20
+ `)?x.lines[I]=x.lines[I].slice(0,-1):(x.lines.splice(I+1,0,"\"),I++);return{oldFileName:t,newFileName:e,oldHeader:s,newHeader:i,hunks:g}}}function yo(t,e){if(e||(e=Ve.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 yo(u,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 rm(t,e,r,n,s,i,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){var u=o.callback;lu(t,e,r,n,s,i,En(En({},o),{callback:function(c){u(c?Do(c,o.headerOptions):void 0)}}))}else{var a=lu(t,e,r,n,s,i,o);return a?Do(a,o?.headerOptions):void 0}}function mx(t,e,r,n,s,i){return rm(t,t,e,r,n,s,i)}function gx(t){var e=t.endsWith(`
23
+ `}function cm(t,e,r,n,s,i,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){var u=o.callback;du(t,e,r,n,s,i,En(En({},o),{callback:function(c){u(c?yo(c,o.headerOptions):void 0)}}))}else{var a=du(t,e,r,n,s,i,o);return a?yo(a,o?.headerOptions):void 0}}function $x(t,e,r,n,s,i){return cm(t,t,e,r,n,s,i)}function Ax(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 sm=_(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.convertChangesToDMP=Dx;function Dx(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 om=_(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.convertChangesToXML=yx;function yx(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(vx(n.value)),n.added?e.push("</ins>"):n.removed&&e.push("</del>")}return e.join("")}function vx(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 dm=_(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.canonicalize=V.convertChangesToXML=V.convertChangesToDMP=V.reversePatch=V.parsePatch=V.applyPatches=V.applyPatch=V.OMIT_HEADERS=V.FILE_HEADERS_ONLY=V.INCLUDE_HEADERS=V.formatPatch=V.createPatch=V.createTwoFilesPatch=V.structuredPatch=V.arrayDiff=V.diffArrays=V.jsonDiff=V.diffJson=V.cssDiff=V.diffCss=V.sentenceDiff=V.diffSentences=V.diffTrimmedLines=V.lineDiff=V.diffLines=V.wordsWithSpaceDiff=V.diffWordsWithSpace=V.wordDiff=V.diffWords=V.characterDiff=V.diffChars=V.Diff=void 0;var _x=Kt();V.Diff=_x.default;var im=Ap();Object.defineProperty(V,"diffChars",{enumerable:!0,get:function(){return im.diffChars}});Object.defineProperty(V,"characterDiff",{enumerable:!0,get:function(){return im.characterDiff}});var yo=Lp();Object.defineProperty(V,"diffWords",{enumerable:!0,get:function(){return yo.diffWords}});Object.defineProperty(V,"diffWordsWithSpace",{enumerable:!0,get:function(){return yo.diffWordsWithSpace}});Object.defineProperty(V,"wordDiff",{enumerable:!0,get:function(){return yo.wordDiff}});Object.defineProperty(V,"wordsWithSpaceDiff",{enumerable:!0,get:function(){return yo.wordsWithSpaceDiff}});var hu=fo();Object.defineProperty(V,"diffLines",{enumerable:!0,get:function(){return hu.diffLines}});Object.defineProperty(V,"diffTrimmedLines",{enumerable:!0,get:function(){return hu.diffTrimmedLines}});Object.defineProperty(V,"lineDiff",{enumerable:!0,get:function(){return hu.lineDiff}});var am=qp();Object.defineProperty(V,"diffSentences",{enumerable:!0,get:function(){return am.diffSentences}});Object.defineProperty(V,"sentenceDiff",{enumerable:!0,get:function(){return am.sentenceDiff}});var um=Wp();Object.defineProperty(V,"diffCss",{enumerable:!0,get:function(){return um.diffCss}});Object.defineProperty(V,"cssDiff",{enumerable:!0,get:function(){return um.cssDiff}});var pu=Hp();Object.defineProperty(V,"diffJson",{enumerable:!0,get:function(){return pu.diffJson}});Object.defineProperty(V,"canonicalize",{enumerable:!0,get:function(){return pu.canonicalize}});Object.defineProperty(V,"jsonDiff",{enumerable:!0,get:function(){return pu.jsonDiff}});var cm=Zp();Object.defineProperty(V,"diffArrays",{enumerable:!0,get:function(){return cm.diffArrays}});Object.defineProperty(V,"arrayDiff",{enumerable:!0,get:function(){return cm.arrayDiff}});var lm=Jp();Object.defineProperty(V,"applyPatch",{enumerable:!0,get:function(){return lm.applyPatch}});Object.defineProperty(V,"applyPatches",{enumerable:!0,get:function(){return lm.applyPatches}});var Ex=uu();Object.defineProperty(V,"parsePatch",{enumerable:!0,get:function(){return Ex.parsePatch}});var bx=em();Object.defineProperty(V,"reversePatch",{enumerable:!0,get:function(){return bx.reversePatch}});var Vr=nm();Object.defineProperty(V,"structuredPatch",{enumerable:!0,get:function(){return Vr.structuredPatch}});Object.defineProperty(V,"createTwoFilesPatch",{enumerable:!0,get:function(){return Vr.createTwoFilesPatch}});Object.defineProperty(V,"createPatch",{enumerable:!0,get:function(){return Vr.createPatch}});Object.defineProperty(V,"formatPatch",{enumerable:!0,get:function(){return Vr.formatPatch}});Object.defineProperty(V,"INCLUDE_HEADERS",{enumerable:!0,get:function(){return Vr.INCLUDE_HEADERS}});Object.defineProperty(V,"FILE_HEADERS_ONLY",{enumerable:!0,get:function(){return Vr.FILE_HEADERS_ONLY}});Object.defineProperty(V,"OMIT_HEADERS",{enumerable:!0,get:function(){return Vr.OMIT_HEADERS}});var Sx=sm();Object.defineProperty(V,"convertChangesToDMP",{enumerable:!0,get:function(){return Sx.convertChangesToDMP}});var Cx=om();Object.defineProperty(V,"convertChangesToXML",{enumerable:!0,get:function(){return Cx.convertChangesToXML}})});var gu=_((N2,fm)=>{"use strict";var mu={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"},wx={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},xx={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?mu.up():"");return t&&(e+=mu.left),e}};fm.exports={cursor:mu,scroll:wx,erase:xx,beep:"\x07"}});var Im=_(pt=>{"use strict";var Je=gu(),bo=require("node:process"),wm=require("node:readline"),$x=require("node:tty"),Ax=An();function xm(t){return t&&typeof t=="object"&&"default"in t?t.default:t}function Fx(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 vo=Fx(wm),hm=xm(wm),Eo=xm(Ax);function kx({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 jx=kx();function $m(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(jx,"")}function Am(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fm={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}})(Fm);var Ix=Fm.exports,Tx=Am(Ix),Rx=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},Px=Am(Rx);function Yn(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=$m(t),t.length===0))return 0;t=t.replace(Px()," ");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(Tx.eastAsianWidth(s)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Du=10,pm=(t=0)=>e=>`\x1B[${e+t}m`,mm=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,gm=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,be={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(be.modifier);var Ox=Object.keys(be.color),Nx=Object.keys(be.bgColor);[...Ox,...Nx];function Lx(){let t=new Map;for(let[e,r]of Object.entries(be)){for(let[n,s]of Object.entries(r))be[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=be[n],t.set(s[0],s[1]);Object.defineProperty(be,e,{value:r,enumerable:!1})}return Object.defineProperty(be,"codes",{value:t,enumerable:!1}),be.color.close="\x1B[39m",be.bgColor.close="\x1B[49m",be.color.ansi=pm(),be.color.ansi256=mm(),be.color.ansi16m=gm(),be.bgColor.ansi=pm(Du),be.bgColor.ansi256=mm(Du),be.bgColor.ansi16m=gm(Du),Object.defineProperties(be,{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=>be.rgbToAnsi256(...be.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)=>be.ansi256ToAnsi(be.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>be.ansi256ToAnsi(be.hexToAnsi256(e)),enumerable:!1}}),be}var Bx=Lx(),So=new Set(["\x1B","\x9B"]),Mx=39,wu="\x07",km="[",qx="]",jm="m",xu=`${qx}8;;`,Dm=t=>`${So.values().next().value}${km}${t}${jm}`,ym=t=>`${So.values().next().value}${xu}${t}${wu}`,Wx=t=>t.split(" ").map(e=>Yn(e)),yu=(t,e,r)=>{let n=[...e],s=!1,i=!1,o=Yn($m(t[t.length-1]));for(let[a,u]of n.entries()){let c=Yn(u);if(o+c<=r?t[t.length-1]+=u:(t.push(u),o=0),So.has(u)&&(s=!0,i=n.slice(a+1).join("").startsWith(xu)),s){i?u===wu&&(s=!1,i=!1):u===jm&&(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())},Hx=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Yn(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},Zx=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",s,i,o=Wx(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let d=Yn(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(""),yu(a,l,e);continue}if(d+o[c]>e&&d>0&&o[c]>0){if(r.wordWrap===!1&&d<e){yu(a,l,e);continue}a.push("")}if(d+o[c]>e&&r.wordWrap===!1){yu(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>Hx(c)));let u=[...a.join(`
27
- `)];for(let[c,l]of u.entries()){if(n+=l,So.has(l)){let{groups:f}=new RegExp(`(?:\\${km}(?<code>\\d+)m|\\${xu}(?<uri>.*)${wu})`).exec(u.slice(c).join(""))||{groups:{}};if(f.code!==void 0){let g=Number.parseFloat(f.code);s=g===Mx?void 0:g}else f.uri!==void 0&&(i=f.uri.length===0?void 0:f.uri)}let d=Bx.codes.get(Number(s));u[c+1]===`
28
- `?(i&&(n+=ym("")),s&&d&&(n+=Dm(d))):l===`
29
- `&&(s&&d&&(n+=Dm(s)),i&&(n+=ym(i)))}return n};function vm(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 dm=v(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.convertChangesToDMP=kx;function kx(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 fm=v(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.convertChangesToXML=Fx;function Fx(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(jx(n.value)),n.added?e.push("</ins>"):n.removed&&e.push("</del>")}return e.join("")}function jx(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 ym=v(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.canonicalize=V.convertChangesToXML=V.convertChangesToDMP=V.reversePatch=V.parsePatch=V.applyPatches=V.applyPatch=V.OMIT_HEADERS=V.FILE_HEADERS_ONLY=V.INCLUDE_HEADERS=V.formatPatch=V.createPatch=V.createTwoFilesPatch=V.structuredPatch=V.arrayDiff=V.diffArrays=V.jsonDiff=V.diffJson=V.cssDiff=V.diffCss=V.sentenceDiff=V.diffSentences=V.diffTrimmedLines=V.lineDiff=V.diffLines=V.wordsWithSpaceDiff=V.diffWordsWithSpace=V.wordDiff=V.diffWords=V.characterDiff=V.diffChars=V.Diff=void 0;var Ix=er();V.Diff=Ix.default;var hm=Pp();Object.defineProperty(V,"diffChars",{enumerable:!0,get:function(){return hm.diffChars}});Object.defineProperty(V,"characterDiff",{enumerable:!0,get:function(){return hm.characterDiff}});var vo=Up();Object.defineProperty(V,"diffWords",{enumerable:!0,get:function(){return vo.diffWords}});Object.defineProperty(V,"diffWordsWithSpace",{enumerable:!0,get:function(){return vo.diffWordsWithSpace}});Object.defineProperty(V,"wordDiff",{enumerable:!0,get:function(){return vo.wordDiff}});Object.defineProperty(V,"wordsWithSpaceDiff",{enumerable:!0,get:function(){return vo.wordsWithSpaceDiff}});var pu=ho();Object.defineProperty(V,"diffLines",{enumerable:!0,get:function(){return pu.diffLines}});Object.defineProperty(V,"diffTrimmedLines",{enumerable:!0,get:function(){return pu.diffTrimmedLines}});Object.defineProperty(V,"lineDiff",{enumerable:!0,get:function(){return pu.lineDiff}});var pm=zp();Object.defineProperty(V,"diffSentences",{enumerable:!0,get:function(){return pm.diffSentences}});Object.defineProperty(V,"sentenceDiff",{enumerable:!0,get:function(){return pm.sentenceDiff}});var mm=Yp();Object.defineProperty(V,"diffCss",{enumerable:!0,get:function(){return mm.diffCss}});Object.defineProperty(V,"cssDiff",{enumerable:!0,get:function(){return mm.cssDiff}});var mu=Jp();Object.defineProperty(V,"diffJson",{enumerable:!0,get:function(){return mu.diffJson}});Object.defineProperty(V,"canonicalize",{enumerable:!0,get:function(){return mu.canonicalize}});Object.defineProperty(V,"jsonDiff",{enumerable:!0,get:function(){return mu.jsonDiff}});var gm=Xp();Object.defineProperty(V,"diffArrays",{enumerable:!0,get:function(){return gm.diffArrays}});Object.defineProperty(V,"arrayDiff",{enumerable:!0,get:function(){return gm.arrayDiff}});var Dm=om();Object.defineProperty(V,"applyPatch",{enumerable:!0,get:function(){return Dm.applyPatch}});Object.defineProperty(V,"applyPatches",{enumerable:!0,get:function(){return Dm.applyPatches}});var Tx=cu();Object.defineProperty(V,"parsePatch",{enumerable:!0,get:function(){return Tx.parsePatch}});var Rx=am();Object.defineProperty(V,"reversePatch",{enumerable:!0,get:function(){return Rx.reversePatch}});var zr=lm();Object.defineProperty(V,"structuredPatch",{enumerable:!0,get:function(){return zr.structuredPatch}});Object.defineProperty(V,"createTwoFilesPatch",{enumerable:!0,get:function(){return zr.createTwoFilesPatch}});Object.defineProperty(V,"createPatch",{enumerable:!0,get:function(){return zr.createPatch}});Object.defineProperty(V,"formatPatch",{enumerable:!0,get:function(){return zr.formatPatch}});Object.defineProperty(V,"INCLUDE_HEADERS",{enumerable:!0,get:function(){return zr.INCLUDE_HEADERS}});Object.defineProperty(V,"FILE_HEADERS_ONLY",{enumerable:!0,get:function(){return zr.FILE_HEADERS_ONLY}});Object.defineProperty(V,"OMIT_HEADERS",{enumerable:!0,get:function(){return zr.OMIT_HEADERS}});var Px=dm();Object.defineProperty(V,"convertChangesToDMP",{enumerable:!0,get:function(){return Px.convertChangesToDMP}});var Ox=fm();Object.defineProperty(V,"convertChangesToXML",{enumerable:!0,get:function(){return Ox.convertChangesToXML}})});var Du=v((K2,vm)=>{"use strict";var gu={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"},Nx={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Lx={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?gu.up():"");return t&&(e+=gu.left),e}};vm.exports={cursor:gu,scroll:Nx,erase:Lx,beep:"\x07"}});var Bm=v(gt=>{"use strict";var Qe=Du(),bo=require("node:process"),Im=require("node:readline"),Bx=require("node:tty"),Mx=kn();function Tm(t){return t&&typeof t=="object"&&"default"in t?t.default:t}function qx(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=qx(Im),_m=Tm(Im),So=Tm(Mx);function Wx({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 Hx=Wx();function Rm(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Hx,"")}function Pm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Om={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}})(Om);var Zx=Om.exports,Ux=Pm(Zx),Vx=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},Gx=Pm(Vx);function Jn(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Rm(t),t.length===0))return 0;t=t.replace(Gx()," ");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(Ux.eastAsianWidth(s)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var yu=10,Em=(t=0)=>e=>`\x1B[${e+t}m`,Sm=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,bm=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Se={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(Se.modifier);var zx=Object.keys(Se.color),Yx=Object.keys(Se.bgColor);[...zx,...Yx];function Jx(){let t=new Map;for(let[e,r]of Object.entries(Se)){for(let[n,s]of Object.entries(r))Se[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=Se[n],t.set(s[0],s[1]);Object.defineProperty(Se,e,{value:r,enumerable:!1})}return Object.defineProperty(Se,"codes",{value:t,enumerable:!1}),Se.color.close="\x1B[39m",Se.bgColor.close="\x1B[49m",Se.color.ansi=Em(),Se.color.ansi256=Sm(),Se.color.ansi16m=bm(),Se.bgColor.ansi=Em(yu),Se.bgColor.ansi256=Sm(yu),Se.bgColor.ansi16m=bm(yu),Object.defineProperties(Se,{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=>Se.rgbToAnsi256(...Se.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)=>Se.ansi256ToAnsi(Se.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Se.ansi256ToAnsi(Se.hexToAnsi256(e)),enumerable:!1}}),Se}var Xx=Jx(),Co=new Set(["\x1B","\x9B"]),Kx=39,xu="\x07",Nm="[",Qx="]",Lm="m",$u=`${Qx}8;;`,Cm=t=>`${Co.values().next().value}${Nm}${t}${Lm}`,wm=t=>`${Co.values().next().value}${$u}${t}${xu}`,e$=t=>t.split(" ").map(e=>Jn(e)),vu=(t,e,r)=>{let n=[...e],s=!1,i=!1,o=Jn(Rm(t[t.length-1]));for(let[a,u]of n.entries()){let c=Jn(u);if(o+c<=r?t[t.length-1]+=u:(t.push(u),o=0),Co.has(u)&&(s=!0,i=n.slice(a+1).join("").startsWith($u)),s){i?u===xu&&(s=!1,i=!1):u===Lm&&(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())},t$=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Jn(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},r$=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",s,i,o=e$(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let d=Jn(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(""),vu(a,l,e);continue}if(d+o[c]>e&&d>0&&o[c]>0){if(r.wordWrap===!1&&d<e){vu(a,l,e);continue}a.push("")}if(d+o[c]>e&&r.wordWrap===!1){vu(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>t$(c)));let u=[...a.join(`
27
+ `)];for(let[c,l]of u.entries()){if(n+=l,Co.has(l)){let{groups:f}=new RegExp(`(?:\\${Nm}(?<code>\\d+)m|\\${$u}(?<uri>.*)${xu})`).exec(u.slice(c).join(""))||{groups:{}};if(f.code!==void 0){let g=Number.parseFloat(f.code);s=g===Kx?void 0:g}else f.uri!==void 0&&(i=f.uri.length===0?void 0:f.uri)}let d=Xx.codes.get(Number(s));u[c+1]===`
28
+ `?(i&&(n+=wm("")),s&&d&&(n+=Cm(d))):l===`
29
+ `&&(s&&d&&(n+=Cm(s)),i&&(n+=wm(i)))}return n};function xm(t,e,r){return String(t).normalize().replace(/\r\n/g,`
30
30
  `).split(`
31
- `).map(n=>Zx(n,e,r)).join(`
32
- `)}var Ux=["up","down","left","right","space","enter","cancel"],bn={actions:new Set(Ux),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function Vx(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)&&(bn.aliases.has(s)||bn.aliases.set(s,n[s]));break}}}}function $u(t,e){if(typeof t=="string")return bn.aliases.get(t)===e;for(let r of t)if(r!==void 0&&$u(r,e))return!0;return!1}function Gx(t,e){if(t===e)return;let r=t.split(`
31
+ `).map(n=>r$(n,e,r)).join(`
32
+ `)}var n$=["up","down","left","right","space","enter","cancel"],Sn={actions:new Set(n$),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function s$(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)&&(Sn.aliases.has(s)||Sn.aliases.set(s,n[s]));break}}}}function Au(t,e){if(typeof t=="string")return Sn.aliases.get(t)===e;for(let r of t)if(r!==void 0&&Au(r,e))return!0;return!1}function o$(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 zx=globalThis.process.platform.startsWith("win"),vu=Symbol("clack:cancel");function Yx(t){return t===vu}function _o(t,e){let r=t;r.isTTY&&r.setRawMode(e)}function Kx({input:t=bo.stdin,output:e=bo.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let s=vo.createInterface({input:t,output:e,prompt:"",tabSize:1});vo.emitKeypressEvents(t,s),t.isTTY&&t.setRawMode(!0);let i=(o,{name:a,sequence:u})=>{let c=String(o);if($u([c,a,u],"cancel")){n&&e.write(Je.cursor.show),process.exit(0);return}if(!r)return;let l=a==="return"?0:-1,d=a==="return"?-1:0;vo.moveCursor(e,l,d,()=>{vo.clearLine(e,1,()=>{t.once("keypress",i)})})};return n&&e.write(Je.cursor.hide),t.once("keypress",i),()=>{t.off("keypress",i),n&&e.write(Je.cursor.show),t.isTTY&&!zx&&t.setRawMode(!1),s.terminal=!1,s.close()}}var Xx=Object.defineProperty,Jx=(t,e,r)=>e in t?Xx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,st=(t,e,r)=>(Jx(t,typeof e!="symbol"?e+"":e,r),r),qt=class{constructor(e,r=!0){st(this,"input"),st(this,"output"),st(this,"_abortSignal"),st(this,"rl"),st(this,"opts"),st(this,"_render"),st(this,"_track",!1),st(this,"_prevFrame",""),st(this,"_subscribers",new Map),st(this,"_cursor",0),st(this,"state","initial"),st(this,"error",""),st(this,"value");let{input:n=bo.stdin,output:s=bo.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(vu);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new $x.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=hm.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50}),hm.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(Je.cursor.show),this.output.off("resize",this.render),_o(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(Je.cursor.show),this.output.off("resize",this.render),_o(this.input,!1),e(vu)})})}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&bn.aliases.has(r.name)&&this.emit("cursor",bn.aliases.get(r.name)),bn.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")}$u([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=vm(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
36
- `).length-1;this.output.write(Je.cursor.move(-999,e*-1))}render(){let e=vm(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Je.cursor.hide);else{let r=Gx(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(Je.cursor.move(0,n)),this.output.write(Je.erase.lines(1));let s=e.split(`
37
- `);this.output.write(s[n]),this._prevFrame=e,this.output.write(Je.cursor.move(0,s.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(Je.cursor.move(0,n)),this.output.write(Je.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 i$=globalThis.process.platform.startsWith("win"),_u=Symbol("clack:cancel");function a$(t){return t===_u}function Eo(t,e){let r=t;r.isTTY&&r.setRawMode(e)}function u$({input:t=bo.stdin,output:e=bo.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:u})=>{let c=String(o);if(Au([c,a,u],"cancel")){n&&e.write(Qe.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(Qe.cursor.hide),t.once("keypress",i),()=>{t.off("keypress",i),n&&e.write(Qe.cursor.show),t.isTTY&&!i$&&t.setRawMode(!1),s.terminal=!1,s.close()}}var c$=Object.defineProperty,l$=(t,e,r)=>e in t?c$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,it=(t,e,r)=>(l$(t,typeof e!="symbol"?e+"":e,r),r),Ht=class{constructor(e,r=!0){it(this,"input"),it(this,"output"),it(this,"_abortSignal"),it(this,"rl"),it(this,"opts"),it(this,"_render"),it(this,"_track",!1),it(this,"_prevFrame",""),it(this,"_subscribers",new Map),it(this,"_cursor",0),it(this,"state","initial"),it(this,"error",""),it(this,"value");let{input:n=bo.stdin,output:s=bo.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(_u);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new Bx.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=_m.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50}),_m.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),Eo(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Qe.cursor.show),this.output.off("resize",this.render),Eo(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(Qe.cursor.show),this.output.off("resize",this.render),Eo(this.input,!1),e(_u)})})}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&Sn.aliases.has(r.name)&&this.emit("cursor",Sn.aliases.get(r.name)),Sn.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")}Au([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
+ `),Eo(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=xm(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
36
+ `).length-1;this.output.write(Qe.cursor.move(-999,e*-1))}render(){let e=xm(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Qe.cursor.hide);else{let r=o$(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(Qe.cursor.move(0,n)),this.output.write(Qe.erase.lines(1));let s=e.split(`
37
+ `);this.output.write(s[n]),this._prevFrame=e,this.output.write(Qe.cursor.move(0,s.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(Qe.cursor.move(0,n)),this.output.write(Qe.erase.down());let s=e.split(`
38
38
  `).slice(n);this.output.write(s.join(`
39
- `)),this._prevFrame=e;return}this.output.write(Je.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},_u=class extends qt{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(Je.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},Qx=Object.defineProperty,e$=(t,e,r)=>e in t?Qx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_m=(t,e,r)=>(e$(t,typeof e!="symbol"?e+"":e,r),r),t$=class extends qt{constructor(t){super(t,!1),_m(this,"options"),_m(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]}}},r$=Object.defineProperty,n$=(t,e,r)=>e in t?r$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Em=(t,e,r)=>(n$(t,typeof e!="symbol"?e+"":e,r),r),s$=class extends qt{constructor(t){super(t,!1),Em(this,"options"),Em(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]}},o$=Object.defineProperty,i$=(t,e,r)=>e in t?o$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bm=(t,e,r)=>(i$(t,typeof e!="symbol"?e+"":e,r),r),Eu=class extends qt{constructor({mask:e,...r}){super(r),bm(this,"valueWithCursor",""),bm(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}${Eo.inverse(Eo.hidden("_"))}`;else{let n=this.masked.slice(0,this.cursor),s=this.masked.slice(this.cursor);this.valueWithCursor=`${n}${Eo.inverse(s[0])}${s.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}},a$=Object.defineProperty,u$=(t,e,r)=>e in t?a$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sm=(t,e,r)=>(u$(t,typeof e!="symbol"?e+"":e,r),r),bu=class extends qt{constructor(e){super(e,!1),Sm(this,"options"),Sm(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}},c$=Object.defineProperty,l$=(t,e,r)=>e in t?c$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cm=(t,e,r)=>(l$(t,typeof e!="symbol"?e+"":e,r),r),Su=class extends qt{constructor(e){super(e,!1),Cm(this,"options"),Cm(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"))})}},Cu=class extends qt{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}${Eo.inverse(r)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};pt.ConfirmPrompt=_u,pt.GroupMultiSelectPrompt=t$,pt.MultiSelectPrompt=s$,pt.PasswordPrompt=Eu,pt.Prompt=qt,pt.SelectKeyPrompt=Su,pt.SelectPrompt=bu,pt.TextPrompt=Cu,pt.block=Kx,pt.isCancel=Yx,pt.updateSettings=Vx});var Ru=_(ke=>{"use strict";var Au=require("node:util"),Ct=Im(),d$=require("node:process"),f$=An(),Tm=gu();function Pm(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var St=Pm(d$),v=Pm(f$);function h$(){return St.platform!=="win32"?St.env.TERM!=="linux":!!St.env.CI||!!St.env.WT_SESSION||!!St.env.TERMINUS_SUBLIME||St.env.ConEmuTask==="{cmd::Cmder}"||St.env.TERM_PROGRAM==="Terminus-Sublime"||St.env.TERM_PROGRAM==="vscode"||St.env.TERM==="xterm-256color"||St.env.TERM==="alacritty"||St.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Fu=h$(),xe=(t,e)=>Fu?t:e,p$=xe("\u25C6","*"),Om=xe("\u25A0","x"),Nm=xe("\u25B2","x"),Co=xe("\u25C7","o"),m$=xe("\u250C","T"),J=xe("\u2502","|"),Qe=xe("\u2514","\u2014"),ku=xe("\u25CF",">"),ju=xe("\u25CB"," "),Iu=xe("\u25FB","[\u2022]"),Kn=xe("\u25FC","[+]"),Lm=xe("\u25FB","[ ]"),g$=xe("\u25AA","\u2022"),Rm=xe("\u2500","-"),D$=xe("\u256E","+"),y$=xe("\u251C","+"),v$=xe("\u256F","+"),_$=xe("\u25CF","\u2022"),E$=xe("\u25C6","*"),b$=xe("\u25B2","!"),S$=xe("\u25A0","x"),zr=t=>{switch(t){case"initial":case"active":return v.cyan(p$);case"cancel":return v.red(Om);case"error":return v.yellow(Nm);case"submit":return v.green(Co)}},Tu=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?v.dim("..."):n(l,d+a===e)})},C$=t=>new Ct.TextPrompt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${v.gray(J)}
40
- ${zr(this.state)} ${t.message}
41
- `,r=t.placeholder?v.inverse(t.placeholder[0])+v.dim(t.placeholder.slice(1)):v.inverse(v.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
42
- ${v.yellow(J)} ${n}
43
- ${v.yellow(Qe)} ${v.yellow(this.error)}
44
- `;case"submit":return`${e}${v.gray(J)} ${v.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${v.gray(J)} ${v.strikethrough(v.dim(this.value??""))}${this.value?.trim()?`
45
- ${v.gray(J)}`:""}`;default:return`${e}${v.cyan(J)} ${n}
46
- ${v.cyan(Qe)}
47
- `}}}).prompt(),w$=t=>new Ct.PasswordPrompt({validate:t.validate,mask:t.mask??g$,render(){let e=`${v.gray(J)}
48
- ${zr(this.state)} ${t.message}
39
+ `)),this._prevFrame=e;return}this.output.write(Qe.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},Eu=class extends Ht{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(Qe.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},d$=Object.defineProperty,f$=(t,e,r)=>e in t?d$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$m=(t,e,r)=>(f$(t,typeof e!="symbol"?e+"":e,r),r),h$=class extends Ht{constructor(t){super(t,!1),$m(this,"options"),$m(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]}}},p$=Object.defineProperty,m$=(t,e,r)=>e in t?p$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Am=(t,e,r)=>(m$(t,typeof e!="symbol"?e+"":e,r),r),g$=class extends Ht{constructor(t){super(t,!1),Am(this,"options"),Am(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]}},D$=Object.defineProperty,y$=(t,e,r)=>e in t?D$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,km=(t,e,r)=>(y$(t,typeof e!="symbol"?e+"":e,r),r),Su=class extends Ht{constructor({mask:e,...r}){super(r),km(this,"valueWithCursor",""),km(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}${So.inverse(So.hidden("_"))}`;else{let n=this.masked.slice(0,this.cursor),s=this.masked.slice(this.cursor);this.valueWithCursor=`${n}${So.inverse(s[0])}${s.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}},v$=Object.defineProperty,_$=(t,e,r)=>e in t?v$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Fm=(t,e,r)=>(_$(t,typeof e!="symbol"?e+"":e,r),r),bu=class extends Ht{constructor(e){super(e,!1),Fm(this,"options"),Fm(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}},E$=Object.defineProperty,S$=(t,e,r)=>e in t?E$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jm=(t,e,r)=>(S$(t,typeof e!="symbol"?e+"":e,r),r),Cu=class extends Ht{constructor(e){super(e,!1),jm(this,"options"),jm(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"))})}},wu=class extends Ht{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}${So.inverse(r)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};gt.ConfirmPrompt=Eu,gt.GroupMultiSelectPrompt=h$,gt.MultiSelectPrompt=g$,gt.PasswordPrompt=Su,gt.Prompt=Ht,gt.SelectKeyPrompt=Cu,gt.SelectPrompt=bu,gt.TextPrompt=wu,gt.block=u$,gt.isCancel=a$,gt.updateSettings=s$});var Pu=v(Fe=>{"use strict";var ku=require("node:util"),xt=Bm(),b$=require("node:process"),C$=kn(),Mm=Du();function Wm(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var wt=Wm(b$),_=Wm(C$);function w$(){return wt.platform!=="win32"?wt.env.TERM!=="linux":!!wt.env.CI||!!wt.env.WT_SESSION||!!wt.env.TERMINUS_SUBLIME||wt.env.ConEmuTask==="{cmd::Cmder}"||wt.env.TERM_PROGRAM==="Terminus-Sublime"||wt.env.TERM_PROGRAM==="vscode"||wt.env.TERM==="xterm-256color"||wt.env.TERM==="alacritty"||wt.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Fu=w$(),xe=(t,e)=>Fu?t:e,x$=xe("\u25C6","*"),Hm=xe("\u25A0","x"),Zm=xe("\u25B2","x"),wo=xe("\u25C7","o"),$$=xe("\u250C","T"),K=xe("\u2502","|"),et=xe("\u2514","\u2014"),ju=xe("\u25CF",">"),Iu=xe("\u25CB"," "),Tu=xe("\u25FB","[\u2022]"),Xn=xe("\u25FC","[+]"),Um=xe("\u25FB","[ ]"),A$=xe("\u25AA","\u2022"),qm=xe("\u2500","-"),k$=xe("\u256E","+"),F$=xe("\u251C","+"),j$=xe("\u256F","+"),I$=xe("\u25CF","\u2022"),T$=xe("\u25C6","*"),R$=xe("\u25B2","!"),P$=xe("\u25A0","x"),Jr=t=>{switch(t){case"initial":case"active":return _.cyan(x$);case"cancel":return _.red(Hm);case"error":return _.yellow(Zm);case"submit":return _.green(wo)}},Ru=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)})},O$=t=>new xt.TextPrompt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${_.gray(K)}
40
+ ${Jr(this.state)} ${t.message}
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(K)} ${n}
43
+ ${_.yellow(et)} ${_.yellow(this.error)}
44
+ `;case"submit":return`${e}${_.gray(K)} ${_.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${_.gray(K)} ${_.strikethrough(_.dim(this.value??""))}${this.value?.trim()?`
45
+ ${_.gray(K)}`:""}`;default:return`${e}${_.cyan(K)} ${n}
46
+ ${_.cyan(et)}
47
+ `}}}).prompt(),N$=t=>new xt.PasswordPrompt({validate:t.validate,mask:t.mask??A$,render(){let e=`${_.gray(K)}
48
+ ${Jr(this.state)} ${t.message}
49
49
  `,r=this.valueWithCursor,n=this.masked;switch(this.state){case"error":return`${e.trim()}
50
- ${v.yellow(J)} ${n}
51
- ${v.yellow(Qe)} ${v.yellow(this.error)}
52
- `;case"submit":return`${e}${v.gray(J)} ${v.dim(n)}`;case"cancel":return`${e}${v.gray(J)} ${v.strikethrough(v.dim(n??""))}${n?`
53
- ${v.gray(J)}`:""}`;default:return`${e}${v.cyan(J)} ${r}
54
- ${v.cyan(Qe)}
55
- `}}}).prompt(),x$=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new Ct.ConfirmPrompt({active:e,inactive:r,initialValue:t.initialValue??!0,render(){let n=`${v.gray(J)}
56
- ${zr(this.state)} ${t.message}
57
- `,s=this.value?e:r;switch(this.state){case"submit":return`${n}${v.gray(J)} ${v.dim(s)}`;case"cancel":return`${n}${v.gray(J)} ${v.strikethrough(v.dim(s))}
58
- ${v.gray(J)}`;default:return`${n}${v.cyan(J)} ${this.value?`${v.green(ku)} ${e}`:`${v.dim(ju)} ${v.dim(e)}`} ${v.dim("/")} ${this.value?`${v.dim(ju)} ${v.dim(r)}`:`${v.green(ku)} ${r}`}
59
- ${v.cyan(Qe)}
60
- `}}}).prompt()},$$=t=>{let e=(r,n)=>{let s=r.label??String(r.value);switch(n){case"selected":return`${v.dim(s)}`;case"active":return`${v.green(ku)} ${s} ${r.hint?v.dim(`(${r.hint})`):""}`;case"cancelled":return`${v.strikethrough(v.dim(s))}`;default:return`${v.dim(ju)} ${v.dim(s)}`}};return new Ct.SelectPrompt({options:t.options,initialValue:t.initialValue,render(){let r=`${v.gray(J)}
61
- ${zr(this.state)} ${t.message}
62
- `;switch(this.state){case"submit":return`${r}${v.gray(J)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${v.gray(J)} ${e(this.options[this.cursor],"cancelled")}
63
- ${v.gray(J)}`;default:return`${r}${v.cyan(J)} ${Tu({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(n,s)=>e(n,s?"active":"inactive")}).join(`
64
- ${v.cyan(J)} `)}
65
- ${v.cyan(Qe)}
66
- `}}}).prompt()},A$=t=>{let e=(r,n="inactive")=>{let s=r.label??String(r.value);return n==="selected"?`${v.dim(s)}`:n==="cancelled"?`${v.strikethrough(v.dim(s))}`:n==="active"?`${v.bgCyan(v.gray(` ${r.value} `))} ${s} ${r.hint?v.dim(`(${r.hint})`):""}`:`${v.gray(v.bgWhite(v.inverse(` ${r.value} `)))} ${s} ${r.hint?v.dim(`(${r.hint})`):""}`};return new Ct.SelectKeyPrompt({options:t.options,initialValue:t.initialValue,render(){let r=`${v.gray(J)}
67
- ${zr(this.state)} ${t.message}
68
- `;switch(this.state){case"submit":return`${r}${v.gray(J)} ${e(this.options.find(n=>n.value===this.value)??t.options[0],"selected")}`;case"cancel":return`${r}${v.gray(J)} ${e(this.options[0],"cancelled")}
69
- ${v.gray(J)}`;default:return`${r}${v.cyan(J)} ${this.options.map((n,s)=>e(n,s===this.cursor?"active":"inactive")).join(`
70
- ${v.cyan(J)} `)}
71
- ${v.cyan(Qe)}
72
- `}}}).prompt()},F$=t=>{let e=(r,n)=>{let s=r.label??String(r.value);return n==="active"?`${v.cyan(Iu)} ${s} ${r.hint?v.dim(`(${r.hint})`):""}`:n==="selected"?`${v.green(Kn)} ${v.dim(s)}`:n==="cancelled"?`${v.strikethrough(v.dim(s))}`:n==="active-selected"?`${v.green(Kn)} ${s} ${r.hint?v.dim(`(${r.hint})`):""}`:n==="submitted"?`${v.dim(s)}`:`${v.dim(Lm)} ${v.dim(s)}`};return new Ct.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
- ${v.reset(v.dim(`Press ${v.gray(v.bgWhite(v.inverse(" space ")))} to select, ${v.gray(v.bgWhite(v.inverse(" enter ")))} to submit`))}`},render(){let r=`${v.gray(J)}
74
- ${zr(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}${v.gray(J)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>e(s,"submitted")).join(v.dim(", "))||v.dim("none")}`;case"cancel":{let s=this.options.filter(({value:i})=>this.value.includes(i)).map(i=>e(i,"cancelled")).join(v.dim(", "));return`${r}${v.gray(J)} ${s.trim()?`${s}
76
- ${v.gray(J)}`:""}`}case"error":{let s=this.error.split(`
77
- `).map((i,o)=>o===0?`${v.yellow(Qe)} ${v.yellow(i)}`:` ${i}`).join(`
78
- `);return`${r+v.yellow(J)} ${Tu({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
79
- ${v.yellow(J)} `)}
50
+ ${_.yellow(K)} ${n}
51
+ ${_.yellow(et)} ${_.yellow(this.error)}
52
+ `;case"submit":return`${e}${_.gray(K)} ${_.dim(n)}`;case"cancel":return`${e}${_.gray(K)} ${_.strikethrough(_.dim(n??""))}${n?`
53
+ ${_.gray(K)}`:""}`;default:return`${e}${_.cyan(K)} ${r}
54
+ ${_.cyan(et)}
55
+ `}}}).prompt(),L$=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new xt.ConfirmPrompt({active:e,inactive:r,initialValue:t.initialValue??!0,render(){let n=`${_.gray(K)}
56
+ ${Jr(this.state)} ${t.message}
57
+ `,s=this.value?e:r;switch(this.state){case"submit":return`${n}${_.gray(K)} ${_.dim(s)}`;case"cancel":return`${n}${_.gray(K)} ${_.strikethrough(_.dim(s))}
58
+ ${_.gray(K)}`;default:return`${n}${_.cyan(K)} ${this.value?`${_.green(ju)} ${e}`:`${_.dim(Iu)} ${_.dim(e)}`} ${_.dim("/")} ${this.value?`${_.dim(Iu)} ${_.dim(r)}`:`${_.green(ju)} ${r}`}
59
+ ${_.cyan(et)}
60
+ `}}}).prompt()},B$=t=>{let e=(r,n)=>{let s=r.label??String(r.value);switch(n){case"selected":return`${_.dim(s)}`;case"active":return`${_.green(ju)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`;case"cancelled":return`${_.strikethrough(_.dim(s))}`;default:return`${_.dim(Iu)} ${_.dim(s)}`}};return new xt.SelectPrompt({options:t.options,initialValue:t.initialValue,render(){let r=`${_.gray(K)}
61
+ ${Jr(this.state)} ${t.message}
62
+ `;switch(this.state){case"submit":return`${r}${_.gray(K)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${_.gray(K)} ${e(this.options[this.cursor],"cancelled")}
63
+ ${_.gray(K)}`;default:return`${r}${_.cyan(K)} ${Ru({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(n,s)=>e(n,s?"active":"inactive")}).join(`
64
+ ${_.cyan(K)} `)}
65
+ ${_.cyan(et)}
66
+ `}}}).prompt()},M$=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 xt.SelectKeyPrompt({options:t.options,initialValue:t.initialValue,render(){let r=`${_.gray(K)}
67
+ ${Jr(this.state)} ${t.message}
68
+ `;switch(this.state){case"submit":return`${r}${_.gray(K)} ${e(this.options.find(n=>n.value===this.value)??t.options[0],"selected")}`;case"cancel":return`${r}${_.gray(K)} ${e(this.options[0],"cancelled")}
69
+ ${_.gray(K)}`;default:return`${r}${_.cyan(K)} ${this.options.map((n,s)=>e(n,s===this.cursor?"active":"inactive")).join(`
70
+ ${_.cyan(K)} `)}
71
+ ${_.cyan(et)}
72
+ `}}}).prompt()},q$=t=>{let e=(r,n)=>{let s=r.label??String(r.value);return n==="active"?`${_.cyan(Tu)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="selected"?`${_.green(Xn)} ${_.dim(s)}`:n==="cancelled"?`${_.strikethrough(_.dim(s))}`:n==="active-selected"?`${_.green(Xn)} ${s} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="submitted"?`${_.dim(s)}`:`${_.dim(Um)} ${_.dim(s)}`};return new xt.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(K)}
74
+ ${Jr(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(K)} ${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(K)} ${s.trim()?`${s}
76
+ ${_.gray(K)}`:""}`}case"error":{let s=this.error.split(`
77
+ `).map((i,o)=>o===0?`${_.yellow(et)} ${_.yellow(i)}`:` ${i}`).join(`
78
+ `);return`${r+_.yellow(K)} ${Ru({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
79
+ ${_.yellow(K)} `)}
80
80
  ${s}
81
- `}default:return`${r}${v.cyan(J)} ${Tu({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
82
- ${v.cyan(J)} `)}
83
- ${v.cyan(Qe)}
84
- `}}}).prompt()},k$=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?Qe:J} `:"";return n==="active"?`${v.dim(c)}${v.cyan(Iu)} ${i} ${r.hint?v.dim(`(${r.hint})`):""}`:n==="group-active"?`${c}${v.cyan(Iu)} ${v.dim(i)}`:n==="group-active-selected"?`${c}${v.green(Kn)} ${v.dim(i)}`:n==="selected"?`${v.dim(c)}${v.green(Kn)} ${v.dim(i)}`:n==="cancelled"?`${v.strikethrough(v.dim(i))}`:n==="active-selected"?`${v.dim(c)}${v.green(Kn)} ${i} ${r.hint?v.dim(`(${r.hint})`):""}`:n==="submitted"?`${v.dim(i)}`:`${v.dim(c)}${v.dim(Lm)} ${v.dim(i)}`};return new Ct.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
- ${v.reset(v.dim(`Press ${v.gray(v.bgWhite(v.inverse(" space ")))} to select, ${v.gray(v.bgWhite(v.inverse(" enter ")))} to submit`))}`},render(){let r=`${v.gray(J)}
86
- ${zr(this.state)} ${t.message}
87
- `;switch(this.state){case"submit":return`${r}${v.gray(J)} ${this.options.filter(({value:n})=>this.value.includes(n)).map(n=>e(n,"submitted")).join(v.dim(", "))}`;case"cancel":{let n=this.options.filter(({value:s})=>this.value.includes(s)).map(s=>e(s,"cancelled")).join(v.dim(", "));return`${r}${v.gray(J)} ${n.trim()?`${n}
88
- ${v.gray(J)}`:""}`}case"error":{let n=this.error.split(`
89
- `).map((s,i)=>i===0?`${v.yellow(Qe)} ${v.yellow(s)}`:` ${s}`).join(`
90
- `);return`${r}${v.yellow(J)} ${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
- ${v.yellow(J)} `)}
81
+ `}default:return`${r}${_.cyan(K)} ${Ru({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:n}).join(`
82
+ ${_.cyan(K)} `)}
83
+ ${_.cyan(et)}
84
+ `}}}).prompt()},W$=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?et:K} `:"";return n==="active"?`${_.dim(c)}${_.cyan(Tu)} ${i} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="group-active"?`${c}${_.cyan(Tu)} ${_.dim(i)}`:n==="group-active-selected"?`${c}${_.green(Xn)} ${_.dim(i)}`:n==="selected"?`${_.dim(c)}${_.green(Xn)} ${_.dim(i)}`:n==="cancelled"?`${_.strikethrough(_.dim(i))}`:n==="active-selected"?`${_.dim(c)}${_.green(Xn)} ${i} ${r.hint?_.dim(`(${r.hint})`):""}`:n==="submitted"?`${_.dim(i)}`:`${_.dim(c)}${_.dim(Um)} ${_.dim(i)}`};return new xt.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(K)}
86
+ ${Jr(this.state)} ${t.message}
87
+ `;switch(this.state){case"submit":return`${r}${_.gray(K)} ${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(K)} ${n.trim()?`${n}
88
+ ${_.gray(K)}`:""}`}case"error":{let n=this.error.split(`
89
+ `).map((s,i)=>i===0?`${_.yellow(et)} ${_.yellow(s)}`:` ${s}`).join(`
90
+ `);return`${r}${_.yellow(K)} ${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(K)} `)}
92
92
  ${n}
93
- `}default:return`${r}${v.cyan(J)} ${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
- ${v.cyan(J)} `)}
95
- ${v.cyan(Qe)}
96
- `}}}).prompt()},j$=(t="",e="")=>{let r=`
93
+ `}default:return`${r}${_.cyan(K)} ${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(K)} `)}
95
+ ${_.cyan(et)}
96
+ `}}}).prompt()},H$=(t="",e="")=>{let r=`
97
97
  ${t}
98
98
  `.split(`
99
- `),n=Au.stripVTControlCharacters(e).length,s=Math.max(r.reduce((o,a)=>{let u=Au.stripVTControlCharacters(a);return u.length>o?u.length:o},0),n)+2,i=r.map(o=>`${v.gray(J)} ${v.dim(o)}${" ".repeat(s-Au.stripVTControlCharacters(o).length)}${v.gray(J)}`).join(`
100
- `);process.stdout.write(`${v.gray(J)}
101
- ${v.green(Co)} ${v.reset(e)} ${v.gray(Rm.repeat(Math.max(s-n-1,1))+D$)}
99
+ `),n=ku.stripVTControlCharacters(e).length,s=Math.max(r.reduce((o,a)=>{let u=ku.stripVTControlCharacters(a);return u.length>o?u.length:o},0),n)+2,i=r.map(o=>`${_.gray(K)} ${_.dim(o)}${" ".repeat(s-ku.stripVTControlCharacters(o).length)}${_.gray(K)}`).join(`
100
+ `);process.stdout.write(`${_.gray(K)}
101
+ ${_.green(wo)} ${_.reset(e)} ${_.gray(qm.repeat(Math.max(s-n-1,1))+k$)}
102
102
  ${i}
103
- ${v.gray(y$+Rm.repeat(s+2)+v$)}
104
- `)},I$=(t="")=>{process.stdout.write(`${v.gray(Qe)} ${v.red(t)}
103
+ ${_.gray(F$+qm.repeat(s+2)+j$)}
104
+ `)},Z$=(t="")=>{process.stdout.write(`${_.gray(et)} ${_.red(t)}
105
105
 
106
- `)},T$=(t="")=>{process.stdout.write(`${v.gray(m$)} ${t}
107
- `)},R$=(t="")=>{process.stdout.write(`${v.gray(J)}
108
- ${v.gray(Qe)} ${t}
106
+ `)},U$=(t="")=>{process.stdout.write(`${_.gray($$)} ${t}
107
+ `)},V$=(t="")=>{process.stdout.write(`${_.gray(K)}
108
+ ${_.gray(et)} ${t}
109
109
 
110
- `)},Gr={message:(t="",{symbol:e=v.gray(J)}={})=>{let r=[`${v.gray(J)}`];if(t){let[n,...s]=t.split(`
111
- `);r.push(`${e} ${n}`,...s.map(i=>`${v.gray(J)} ${i}`))}process.stdout.write(`${r.join(`
110
+ `)},Yr={message:(t="",{symbol:e=_.gray(K)}={})=>{let r=[`${_.gray(K)}`];if(t){let[n,...s]=t.split(`
111
+ `);r.push(`${e} ${n}`,...s.map(i=>`${_.gray(K)} ${i}`))}process.stdout.write(`${r.join(`
112
112
  `)}
113
- `)},info:t=>{Gr.message(t,{symbol:v.blue(_$)})},success:t=>{Gr.message(t,{symbol:v.green(E$)})},step:t=>{Gr.message(t,{symbol:v.green(Co)})},warn:t=>{Gr.message(t,{symbol:v.yellow(b$)})},warning:t=>{Gr.warn(t)},error:t=>{Gr.message(t,{symbol:v.red(S$)})}},Bm=()=>{let t=Fu?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=Fu?80:120,r=process.env.CI==="true",n,s,i=!1,o="",a,u=C=>{let b=C>1?"Something went wrong":"Canceled";i&&h(b,C)},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=>{Yr.message(t,{symbol:_.blue(I$)})},success:t=>{Yr.message(t,{symbol:_.green(T$)})},step:t=>{Yr.message(t,{symbol:_.green(wo)})},warn:t=>{Yr.message(t,{symbol:_.yellow(R$)})},warning:t=>{Yr.warn(t)},error:t=>{Yr.message(t,{symbol:_.red(P$)})}},Vm=()=>{let t=Fu?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=Fu?80:120,r=process.env.CI==="true",n,s,i=!1,o="",a,u=C=>{let S=C>1?"Something went wrong":"Canceled";i&&p(S,C)},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(`
114
114
  `);let C=a.split(`
115
- `);process.stdout.write(Tm.cursor.move(-999,C.length-1)),process.stdout.write(Tm.erase.down(C.length))},m=C=>C.replace(/\.+$/,""),D=(C="")=>{i=!0,n=Ct.block(),o=m(C),process.stdout.write(`${v.gray(J)}
116
- `);let b=0,I=0;d(),s=setInterval(()=>{if(r&&o===a)return;g(),a=o;let R=v.magenta(t[b]),q=r?"...":".".repeat(Math.floor(I)).slice(0,3);process.stdout.write(`${R} ${o}${q}`),b=b+1<t.length?b+1:0,I=I<t.length?I+.125:0},e)},h=(C="",b=0)=>{i=!1,clearInterval(s),g();let I=b===0?v.green(Co):b===1?v.red(Om):v.red(Nm);o=m(C??o),process.stdout.write(`${I} ${o}
117
- `),f(),n()};return{start:D,stop:h,message:(C="")=>{o=m(C??o)}}},P$=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"&&Ct.isCancel(o)){r[s]="canceled",e.onCancel({results:r});continue}r[s]=o}return r},O$=async t=>{for(let e of t){if(e.enabled===!1)continue;let r=Bm();r.start(e.title);let n=await e.task(r.message);r.stop(n||e.title)}};ke.isCancel=Ct.isCancel,ke.updateSettings=Ct.updateSettings,ke.cancel=I$,ke.confirm=x$,ke.group=P$,ke.groupMultiselect=k$,ke.intro=T$,ke.log=Gr,ke.multiselect=F$,ke.note=j$,ke.outro=R$,ke.password=w$,ke.select=$$,ke.selectKey=A$,ke.spinner=Bm,ke.tasks=O$,ke.text=C$});var Xn=_((W2,Hm)=>{var Be=require("fs"),mt=require("path");function xo(t){let e=mt.join(t,"rcode/skills"),r={agents:new Set,actions:new Set},n=mt.join(t,"rcode/agents");if(Be.existsSync(n))for(let o of Be.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=Be.readFileSync(mt.join(o,"SKILL.md"),"utf8");return/^internal:\s*true\s*$/m.test(a)}catch{return!1}}function i(o){if(Be.existsSync(o))for(let a of Be.readdirSync(o,{withFileTypes:!0})){if(!a.isDirectory())continue;let u=mt.join(o,a.name);if(Be.existsSync(mt.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(mt.join(e,"actions")),r}function Mm(t,e=null){if(!Be.existsSync(t))return new Set;let r=new Set;for(let n of Be.readdirSync(t,{withFileTypes:!0}))n.isDirectory()&&(e&&!n.name.startsWith(e)||r.add(e?n.name.slice(e.length):n.name));return r}function wo(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 qm(t,e,r={}){let n=r.globalFallback!==!1,s=xo(e),i=mt.join(t,".claude/agents"),o=mt.join(t,".claude/skills"),a=new Set;if(Be.existsSync(i))for(let l of Be.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=mt.join(l.homedir(),".claude/agents");if(Be.existsSync(d))for(let f of Be.readdirSync(d))f.startsWith("rcode-")&&f.endsWith(".md")&&a.add(f.replace(/^rcode-/,"").replace(/\.md$/,""))}catch{}let u=Mm(o),c=new Set([...u].filter(l=>s.actions.has(l)));if(c.size===0&&n)try{let l=require("os"),d=mt.join(l.homedir(),".claude/skills"),f=Mm(d);c=new Set([...f].filter(g=>s.actions.has(g)))}catch{}return[wo("claude","agents",s.agents,a),wo("claude","actions",s.actions,c)]}function Pu(t,e,r){let n=xo(r),s=t==="cursor"?".cursor/rules":".windsurf/rules",i=mt.join(e,s,"rcode","agents"),o=new Set;if(Be.existsSync(i))for(let a of Be.readdirSync(i,{withFileTypes:!0}))a.isFile()&&(!a.name.startsWith("rcode-")||!a.name.endsWith(".mdc")||o.add(a.name.replace(/^rcode-/,"").replace(/\.mdc$/,"")));return[wo(t,"agents",n.agents,o)]}function Wm(t,e){let r=xo(e),n=mt.join(t,".antigravity/rcode/agents"),s=new Set;if(Be.existsSync(n))for(let i of Be.readdirSync(n,{withFileTypes:!0}))i.isFile()&&(!i.name.startsWith("rcode-")||!i.name.endsWith(".md")||s.add(i.name.replace(/^rcode-/,"").replace(/\.md$/,"")));return[wo("antigravity","agents",r.agents,s)]}function N$(t,e,r){let n=[];r.includes("claude")&&n.push(...qm(t,e)),r.includes("cursor")&&n.push(...Pu("cursor",t,e)),r.includes("windsurf")&&n.push(...Pu("windsurf",t,e)),r.includes("antigravity")&&n.push(...Wm(t,e));let s=n.some(i=>i.missing.length>0||i.extra.length>0);return{reports:n,hasDrift:s}}function L$(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
- `)}Hm.exports={readPackageManifest:xo,verifyInstall:N$,verifyClaudeInstall:qm,verifyRulesInstall:Pu,verifyAntigravityInstall:Wm,formatReport:L$}});var es=_((H2,Qt)=>{var y=require("fs"),p=require("path"),B$=require("crypto"),gt=require("os"),{writeFileAtomic:$t,safeRmSync:Nu}=Zt(),G=An(),{createSpinner:M$}=bc(),q$=mf(),{z:je}=Na(),Sn=$p(),{createTwoFilesPatch:Zm}=dm(),et=Ru(),Kr=t=>G.green("\u2713")+" "+t,Um=t=>G.red("\u2717")+" "+t,Jt=t=>G.yellow("\u26A0")+" "+t,$o=t=>G.cyan("\u2192")+" "+t,z=t=>G.dim(t),wt=t=>G.bold(t),xt=p.resolve(__dirname,".."),Fe=p.join(xt,"rcode"),Qn=Object.freeze(["claude","cursor","gemini","vscode","antigravity","windsurf","codex"]);function W$(){let t=[p.join(process.env.HOME||"",".pnpm-global","node_modules","@hanzlaa","rcode"),p.join(process.env.HOME||"",".npm-global","lib","node_modules","@hanzlaa","rcode"),p.join(process.cwd(),"node_modules","@hanzlaa","rcode"),p.dirname(p.dirname(process.argv[1]||""))];for(let e of t)if(e&&y.existsSync(p.join(e,"package.json")))return e;return p.dirname(p.dirname(process.argv[1]||""))}function H$(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 Z$=je.object({user_name:je.string().min(1),project_name:je.string().min(1),communication_language:je.string().default("English"),mode:je.enum(["guided","yolo"],{errorMap:()=>({message:'expected "guided" or "yolo"'})}).default("guided"),model_profile:je.string().optional(),commit_planning:je.boolean().optional(),rcode_source_path:je.string().optional(),workflow:je.object({research_by_default:je.boolean().optional(),plan_checker:je.boolean().optional(),post_execute_gates:je.boolean().optional(),ui_safety_gate:je.boolean().optional(),nyquist_validation:je.boolean().optional()}).optional(),output:je.object({verbose:je.boolean().optional()}).optional(),git:je.object({branching_strategy:je.string().optional()}).optional()}).passthrough();function Lu(t){let e={target:process.cwd(),targetProvided:!1,force:!1,reset:!1,yes:!1,userName:gt.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,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==="--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=gt.homedir()),!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):H$(p.dirname(n))&&(e.target=n)}return e.projectName||(e.projectName=p.basename(e.target)),e}function U$(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(Mm.cursor.move(-999,C.length-1)),process.stdout.write(Mm.erase.down(C.length))},m=C=>C.replace(/\.+$/,""),y=(C="")=>{i=!0,n=xt.block(),o=m(C),process.stdout.write(`${_.gray(K)}
116
+ `);let S=0,I=0;d(),s=setInterval(()=>{if(r&&o===a)return;g(),a=o;let P=_.magenta(t[S]),W=r?"...":".".repeat(Math.floor(I)).slice(0,3);process.stdout.write(`${P} ${o}${W}`),S=S+1<t.length?S+1:0,I=I<t.length?I+.125:0},e)},p=(C="",S=0)=>{i=!1,clearInterval(s),g();let I=S===0?_.green(wo):S===1?_.red(Hm):_.red(Zm);o=m(C??o),process.stdout.write(`${I} ${o}
117
+ `),f(),n()};return{start:y,stop:p,message:(C="")=>{o=m(C??o)}}},G$=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"&&xt.isCancel(o)){r[s]="canceled",e.onCancel({results:r});continue}r[s]=o}return r},z$=async t=>{for(let e of t){if(e.enabled===!1)continue;let r=Vm();r.start(e.title);let n=await e.task(r.message);r.stop(n||e.title)}};Fe.isCancel=xt.isCancel,Fe.updateSettings=xt.updateSettings,Fe.cancel=Z$,Fe.confirm=L$,Fe.group=G$,Fe.groupMultiselect=W$,Fe.intro=U$,Fe.log=Yr,Fe.multiselect=q$,Fe.note=H$,Fe.outro=V$,Fe.password=N$,Fe.select=B$,Fe.selectKey=M$,Fe.spinner=Vm,Fe.tasks=z$,Fe.text=O$});var Kn=v((nI,Jm)=>{var Be=require("fs"),Dt=require("path");function $o(t){let e=Dt.join(t,"rcode/skills"),r={agents:new Set,actions:new Set},n=Dt.join(t,"rcode/agents");if(Be.existsSync(n))for(let o of Be.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=Be.readFileSync(Dt.join(o,"SKILL.md"),"utf8");return/^internal:\s*true\s*$/m.test(a)}catch{return!1}}function i(o){if(Be.existsSync(o))for(let a of Be.readdirSync(o,{withFileTypes:!0})){if(!a.isDirectory())continue;let u=Dt.join(o,a.name);if(Be.existsSync(Dt.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(Dt.join(e,"actions")),r}function Gm(t,e=null){if(!Be.existsSync(t))return new Set;let r=new Set;for(let n of Be.readdirSync(t,{withFileTypes:!0}))n.isDirectory()&&(e&&!n.name.startsWith(e)||r.add(e?n.name.slice(e.length):n.name));return r}function xo(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 zm(t,e,r={}){let n=r.globalFallback!==!1,s=$o(e),i=Dt.join(t,".claude/agents"),o=Dt.join(t,".claude/skills"),a=new Set;if(Be.existsSync(i))for(let l of Be.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=Dt.join(l.homedir(),".claude/agents");if(Be.existsSync(d))for(let f of Be.readdirSync(d))f.startsWith("rcode-")&&f.endsWith(".md")&&a.add(f.replace(/^rcode-/,"").replace(/\.md$/,""))}catch{}let u=Gm(o),c=new Set([...u].filter(l=>s.actions.has(l)));if(c.size===0&&n)try{let l=require("os"),d=Dt.join(l.homedir(),".claude/skills"),f=Gm(d);c=new Set([...f].filter(g=>s.actions.has(g)))}catch{}return[xo("claude","agents",s.agents,a),xo("claude","actions",s.actions,c)]}function Ou(t,e,r){let n=$o(r),s=t==="cursor"?".cursor/rules":".windsurf/rules",i=Dt.join(e,s,"rcode","agents"),o=new Set;if(Be.existsSync(i))for(let a of Be.readdirSync(i,{withFileTypes:!0}))a.isFile()&&(!a.name.startsWith("rcode-")||!a.name.endsWith(".mdc")||o.add(a.name.replace(/^rcode-/,"").replace(/\.mdc$/,"")));return[xo(t,"agents",n.agents,o)]}function Ym(t,e){let r=$o(e),n=Dt.join(t,".antigravity/rcode/agents"),s=new Set;if(Be.existsSync(n))for(let i of Be.readdirSync(n,{withFileTypes:!0}))i.isFile()&&(!i.name.startsWith("rcode-")||!i.name.endsWith(".md")||s.add(i.name.replace(/^rcode-/,"").replace(/\.md$/,"")));return[xo("antigravity","agents",r.agents,s)]}function Y$(t,e,r){let n=[];r.includes("claude")&&n.push(...zm(t,e)),r.includes("cursor")&&n.push(...Ou("cursor",t,e)),r.includes("windsurf")&&n.push(...Ou("windsurf",t,e)),r.includes("antigravity")&&n.push(...Ym(t,e));let s=n.some(i=>i.missing.length>0||i.extra.length>0);return{reports:n,hasDrift:s}}function J$(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
+ `)}Jm.exports={readPackageManifest:$o,verifyInstall:Y$,verifyClaudeInstall:zm,verifyRulesInstall:Ou,verifyAntigravityInstall:Ym,formatReport:J$}});var ts=v((sI,at)=>{var D=require("fs"),h=require("path"),X$=require("crypto"),K$=require("os"),{writeFileAtomic:kt,safeRmSync:Bu}=zt(),{homedir:Ge}=An(),G=kn(),{createSpinner:Q$}=kc(),eA=Sf(),{z:je}=La(),bn=Rp(),{createTwoFilesPatch:Xm}=ym(),tt=Pu(),Ut=t=>G.green("\u2713")+" "+t,Km=t=>G.red("\u2717")+" "+t,Zt=t=>G.yellow("\u26A0")+" "+t,Ao=t=>G.cyan("\u2192")+" "+t,Y=t=>G.dim(t),$t=t=>G.bold(t),yt=h.resolve(__dirname,".."),ke=h.join(yt,"rcode"),es=Object.freeze(["claude","cursor","gemini","vscode","antigravity","windsurf","codex","grok"]);function tA(){let t=[h.join(process.env.HOME||"",".pnpm-global","node_modules","@hanzlaa","rcode"),h.join(process.env.HOME||"",".npm-global","lib","node_modules","@hanzlaa","rcode"),h.join(process.cwd(),"node_modules","@hanzlaa","rcode"),h.dirname(h.dirname(process.argv[1]||""))];for(let e of t)if(e&&D.existsSync(h.join(e,"package.json")))return e;return h.dirname(h.dirname(process.argv[1]||""))}function rA(t){let e=t;for(;;){if(D.existsSync(h.join(e,"pnpm-workspace.yaml")))return e;let r=h.dirname(e);if(r===e)return null;e=r}}var nA=je.object({user_name:je.string().min(1),project_name:je.string().min(1),communication_language:je.string().default("English"),mode:je.enum(["guided","yolo"],{errorMap:()=>({message:'expected "guided" or "yolo"'})}).default("guided"),model_profile:je.string().optional(),commit_planning:je.boolean().optional(),rcode_source_path:je.string().optional(),workflow:je.object({research_by_default:je.boolean().optional(),plan_checker:je.boolean().optional(),post_execute_gates:je.boolean().optional(),ui_safety_gate:je.boolean().optional(),nyquist_validation:je.boolean().optional()}).optional(),output:je.object({verbose:je.boolean().optional()}).optional(),git:je.object({branching_strategy:je.string().optional()}).optional()}).passthrough();function Mu(t){let e={target:process.cwd(),targetProvided:!1,force:!1,reset:!1,yes:!1,userName:K$.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,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==="--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=h.resolve(r[0]),e.targetProvided=!0),e.global&&!e.targetProvided&&(e.target=Ge()),!e.targetProvided&&!e.global){let n=process.cwd(),s=D.existsSync(h.join(n,"pnpm-workspace.yaml")),i=process.env.INIT_CWD;s&&i&&h.resolve(i)!==h.resolve(n)?e.target=h.resolve(i):rA(h.dirname(n))&&(e.target=n)}return e.projectName||(e.projectName=h.basename(e.target)),e}function sA(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=h.join(t,l);D.existsSync(d)&&n.push(l)}for(let c of[".rcode/config.yaml",".rcode/state.json",".rcode/_config/manifest.yaml",".rcode/_config/files-manifest.csv"])D.existsSync(h.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=h.join(t,".rcode/backups");try{D.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=h.join(s,`install-force-${i}.tgz`),a=h.relative(t,o),u=r("tar",["-czf",o,"-C",t,"--files-from=-"],{input:n.join(`
119
119
  `)+`
120
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 V$(t){let e=t||Me(),r=["",G.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"),G.cyan("\u2502")+" "+G.cyan("\u2502"),G.cyan("\u2502")+" "+G.bold(G.yellow("\u{1F54C} rcode Memory Bank"))+" "+z("\u2014 installer")+" "+G.cyan("\u2502"),G.cyan("\u2502")+" "+z("A persistent context-brain for your editor")+" "+G.cyan("\u2502"),G.cyan("\u2502")+" "+G.cyan("\u2502"),G.cyan("\u2502")+" "+z("version ")+G.green("v"+e)+" "+G.cyan("\u2502"),G.cyan("\u2502")+" "+z("docs ")+"github.com/hanzlahabib/rihal-code "+G.cyan("\u2502"),G.cyan("\u2502")+" "+z("by ")+"Hanzla Habib "+G.cyan("\u2502"),G.cyan("\u2502")+" "+G.cyan("\u2502"),G.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 Vm(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=gt.homedir();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 G$(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=Vm(t.target),o=Qn.filter(a=>i[a]);return o.length>0?o:["claude"]}let e=Vm(t.target),r=Qn.filter(i=>i!=="antigravity"&&e[i]),n=r.length>0?r:["claude"],s=await et.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 et.isCancel(s)&&(et.cancel("Install cancelled."),process.exit(0)),s}async function z$(t){if(t.commitPlanning!==null)return t.commitPlanning;if(t.noPrompt||t.global)return!1;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 et.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 et.isCancel(n)&&(et.cancel("Install cancelled."),process.exit(0)),n==="commit"}function Ym(){console.log(`
121
+ `)[0]}`,fileCount:n.length}:{ok:!0,path:a,fileCount:n.length}}function oA(t){let e=t||Me(),r=["",G.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"),G.cyan("\u2502")+" "+G.cyan("\u2502"),G.cyan("\u2502")+" "+G.bold(G.yellow("\u{1F54C} rcode Memory Bank"))+" "+Y("\u2014 installer")+" "+G.cyan("\u2502"),G.cyan("\u2502")+" "+Y("A persistent context-brain for your editor")+" "+G.cyan("\u2502"),G.cyan("\u2502")+" "+G.cyan("\u2502"),G.cyan("\u2502")+" "+Y("version ")+G.green("v"+e)+" "+G.cyan("\u2502"),G.cyan("\u2502")+" "+Y("docs ")+"github.com/hanzlahabib/rihal-code "+G.cyan("\u2502"),G.cyan("\u2502")+" "+Y("by ")+"Hanzla Habib "+G.cyan("\u2502"),G.cyan("\u2502")+" "+G.cyan("\u2502"),G.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 Qm(t){let e={claude:!1,cursor:!1,gemini:!1,vscode:!1,antigravity:!1,windsurf:!1,codex:!1};D.existsSync(h.join(t,".claude"))&&(e.claude=!0),D.existsSync(h.join(t,".cursor"))&&(e.cursor=!0),D.existsSync(h.join(t,".gemini"))&&(e.gemini=!0),D.existsSync(h.join(t,".vscode"))&&(e.vscode=!0),D.existsSync(h.join(t,".antigravity"))&&(e.antigravity=!0),D.existsSync(h.join(t,".windsurf"))&&(e.windsurf=!0);let r=Ge();return D.existsSync(h.join(r,".claude"))&&(e.claude=!0),D.existsSync(h.join(r,".cursor"))&&(e.cursor=!0),D.existsSync(h.join(r,".config","Cursor"))&&(e.cursor=!0),D.existsSync(h.join(r,".gemini"))&&(e.gemini=!0),D.existsSync(h.join(r,".vscode"))&&(e.vscode=!0),D.existsSync(h.join(r,".config","Code"))&&(e.vscode=!0),D.existsSync(h.join(r,".antigravity"))&&(e.antigravity=!0),D.existsSync(h.join(r,".windsurf"))&&(e.windsurf=!0),D.existsSync(h.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 iA(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=Qm(t.target),o=es.filter(a=>i[a]);return o.length>0?o:["claude"]}let e=Qm(t.target),r=es.filter(i=>i!=="antigravity"&&e[i]),n=r.length>0?r:["claude"],s=await tt.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 tt.isCancel(s)&&(tt.cancel("Install cancelled."),process.exit(0)),s}async function aA(t){if(t.commitPlanning!==null)return t.commitPlanning;if(t.noPrompt||t.global)return!1;let e=null;try{let s=h.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 tt.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 tt.isCancel(n)&&(tt.cancel("Install cancelled."),process.exit(0)),n==="commit"}function rg(){console.log(`
123
123
  rcode installer
124
124
 
125
125
  Usage:
@@ -145,10 +145,10 @@ Installs (IDE-specific):
145
145
  cursor: target/.cursor/rules/rcode/ Cursor-specific rules + agents
146
146
  gemini: target/.gemini/rcode/ Gemini CLI commands + agents
147
147
  target/.planning/ artifact output dir (all IDEs)
148
- `)}function Bu(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")};default:throw new Error(`Unknown IDE: ${t}. Supported: ${Qn.join(", ")}`)}}function Yr(t,e=[]){return y.existsSync(t)?q$.sync("**/*",{cwd:t,dot:!0,onlyFiles:!0,followSymbolicLinks:!1,ignore:e}).map(r=>p.join(t,r)):[]}function Cn(t){return B$.createHash("sha256").update(t).digest("hex")}function br(t){y.mkdirSync(t,{recursive:!0})}function Km(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()?Km(n,s):r.isFile()&&y.copyFileSync(n,s)}}}function Y$(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
148
+ `)}function qu(t,e){switch(t){case"claude":return{agentsDir:h.join(e,".claude","agents"),commandsDir:h.join(e,".claude","commands"),workflowsDir:h.join(e,".rcode","workflows"),referencesDir:h.join(e,".rcode","references"),binDir:h.join(e,".rcode","bin")};case"cursor":return{agentsDir:h.join(e,".cursor","rules","rcode","agents"),commandsDir:h.join(e,".cursor","rules","rcode","commands"),workflowsDir:h.join(e,".rcode","workflows"),referencesDir:h.join(e,".rcode","references"),binDir:h.join(e,".rcode","bin")};case"gemini":return{agentsDir:h.join(e,".gemini","rcode","agents"),commandsDir:h.join(e,".gemini","rcode","commands"),workflowsDir:h.join(e,".rcode","workflows"),referencesDir:h.join(e,".rcode","references"),binDir:h.join(e,".rcode","bin")};case"vscode":return{agentsDir:h.join(e,".claude","agents"),commandsDir:h.join(e,".claude","commands"),workflowsDir:h.join(e,".rcode","workflows"),referencesDir:h.join(e,".rcode","references"),binDir:h.join(e,".rcode","bin"),markerDir:h.join(e,".vscode","rcode")};case"antigravity":return{agentsDir:h.join(e,".antigravity","rcode","agents"),commandsDir:h.join(e,".antigravity","rcode","commands"),workflowsDir:h.join(e,".rcode","workflows"),referencesDir:h.join(e,".rcode","references"),binDir:h.join(e,".rcode","bin")};case"windsurf":return{agentsDir:h.join(e,".windsurf","rules","rcode","agents"),commandsDir:h.join(e,".windsurf","rules","rcode","commands"),workflowsDir:h.join(e,".rcode","workflows"),referencesDir:h.join(e,".rcode","references"),binDir:h.join(e,".rcode","bin")};case"codex":return{agentsDir:h.join(e,".claude","agents"),commandsDir:h.join(e,".claude","commands"),workflowsDir:h.join(e,".rcode","workflows"),referencesDir:h.join(e,".rcode","references"),binDir:h.join(e,".rcode","bin")};case"grok":return{agentsDir:h.join(e,".claude","agents"),commandsDir:h.join(e,".claude","commands"),workflowsDir:h.join(e,".rcode","workflows"),referencesDir:h.join(e,".rcode","references"),binDir:h.join(e,".rcode","bin")};default:throw new Error(`Unknown IDE: ${t}. Supported: ${es.join(", ")}`)}}function Xr(t,e=[]){return D.existsSync(t)?eA.sync("**/*",{cwd:t,dot:!0,onlyFiles:!0,followSymbolicLinks:!1,ignore:e}).map(r=>h.join(t,r)):[]}function Cn(t){return X$.createHash("sha256").update(t).digest("hex")}function At(t){D.mkdirSync(t,{recursive:!0})}function ng(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=h.join(t,r.name),s=h.join(e,r.name);r.isDirectory()?ng(n,s):r.isFile()&&D.copyFileSync(n,s)}}}function uA(t,e){let r=h.join(t,".planning"),n=h.join(r,"ROADMAP.md"),s=h.join(r,"STATE.md"),i=h.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||h.basename(t),u=`<!-- INSTALL STUB \u2014 overwritten by /rcode-new-project. Delete this file or run
149
149
  /rcode-new-project before committing. See https://github.com/hanzlahabib/rihal-code/issues/670 -->
150
150
 
151
- `;y.writeFileSync(i,u+`# ${a}
151
+ `;D.writeFileSync(i,u+`# ${a}
152
152
 
153
153
  **One-line:** Describe what this project is in one sentence.
154
154
 
@@ -161,7 +161,7 @@ What this project delivers and who it serves.
161
161
  - Language/framework
162
162
  - Key dependencies
163
163
  - Deployment target
164
- `),y.writeFileSync(n,u+`# ${a} \u2014 Roadmap
164
+ `),D.writeFileSync(n,u+`# ${a} \u2014 Roadmap
165
165
 
166
166
  **Milestone: M1 \u2014 Initial Delivery** (v1.0)
167
167
  Started: ${o} \xB7 Current
@@ -181,7 +181,7 @@ Started: ${o} \xB7 Current
181
181
  ## Backlog
182
182
 
183
183
  Ideas and future phases go here.
184
- `),y.writeFileSync(s,u+`# ${a} \u2014 State
184
+ `),D.writeFileSync(s,u+`# ${a} \u2014 State
185
185
 
186
186
  **Last updated:** ${o}
187
187
  **Milestone:** M1 \u2014 Initial Delivery
@@ -201,163 +201,167 @@ _None._
201
201
  ## Next Action
202
202
 
203
203
  Run \`/rcode-new-project <description>\` to bootstrap, or \`/rcode-sprint-planning\` once a real phase exists.
204
- `);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 I=y.readFileSync(m,"utf8").match(/^project_name:\s*"?([^"\n]+)"?/m);I&&(g=I[1].trim())}catch{}let D=null,h=p.join(t,".planning","ROADMAP.md");if(!f&&y.existsSync(h))try{let b=y.readFileSync(h,"utf8"),I=b.match(/^\|\s*(\d+(?:\.\d+)?)\s*\|/m);if(I)D=String(parseInt(I[1],10));else{let R=b.match(/^#{2,4}\s*Phase\s+(\d+(?:\.\d+)?)/im);R&&(D=String(parseInt(R[1],10)))}}catch{}let C={version:"1",project:g,...f?{_seeded_stub:!0}:{},created:d,updated:d,current_phase:D,current_plan:0,current_sprint:null,milestone:null,phases:[],executions:[],decisions:[],blockers:[],council_sessions:[],chains:[],workstreams:[],active_workstream:null,last_session:null,velocity_history:[]};y.mkdirSync(p.dirname(c),{recursive:!0}),$t(c,JSON.stringify(C,null,2)+`
205
- `)}return!0}function K$(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/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(`
206
- `),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 C=g;return C>0&&d[C-1]===`
207
- `&&(C-=1),d.slice(0,C)+f}let D=g;D>0&&d[D-1]===`
208
- `&&(D-=1);let h=m+s.length;return d[h]===`
209
- `&&(h+=1),d.slice(0,D)+f+d.slice(h)};var u=l;if(!y.existsSync(a))return $t(a,o),{action:"created"};let c=y.readFileSync(a,"utf8");if(c.includes(n)){let d=l(c,o);return d!==null&&d!==c?($t(a,d),{action:"updated"}):{action:"already-present"}}return $t(a,c+o),{action:"appended"}}catch(c){return{action:"skipped-error",error:c.message}}}function X$(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(`
210
- `),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 C=g;return C>0&&d[C-1]===`
211
- `&&(C-=1),d.slice(0,C)+f}let D=g;D>0&&d[D-1]===`
212
- `&&(D-=1);let h=m+s.length;return d[h]===`
213
- `&&(h+=1),d.slice(0,D)+f+d.slice(h)};var u=l;if(y.mkdirSync(o,{recursive:!0}),!y.existsSync(a))return $t(a,`#!/bin/sh
214
- ${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?($t(a,d,{mode:493}),{action:"updated"}):{action:"already-present"}}return $t(a,c+i,{mode:493}),{action:"appended"}}catch(c){return{action:"skipped-error",error:c.message}}}function J$(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 Gm(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(gt.homedir(),".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"),C=/^internal:\s*true\s*$/m.test(h);return l.set(m,C),C}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 b=D.name.startsWith("rcode-")?D.name:`rcode-${D.name}`,I=d(h),R=I?p.join(i,b):p.join(s,b);if(!I&&a.has(b)&&!f(R)){if(y.existsSync(R))try{Nu(R,e)}catch{}c++;continue}Km(h,R),u++}else g(h)}}for(let m of["agents","actions","core"])g(p.join(n,m));return{count:u,skippedGlobal:c}}function Ou(t){if(!t.startsWith(`---
204
+ `);let c=h.join(t,".rcode","state.json");function l(){let d=h.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(c)){let d=new Date().toISOString(),f=l(),g=null,m=h.join(t,".rcode","config.yaml");if(D.existsSync(m))try{let I=D.readFileSync(m,"utf8").match(/^project_name:\s*"?([^"\n]+)"?/m);I&&(g=I[1].trim())}catch{}let y=null,p=h.join(t,".planning","ROADMAP.md");if(!f&&D.existsSync(p))try{let S=D.readFileSync(p,"utf8"),I=S.match(/^\|\s*(\d+(?:\.\d+)?)\s*\|/m);if(I)y=String(parseInt(I[1],10));else{let P=S.match(/^#{2,4}\s*Phase\s+(\d+(?:\.\d+)?)/im);P&&(y=String(parseInt(P[1],10)))}}catch{}let C={version:"1",project:g,...f?{_seeded_stub:!0}:{},created:d,updated:d,current_phase:y,current_plan:0,current_sprint:null,milestone:null,phases:[],executions:[],decisions:[],blockers:[],council_sessions:[],chains:[],workstreams:[],active_workstream:null,last_session:null,velocity_history:[]};D.mkdirSync(h.dirname(c),{recursive:!0}),kt(c,JSON.stringify(C,null,2)+`
205
+ `)}return!0}function cA(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/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(`
206
+ `),a=h.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 C=g;return C>0&&d[C-1]===`
207
+ `&&(C-=1),d.slice(0,C)+f}let y=g;y>0&&d[y-1]===`
208
+ `&&(y-=1);let p=m+s.length;return d[p]===`
209
+ `&&(p+=1),d.slice(0,y)+f+d.slice(p)};var u=l;if(!D.existsSync(a))return kt(a,o),{action:"created"};let c=D.readFileSync(a,"utf8");if(c.includes(n)){let d=l(c,o);return d!==null&&d!==c?(kt(a,d),{action:"updated"}):{action:"already-present"}}return kt(a,c+o),{action:"appended"}}catch(c){return{action:"skipped-error",error:c.message}}}function lA(t,e={}){if(e.gitHooks===!1)return{action:"skipped-flag"};let r=h.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(`
210
+ `),o=h.join(r,"hooks"),a=h.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 C=g;return C>0&&d[C-1]===`
211
+ `&&(C-=1),d.slice(0,C)+f}let y=g;y>0&&d[y-1]===`
212
+ `&&(y-=1);let p=m+s.length;return d[p]===`
213
+ `&&(p+=1),d.slice(0,y)+f+d.slice(p)};var u=l;if(D.mkdirSync(o,{recursive:!0}),!D.existsSync(a))return kt(a,`#!/bin/sh
214
+ ${i}`,{mode:493}),{action:"created"};let c=D.readFileSync(a,"utf8");if(c.includes(n)){let d=l(c,i);return d!==null&&d!==c?(kt(a,d,{mode:493}),{action:"updated"}):{action:"already-present"}}return kt(a,c+i,{mode:493}),{action:"appended"}}catch(c){return{action:"skipped-error",error:c.message}}}function dA(t,e){let r=h.join(t,"rcode","brain"),n=h.join(e,".rcode","brain");D.mkdirSync(n,{recursive:!0});let s=0;for(let o of["sources.yaml","README.md"]){let a=h.join(r,o),u=h.join(n,o);D.existsSync(a)&&!D.existsSync(u)&&(D.copyFileSync(a,u),s++)}let i=h.join(t,"rcode","skills","_shared");if(D.existsSync(i)){let o=h.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 u=h.join(o,a.name);D.existsSync(u)||(D.copyFileSync(h.join(i,a.name),u),s++)}}return s}function eg(t,e,r={}){let n=h.join(t,"rcode/skills"),s=h.join(e,".claude/skills"),i=h.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=h.join(Ge(),".claude","skills"),a=r.skipGlobalDuplicates&&D.existsSync(o)?new Set(D.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 y=h.join(m,"SKILL.md");if(!D.existsSync(y))return l.set(m,!1),!1;let p=D.readFileSync(y,"utf8"),C=/^internal:\s*true\s*$/m.test(p);return l.set(m,C),C}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 p=h.join(m,y.name);if(D.existsSync(h.join(p,"SKILL.md"))){let S=y.name.startsWith("rcode-")?y.name:`rcode-${y.name}`,I=d(p),P=I?h.join(i,S):h.join(s,S);if(!I&&a.has(S)&&!f(P)){if(D.existsSync(P))try{Bu(P,e)}catch{}c++;continue}ng(p,P),u++}else g(p)}}for(let m of["agents","actions","core"])g(h.join(n,m));return{count:u,skippedGlobal:c}}function Nu(t){if(!t.startsWith(`---
215
215
  `))return{frontmatter:{},body:t};let e=t.indexOf(`
216
216
  ---
217
217
  `,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(`
218
- `)){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 Xm(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 Mu(t="claude",e=process.cwd()){if(Array.isArray(t)){let f=new Set,g=[];for(let m of t)for(let D of Mu(m,e)){let h=D.rel;f.has(h)||(f.add(h),g.push(D))}return g}let r=[],n=Bu(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 Yr(p.join(Fe,"workflows"))){let g=p.relative(p.join(Fe,"workflows"),f);r.push({src:f,rel:p.join(s,g)})}for(let f of Yr(p.join(Fe,"references"))){let g=p.relative(p.join(Fe,"references"),f);r.push({src:f,rel:p.join(i,g)})}for(let f of Yr(p.join(Fe,"bin"))){let g=p.relative(p.join(Fe,"bin"),f);r.push({src:f,rel:p.join(o,g),executable:f.endsWith(".cjs")})}let c=p.join(Fe,"templates","projects"),l=p.relative(e,p.join(e,".rcode","templates","projects"));for(let f of Yr(c)){let g=p.relative(c,f);r.push({src:f,rel:p.join(l,g)})}for(let f of Yr(p.join(Fe,"agents"))){let g=p.relative(p.join(Fe,"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 Yr(p.join(Fe,"commands"))){let g=p.relative(p.join(Fe,"commands"),f),m=t==="cursor"?".mdc":".md",D=p.basename(f,".md"),h=t==="claude"||t==="vscode"?`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 Yr(p.join(Fe,"agents","rules"))){let g=p.relative(p.join(Fe,"agents","rules"),f);r.push({src:f,rel:p.join(".rcode","agents-rules",g)})}return r}function Q$(t){let e=p.join(Fe,"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(`
219
- `)){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 Jm(){let t=p.join(Fe,"modules");return y.existsSync(t)?y.readdirSync(t).filter(e=>e.endsWith(".yaml")).map(e=>e.replace(".yaml","")):[]}function e1(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"))?!0:r.has(n.rel))}function t1(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}=Ou(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}=Ou(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(gt.homedir(),".claude","agents"),p.join(gt.homedir(),".rcode","agents")];try{let u=p.join(Fe,"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}=Ou(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(`
218
+ `)){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 sg(t){let e=h.join(t,".claude","commands","rcode"),r=h.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=h.join(e,i);if(!D.statSync(o).isFile()||!i.endsWith(".md"))continue;let u=h.basename(i,".md").startsWith("rcode-")?i:`rcode-${i}`,c=h.join(r,u);if(D.existsSync(c)){D.unlinkSync(o);continue}D.renameSync(o,c),n++}let s=!1;try{D.rmdirSync(e),s=!0}catch{}return{moved:n,removed_dir:s}}function Wu(t="claude",e=process.cwd()){if(Array.isArray(t)){let f=new Set,g=[];for(let m of t)for(let y of Wu(m,e)){let p=y.rel;f.has(p)||(f.add(p),g.push(y))}return g}let r=[],n=qu(t,e),s=h.relative(e,n.workflowsDir),i=h.relative(e,n.referencesDir),o=h.relative(e,n.binDir),a=h.relative(e,n.agentsDir),u=h.relative(e,n.commandsDir);for(let f of Xr(h.join(ke,"workflows"))){let g=h.relative(h.join(ke,"workflows"),f);r.push({src:f,rel:h.join(s,g)})}for(let f of Xr(h.join(ke,"references"))){let g=h.relative(h.join(ke,"references"),f);r.push({src:f,rel:h.join(i,g)})}for(let f of Xr(h.join(ke,"bin"))){let g=h.relative(h.join(ke,"bin"),f);r.push({src:f,rel:h.join(o,g),executable:f.endsWith(".cjs")})}let c=h.join(ke,"templates","projects"),l=h.relative(e,h.join(e,".rcode","templates","projects"));for(let f of Xr(c)){let g=h.relative(c,f);r.push({src:f,rel:h.join(l,g)})}for(let f of Xr(h.join(ke,"agents"))){let g=h.relative(h.join(ke,"agents"),f),m=t==="cursor"?".mdc":".md",y=h.basename(f,".md")+m;r.push({src:f,rel:h.join(a,h.dirname(g),y),ide:t,cursor:t==="cursor"})}for(let f of Xr(h.join(ke,"commands"))){let g=h.relative(h.join(ke,"commands"),f),m=t==="cursor"?".mdc":".md",y=h.basename(f,".md"),p=t==="claude"||t==="vscode"||t==="grok"?`rcode-${y}${m}`:y+m;r.push({src:f,rel:h.join(u,h.dirname(g),p),ide:t,cursor:t==="cursor"})}let d=h.join(e,".rcode","agents-rules");for(let f of Xr(h.join(ke,"agents","rules"))){let g=h.relative(h.join(ke,"agents","rules"),f);r.push({src:f,rel:h.join(".rcode","agents-rules",g)})}return r}function fA(t){let e=h.join(ke,"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(`
219
+ `)){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 og(){let t=h.join(ke,"modules");return D.existsSync(t)?D.readdirSync(t).filter(e=>e.endsWith(".yaml")).map(e=>e.replace(".yaml","")):[]}function hA(t,e){if(e.length===0)return t;let r=new Set;for(let n of e){let s=fA(n);if(!s){console.warn(` \u26A0 Unknown module: ${n}`);continue}for(let i of s.agents)r.add(h.join(".claude","agents",i));for(let i of s.workflows)r.add(h.join(".rcode","workflows",i));for(let i of s.commands)r.add(h.join(".claude","commands",`rcode-${i}`));for(let i of s.references)r.add(h.join(".rcode","references",i))}return t.filter(n=>n.rel.startsWith(h.join(".rcode","bin"))?!0:r.has(n.rel))}function pA(t,e){let r=[["id","file","name","description","color"]],n=new Set,s=new Map,i=u=>(s.has(u)||s.set(u,D.readFileSync(u,"utf8")),s.get(u));for(let u of t){if(!u.rel.startsWith(h.join(".claude","agents"))||!u.rel.match(/^\.claude[\/\\]agents[\/\\][^\/\\]+\.md$/))continue;let c=h.join(e,u.rel),l=i(c),{frontmatter:d}=Nu(l),f=d.name||h.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=h.join(e,".claude","agents");if(D.existsSync(o)){let u=D.readdirSync(o).filter(l=>l.startsWith("rcode-")&&l.endsWith(".md")),c=new Set(t.filter(l=>l.rel.startsWith(h.join(".claude","agents"))).map(l=>h.basename(l.rel)));for(let l of u){if(c.has(l))continue;let d=h.join(o,l),f=i(d),{frontmatter:g}=Nu(f),m=g.name||h.basename(l,".md"),y=m.replace(/^rcode-/,"");if(n.has(y))continue;n.add(y);let p=(g.description||"").replace(/"/g,'""');r.push([y,h.join(".claude","agents",l),m,`"${p}"`,g.color||""])}}let a=[h.join(Ge(),".claude","agents"),h.join(Ge(),".rcode","agents")];try{let u=h.join(ke,"agents");D.existsSync(u)&&a.push(u)}catch{}for(let u of a){if(!D.existsSync(u))continue;let c;try{c=D.readdirSync(u).filter(l=>l.startsWith("rcode-")&&l.endsWith(".md"))}catch{continue}for(let l of c){let d=h.join(u,l),f;try{f=i(d)}catch{continue}let{frontmatter:g}=Nu(f),m=g.name||h.basename(l,".md"),y=m.replace(/^rcode-/,"");if(n.has(y))continue;n.add(y);let p=(g.description||"").replace(/"/g,'""');r.push([y,h.join(".claude","agents",l),m,`"${p}"`,g.color||""])}}return r.map(u=>u.join(",")).join(`
220
220
  `)+`
221
- `}function r1(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,Cn(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,Cn(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(`
222
- `).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,Cn(m),String(m.length)]),i.add(f)}}catch{}}return s.map(c=>c.join(",")).join(`
221
+ `}function mA(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,D.readFileSync(c)),o.get(c));for(let c of t){let l=h.join(e,c.rel);if(!D.existsSync(l))continue;let d=a(l),f=c.rel.split(h.sep).join("/");s.push([f,Cn(d),String(d.length)]),i.add(f)}function u(c){if(D.existsSync(c))for(let l of D.readdirSync(c,{withFileTypes:!0})){let d=h.join(c,l.name);if(l.isDirectory())u(d);else if(l.isFile()){let f=h.relative(e,d).split(h.sep).join("/");if(i.has(f)||f.startsWith("..")||h.isAbsolute(f))continue;try{let g=a(d);s.push([f,Cn(g),String(g.length)]),i.add(f)}catch{}}}}for(let c of n)u(c);if(r){let c=h.join(e,".rcode","_config","files-manifest.csv");if(D.existsSync(c))try{let l=D.readFileSync(c,"utf8").split(`
222
+ `).slice(1).filter(Boolean);for(let d of l){let[f]=d.split(",");if(!f||i.has(f))continue;let g=h.join(e,f);if(!D.existsSync(g))continue;let m=a(g);s.push([f,Cn(m),String(m.length)]),i.add(f)}}catch{}}return s.map(c=>c.join(",")).join(`
223
223
  `)+`
224
- `}function n1(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(`
225
- `).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;Nu(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 s1(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 Me(){try{return JSON.parse(y.readFileSync(p.join(xt,"package.json"),"utf8")).version||"0.0.0"}catch{return"0.0.0"}}function zm(t){let e=Me(),r=t.modules.length>0?t.modules:Jm(),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(`
226
- `)){if(d.startsWith("version:")){let f=d.replace("version:","").trim();Sn.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(`
224
+ `}function gA(t,e){let r=h.join(t,".rcode","_config","files-manifest.csv");if(!D.existsSync(r))return 0;let n;try{n=D.readFileSync(r,"utf8").split(`
225
+ `).slice(1).filter(Boolean).map(f=>f.split(",")[0]).filter(Boolean)}catch{return 0}let s=new Set(e.map(d=>d.rel.split(h.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=h.resolve(t);for(let d of n){if(s.has(d)||i.test(d)||o(d)||d.includes("..")||h.isAbsolute(d))continue;let f=h.join(t,d);if(!D.existsSync(f))continue;Bu(f,c).ok&&(u.add(h.dirname(f)),a+=1)}let l=Array.from(u).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 DA(t){let e=h.join(t,"package.json"),r=h.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 Me(){try{return JSON.parse(D.readFileSync(h.join(yt,"package.json"),"utf8")).version||"0.0.0"}catch{return"0.0.0"}}function tg(t){let e=Me(),r=t.modules.length>0?t.modules:og(),n=[],s=null,i=h.join(t.target,".rcode","_config","manifest.yaml");if(D.existsSync(i)){let c=D.readFileSync(i,"utf8"),l=!1;for(let d of c.split(`
226
+ `)){if(d.startsWith("version:")){let f=d.replace("version:","").trim();bn.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(`
227
227
  `),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(`
228
- `)}function Jn(t){return(t||"").replace(/[\n\r]/g," ").replace(/"/g,'\\"')}function o1(t){return["# rcode v2 project config","# Generated by install. Safe to edit.",`user_name: "${Jn(t.userName)}"`,`project_name: "${Jn(t.projectName)}"`,`communication_language: "${Jn(t.language)}"`,`mode: "${Jn(t.mode)}"`,'model_profile: "balanced"',`commit_planning: ${t.commitPlanning!==!1}`,`rcode_source_path: "${Jn(W$())}/"`,"workflow:"," research_by_default: false"," plan_checker: true"," post_execute_gates: true"," ui_safety_gate: true","git:",' branching_strategy: "none"',""].join(`
229
- `)}function i1(t){let e=Z$.safeParse(t);return e.success?{valid:!0}:{valid:!1,errors:e.error.issues.map(n=>` ${n.path.join(".")||"(root)"}: ${n.message}`)}}function a1(t){let e={},r=null;for(let n of t.split(`
230
- `)){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 qu(t){if(t.help)return Ym(),0;if(t.reset&&!t.force)return console.log(""),console.log(" "+Jt("--reset has no effect without --force.")),console.log(" "+z(" --reset wipes config.yaml and state.json. To prevent accidental data loss,")),console.log(" "+z(" it must be paired with --force. Re-run as:")),console.log(" "+z(" rcode install --reset --force")),console.log(""),2;let e=()=>{};if(!t.global){let r=u1(t.target);if(!r.ok)return console.log(""),console.log(" "+Jt(`Another install is already running here (PID ${r.pid}).`)),console.log(" "+z(` Lock: ${r.lockPath}`)),console.log(" "+z(" If the other process crashed, delete the lock file and retry:")),console.log(" "+z(` rm ${r.lockPath}`)),console.log(""),3;e=r.release,process.on("exit",e)}try{return await c1(t)}finally{e(),process.removeListener("exit",e)}}function u1(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}}async function c1(t){let e=Me();process.stdin.isTTY&&!t.yes&&V$(e),t.ides=await G$(t),t.commitPlanning=await z$(t),console.log(`
231
- \u{1F54C} ${wt("rcode")} ${G.cyan("v"+e)} ${z("\u2192")} ${t.target}`);let n=p.join(t.target,".rcode","_config","manifest.yaml");if(y.existsSync(n)){let F=y.readFileSync(n,"utf8").match(/^version:\s*(.+)$/m),w=F?F[1].trim():"unknown",T=Sn.valid(w)&&Sn.valid(e)?Sn.lt(w,e):w!==e;console.log(T?" "+$o(`Upgrading ${G.dim("v"+w)} \u2192 ${G.green("v"+e)} (config + state + .planning preserved)`):" "+$o(`Refreshing v${w} (config + state + .planning preserved)`)),t.force||console.log(z(" Pass --force to also sweep orphaned files from the previous version."))}if(!y.existsSync(Fe))return console.error(`\u2716 Source tree not found at ${Fe}. Running from wrong dir?`),1;t.ides=t.ides.map(F=>F==="claude-code"?"claude":F);let s=t.ides.filter(F=>!Qn.includes(F));if(s.length>0)return console.error(`\u2716 --ide ${s.join(", ")} is not supported in v${Me()}.`),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(""),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(" "+z("VS Code \u2192 installing to .claude/ paths (read by Claude Code / Continue / Copilot extensions).")),t.ides.includes("codex")&&console.log(" "+z("Codex \u2192 installing to .claude/ paths + AGENTS.md. Use `rcode workflow show <name>` to feed workflows to Codex.")),t.ides.includes("gemini")&&(console.log(`
228
+ `)}function Qn(t){return(t||"").replace(/[\n\r]/g," ").replace(/"/g,'\\"')}function yA(t){return["# rcode v2 project config","# Generated by install. Safe to edit.",`user_name: "${Qn(t.userName)}"`,`project_name: "${Qn(t.projectName)}"`,`communication_language: "${Qn(t.language)}"`,`mode: "${Qn(t.mode)}"`,'model_profile: "balanced"',`commit_planning: ${t.commitPlanning!==!1}`,`rcode_source_path: "${Qn(tA())}/"`,"workflow:"," research_by_default: false"," plan_checker: true"," post_execute_gates: true"," ui_safety_gate: true","git:",' branching_strategy: "none"',""].join(`
229
+ `)}function vA(t){let e=nA.safeParse(t);return e.success?{valid:!0}:{valid:!1,errors:e.error.issues.map(n=>` ${n.path.join(".")||"(root)"}: ${n.message}`)}}function _A(t){let e={},r=null;for(let n of t.split(`
230
+ `)){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 Hu(t){if(t.help)return rg(),0;if(t.reset&&!t.force)return console.log(""),console.log(" "+Zt("--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=EA(t.target);if(!r.ok)return console.log(""),console.log(" "+Zt(`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 SA(t)}finally{e(),process.removeListener("exit",e)}}function EA(t){let e=h.join(t,".rcode"),r=h.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 Zu(t){let e=Ge(),r=h.join(e,".rcode","slash-commands"),n=h.join(e,".rcode","bin");At(r),At(n);let s=h.join(ke,"commands"),i=0;for(let u of D.readdirSync(s))u.endsWith(".md")&&(D.copyFileSync(h.join(s,u),h.join(r,u)),i++);let o=h.join(yt,"cli","rcode-slash-router.cjs"),a=h.join(n,"rcode-slash-router.cjs");return D.copyFileSync(o,a),t&&t.global!=="silent"&&console.log(" "+Ut(`Slash-router: ${i} command bodies \u2192 ~/.rcode/slash-commands/ + router \u2192 ~/.rcode/bin/`)),a}function ig(){return`node "${h.join(Ge(),".rcode","bin","rcode-slash-router.cjs")}"`}function ag(t,e,r,n){let s={};if(D.existsSync(t))try{s=JSON.parse(D.readFileSync(t,"utf8"))||{}}catch{return console.log(" "+Zt(`${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(" "+Ut(`${n}: slash-router hook already present (idempotent).`)),!1):(s.hooks[e].push({hooks:[{type:"command",command:r,timeout:10}]}),At(h.dirname(t)),D.writeFileSync(t,JSON.stringify(s,null,2)+`
231
+ `),console.log(" "+Ut(`${n}: wired slash-router into ${e} hook (existing hooks preserved).`)),!0)}function ug(t){Zu(t);let e=h.join(Ge(),".codex","hooks.json");ag(e,"UserPromptSubmit",ig(),"Codex")}function cg(t){Zu(t);let e=h.join(Ge(),".gemini","antigravity","settings.json");ag(e,"UserPrompt",ig(),"Antigravity")}function Lu(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":ug(t);break;case"antigravity":cg(t);break;default:break}}async function SA(t){let e=Me();process.stdin.isTTY&&!t.yes&&oA(e),t.ides=await iA(t),t.commitPlanning=await aA(t),console.log(`
232
+ \u{1F54C} ${$t("rcode")} ${G.cyan("v"+e)} ${Y("\u2192")} ${t.target}`);let n=h.join(t.target,".rcode","_config","manifest.yaml");if(D.existsSync(n)){let k=D.readFileSync(n,"utf8").match(/^version:\s*(.+)$/m),w=k?k[1].trim():"unknown",T=bn.valid(w)&&bn.valid(e)?bn.lt(w,e):w!==e;console.log(T?" "+Ao(`Upgrading ${G.dim("v"+w)} \u2192 ${G.green("v"+e)} (config + state + .planning preserved)`):" "+Ao(`Refreshing v${w} (config + state + .planning preserved)`)),t.force||console.log(Y(" Pass --force to also sweep orphaned files from the previous version."))}if(!D.existsSync(ke))return console.error(`\u2716 Source tree not found at ${ke}. Running from wrong dir?`),1;t.ides=t.ides.map(k=>k==="claude-code"?"claude":k);let s=t.ides.filter(k=>!es.includes(k));if(s.length>0)return console.error(`\u2716 --ide ${s.join(", ")} is not supported in v${Me()}.`),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.ides.includes("gemini")&&(console.log(`
232
233
  \u26A0\uFE0F Gemini CLI install not yet implemented
233
234
  `),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.
234
235
  `),console.log(`For now, use: --ide claude or --ide cursor
235
- `),t.ides=t.ides.filter(F=>F!=="gemini"),t.ides.length===0))return 1;if(t.ides.includes("antigravity")&&(console.log(" "+Jt("Antigravity install is experimental. Files land at .antigravity/rcode/{agents,commands}/.")),console.log(" "+z("If Antigravity expects a different path, adjust .rcode/config.yaml and re-run."))),t.modules.length>0){let F=Jm(),w=t.modules.filter(T=>!F.includes(T));if(w.length>0)return console.error(`\u2716 Unknown module(s): ${w.join(", ")}`),console.error(` Available modules: ${F.join(", ")}`),1}if(Array.isArray(t.ides)&&t.ides.includes("vscode")||t.ide==="vscode"){let F=Xm(t.target);F.moved>0&&console.log(` \u21BB Migrated ${F.moved} legacy vscode-layout command(s) to .claude/commands/rcode-{name}.md`)}let i=Mu(t.ides,t.target),o=e1(i,t.modules);if(o.length===0)return 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 F of o)console.log(" + "+F.rel);return 0}if(t.forceOverwrite&&!t.noBackup){let F=U$(t.target,o);if(F.ok)console.log(" "+$o(`${G.dim("--force-overwrite")} backup: ${G.cyan(F.path)} ${G.dim("("+F.fileCount+" files \u2014 restore with: tar -xzf "+F.path+")")}`));else if(F.fileCount>0)return console.error(""),console.error(`\u2716 Could not create backup: ${F.warning}`),console.error(" Refusing to --force-overwrite without a backup. Pass --no-backup to override."),console.error(""),1}let a=0;t.force&&(a=n1(t.target,o));let u=new Map;if(t.nonDestructive){let F=p.join(t.target,".rcode","_config","files-manifest.csv");if(y.existsSync(F))try{let w=y.readFileSync(F,"utf8").split(`
236
- `).slice(1).filter(Boolean);for(let T of w){let[B,U]=T.split(",");B&&U&&u.set(B,U)}}catch{}}let c=0,l=0,d=0,f=0,g=[],m=[],D=[],h=M$(z(`Installing ${o.length} files\u2026`),{color:"cyan"}).start();for(let F of o){let w=p.join(t.target,F.rel),T=F.rel.split(p.sep).join("/");br(p.dirname(w));let B=null,U=null,Q=()=>(B||(B=y.readFileSync(w)),B),pe=()=>(U||(U=y.readFileSync(F.src)),U);if(t.nonDestructive&&!t.forceOverwrite&&!t.acceptAll&&y.existsSync(w)){let kt=u.get(T);if(kt){let rr=Q().toString("utf8");if(Cn(Q())!==kt){let Ht=pe().toString("utf8"),dc=Zm(T,T,rr,Ht,"installed","source"),fc=0,hc=0;for(let ps of dc.split(`
237
- `))ps.startsWith("+")&&!ps.startsWith("+++")&&fc++,ps.startsWith("-")&&!ps.startsWith("---")&&hc++;d+=1,g.push(T),m.push({rel:T,insertions:fc,deletions:hc,patch:dc}),l+=1;continue}}}if(y.existsSync(w)&&!t.force&&!t.forceOverwrite){let kt=Cn(Q()),rr=Cn(pe());if(kt===rr){l++;continue}if(!t.yes&&!t.nonDestructive){D.push({rel:T,src:F.src,destPath:w,existingContent:Q().toString("utf8"),sourceContent:pe().toString("utf8")}),l++;continue}}if(y.existsSync(w)&&t.forceOverwrite){let kt=Q(),rr=pe();kt.equals(rr)||h.update({text:z(`overwriting ${F.rel}`)})}let De=pe().toString("utf8");F.cursor&&(De=De),y.writeFileSync(w,De,"utf8"),F.executable&&y.chmodSync(w,493),c++}if(h.success({text:Kr(`${c} files installed`)}),D.length>0){let F={workflows:[],agents:[],commands:[],skills:[],references:[],other:[]};for(let w of D)w.rel.includes("/workflows/")?F.workflows.push(w):w.rel.includes("/agents/")?F.agents.push(w):w.rel.includes("/commands/")?F.commands.push(w):w.rel.includes("/skills/")?F.skills.push(w):w.rel.includes("/references/")?F.references.push(w):F.other.push(w);console.log(""),console.log(" "+Jt(`${D.length} file${D.length===1?"":"s"} have local edits AND v${Me()} updates:`));for(let[w,T]of Object.entries(F))T.length!==0&&console.log(" "+z(`${T.length} ${w}`));if(console.log(""),!t.yes&&process.stdin.isTTY){let w=await et.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"+Me()+" for all",hint:"lose local edits, get all bug fixes"},{value:"keep",label:"Keep my local edits",hint:"skip v"+Me()+" updates for these files (current behaviour)"}]});if(et.isCancel(w))et.note("Skipped \u2014 local edits preserved.");else if(w==="upstream"){let T=0;for(let B of D)y.writeFileSync(B.destPath,B.sourceContent,"utf8"),T++;f+=T,console.log(" "+Kr(`Applied v${Me()} to ${T} file${T===1?"":"s"}.`))}else if(w==="review"){let T=0,B=0;for(let U of D){let Q=Zm(U.rel,U.rel,U.existingContent,U.sourceContent,"local","v"+Me()),pe=0,De=0;for(let nr of Q.split(`
238
- `))nr.startsWith("+")&&!nr.startsWith("+++")&&pe++,nr.startsWith("-")&&!nr.startsWith("---")&&De++;console.log(""),console.log(" "+G.bold(U.rel)+z(" ")+G.green(`+${pe}`)+" "+G.red(`-${De}`));let kt=await et.select({message:"Take upstream, keep local, or view diff?",initialValue:"view",options:[{value:"upstream",label:"Take v"+Me()},{value:"keep",label:"Keep local"},{value:"view",label:"View diff first"}]}),rr=kt;if(et.isCancel(kt)||kt==="view"){for(let Ht of Q.split(`
239
- `).slice(4))Ht.startsWith("+")?process.stdout.write(G.green(Ht)+`
240
- `):Ht.startsWith("-")?process.stdout.write(G.red(Ht)+`
241
- `):Ht.startsWith("@")?process.stdout.write(G.cyan(Ht)+`
242
- `):process.stdout.write(z(Ht)+`
243
- `);let nr=await et.select({message:"Now: take upstream or keep local?",initialValue:"keep",options:[{value:"upstream",label:"Take v"+Me()},{value:"keep",label:"Keep local"}]});rr=et.isCancel(nr)?"keep":nr}rr==="upstream"?(y.writeFileSync(U.destPath,U.sourceContent,"utf8"),T++):B++}f+=T,console.log(" "+Kr(`Review complete: ${T} applied, ${B} kept local.`))}else console.log(" "+z(`${D.length} file${D.length===1?"":"s"} kept local. Re-run with --force-overwrite or 'rcode update' anytime.`))}else console.log(" "+z(`Re-run with --force-overwrite to apply v${Me()} updates, or pipe through an interactive shell to resolve per-file.`));console.log("")}if(f>0&&(console.log(" "+Kr(`Total this run: ${c} installed \xB7 ${f} updated \xB7 ${d+l} unchanged.`)),console.log("")),t.global){let F=p.join(t.target,".rcode","_config");br(F),y.writeFileSync(p.join(F,"manifest.yaml"),zm(t));let T=Gm(xt,t.target).count;try{let{main:B}=require(p.join(xt,"cli","generate-command-skills.cjs")),U=p.join(t.target,".claude","skills"),Q=B(xt,U,Me(),{skipGlobalDuplicates:!0});T+=Q.generated}catch{}return console.log(""),console.log(` ${z(`${T} skills installed globally`)}`),0}let C=p.join(gt.homedir(),".claude","commands"),b=p.join(t.target,".claude","commands"),I=t.target!==gt.homedir();if(I&&!t.forceOverwrite)try{let F=y.existsSync(C)&&(y.readdirSync(C).some(T=>T.startsWith("rcode-")&&T.endsWith(".md"))||y.existsSync(p.join(C,"rcode"))),w=y.existsSync(b)&&(y.readdirSync(b).some(T=>T.startsWith("rcode-")&&T.endsWith(".md"))||y.existsSync(p.join(b,"rcode")));if(F&&!w){let T=o.length,B=o.filter(U=>{let Q=U.rel.split(p.sep).join("/");return!Q.startsWith(".claude/commands/")&&!Q.startsWith(".claude/agents/")});B.length<T&&(o.length=0,B.forEach(U=>o.push(U)),console.log(" "+z("Global rcode commands detected in ~/.claude/ \u2014 skipping project-level agent/command install to avoid duplicates.")),console.log(" "+z("Use --force-overwrite to install locally anyway.")))}else if(F&&w){try{let B=y.readdirSync(b).filter(pe=>pe.startsWith("rcode-")&&pe.endsWith(".md"));for(let pe of B)y.unlinkSync(p.join(b,pe));let U=p.join(b,"rcode");y.existsSync(U)&&Nu(U,t.target);let Q=p.join(t.target,".claude","agents");if(y.existsSync(Q)){let pe=y.readdirSync(Q).filter(De=>De.startsWith("rcode-")&&De.endsWith(".md"));for(let De of pe)y.unlinkSync(p.join(Q,De))}console.log(" "+z("Removed duplicate project-level rcode commands (global ones in ~/.claude/ take precedence)."))}catch{}let T=o.filter(B=>{let U=B.rel.split(p.sep).join("/");return!U.startsWith(".claude/commands/")&&!U.startsWith(".claude/agents/")});o.length=0,T.forEach(B=>o.push(B))}}catch{}let R=p.join(t.target,".rcode","_config");br(R),br(p.join(t.target,".planning")),y.writeFileSync(p.join(R,"manifest.yaml"),zm(t)),y.writeFileSync(p.join(R,"agent-manifest.csv"),t1(o,t.target));let q=p.join(t.target,".rcode","config.yaml"),j=p.join(t.target,".rcode","state.json"),P=!1;if(t.reset&&t.force?(y.existsSync(q)&&y.unlinkSync(q),y.existsSync(j)&&y.unlinkSync(j)):t.force&&(y.existsSync(q)||y.existsSync(j))&&(P=!0),!y.existsSync(q))$t(q,o1(t));else try{let F=y.readFileSync(q,"utf8"),w=t.commitPlanning!==!1,T=/^commit_planning:\s*(true|false)\s*$/m,B=F.match(T),U=B?B[1]==="true":null;if(B&&U!==w){let Q=F.replace(T,`commit_planning: ${w}`);$t(q,Q),console.log(" "+z(`Updated commit_planning in config.yaml (${U} \u2192 ${w}) \u2014 closes #685.`))}else if(!B){let Q=F.replace(/\n*$/,"")+`
236
+ `),t.ides=t.ides.filter(k=>k!=="gemini"),t.ides.length===0))return 1;if(t.ides.includes("antigravity")&&(console.log(" "+Zt("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."))),t.modules.length>0){let k=og(),w=t.modules.filter(T=>!k.includes(T));if(w.length>0)return console.error(`\u2716 Unknown module(s): ${w.join(", ")}`),console.error(` Available modules: ${k.join(", ")}`),1}if(Array.isArray(t.ides)&&t.ides.includes("vscode")||t.ide==="vscode"){let k=sg(t.target);k.moved>0&&console.log(` \u21BB Migrated ${k.moved} legacy vscode-layout command(s) to .claude/commands/rcode-{name}.md`)}let i=Wu(t.ides,t.target),o=hA(i,t.modules);if(o.length===0)return 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 k of o)console.log(" + "+k.rel);return 0}if(t.forceOverwrite&&!t.noBackup){let k=sA(t.target,o);if(k.ok)console.log(" "+Ao(`${G.dim("--force-overwrite")} backup: ${G.cyan(k.path)} ${G.dim("("+k.fileCount+" files \u2014 restore with: tar -xzf "+k.path+")")}`));else if(k.fileCount>0)return console.error(""),console.error(`\u2716 Could not create backup: ${k.warning}`),console.error(" Refusing to --force-overwrite without a backup. Pass --no-backup to override."),console.error(""),1}let a=0;t.force&&(a=gA(t.target,o));let u=new Map;if(t.nonDestructive){let k=h.join(t.target,".rcode","_config","files-manifest.csv");if(D.existsSync(k))try{let w=D.readFileSync(k,"utf8").split(`
237
+ `).slice(1).filter(Boolean);for(let T of w){let[L,U]=T.split(",");L&&U&&u.set(L,U)}}catch{}}let c=0,l=0,d=0,f=0,g=[],m=[],y=[],p=Q$(Y(`Installing ${o.length} files\u2026`),{color:"cyan"}).start();for(let k of o){let w=h.join(t.target,k.rel),T=k.rel.split(h.sep).join("/");At(h.dirname(w));let L=null,U=null,Q=()=>(L||(L=D.readFileSync(w)),L),pe=()=>(U||(U=D.readFileSync(k.src)),U);if(t.nonDestructive&&!t.forceOverwrite&&!t.acceptAll&&D.existsSync(w)){let It=u.get(T);if(It){let or=Q().toString("utf8");if(Cn(Q())!==It){let Gt=pe().toString("utf8"),Dc=Xm(T,T,or,Gt,"installed","source"),yc=0,vc=0;for(let ms of Dc.split(`
238
+ `))ms.startsWith("+")&&!ms.startsWith("+++")&&yc++,ms.startsWith("-")&&!ms.startsWith("---")&&vc++;d+=1,g.push(T),m.push({rel:T,insertions:yc,deletions:vc,patch:Dc}),l+=1;continue}}}if(D.existsSync(w)&&!t.force&&!t.forceOverwrite){let It=Cn(Q()),or=Cn(pe());if(It===or){l++;continue}if(!t.yes&&!t.nonDestructive){y.push({rel:T,src:k.src,destPath:w,existingContent:Q().toString("utf8"),sourceContent:pe().toString("utf8")}),l++;continue}}if(D.existsSync(w)&&t.forceOverwrite){let It=Q(),or=pe();It.equals(or)||p.update({text:Y(`overwriting ${k.rel}`)})}let De=pe().toString("utf8");k.cursor&&(De=De),D.writeFileSync(w,De,"utf8"),k.executable&&D.chmodSync(w,493),c++}if(p.success({text:Ut(`${c} files installed`)}),y.length>0){let k={workflows:[],agents:[],commands:[],skills:[],references:[],other:[]};for(let w of y)w.rel.includes("/workflows/")?k.workflows.push(w):w.rel.includes("/agents/")?k.agents.push(w):w.rel.includes("/commands/")?k.commands.push(w):w.rel.includes("/skills/")?k.skills.push(w):w.rel.includes("/references/")?k.references.push(w):k.other.push(w);console.log(""),console.log(" "+Zt(`${y.length} file${y.length===1?"":"s"} have local edits AND v${Me()} updates:`));for(let[w,T]of Object.entries(k))T.length!==0&&console.log(" "+Y(`${T.length} ${w}`));if(console.log(""),!t.yes&&process.stdin.isTTY){let w=await tt.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"+Me()+" for all",hint:"lose local edits, get all bug fixes"},{value:"keep",label:"Keep my local edits",hint:"skip v"+Me()+" updates for these files (current behaviour)"}]});if(tt.isCancel(w))tt.note("Skipped \u2014 local edits preserved.");else if(w==="upstream"){let T=0;for(let L of y)D.writeFileSync(L.destPath,L.sourceContent,"utf8"),T++;f+=T,console.log(" "+Ut(`Applied v${Me()} to ${T} file${T===1?"":"s"}.`))}else if(w==="review"){let T=0,L=0;for(let U of y){let Q=Xm(U.rel,U.rel,U.existingContent,U.sourceContent,"local","v"+Me()),pe=0,De=0;for(let ir of Q.split(`
239
+ `))ir.startsWith("+")&&!ir.startsWith("+++")&&pe++,ir.startsWith("-")&&!ir.startsWith("---")&&De++;console.log(""),console.log(" "+G.bold(U.rel)+Y(" ")+G.green(`+${pe}`)+" "+G.red(`-${De}`));let It=await tt.select({message:"Take upstream, keep local, or view diff?",initialValue:"view",options:[{value:"upstream",label:"Take v"+Me()},{value:"keep",label:"Keep local"},{value:"view",label:"View diff first"}]}),or=It;if(tt.isCancel(It)||It==="view"){for(let Gt of Q.split(`
240
+ `).slice(4))Gt.startsWith("+")?process.stdout.write(G.green(Gt)+`
241
+ `):Gt.startsWith("-")?process.stdout.write(G.red(Gt)+`
242
+ `):Gt.startsWith("@")?process.stdout.write(G.cyan(Gt)+`
243
+ `):process.stdout.write(Y(Gt)+`
244
+ `);let ir=await tt.select({message:"Now: take upstream or keep local?",initialValue:"keep",options:[{value:"upstream",label:"Take v"+Me()},{value:"keep",label:"Keep local"}]});or=tt.isCancel(ir)?"keep":ir}or==="upstream"?(D.writeFileSync(U.destPath,U.sourceContent,"utf8"),T++):L++}f+=T,console.log(" "+Ut(`Review complete: ${T} applied, ${L} kept local.`))}else console.log(" "+Y(`${y.length} file${y.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${Me()} updates, or pipe through an interactive shell to resolve per-file.`));console.log("")}if(f>0&&(console.log(" "+Ut(`Total this run: ${c} installed \xB7 ${f} updated \xB7 ${d+l} unchanged.`)),console.log("")),t.global){let k=h.join(t.target,".rcode","_config");At(k),D.writeFileSync(h.join(k,"manifest.yaml"),tg(t));let T=eg(yt,t.target).count;try{let{main:L}=require(h.join(yt,"cli","generate-command-skills.cjs")),U=h.join(t.target,".claude","skills"),Q=L(yt,U,Me(),{skipGlobalDuplicates:!0});T+=Q.generated}catch{}console.log(""),console.log(` ${Y(`${T} skills installed globally`)}`);try{Lu(t)}catch(L){process.stderr.write(G.yellow(`WARNING: native slash-command install skipped: ${L?.message||L}`)+`
245
+ `)}return 0}let C=h.join(Ge(),".claude","commands"),S=h.join(t.target,".claude","commands"),I=t.target!==Ge();if(I&&!t.forceOverwrite)try{let k=D.existsSync(C)&&(D.readdirSync(C).some(T=>T.startsWith("rcode-")&&T.endsWith(".md"))||D.existsSync(h.join(C,"rcode"))),w=D.existsSync(S)&&(D.readdirSync(S).some(T=>T.startsWith("rcode-")&&T.endsWith(".md"))||D.existsSync(h.join(S,"rcode")));if(k&&!w){let T=o.length,L=o.filter(U=>{let Q=U.rel.split(h.sep).join("/");return!Q.startsWith(".claude/commands/")&&!Q.startsWith(".claude/agents/")});L.length<T&&(o.length=0,L.forEach(U=>o.push(U)),console.log(" "+Y("Global rcode commands detected in ~/.claude/ \u2014 skipping project-level agent/command install to avoid duplicates.")),console.log(" "+Y("Use --force-overwrite to install locally anyway.")))}else if(k&&w){try{let L=D.readdirSync(S).filter(pe=>pe.startsWith("rcode-")&&pe.endsWith(".md"));for(let pe of L)D.unlinkSync(h.join(S,pe));let U=h.join(S,"rcode");D.existsSync(U)&&Bu(U,t.target);let Q=h.join(t.target,".claude","agents");if(D.existsSync(Q)){let pe=D.readdirSync(Q).filter(De=>De.startsWith("rcode-")&&De.endsWith(".md"));for(let De of pe)D.unlinkSync(h.join(Q,De))}console.log(" "+Y("Removed duplicate project-level rcode commands (global ones in ~/.claude/ take precedence)."))}catch{}let T=o.filter(L=>{let U=L.rel.split(h.sep).join("/");return!U.startsWith(".claude/commands/")&&!U.startsWith(".claude/agents/")});o.length=0,T.forEach(L=>o.push(L))}}catch{}let P=h.join(t.target,".rcode","_config");At(P),At(h.join(t.target,".planning")),D.writeFileSync(h.join(P,"manifest.yaml"),tg(t)),D.writeFileSync(h.join(P,"agent-manifest.csv"),pA(o,t.target));let W=h.join(t.target,".rcode","config.yaml"),F=h.join(t.target,".rcode","state.json"),R=!1;if(t.reset&&t.force?(D.existsSync(W)&&D.unlinkSync(W),D.existsSync(F)&&D.unlinkSync(F)):t.force&&(D.existsSync(W)||D.existsSync(F))&&(R=!0),!D.existsSync(W))kt(W,yA(t));else try{let k=D.readFileSync(W,"utf8"),w=t.commitPlanning!==!1,T=/^commit_planning:\s*(true|false)\s*$/m,L=k.match(T),U=L?L[1]==="true":null;if(L&&U!==w){let Q=k.replace(T,`commit_planning: ${w}`);kt(W,Q),console.log(" "+Y(`Updated commit_planning in config.yaml (${U} \u2192 ${w}) \u2014 closes #685.`))}else if(!L){let Q=k.replace(/\n*$/,"")+`
244
246
  commit_planning: ${w}
245
- `;$t(q,Q)}}catch{}try{let F=y.readFileSync(q,"utf8"),w=a1(F),T=i1(w);if(!T.valid){console.log(""),console.log(" "+Jt("config.yaml has validation errors:"));for(let B of T.errors)console.log(G.yellow(B));console.log(z(" \u2192 Edit .rcode/config.yaml to fix, then run /rcode-status"))}}catch{}if(!y.existsSync(j)){let F=p.join(Fe,"state.json");if(y.existsSync(F)){let w=new Date().toISOString(),T=JSON.stringify(String(t.projectName||p.basename(t.target))).slice(1,-1),B=y.readFileSync(F,"utf8").replace(/__PROJECT_NAME__/g,T).replace(/__INSTALL_DATE__/g,w),U=p.join(t.target,".planning","ROADMAP.md");if(y.existsSync(U))try{y.readFileSync(U,"utf8").includes("<!-- INSTALL STUB")||(B=B.replace(/^\s*"_seeded_stub":\s*true,?\s*\n/m,""))}catch{}br(p.dirname(j)),$t(j,B)}}br(p.join(t.target,".planning","council-sessions"));let k=p.join(t.target,".rcode","context");br(k);let M=p.join(k,"active.md"),re=p.join(k,"project-brief.md");y.existsSync(M)||y.writeFileSync(M,`# Active Context
247
+ `;kt(W,Q)}}catch{}try{let k=D.readFileSync(W,"utf8"),w=_A(k),T=vA(w);if(!T.valid){console.log(""),console.log(" "+Zt("config.yaml has validation errors:"));for(let L of T.errors)console.log(G.yellow(L));console.log(Y(" \u2192 Edit .rcode/config.yaml to fix, then run /rcode-status"))}}catch{}if(!D.existsSync(F)){let k=h.join(ke,"state.json");if(D.existsSync(k)){let w=new Date().toISOString(),T=JSON.stringify(String(t.projectName||h.basename(t.target))).slice(1,-1),L=D.readFileSync(k,"utf8").replace(/__PROJECT_NAME__/g,T).replace(/__INSTALL_DATE__/g,w),U=h.join(t.target,".planning","ROADMAP.md");if(D.existsSync(U))try{D.readFileSync(U,"utf8").includes("<!-- INSTALL STUB")||(L=L.replace(/^\s*"_seeded_stub":\s*true,?\s*\n/m,""))}catch{}At(h.dirname(F)),kt(F,L)}}At(h.join(t.target,".planning","council-sessions"));let j=h.join(t.target,".rcode","context");At(j);let M=h.join(j,"active.md"),re=h.join(j,"project-brief.md");D.existsSync(M)||D.writeFileSync(M,`# Active Context
246
248
 
247
249
  _Run \`/rcode-init\` inside your AI editor to populate this file._
248
- `),y.existsSync(re)||y.writeFileSync(re,`# Project Brief
250
+ `),D.existsSync(re)||D.writeFileSync(re,`# Project Brief
249
251
 
250
252
  _Run \`/rcode-init\` inside your AI editor to populate this file._
251
- `);let $=p.join(gt.homedir(),".rcode","agents");br($);let ae=Gm(xt,t.target,{skipGlobalDuplicates:I}),X=ae.count;ae.skippedGlobal>0&&console.log(" "+z(`Skipped ${ae.skippedGlobal} project-level rcode skills (global ones in ~/.claude/skills/ take precedence) \u2014 closes #679.`));try{let{main:F}=require(p.join(xt,"cli","generate-command-skills.cjs")),w=p.join(t.target,".claude","skills"),T=F(xt,w,Me(),{skipGlobalDuplicates:I});T.generated>0&&(console.log(" "+z(`${T.generated} sidebar skill stub${T.generated===1?"":"s"} generated for command discoverability`)),X+=T.generated),T.skippedGlobal>0&&console.log(" "+z(`Skipped ${T.skippedGlobal} sidebar stub${T.skippedGlobal===1?"":"s"} that duplicate global ~/.claude/skills/ \u2014 closes #679.`))}catch(F){console.log(" "+z(`(sidebar stub generation skipped: ${F.message})`))}y.writeFileSync(p.join(R,"files-manifest.csv"),r1(o,t.target,{mergeExistingManifest:!t.force,extraScanDirs:[p.join(t.target,".claude","skills"),p.join(t.target,".rcode","skills")]}));let ne=Y$(t.target,t.projectName);J$(xt,t.target);let x=K$(t.target,{commitPlanning:t.commitPlanning}),A=X$(t.target,{gitHooks:t.gitHooks}),fe=null;try{let{execFileSync:F}=require("child_process"),w=p.join(t.target,".rcode","bin","rcode-tools.cjs");if(y.existsSync(w)){let T=F("node",[w,"brain","pull"],{cwd:t.target,encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:6e4});try{fe=JSON.parse(T)}catch{}}}catch(F){fe={ok:!1,error:String(F.message||F).slice(0,200)}}if(console.log(""),t.force&&a>0&&console.log(" "+$o(`${a} stale files swept`)),t.force&&P&&console.log(" "+Jt("config.yaml and state.json preserved (pass --reset to wipe)")),fe&&fe.ok){let F=(fe.pulled||[]).length,w=(fe.skipped||[]).length;console.log(" "+Kr(`Brain: ${F} source${F===1?"":"s"} pulled`+(w?`, ${w} skipped (placeholder URLs)`:"")))}else fe&&fe.error&&console.log(" "+z(`Brain: skipped (${fe.error})`));if(x){let F={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 (${x.error})`}[x.action]||".gitignore unchanged";console.log(" "+z(F))}if(A){let F={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 (${A.error})`}[A.action]||"pre-commit hook unchanged";console.log(" "+z(F))}if(l>0&&console.log(" "+z(`${l} files skipped (unchanged)`)),d>0&&t.nonDestructive){console.log(""),console.log(" "+Jt(`${d} file${d===1?"":"s"} preserved (modified since install):`));for(let F of m.slice(0,10)){let w=G.green(`+${F.insertions}`)+" "+G.red(`-${F.deletions}`);if(console.log(` ${z(F.rel)} ${w}`),t.showDiff&&F.patch)for(let T of F.patch.split(`
253
+ `);let $=h.join(Ge(),".rcode","agents");At($);let ae=eg(yt,t.target,{skipGlobalDuplicates:I}),X=ae.count;ae.skippedGlobal>0&&console.log(" "+Y(`Skipped ${ae.skippedGlobal} project-level rcode skills (global ones in ~/.claude/skills/ take precedence) \u2014 closes #679.`));try{let{main:k}=require(h.join(yt,"cli","generate-command-skills.cjs")),w=h.join(t.target,".claude","skills"),T=k(yt,w,Me(),{skipGlobalDuplicates:I});T.generated>0&&(console.log(" "+Y(`${T.generated} sidebar skill stub${T.generated===1?"":"s"} generated for command discoverability`)),X+=T.generated),T.skippedGlobal>0&&console.log(" "+Y(`Skipped ${T.skippedGlobal} sidebar stub${T.skippedGlobal===1?"":"s"} that duplicate global ~/.claude/skills/ \u2014 closes #679.`))}catch(k){console.log(" "+Y(`(sidebar stub generation skipped: ${k.message})`))}D.writeFileSync(h.join(P,"files-manifest.csv"),mA(o,t.target,{mergeExistingManifest:!t.force,extraScanDirs:[h.join(t.target,".claude","skills"),h.join(t.target,".rcode","skills")]}));let ne=uA(t.target,t.projectName);dA(yt,t.target);let x=cA(t.target,{commitPlanning:t.commitPlanning}),A=lA(t.target,{gitHooks:t.gitHooks}),fe=null;try{let{execFileSync:k}=require("child_process"),w=h.join(t.target,".rcode","bin","rcode-tools.cjs");if(D.existsSync(w)){let T=k("node",[w,"brain","pull"],{cwd:t.target,encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:6e4});try{fe=JSON.parse(T)}catch{}}}catch(k){fe={ok:!1,error:String(k.message||k).slice(0,200)}}if(console.log(""),t.force&&a>0&&console.log(" "+Ao(`${a} stale files swept`)),t.force&&R&&console.log(" "+Zt("config.yaml and state.json preserved (pass --reset to wipe)")),fe&&fe.ok){let k=(fe.pulled||[]).length,w=(fe.skipped||[]).length;console.log(" "+Ut(`Brain: ${k} source${k===1?"":"s"} pulled`+(w?`, ${w} skipped (placeholder URLs)`:"")))}else fe&&fe.error&&console.log(" "+Y(`Brain: skipped (${fe.error})`));if(x){let k={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 (${x.error})`}[x.action]||".gitignore unchanged";console.log(" "+Y(k))}if(A){let k={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 (${A.error})`}[A.action]||"pre-commit hook unchanged";console.log(" "+Y(k))}if(l>0&&console.log(" "+Y(`${l} files skipped (unchanged)`)),d>0&&t.nonDestructive){console.log(""),console.log(" "+Zt(`${d} file${d===1?"":"s"} preserved (modified since install):`));for(let k of m.slice(0,10)){let w=G.green(`+${k.insertions}`)+" "+G.red(`-${k.deletions}`);if(console.log(` ${Y(k.rel)} ${w}`),t.showDiff&&k.patch)for(let T of k.patch.split(`
252
254
  `).slice(4))T.startsWith("+")?process.stdout.write(G.green(T)+`
253
255
  `):T.startsWith("-")?process.stdout.write(G.red(T)+`
254
256
  `):T.startsWith("@")?process.stdout.write(G.cyan(T)+`
255
- `):process.stdout.write(z(T)+`
256
- `)}m.length>10&&console.log(z(` \u2026 and ${m.length-10} more`)),console.log(z(" To overwrite: re-run with --force-overwrite | To see full diffs: --show-diff")),console.log("")}let se=t.ides.includes("claude")?"claude":t.ides[0],Se=Bu(se,t.target),tt=Se.agentsDir,Ie=Se.commandsDir,Dt=0,tr=0,wr=!1,yt=!1;try{if(y.existsSync(tt)&&(Dt=y.readdirSync(tt).filter(F=>(F.startsWith("rcode-")||F.startsWith("rcode-"))&&(F.endsWith(".md")||F.endsWith(".mdc"))).length),y.existsSync(Ie)){let F=se==="claude"?w=>w.startsWith("rcode-")&&(w.endsWith(".md")||w.endsWith(".mdc")):w=>w.endsWith(".md")||w.endsWith(".mdc");tr=y.readdirSync(Ie).filter(F).length}if(Dt===0||tr===0||X<20){let F=p.join(gt.homedir(),".claude/agents"),w=p.join(gt.homedir(),".claude/commands"),T=p.join(gt.homedir(),".claude/skills");if(Dt===0&&y.existsSync(F)){let B=y.readdirSync(F).filter(U=>(U.startsWith("rcode-")||U.startsWith("rcode-"))&&U.endsWith(".md")).length;B>0&&(Dt=B,wr=!0)}if(tr===0&&y.existsSync(w)){let B=y.readdirSync(w).filter(U=>(U.startsWith("rcode-")||U.startsWith("rcode-"))&&U.endsWith(".md")).length;B>0&&(tr=B,yt=!0)}if(X<20&&y.existsSync(T))try{let B=y.readdirSync(T,{withFileTypes:!0}).filter(U=>U.isDirectory()&&U.name.startsWith("rcode-")).length;B>X&&(X=B)}catch{}}}catch(F){console.error("[install] installInner: failed to count installed agents/commands:",F?.message||F)}try{let F=p.join(t.target,".rcode","skills"),w=p.join(t.target,".claude","commands"),T=[F,w],B=!1,U=!1;for(let Q of T){if(!y.existsSync(Q))continue;let pe=y.readdirSync(Q);pe.some(De=>De.startsWith("rcode-"))&&(B=!0),pe.some(De=>De.startsWith("rihal-"))&&(U=!0)}B&&U&&process.stderr.write(G.yellow("WARNING: rcode-* and rihal-* namespaces both detected \u2014 consider removing one to reduce roster size.")+`
257
- `)}catch{}let oe=Me();console.log(""),console.log(` ${wt("Version:")} ${G.cyan("@hanzlaa/rcode@"+oe)}`),console.log(` ${wt("IDE:")} ${t.ides.join(", ")}`),console.log(` ${wt("Language:")} ${t.language} ${z("(change in .rcode/config.yaml)")}`),console.log(` ${wt("Mode:")} ${t.mode} ${z("(guided=confirm at gates, yolo=autonomous)")}`),console.log(` ${wt("Planning:")} ${t.commitPlanning!==!1?"committed":"gitignored"} ${z("(flip: rcode-tools gitignore refresh)")}`),console.log("");let nn=p.relative(t.target,Se.agentsDir)||Se.agentsDir,Ho=p.relative(t.target,Se.commandsDir)||Se.commandsDir;if(console.log(` ${wt("Agents:")} ${G.green(String(Dt))} in ${wr?"~/.claude/agents/ (global)":nn+"/"}`),console.log(` ${wt("Commands:")} ${G.green(String(tr))} slash commands in ${yt?"~/.claude/commands/ (global)":Ho+"/"}`),X>0&&console.log(` ${wt("Skills:")} ${G.green(String(X))} phrase-activated`),console.log(""),ne&&(console.log(" "+Kr("Starter planning scaffolded in .planning/ (ROADMAP, STATE, PROJECT)")),console.log("")),console.log(` ${wt("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(` ${z("Configure interactively (one-time, per project):")}`),console.log(` ${z("rcode install # pick IDE + planning policy for THIS project")}`),console.log(` ${z("rcode config # adjust defaults later")}`),console.log("")),console.log(z(" Refresh anytime:")),console.log(z(" pnpm dlx @hanzlaa/rcode@latest install # recommended (avoids npm 11.x npx issues)")),console.log(z(" npx @hanzlaa/rcode@latest install # npm / yarn")),console.log(z(` /rcode-update v${oe} # pin rcode to a specific version`)),console.log(""),console.log(z(" Want the rcode CLI on your PATH? (optional \u2014 needed for rcode version / rcode update):")),console.log(z(" npm install -g @hanzlaa/rcode # installs rcode, rcode, rcode commands")),console.log(z(" rcode version # verify")),console.log(""),console.log(z(" Customize without losing changes on update:")),console.log(z(" Create <name>.local.md siblings (e.g. .claude/agents/rcode-waleed.local.md)")),console.log(z(" *.local.md files are NEVER touched by install / --force-overwrite / uninstall.")),console.log(""),console.log(" "+Jt("If your IDE is already open, reload the window to refresh skills/commands.")),console.log(z(" 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:F}=require("child_process");F("npm",["view","@hanzlaa/rcode","version","--json"],{timeout:4e3},(w,T)=>{if(!w)try{let B=JSON.parse(T.trim());Sn.valid(B)&&Sn.gt(B,oe)&&(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 ${G.yellow("Update available:")} ${G.dim(oe)} \u2192 ${G.green(B)}${" ".repeat(Math.max(0,20-oe.length-B.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 F=s1(t.target);F.ok||(console.log(" "+Jt(F.message)),console.log(""))}return l1(t.target,{agentCount:Dt,commandCount:tr,skillsInstalled:X})?0:1}function l1(t,e){console.log(` ${wt("Health check:")}`);let{execFileSync:r}=require("child_process"),n=0,s={agents:20,skills:20,commands:20};try{let{readPackageManifest:o}=Xn(),a=o(xt);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(xt,"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(` ${Kr(o)}${u?z(" \u2014 "+u):""}`)}catch(u){n+=1,console.log(` ${Um(o)} ${G.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(" "+Um(`${n} health check${n===1?"":"s"} failed \u2014 install may be broken.`)),console.log(z(" Debug: node .rcode/bin/rcode-tools.cjs state read && ls -la .rcode/")),console.log(z(" Reinstall: rcode install . --force")),console.log(""),!1):(console.log(""),!0)}async function d1(){let t=process.argv.slice(2),e=Lu(t);if(e.help){Ym();return}!e.yes&&process.stdin.isTTY&&!process.env.CI&&await f1(e);try{let n=await qu(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 f1(t){let{intro:e,outro:r,text:n,select:s,multiselect:i,confirm:o,isCancel:a,cancel:u,note:c}=et,l=Me();if(console.log(""),e(G.bold("\u{1F54C} rcode")+G.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 C=p.resolve((h||t.target).trim());t.target=C,t.projectName=p.basename(C)}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([`${G.dim("Directory:")} ${t.target}`,`${G.dim("Editor:")} ${t.ides.join(", ")}`,`${G.dim("Language:")} ${t.language}`,`${G.dim("Mode:")} ${t.mode}`,`${G.dim("Planning:")} ${t.commitPlanning?"committed to git":"kept local (gitignored)"}`,`${G.dim("User:")} ${t.userName}`].join(`
258
- `),"Installing with these settings"),console.log("")}require.main===Qt&&d1();async function h1(t){let e=Array.isArray(t)?t:[],r=Lu(e),n=await qu(r);n!==0&&process.exit(n)}Qt.exports=h1;Qt.exports.parseArgs=Lu;Qt.exports.buildInstallPlan=Mu;Qt.exports.install=qu;Qt.exports.SUPPORTED_IDES=Qn;Qt.exports.migrateVscodeCommandsLayout=Xm;Qt.exports.getPathsForIde=Bu});var ts=_((Z2,eg)=>{var p1=require("readline"),Wt=class extends Error{constructor(e="Prompt aborted"){super(e),this.name="PromptAbortError"}},Qm=!1;function m1(){Qm||(Qm=!0,process.on("SIGINT",()=>{process.stdout.write(`
257
+ `):process.stdout.write(Y(T)+`
258
+ `)}m.length>10&&console.log(Y(` \u2026 and ${m.length-10} more`)),console.log(Y(" To overwrite: re-run with --force-overwrite | To see full diffs: --show-diff")),console.log("")}let se=t.ides.includes("claude")?"claude":t.ides[0],be=qu(se,t.target),rt=be.agentsDir,Ie=be.commandsDir,vt=0,sr=0,$r=!1,_t=!1;try{if(D.existsSync(rt)&&(vt=D.readdirSync(rt).filter(k=>(k.startsWith("rcode-")||k.startsWith("rcode-"))&&(k.endsWith(".md")||k.endsWith(".mdc"))).length),D.existsSync(Ie)){let k=se==="claude"?w=>w.startsWith("rcode-")&&(w.endsWith(".md")||w.endsWith(".mdc")):w=>w.endsWith(".md")||w.endsWith(".mdc");sr=D.readdirSync(Ie).filter(k).length}if(vt===0||sr===0||X<20){let k=h.join(Ge(),".claude/agents"),w=h.join(Ge(),".claude/commands"),T=h.join(Ge(),".claude/skills");if(vt===0&&D.existsSync(k)){let L=D.readdirSync(k).filter(U=>(U.startsWith("rcode-")||U.startsWith("rcode-"))&&U.endsWith(".md")).length;L>0&&(vt=L,$r=!0)}if(sr===0&&D.existsSync(w)){let L=D.readdirSync(w).filter(U=>(U.startsWith("rcode-")||U.startsWith("rcode-"))&&U.endsWith(".md")).length;L>0&&(sr=L,_t=!0)}if(X<20&&D.existsSync(T))try{let L=D.readdirSync(T,{withFileTypes:!0}).filter(U=>U.isDirectory()&&U.name.startsWith("rcode-")).length;L>X&&(X=L)}catch{}}}catch(k){console.error("[install] installInner: failed to count installed agents/commands:",k?.message||k)}try{let k=h.join(t.target,".rcode","skills"),w=h.join(t.target,".claude","commands"),T=[k,w],L=!1,U=!1;for(let Q of T){if(!D.existsSync(Q))continue;let pe=D.readdirSync(Q);pe.some(De=>De.startsWith("rcode-"))&&(L=!0),pe.some(De=>De.startsWith("rihal-"))&&(U=!0)}L&&U&&process.stderr.write(G.yellow("WARNING: rcode-* and rihal-* namespaces both detected \u2014 consider removing one to reduce roster size.")+`
259
+ `)}catch{}try{Lu(t)}catch(k){process.stderr.write(G.yellow(`WARNING: native slash-command install skipped: ${k?.message||k}`)+`
260
+ `)}let oe=Me();console.log(""),console.log(` ${$t("Version:")} ${G.cyan("@hanzlaa/rcode@"+oe)}`),console.log(` ${$t("IDE:")} ${t.ides.join(", ")}`),console.log(` ${$t("Language:")} ${t.language} ${Y("(change in .rcode/config.yaml)")}`),console.log(` ${$t("Mode:")} ${t.mode} ${Y("(guided=confirm at gates, yolo=autonomous)")}`),console.log(` ${$t("Planning:")} ${t.commitPlanning!==!1?"committed":"gitignored"} ${Y("(flip: rcode-tools gitignore refresh)")}`),console.log("");let nn=h.relative(t.target,be.agentsDir)||be.agentsDir,Zo=h.relative(t.target,be.commandsDir)||be.commandsDir;if(console.log(` ${$t("Agents:")} ${G.green(String(vt))} in ${$r?"~/.claude/agents/ (global)":nn+"/"}`),console.log(` ${$t("Commands:")} ${G.green(String(sr))} slash commands in ${_t?"~/.claude/commands/ (global)":Zo+"/"}`),X>0&&console.log(` ${$t("Skills:")} ${G.green(String(X))} phrase-activated`),console.log(""),ne&&(console.log(" "+Ut("Starter planning scaffolded in .planning/ (ROADMAP, STATE, PROJECT)")),console.log("")),console.log(` ${$t("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${oe} # 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(" "+Zt("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:k}=require("child_process");k("npm",["view","@hanzlaa/rcode","version","--json"],{timeout:4e3},(w,T)=>{if(!w)try{let L=JSON.parse(T.trim());bn.valid(L)&&bn.gt(L,oe)&&(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 ${G.yellow("Update available:")} ${G.dim(oe)} \u2192 ${G.green(L)}${" ".repeat(Math.max(0,20-oe.length-L.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 k=DA(t.target);k.ok||(console.log(" "+Zt(k.message)),console.log(""))}return bA(t.target,{agentCount:vt,commandCount:sr,skillsInstalled:X})?0:1}function bA(t,e){console.log(` ${$t("Health check:")}`);let{execFileSync:r}=require("child_process"),n=0,s={agents:20,skills:20,commands:20};try{let{readPackageManifest:o}=Kn(),a=o(yt);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=h.join(yt,"rcode","commands");if(D.existsSync(c)){let l=D.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(` ${Ut(o)}${u?Y(" \u2014 "+u):""}`)}catch(u){n+=1,console.log(` ${Km(o)} ${G.red("\u2014")} ${String(u.message||u).slice(0,120)}`)}}return i("rcode-tools.cjs runs",()=>{let o=h.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=h.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=h.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(" "+Km(`${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 CA(){let t=process.argv.slice(2),e=Mu(t);if(e.help){rg();return}!e.yes&&process.stdin.isTTY&&!process.env.CI&&await wA(e);try{let n=await Hu(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 wA(t){let{intro:e,outro:r,text:n,select:s,multiselect:i,confirm:o,isCancel:a,cancel:u,note:c}=tt,l=Me();if(console.log(""),e(G.bold("\u{1F54C} rcode")+G.dim(` v${l}`)),!t.targetProvided){let p=await n({message:"Install directory?",placeholder:t.target,defaultValue:t.target,initialValue:t.target});a(p)&&(u("Installation cancelled."),process.exit(0));let C=h.resolve((p||t.target).trim());t.target=C,t.projectName=h.basename(C)}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 y=await n({message:"Your name? (used in agent responses)",placeholder:t.userName,defaultValue:t.userName,initialValue:t.userName});a(y)&&(u("Installation cancelled."),process.exit(0)),t.userName=(y||t.userName).trim(),c([`${G.dim("Directory:")} ${t.target}`,`${G.dim("Editor:")} ${t.ides.join(", ")}`,`${G.dim("Language:")} ${t.language}`,`${G.dim("Mode:")} ${t.mode}`,`${G.dim("Planning:")} ${t.commitPlanning?"committed to git":"kept local (gitignored)"}`,`${G.dim("User:")} ${t.userName}`].join(`
261
+ `),"Installing with these settings"),console.log("")}require.main===at&&CA();async function xA(t){let e=Array.isArray(t)?t:[],r=Mu(e),n=await Hu(r);n!==0&&process.exit(n)}at.exports=xA;at.exports.parseArgs=Mu;at.exports.buildInstallPlan=Wu;at.exports.install=Hu;at.exports.SUPPORTED_IDES=es;at.exports.migrateVscodeCommandsLayout=sg;at.exports.getPathsForIde=qu;at.exports.installSlashRouterCommands=Zu;at.exports.installCodexSlashRouterHook=ug;at.exports.installAntigravitySlashRouterHook=cg;at.exports.installNativeHomeSlashCommands=Lu});var rs=v((oI,dg)=>{var $A=require("readline"),Vt=class extends Error{constructor(e="Prompt aborted"){super(e),this.name="PromptAbortError"}},lg=!1;function AA(){lg||(lg=!0,process.on("SIGINT",()=>{process.stdout.write(`
259
262
 
260
263
  Cancelled.
261
- `),process.exit(0)}))}var Xr=null;function Wu(){return Xr||(Xr=g1(),Xr)}function g1(){m1();let t=!!process.stdin.isTTY,e=p1.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 Wt("Input stream closed"))}}));function o(u){return t?n?Promise.reject(new Wt("Input stream closed")):new Promise((c,l)=>{let d=!1,f=()=>{!d&&!r&&(d=!0,l(new Wt("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 Wt("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 D1(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=Wu();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 C=e.find(b=>b.key===h||b.id===h);if(!C)D.push(h);else if(s)for(let b of s(C.id))m.push(b);else m.push(C.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 Wt(`No valid selection after ${i} attempts`)}async function y1(t,{default:e="n",maxAttempts:r=3}={}){let n=e.toLowerCase()==="y"?"y":"n",s=Wu();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 Wt(`No valid yes/no answer after ${r} attempts`)}async function v1(t,{default:e="",validate:r=null,maxAttempts:n=3}={}){let s=Wu();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 Wt(`No valid text input after ${n} attempts`)}function _1(){Xr&&(Xr.close(),Xr=null)}eg.exports={askChoice:D1,askConfirm:y1,askText:v1,closeSession:_1,PromptAbortError:Wt}});var sg=_((U2,Ao)=>{var le=require("fs"),de=require("path"),{spawnSync:tg}=require("child_process"),rs=Ru(),{PromptAbortError:E1}=ts(),{writeFileAtomic:b1}=Zt(),{verifyInstall:S1,formatReport:C1}=Xn(),w1=es();function x1(t){let e=le.readFileSync(t,"utf8"),r={};for(let n of e.split(`
262
- `)){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 $1(t,e,r){let n=new RegExp(`^${e}:\\s*.*$`,"m"),s=typeof r=="string"?`${e}: "${r.replace(/"/g,'\\"')}"`:`${e}: ${r}`;return n.test(t)?t.replace(n,s):t.replace(/\n*$/,"")+`
264
+ `),process.exit(0)}))}var Kr=null;function Uu(){return Kr||(Kr=kA(),Kr)}function kA(){AA();let t=!!process.stdin.isTTY,e=$A.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 Vt("Input stream closed"))}}));function o(u){return t?n?Promise.reject(new Vt("Input stream closed")):new Promise((c,l)=>{let d=!1,f=()=>{!d&&!r&&(d=!0,l(new Vt("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 Vt("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 FA(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=Uu();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(p=>p.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 p of g){let C=e.find(S=>S.key===p||S.id===p);if(!C)y.push(p);else if(s)for(let S of s(C.id))m.push(S);else m.push(C.id)}if(m.length===0){console.log(` \u26A0 Didn't recognize: ${y.map(p=>`"${p}"`).join(", ")}`),console.log(` ${u}`),console.log();continue}return y.length>0&&console.log(` \u26A0 Skipping unknown: ${y.map(p=>`"${p}"`).join(", ")}`),[...new Set(m)]}throw new Vt(`No valid selection after ${i} attempts`)}async function jA(t,{default:e="n",maxAttempts:r=3}={}){let n=e.toLowerCase()==="y"?"y":"n",s=Uu();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 Vt(`No valid yes/no answer after ${r} attempts`)}async function IA(t,{default:e="",validate:r=null,maxAttempts:n=3}={}){let s=Uu();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 Vt(`No valid text input after ${n} attempts`)}function TA(){Kr&&(Kr.close(),Kr=null)}dg.exports={askChoice:FA,askConfirm:jA,askText:IA,closeSession:TA,PromptAbortError:Vt}});var mg=v((iI,ko)=>{var le=require("fs"),de=require("path"),{spawnSync:fg}=require("child_process"),ns=Pu(),{PromptAbortError:RA}=rs(),{writeFileAtomic:PA}=zt(),{homedir:OA}=An(),{verifyInstall:NA,formatReport:LA}=Kn(),BA=ts();function MA(t){let e=le.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 qA(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)*$/,"")+`
263
265
  ${s}
264
- `}function rg(t){let e={yes:!1};for(let r of t)(r==="--yes"||r==="-y")&&(e.yes=!0);return e}function ng(t){let e=[],r=require("os"),n=de.join(r.homedir(),".claude/skills"),s=le.existsSync(de.join(t,".claude/skills"))&&le.readdirSync(de.join(t,".claude/skills")).some(a=>a.startsWith("rcode-"))||le.existsSync(de.join(t,".claude/agents"))&&le.readdirSync(de.join(t,".claude/agents")).some(a=>a.startsWith("rcode-"))||le.existsSync(de.join(t,".claude/commands"))&&le.readdirSync(de.join(t,".claude/commands")).some(a=>a.startsWith("rcode-")),i=le.existsSync(n)&&le.readdirSync(n).some(a=>a.startsWith("rcode-")),o=le.existsSync(de.join(t,".rcode/config.yaml"));return(s||o&&i)&&e.push("claude"),le.existsSync(de.join(t,".cursor/rules"))&&le.readdirSync(de.join(t,".cursor/rules")).some(u=>u.startsWith("rcode-")&&u.endsWith(".mdc"))&&e.push("cursor"),le.existsSync(de.join(t,".windsurf/rules"))&&le.readdirSync(de.join(t,".windsurf/rules")).some(u=>u.startsWith("rcode-")&&u.endsWith(".mdc"))&&e.push("windsurf"),le.existsSync(de.join(t,".antigravity/agents"))&&le.readdirSync(de.join(t,".antigravity/agents")).some(u=>u.startsWith("rcode-"))&&e.push("antigravity"),e}function A1(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"),le.existsSync(de.join(t,"AGENTS.md"))&&r.push("AGENTS.md");let n=r.filter(l=>le.existsSync(de.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=de.join(t,".rcode/backups");try{le.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=de.join(i,`update-${o}.tgz`),u=de.relative(t,a),c=tg("tar",["-czf",a,"-C",t,"--files-from=-"],{input:n.join(`
266
+ `}function hg(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=de.join(OA(),".claude/skills"),n=le.existsSync(de.join(t,".claude/skills"))&&le.readdirSync(de.join(t,".claude/skills")).some(o=>o.startsWith("rcode-"))||le.existsSync(de.join(t,".claude/agents"))&&le.readdirSync(de.join(t,".claude/agents")).some(o=>o.startsWith("rcode-"))||le.existsSync(de.join(t,".claude/commands"))&&le.readdirSync(de.join(t,".claude/commands")).some(o=>o.startsWith("rcode-")),s=le.existsSync(r)&&le.readdirSync(r).some(o=>o.startsWith("rcode-")),i=le.existsSync(de.join(t,".rcode/config.yaml"));return(n||i&&s)&&e.push("claude"),le.existsSync(de.join(t,".cursor/rules"))&&le.readdirSync(de.join(t,".cursor/rules")).some(a=>a.startsWith("rcode-")&&a.endsWith(".mdc"))&&e.push("cursor"),le.existsSync(de.join(t,".windsurf/rules"))&&le.readdirSync(de.join(t,".windsurf/rules")).some(a=>a.startsWith("rcode-")&&a.endsWith(".mdc"))&&e.push("windsurf"),le.existsSync(de.join(t,".antigravity/agents"))&&le.readdirSync(de.join(t,".antigravity/agents")).some(a=>a.startsWith("rcode-"))&&e.push("antigravity"),e}function WA(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"),le.existsSync(de.join(t,"AGENTS.md"))&&r.push("AGENTS.md");let n=r.filter(l=>le.existsSync(de.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=de.join(t,".rcode/backups");try{le.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=de.join(i,`update-${o}.tgz`),u=de.relative(t,a),c=fg("tar",["-czf",a,"-C",t,"--files-from=-"],{input:n.join(`
265
267
  `)+`
266
- `,encoding:"utf8"});return c.status!==0?{ok:!1,warning:`tar failed: ${(c.stderr||"").trim()}`}:{ok:!0,path:u}}function F1(t,e){let r={claude:0,cursor:0,windsurf:0,antigravity:0};if(e.includes("claude")){let n=de.join(t,".claude/skills");if(le.existsSync(n))for(let o of le.readdirSync(n))o.startsWith("rcode-")&&(le.rmSync(de.join(n,o),{recursive:!0,force:!0}),r.claude++);let s=de.join(t,".claude/commands/rcode");le.existsSync(s)&&le.rmSync(s,{recursive:!0,force:!0});let i=de.join(t,".claude/commands");if(le.existsSync(i))for(let o of le.readdirSync(i))o.startsWith("rcode-")&&(o.endsWith(".md")||o.endsWith(".mdc"))&&le.unlinkSync(de.join(i,o))}if(e.includes("cursor")){let n=de.join(t,".cursor/rules");if(le.existsSync(n))for(let s of le.readdirSync(n))s.startsWith("rcode-")&&s.endsWith(".mdc")&&(le.rmSync(de.join(n,s)),r.cursor++)}if(e.includes("windsurf")){let n=de.join(t,".windsurf/rules");if(le.existsSync(n))for(let s of le.readdirSync(n))s.startsWith("rcode-")&&s.endsWith(".mdc")&&(le.rmSync(de.join(n,s)),r.windsurf++)}if(e.includes("antigravity")){let n=de.join(t,".antigravity/agents");if(le.existsSync(n))for(let s of le.readdirSync(n))s.startsWith("rcode-")&&(le.rmSync(de.join(n,s)),r.antigravity++)}return r}function k1(t){let e=de.join(t,"AGENTS.md");if(!le.existsSync(e))return;let r=le.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+$/,`
267
- `);let{writeFileAtomic:i}=Zt();i(e,r)}}Ao.exports=async function(e,{packageRoot:r,packageJson:n}){try{return await j1(e,{packageRoot:r,packageJson:n})}catch(s){throw s instanceof E1&&(console.log(`
268
- \u274C Update cancelled \u2014 ${s.message}.`),process.exit(0)),s}};async function j1(t,{packageRoot:e,packageJson:r}){let n=process.cwd(),s=rg(t),i=r?.version||"0.0.0",o=de.join(n,".rcode/config.yaml"),a=de.join(n,".rcode/config.json"),u=le.existsSync(o)?o:a;le.existsSync(u)||(console.error(`
268
+ `,encoding:"utf8"});return c.status!==0?{ok:!1,warning:`tar failed: ${(c.stderr||"").trim()}`}:{ok:!0,path:u}}function HA(t,e){let r={claude:0,cursor:0,windsurf:0,antigravity:0};if(e.includes("claude")){let n=de.join(t,".claude/skills");if(le.existsSync(n))for(let o of le.readdirSync(n))o.startsWith("rcode-")&&(le.rmSync(de.join(n,o),{recursive:!0,force:!0}),r.claude++);let s=de.join(t,".claude/commands/rcode");le.existsSync(s)&&le.rmSync(s,{recursive:!0,force:!0});let i=de.join(t,".claude/commands");if(le.existsSync(i))for(let o of le.readdirSync(i))o.startsWith("rcode-")&&(o.endsWith(".md")||o.endsWith(".mdc"))&&le.unlinkSync(de.join(i,o))}if(e.includes("cursor")){let n=de.join(t,".cursor/rules");if(le.existsSync(n))for(let s of le.readdirSync(n))s.startsWith("rcode-")&&s.endsWith(".mdc")&&(le.rmSync(de.join(n,s)),r.cursor++)}if(e.includes("windsurf")){let n=de.join(t,".windsurf/rules");if(le.existsSync(n))for(let s of le.readdirSync(n))s.startsWith("rcode-")&&s.endsWith(".mdc")&&(le.rmSync(de.join(n,s)),r.windsurf++)}if(e.includes("antigravity")){let n=de.join(t,".antigravity/agents");if(le.existsSync(n))for(let s of le.readdirSync(n))s.startsWith("rcode-")&&(le.rmSync(de.join(n,s)),r.antigravity++)}return r}function ZA(t){let e=de.join(t,"AGENTS.md");if(!le.existsSync(e))return;let r=le.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+$/,`
269
+ `);let{writeFileAtomic:i}=zt();i(e,r)}}ko.exports=async function(e,{packageRoot:r,packageJson:n}){try{return await UA(e,{packageRoot:r,packageJson:n})}catch(s){throw s instanceof RA&&(console.log(`
270
+ \u274C Update cancelled \u2014 ${s.message}.`),process.exit(0)),s}};async function UA(t,{packageRoot:e,packageJson:r}){let n=process.cwd(),s=hg(t),i=r?.version||"0.0.0",o=de.join(n,".rcode/config.yaml"),a=de.join(n,".rcode/config.json"),u=le.existsSync(o)?o:a;le.existsSync(u)||(console.error(`
269
271
  \u274C rcode is not installed in this directory.`),console.error(` To install: rcode install
270
- `),process.exit(1));let c,l="",d=u.endsWith(".yaml");try{if(d){let R=x1(u);c=R.obj,l=R.raw}else c=JSON.parse(le.readFileSync(u,"utf8"))}catch(R){console.error(`
271
- \u274C ${de.basename(u)} is not parseable: ${R.message}
272
- `),process.exit(1)}let f=c.installed_version||"(unknown, pre-tracking)",g=ng(n);if(g.length===0&&(console.error(`
272
+ `),process.exit(1));let c,l="",d=u.endsWith(".yaml");try{if(d){let P=MA(u);c=P.obj,l=P.raw}else c=JSON.parse(le.readFileSync(u,"utf8"))}catch(P){console.error(`
273
+ \u274C ${de.basename(u)} is not parseable: ${P.message}
274
+ `),process.exit(1)}let f=c.installed_version||"(unknown, pre-tracking)",g=pg(n);if(g.length===0&&(console.error(`
273
275
  \u274C No editor install detected.`),console.error(` Run 'rcode install' to set up at least one editor first.
274
276
  `),process.exit(1)),console.log(`
275
277
  \u{1F54C} rcode \u2014 Update
276
- `),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 q=["claude","cursor","gemini"].filter(j=>!g.includes(j));if(q.length>0){let j={claude:"Claude Code",cursor:"Cursor",gemini:"Gemini CLI"},P=await rs.multiselect({message:"Add support for additional editors?",options:q.map(k=>({value:k,label:j[k]||k})),required:!1});rs.isCancel(P)&&(rs.cancel("Update cancelled."),process.exit(0));for(let k of P)g.push(k);console.log(` Editors to update: ${g.join(", ")}`),console.log()}}if(!s.yes){let R=await rs.confirm({message:"Proceed with update?",initialValue:!1});if(rs.isCancel(R)||!R){console.log(`
277
- \u274C Update cancelled. Nothing changed.`);return}}console.log();let m=A1(n,g);m.ok?console.log(` \u{1F4BE} backup: ${m.path}`):console.log(` \u26A0 no backup created (${m.warning}) \u2014 continuing anyway`);let D=F1(n,g),h=D.claude+D.cursor+D.windsurf+D.antigravity;console.log(` \u{1F9F9} cleaned ${h} old skill files`),k1(n),console.log();let C=g.filter(R=>["claude","cursor","gemini"].includes(R));if(C.length>0){if(g.some(R=>!["claude","cursor","gemini"].includes(R))){let R=g.filter(q=>!["claude","cursor","gemini"].includes(q));console.log(` \u26A0 ${R.join(", ")} refresh not yet supported by installer \u2014 skipping`)}w1.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:C,modules:[],help:!1}),console.log(` \u2713 [${C.join(", ")}] \u2192 refreshed via install.js`)}if(d){let R=$1(l,"installed_version",i);b1(u,R)}else{c.installed_version=i;let{writeJsonAtomic:R}=Zt();R(u,c)}console.log(` \u2713 ${de.relative(n,u)} \u2192 installed_version: ${i}`),console.log();let{reports:b,hasDrift:I}=S1(n,e,g);I?(console.log("\u26A0 Post-update verification found drift:"),console.log(C1(b)),console.log(`
278
- 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()}Ao.exports.parseArgs=rg;Ao.exports.detectInstalledEditors=ng});var Hu=_((V2,Sr)=>{var Y=require("fs"),Z=require("path"),{spawnSync:og}=require("child_process"),{askConfirm:ig,PromptAbortError:ag}=ts(),{writeFileAtomic:ug,safeRmSync:Jr}=Zt();function I1(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 cg(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,`
278
+ `),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 W=["claude","cursor","gemini"].filter(F=>!g.includes(F));if(W.length>0){let F={claude:"Claude Code",cursor:"Cursor",gemini:"Gemini CLI"},R=await ns.multiselect({message:"Add support for additional editors?",options:W.map(j=>({value:j,label:F[j]||j})),required:!1});ns.isCancel(R)&&(ns.cancel("Update cancelled."),process.exit(0));for(let j of R)g.push(j);console.log(` Editors to update: ${g.join(", ")}`),console.log()}}if(!s.yes){let P=await ns.confirm({message:"Proceed with update?",initialValue:!1});if(ns.isCancel(P)||!P){console.log(`
279
+ \u274C Update cancelled. Nothing changed.`);return}}console.log();let m=WA(n,g);m.ok?console.log(` \u{1F4BE} backup: ${m.path}`):console.log(` \u26A0 no backup created (${m.warning}) \u2014 continuing anyway`);let y=HA(n,g),p=y.claude+y.cursor+y.windsurf+y.antigravity;console.log(` \u{1F9F9} cleaned ${p} old skill files`),ZA(n),console.log();let C=g.filter(P=>["claude","cursor","gemini"].includes(P));if(C.length>0){if(g.some(P=>!["claude","cursor","gemini"].includes(P))){let P=g.filter(W=>!["claude","cursor","gemini"].includes(W));console.log(` \u26A0 ${P.join(", ")} refresh not yet supported by installer \u2014 skipping`)}BA.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:C,modules:[],help:!1}),console.log(` \u2713 [${C.join(", ")}] \u2192 refreshed via install.js`)}if(d){let P=qA(l,"installed_version",i);PA(u,P)}else{c.installed_version=i;let{writeJsonAtomic:P}=zt();P(u,c)}console.log(` \u2713 ${de.relative(n,u)} \u2192 installed_version: ${i}`),console.log();let{reports:S,hasDrift:I}=NA(n,e,g);I?(console.log("\u26A0 Post-update verification found drift:"),console.log(LA(S)),console.log(`
280
+ 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()}ko.exports.parseArgs=hg;ko.exports.detectInstalledEditors=pg});var Yu=v((aI,rr)=>{var z=require("fs"),Vu=require("os"),q=require("path"),{spawnSync:gg}=require("child_process"),{askConfirm:Dg,PromptAbortError:yg}=rs(),{writeFileAtomic:zu,safeRmSync:wr}=zt();function VA(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 vg(t){return/\.local\.(md|mdc|json|yaml|yml|toml|js|ts)$/.test(t)}function _g(t){return t.replace(/\n?# ===== rcode-managed gitignore block[\s\S]*?# ===== end rcode-managed gitignore block =====\n?/g,`
279
281
  `).replace(/\n?# >>> rcode >>>[\s\S]*?# <<< rcode <<<\n?/g,`
280
282
  `).replace(/\n{3,}/g,`
281
283
 
282
- `)}function T1(t){let e=Z.join(t,".git","hooks","pre-commit");if(!Y.existsSync(e))return"skipped";let r="# ===== rcode-managed pre-commit block =====",n="# ===== end rcode pre-commit block =====",s;try{s=Y.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]===`
284
+ `)}function GA(t){let e=q.join(t,".git","hooks","pre-commit");if(!z.existsSync(e))return"skipped";let r="# ===== rcode-managed pre-commit block =====",n="# ===== end rcode pre-commit block =====",s;try{s=z.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]===`
283
285
  `&&a--;let u=o+n.length;u<s.length&&s[u]===`
284
- `&&u++;let c=s.slice(0,a)+s.slice(u),l=c.trim();if(l===""||l==="#!/bin/sh"||l==="#!/bin/bash")try{return Y.unlinkSync(e),"removed"}catch{return"skipped"}try{return ug(e,c,{mode:493}),"stripped"}catch{return"skipped"}}function wn(t,e){if(!Y.existsSync(t))return 0;let r=0,n=Z.resolve(process.cwd());for(let s of Y.readdirSync(t,{withFileTypes:!0})){if(cg(s.name)||!e(s.name))continue;let i=Z.join(t,s.name),o=Jr(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 R1(t){if(!Y.existsSync(t))return!1;try{if(Y.readdirSync(t).length===0)return Y.rmdirSync(t),!0}catch{}return!1}function P1(t,e){for(let r of e)R1(Z.join(t,r))}function O1(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=Z.join(t,".vscode/rcode");Y.existsSync(o)&&r.vscode.push(".vscode/rcode")}if(e.includes("claude")){let o=Z.join(t,".claude/skills");Y.existsSync(o)&&(r.claude.skills=Y.readdirSync(o).filter(l=>l.startsWith("rcode-")||fg(l)));let a=Z.join(t,".claude/commands/rcode");Y.existsSync(a)&&(r.claude.commands=Y.readdirSync(a));let u=Z.join(t,".claude/commands");if(Y.existsSync(u)){let l=Y.readdirSync(u).filter(d=>d.startsWith("rcode-")&&(d.endsWith(".md")||d.endsWith(".mdc")));r.claude.commands=[...r.claude.commands,...l]}let c=Z.join(t,".claude/agents");Y.existsSync(c)&&(r.claude.agents=Y.readdirSync(c).filter(l=>l.startsWith("rcode-")&&l.endsWith(".md"))),Y.existsSync(Z.join(t,".claude/agents/rules"))&&(r.claude.agentsRulesDir=!0)}if(e.includes("cursor")){let o=Z.join(t,".cursor/rules");Y.existsSync(o)&&(r.cursor=Y.readdirSync(o).filter(a=>a.startsWith("rcode-")||a==="rcode.mdc"||a==="rcode-method.mdc"||a==="rcode"))}if(e.includes("windsurf")){let o=Z.join(t,".windsurf/rules");Y.existsSync(o)&&(r.windsurf=Y.readdirSync(o).filter(a=>a.startsWith("rcode-")||a==="rcode.mdc"||a==="rcode-method.mdc"))}if(e.includes("antigravity")){let o=Z.join(t,".antigravity/agents");Y.existsSync(o)&&(r.antigravity=Y.readdirSync(o).filter(a=>a.startsWith("rcode-")))}if(e.includes("gemini"))for(let o of["agents","commands"]){let a=Z.join(t,".gemini","rcode",o);if(Y.existsSync(a))for(let u of Y.readdirSync(a))(u.startsWith("rcode-")||u.endsWith(".md"))&&r.gemini.push(Z.join(".gemini/rcode",o,u))}let n=Z.join(t,"AGENTS.md");if(Y.existsSync(n)){let o=Y.readFileSync(n,"utf8");(o.includes("## rcode Agents (installed)")||o.includes("## rcode Method Agents (installed)"))&&(r.agentsMd="present")}let s=Z.join(t,".rcode");if(Y.existsSync(s)){let a=function(u){for(let c of Y.readdirSync(u,{withFileTypes:!0}))c.isDirectory()?a(Z.join(u,c.name)):o++};var i=a;let o=0;try{a(s)}catch{}r.stateDir={files:o}}return r}function dg(){try{let{readPackageManifest:t}=Xn(),e=Z.resolve(__dirname,".."),r=t(e);if(r&&r.actions instanceof Set&&r.actions.size>0)return Array.from(r.actions)}catch{}return[]}var N1=dg();function fg(t){return N1.includes(t)}function hg(t,e,r={}){let n=[];for(let i of t.claude.skills)n.push(Z.join(".claude/skills",i));for(let i of t.claude.commands)i.startsWith("rcode-")&&i.endsWith(".md")&&n.push(Z.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(Z.join(".claude/agents",i));t.claude.agentsRulesDir&&n.push(".claude/agents/rules");for(let i of t.cursor)n.push(Z.join(".cursor/rules",i));for(let i of t.windsurf)n.push(Z.join(".windsurf/rules",i));for(let i of t.antigravity)n.push(Z.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&&Y.existsSync(Z.join(e,"AGENTS.md"))&&n.push("AGENTS.md"),r.purge){let i=Z.join(e,".rcode");if(Y.existsSync(i))try{for(let o of Y.readdirSync(i))o!=="backups"&&n.push(Z.join(".rcode",o))}catch{}Y.existsSync(Z.join(e,".planning"))&&n.push(".planning")}return n}function L1(t,e,r={}){let n=hg(e,t,{purge:r.purge===!0});if(n.length===0)return{ok:!1,warning:"nothing to back up"};if(og("tar",["--version"],{stdio:"ignore"}).status!==0)return{ok:!1,warning:"tar not available on this system"};let i=r.purge?Z.join(t,".rcode-backups"):Z.join(t,".rcode/backups");try{Y.mkdirSync(i,{recursive:!0})}catch(l){return{ok:!1,warning:`could not create ${Z.relative(t,i)}/: ${l.message}`}}let o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),a=Z.join(i,`uninstall-${o}.tgz`),u=Z.relative(t,a),c=og("tar",["-czf",a,"-C",t,"--files-from=-"],{input:n.join(`
286
+ `&&u++;let c=s.slice(0,a)+s.slice(u),l=c.trim();if(l===""||l==="#!/bin/sh"||l==="#!/bin/bash")try{return z.unlinkSync(e),"removed"}catch{return"skipped"}try{return zu(e,c,{mode:493}),"stripped"}catch{return"skipped"}}function Gu(t,e){if(!z.existsSync(t))return"skipped";let r;try{r=JSON.parse(z.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 zu(t,JSON.stringify(r,null,2)+`
287
+ `),"removed"}catch{return"skipped"}}function wn(t,e){if(!z.existsSync(t))return 0;let r=0,n=q.resolve(process.cwd());for(let s of z.readdirSync(t,{withFileTypes:!0})){if(vg(s.name)||!e(s.name))continue;let i=q.join(t,s.name),o=wr(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 zA(t){if(!z.existsSync(t))return!1;try{if(z.readdirSync(t).length===0)return z.rmdirSync(t),!0}catch{}return!1}function YA(t,e){for(let r of e)zA(q.join(t,r))}function JA(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");z.existsSync(o)&&r.vscode.push(".vscode/rcode")}if(e.includes("claude")){let o=q.join(t,".claude/skills");z.existsSync(o)&&(r.claude.skills=z.readdirSync(o).filter(l=>l.startsWith("rcode-")||Sg(l)));let a=q.join(t,".claude/commands/rcode");z.existsSync(a)&&(r.claude.commands=z.readdirSync(a));let u=q.join(t,".claude/commands");if(z.existsSync(u)){let l=z.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");z.existsSync(c)&&(r.claude.agents=z.readdirSync(c).filter(l=>l.startsWith("rcode-")&&l.endsWith(".md"))),z.existsSync(q.join(t,".claude/agents/rules"))&&(r.claude.agentsRulesDir=!0)}if(e.includes("cursor")){let o=q.join(t,".cursor/rules");z.existsSync(o)&&(r.cursor=z.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");z.existsSync(o)&&(r.windsurf=z.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");z.existsSync(o)&&(r.antigravity=z.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(z.existsSync(a))for(let u of z.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(z.existsSync(n)){let o=z.readFileSync(n,"utf8");(o.includes("## rcode Agents (installed)")||o.includes("## rcode Method Agents (installed)"))&&(r.agentsMd="present")}let s=q.join(t,".rcode");if(z.existsSync(s)){let a=function(u){for(let c of z.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 Eg(){try{let{readPackageManifest:t}=Kn(),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 XA=Eg();function Sg(t){return XA.includes(t)}function bg(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&&z.existsSync(q.join(e,"AGENTS.md"))&&n.push("AGENTS.md"),r.purge){let i=q.join(e,".rcode");if(z.existsSync(i))try{for(let o of z.readdirSync(i))o!=="backups"&&n.push(q.join(".rcode",o))}catch{}z.existsSync(q.join(e,".planning"))&&n.push(".planning")}return n}function KA(t,e,r={}){let n=bg(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(gg("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{z.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=gg("tar",["-czf",a,"-C",t,"--files-from=-"],{input:n.join(`
285
288
  `)+`
286
- `,encoding:"utf8"});return c.status!==0?{ok:!1,warning:`tar exited ${c.status}: ${(c.stderr||"").trim()}`}:{ok:!0,path:u}}function B1(t){if(!Y.existsSync(t))return!1;let e=Y.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+$/,`
287
- `),ug(t,e)),r}Sr.exports=async function(e){try{return await M1(e)}catch(r){throw r instanceof ag&&(console.log(`
288
- \u274C Uninstall cancelled \u2014 ${r.message}.`),process.exit(0)),r}};async function M1(t){let e=I1(t),r=process.cwd(),{SUPPORTED_IDES:n}=es(),s=e.editor?e.editor==="all"?Array.from(n):[e.editor]:Array.from(n);console.log(`
289
+ `,encoding:"utf8"});return c.status!==0?{ok:!1,warning:`tar exited ${c.status}: ${(c.stderr||"").trim()}`}:{ok:!0,path:u}}function QA(t){if(!z.existsSync(t))return!1;let e=z.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+$/,`
290
+ `),zu(t,e)),r}rr.exports=async function(e){try{return await ek(e)}catch(r){throw r instanceof yg&&(console.log(`
291
+ \u274C Uninstall cancelled \u2014 ${r.message}.`),process.exit(0)),r}};async function ek(t){let e=VA(t),r=process.cwd(),{SUPPORTED_IDES:n}=ts(),s=e.editor?e.editor==="all"?Array.from(n):[e.editor]:Array.from(n);console.log(`
289
292
  \u{1F54C} rcode \u2014 Uninstall
290
- `),console.log(` Project: ${r}`),console.log(` Scope: ${s.join(", ")}`),console.log();let i=Y.existsSync(Z.join(r,".rcode/config.yaml"))||Y.existsSync(Z.join(r,".rcode/config.json")),o=Y.existsSync(Z.join(r,".claude/skills"))||Y.existsSync(Z.join(r,".cursor/rules"))||Y.existsSync(Z.join(r,".windsurf/rules"))||Y.existsSync(Z.join(r,".antigravity/agents"));if(!i&&!o){console.log(`
291
- \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=O1(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(`
293
+ `),console.log(` Project: ${r}`),console.log(` Scope: ${s.join(", ")}`),console.log();let i=z.existsSync(q.join(r,".rcode/config.yaml"))||z.existsSync(q.join(r,".rcode/config.json")),o=z.existsSync(q.join(r,".claude/skills"))||z.existsSync(q.join(r,".cursor/rules"))||z.existsSync(q.join(r,".windsurf/rules"))||z.existsSync(q.join(r,".antigravity/agents"));if(!i&&!o){console.log(`
294
+ \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=JA(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(`
292
295
  \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:
293
- `),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 ig(`Proceed with removing ${m} skill/command files${a.agentsMd?" + AGENTS.md section":""}? [y/N] `,{default:"n"})){console.log(`
294
- \u274C Aborted. Nothing was removed.`);return}console.log();let D=L1(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 j=Z.join(r,".claude/skills"),P=wn(j,ne=>ne.startsWith("rcode-")||fg(ne));h+=P,P>0&&console.log(` \u2713 removed ${P} Claude skills`);let k=Z.join(r,".claude/commands/rcode");if(Y.existsSync(k)){let ne=Jr(k,Z.resolve(r));!ne.ok&&ne.reason==="outside-root"&&console.log(` \u26A0 refused to remove ${k} \u2014 symlink resolves outside project root`)}let M=Z.join(r,".claude/commands"),re=0;if(Y.existsSync(M))for(let ne of Y.readdirSync(M))ne.startsWith("rcode-")&&(ne.endsWith(".md")||ne.endsWith(".mdc"))&&(Y.unlinkSync(Z.join(M,ne)),re++);let $=a.claude.commands.length;h+=$,$>0&&console.log(` \u2713 removed ${$} slash commands from .claude/commands/`);let ae=Z.join(r,".claude/agents"),X=wn(ae,ne=>ne.startsWith("rcode-")&&ne.endsWith(".md"));if(h+=X,X>0&&console.log(` \u2713 removed ${X} Claude agents`),a.claude.agentsRulesDir){let ne=Z.join(r,".claude/agents/rules"),x=Jr(ne,Z.resolve(r));x.ok&&x.reason!=="missing"?console.log(" \u2713 removed .claude/agents/rules/ (agent reference rules)"):x.reason==="outside-root"&&console.log(" \u26A0 refused to remove .claude/agents/rules/ \u2014 symlink resolves outside project root")}try{Y.existsSync(Z.join(r,".claude/commands"))&&Y.readdirSync(Z.join(r,".claude/commands")).length===0&&Y.rmdirSync(Z.join(r,".claude/commands")),Y.existsSync(ae)&&Y.readdirSync(ae).length===0&&Y.rmdirSync(ae)}catch{}}if(s.includes("cursor")){let j=Z.join(r,".cursor/rules"),P=wn(j,k=>k.startsWith("rcode-")||k==="rcode.mdc"||k==="rcode-method.mdc"||k==="rcode");h+=P,P>0&&console.log(` \u2713 removed ${P} Cursor rules`)}if(s.includes("windsurf")){let j=Z.join(r,".windsurf/rules"),P=wn(j,k=>k.startsWith("rcode-")||k==="rcode.mdc"||k==="rcode-method.mdc");h+=P,P>0&&console.log(` \u2713 removed ${P} Windsurf rules`)}if(s.includes("antigravity")){let j=Z.join(r,".antigravity/agents"),P=wn(j,k=>k.startsWith("rcode-"));h+=P,P>0&&console.log(` \u2713 removed ${P} Antigravity agents`)}if(s.includes("gemini")){let j=0;for(let P of["agents","commands"]){let k=Z.join(r,".gemini","rcode",P);j+=wn(k,M=>M.startsWith("rcode-")||M.endsWith(".md"))}h+=j,j>0&&console.log(` \u2713 removed ${j} Gemini files`)}if(s.includes("vscode")){let j=Z.join(r,".vscode/rcode");Y.existsSync(j)&&Jr(j,Z.resolve(r)).ok&&(h+=1,console.log(" \u2713 removed .vscode/rcode/ marker"))}if(a.agentsMd){let j=Z.join(r,"AGENTS.md");B1(j)&&console.log(" \u2713 stripped rcode section from AGENTS.md")}let C=Z.join(r,".gitignore");if(Y.existsSync(C))try{let j=Y.readFileSync(C,"utf8"),P=lg(j);P!==j&&(Y.writeFileSync(C,P),console.log(" \u2713 stripped rcode block from .gitignore"))}catch(j){console.log(` \u26A0 could not strip .gitignore block: ${j.message}`)}let b=T1(r);b==="removed"?console.log(" \u2713 removed .git/hooks/pre-commit (was rcode-only)"):b==="stripped"&&console.log(" \u2713 stripped rcode block from .git/hooks/pre-commit"),P1(r,[".claude/skills",".claude/commands",".claude",".cursor/rules",".cursor",".windsurf/rules",".windsurf",".antigravity/agents",".antigravity"]);let I=Z.join(r,".rcode","brain");if(Y.existsSync(I)){let j=Jr(I,Z.resolve(r));j.ok?console.log(" \u2713 removed .rcode/brain/ (pulled content, will refresh on reinstall)"):j.reason==="outside-root"&&console.log(" \u26A0 refused to remove .rcode/brain/ \u2014 symlink resolves outside project root")}if(a.stateDir){let j=Z.join(r,".rcode"),P=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(),P=await ig("Also delete .rcode/ state? This is destructive and cannot be undone. [y/N] ",{default:"n"})),P){let k=Jr(j,Z.resolve(r));k.ok?console.log(" \u2713 removed .rcode/ state directory"):k.reason==="outside-root"?console.log(" \u26A0 refused to remove .rcode/ \u2014 symlink resolves outside project root"):console.log(` \u26A0 could not remove .rcode/: ${k.reason}`)}else console.log(" \u2139 kept .rcode/ state directory (your project data is preserved)")}if(e.purge){let j=Z.join(r,".planning");if(Y.existsSync(j)){let P=Jr(j,Z.resolve(r));P.ok?console.log(" \u2713 removed .planning/ (--purge)"):P.reason==="outside-root"?console.log(" \u26A0 refused to remove .planning/ \u2014 symlink resolves outside project root"):console.log(` \u26A0 could not remove .planning/: ${P.reason}`)}}console.log(`
295
- \u2705 Uninstall complete. Removed ${h} files.`),D.ok&&console.log(` Backup: ${D.path} (restore with: tar -xzf ${D.path})`);let R=a.stateDir&&Y.existsSync(Z.join(r,".rcode")),q=!e.purge&&Y.existsSync(Z.join(r,".planning"));(R||q)&&(console.log(),console.log("\u2139 Preserved (your project data \u2014 not removed by default):"),R&&(console.log(" .rcode/ phases, decisions, progress, config"),console.log(" /rcode-init will detect this on reinstall")),q&&console.log(" .planning/ planning scaffolds (ROADMAP, STATE, PROJECT)"),console.log(" To remove these on next uninstall: 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(`
296
- To reinstall later:`),console.log(" rcode install")}Sr.exports.isLocalOverride=cg;Sr.exports.planToPathList=hg;Sr.exports.discoverKnownActionSkills=dg;Sr.exports.stripRcodeGitignoreBlock=lg;require.main===Sr&&Sr.exports(process.argv.slice(2)).catch(t=>{t instanceof ag&&(console.log(`
296
+ `),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 Dg(`Proceed with removing ${m} skill/command files${a.agentsMd?" + AGENTS.md section":""}? [y/N] `,{default:"n"})){console.log(`
297
+ \u274C Aborted. Nothing was removed.`);return}console.log();let y=KA(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 p=0;if(s.includes("claude")){let F=q.join(r,".claude/skills"),R=wn(F,ne=>ne.startsWith("rcode-")||Sg(ne));p+=R,R>0&&console.log(` \u2713 removed ${R} Claude skills`);let j=q.join(r,".claude/commands/rcode");if(z.existsSync(j)){let ne=wr(j,q.resolve(r));!ne.ok&&ne.reason==="outside-root"&&console.log(` \u26A0 refused to remove ${j} \u2014 symlink resolves outside project root`)}let M=q.join(r,".claude/commands"),re=0;if(z.existsSync(M))for(let ne of z.readdirSync(M))ne.startsWith("rcode-")&&(ne.endsWith(".md")||ne.endsWith(".mdc"))&&(z.unlinkSync(q.join(M,ne)),re++);let $=a.claude.commands.length;p+=$,$>0&&console.log(` \u2713 removed ${$} slash commands from .claude/commands/`);let ae=q.join(r,".claude/agents"),X=wn(ae,ne=>ne.startsWith("rcode-")&&ne.endsWith(".md"));if(p+=X,X>0&&console.log(` \u2713 removed ${X} Claude agents`),a.claude.agentsRulesDir){let ne=q.join(r,".claude/agents/rules"),x=wr(ne,q.resolve(r));x.ok&&x.reason!=="missing"?console.log(" \u2713 removed .claude/agents/rules/ (agent reference rules)"):x.reason==="outside-root"&&console.log(" \u26A0 refused to remove .claude/agents/rules/ \u2014 symlink resolves outside project root")}try{z.existsSync(q.join(r,".claude/commands"))&&z.readdirSync(q.join(r,".claude/commands")).length===0&&z.rmdirSync(q.join(r,".claude/commands")),z.existsSync(ae)&&z.readdirSync(ae).length===0&&z.rmdirSync(ae)}catch{}}if(s.includes("cursor")){let F=q.join(r,".cursor/rules"),R=wn(F,j=>j.startsWith("rcode-")||j==="rcode.mdc"||j==="rcode-method.mdc"||j==="rcode");p+=R,R>0&&console.log(` \u2713 removed ${R} Cursor rules`)}if(s.includes("windsurf")){let F=q.join(r,".windsurf/rules"),R=wn(F,j=>j.startsWith("rcode-")||j==="rcode.mdc"||j==="rcode-method.mdc");p+=R,R>0&&console.log(` \u2713 removed ${R} Windsurf rules`)}if(s.includes("antigravity")){let F=q.join(r,".antigravity/agents"),R=wn(F,j=>j.startsWith("rcode-"));p+=R,R>0&&console.log(` \u2713 removed ${R} Antigravity agents`)}if(s.includes("codex")&&Gu(q.join(Vu.homedir(),".codex","hooks.json"),"UserPromptSubmit")==="removed"&&console.log(" \u2713 removed rcode slash-router hook from ~/.codex/hooks.json"),s.includes("antigravity")&&Gu(q.join(Vu.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 F=Vu.homedir();for(let R of[q.join(F,".rcode","slash-commands"),q.join(F,".rcode","bin")])z.existsSync(R)&&wr(R,F).ok&&console.log(` \u2713 removed ${R}`)}if(s.includes("gemini")){let F=0;for(let R of["agents","commands"]){let j=q.join(r,".gemini","rcode",R);F+=wn(j,M=>M.startsWith("rcode-")||M.endsWith(".md"))}p+=F,F>0&&console.log(` \u2713 removed ${F} Gemini files`)}if(s.includes("vscode")){let F=q.join(r,".vscode/rcode");z.existsSync(F)&&wr(F,q.resolve(r)).ok&&(p+=1,console.log(" \u2713 removed .vscode/rcode/ marker"))}if(a.agentsMd){let F=q.join(r,"AGENTS.md");QA(F)&&console.log(" \u2713 stripped rcode section from AGENTS.md")}let C=q.join(r,".gitignore");if(z.existsSync(C))try{let F=z.readFileSync(C,"utf8"),R=_g(F);R!==F&&(z.writeFileSync(C,R),console.log(" \u2713 stripped rcode block from .gitignore"))}catch(F){console.log(` \u26A0 could not strip .gitignore block: ${F.message}`)}let S=GA(r);S==="removed"?console.log(" \u2713 removed .git/hooks/pre-commit (was rcode-only)"):S==="stripped"&&console.log(" \u2713 stripped rcode block from .git/hooks/pre-commit"),YA(r,[".claude/skills",".claude/commands",".claude",".cursor/rules",".cursor",".windsurf/rules",".windsurf",".antigravity/agents",".antigravity"]);let I=q.join(r,".rcode","brain");if(z.existsSync(I)){let F=wr(I,q.resolve(r));F.ok?console.log(" \u2713 removed .rcode/brain/ (pulled content, will refresh on reinstall)"):F.reason==="outside-root"&&console.log(" \u26A0 refused to remove .rcode/brain/ \u2014 symlink resolves outside project root")}if(a.stateDir){let F=q.join(r,".rcode"),R=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(),R=await Dg("Also delete .rcode/ state? This is destructive and cannot be undone. [y/N] ",{default:"n"})),R){let j=wr(F,q.resolve(r));j.ok?console.log(" \u2713 removed .rcode/ state directory"):j.reason==="outside-root"?console.log(" \u26A0 refused to remove .rcode/ \u2014 symlink resolves outside project root"):console.log(` \u26A0 could not remove .rcode/: ${j.reason}`)}else console.log(" \u2139 kept .rcode/ state directory (your project data is preserved)")}if(e.purge){let F=q.join(r,".planning");if(z.existsSync(F)){let R=wr(F,q.resolve(r));R.ok?console.log(" \u2713 removed .planning/ (--purge)"):R.reason==="outside-root"?console.log(" \u26A0 refused to remove .planning/ \u2014 symlink resolves outside project root"):console.log(` \u26A0 could not remove .planning/: ${R.reason}`)}}console.log(`
298
+ \u2705 Uninstall complete. Removed ${p} files.`),y.ok&&console.log(` Backup: ${y.path} (restore with: tar -xzf ${y.path})`);let P=a.stateDir&&z.existsSync(q.join(r,".rcode")),W=!e.purge&&z.existsSync(q.join(r,".planning"));(P||W)&&(console.log(),console.log("\u2139 Preserved (your project data \u2014 not removed by default):"),P&&(console.log(" .rcode/ phases, decisions, progress, config"),console.log(" /rcode-init will detect this on reinstall")),W&&console.log(" .planning/ planning scaffolds (ROADMAP, STATE, PROJECT)"),console.log(" To remove these on next uninstall: 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(`
299
+ To reinstall later:`),console.log(" rcode install")}rr.exports.isLocalOverride=vg;rr.exports.planToPathList=bg;rr.exports.discoverKnownActionSkills=Eg;rr.exports.stripRcodeGitignoreBlock=_g;rr.exports.removeSlashRouterHook=Gu;require.main===rr&&rr.exports(process.argv.slice(2)).catch(t=>{t instanceof yg&&(console.log(`
297
300
  \u274C Aborted.`),process.exit(1)),console.error(`
298
- \u274C Uninstall failed: ${t.message}`),process.env.DEBUG&&console.error(t.stack),process.exit(1)})});var gg=_((G2,mg)=>{"use strict";var ns=require("fs"),Zu=require("os"),ve=require("path"),{spawnSync:er}=require("child_process");function qe(t){try{return ns.accessSync(t),!0}catch{return!1}}function xn(t){try{return ns.readdirSync(t)}catch{return[]}}function q1(){let t=Zu.homedir(),e=[];try{let n=er("npm",["root","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"npm",dir:n.stdout.trim()})}catch{}try{let n=er("pnpm",["root","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"pnpm",dir:n.stdout.trim()})}catch{}try{let n=er("yarn",["global","dir"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"yarn",dir:ve.join(n.stdout.trim(),"node_modules")})}catch{}try{let n=er("bun",["pm","bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"bun",dir:ve.join(t,".bun","install","global","node_modules")})}catch{}let r=ve.join(t,".nvm","versions","node");if(qe(r))for(let n of xn(r)){let s=ve.join(r,n,"lib","node_modules");qe(s)&&!e.some(i=>i.dir===s)&&e.push({manager:`nvm/${n}`,dir:s})}return e}function W1(t){let e=[];for(let r of["@hanzlaa","@hanzlahabib"]){let n=ve.join(t,r);if(qe(n))for(let s of xn(n))(s==="rcode"||s==="rcode"||s.startsWith("rcode"))&&e.push({scope:r,pkg:s,dir:ve.join(n,s)})}return e}function H1(){let t=Zu.homedir(),e=new Set;try{let n=er("npm",["prefix","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(ve.join(n.stdout.trim(),"bin"))}catch{}try{let n=er("pnpm",["bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}try{let n=er("yarn",["global","bin"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}try{let n=er("bun",["pm","bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}e.add(ve.join(t,".local","share","pnpm")),e.add(ve.join(t,".local","bin")),e.add(ve.join(t,".bun","bin"));let r=ve.join(t,".nvm","versions","node");if(qe(r))for(let n of xn(r))e.add(ve.join(r,n,"bin"));return[...e].filter(qe)}var Z1=["rcode","rcode","rcode"];function U1(t){let e=[];for(let r of Z1){let n=ve.join(t,r);if(qe(n)){let s=null;try{s=ns.readlinkSync(n)}catch{}(!s||/rcode|rcode|@hanzlaa|@hanzlahabib/.test(s))&&e.push({name:r,path:n,target:s})}}return e}function pg(t){let e=[];if(!qe(t))return e;let r=ve.join(t,"commands");if(qe(r)){for(let o of xn(r))o.startsWith("rcode-")&&(o.endsWith(".md")||o.endsWith(".mdc"))&&e.push({kind:"command",path:ve.join(r,o)});let i=ve.join(r,"rcode");qe(i)&&e.push({kind:"commands-dir",path:i})}let n=ve.join(t,"agents");if(qe(n))for(let i of xn(n))i.startsWith("rcode-")&&(i.endsWith(".md")||i.endsWith(".mdc"))&&e.push({kind:"agent",path:ve.join(n,i)});let s=ve.join(t,"skills");if(qe(s))for(let i of xn(s))i.startsWith("rcode-")&&e.push({kind:"skill-dir",path:ve.join(s,i)});return e}function V1({includePlanning:t}){let e=Zu.homedir(),r=process.cwd(),n={packages:[],bins:[],globalClaude:[],globalrcode:null,projectClaude:[],projectrcode:null,projectPlanning:null};for(let{manager:o,dir:a}of q1())for(let u of W1(a))n.packages.push({manager:o,...u});for(let o of H1())for(let a of U1(o))n.bins.push({binDir:o,...a});n.globalClaude=pg(ve.join(e,".claude"));let s=ve.join(e,".rcode");qe(s)&&(n.globalrcode=globalRcode),n.projectClaude=pg(ve.join(r,".claude"));let i=ve.join(r,".rcode");if(qe(i)&&r!==e&&(n.projectrcode=projectRcode),t){let o=ve.join(r,".planning");qe(o)&&r!==e&&(n.projectPlanning=o)}return n}function G1(t,{dryRun:e}){console.log(`
301
+ \u274C Uninstall failed: ${t.message}`),process.env.DEBUG&&console.error(t.stack),process.exit(1)})});var xg=v((uI,wg)=>{"use strict";var ss=require("fs"),ve=require("path"),{spawnSync:nr}=require("child_process"),{homedir:Ju}=An();function qe(t){try{return ss.accessSync(t),!0}catch{return!1}}function xn(t){try{return ss.readdirSync(t)}catch{return[]}}function tk(){let t=Ju(),e=[];try{let n=nr("npm",["root","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"npm",dir:n.stdout.trim()})}catch{}try{let n=nr("pnpm",["root","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"pnpm",dir:n.stdout.trim()})}catch{}try{let n=nr("yarn",["global","dir"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"yarn",dir:ve.join(n.stdout.trim(),"node_modules")})}catch{}try{let n=nr("bun",["pm","bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.push({manager:"bun",dir:ve.join(t,".bun","install","global","node_modules")})}catch{}let r=ve.join(t,".nvm","versions","node");if(qe(r))for(let n of xn(r)){let s=ve.join(r,n,"lib","node_modules");qe(s)&&!e.some(i=>i.dir===s)&&e.push({manager:`nvm/${n}`,dir:s})}return e}function rk(t){let e=[];for(let r of["@hanzlaa","@hanzlahabib"]){let n=ve.join(t,r);if(qe(n))for(let s of xn(n))(s==="rcode"||s==="rcode"||s.startsWith("rcode"))&&e.push({scope:r,pkg:s,dir:ve.join(n,s)})}return e}function nk(){let t=Ju(),e=new Set;try{let n=nr("npm",["prefix","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(ve.join(n.stdout.trim(),"bin"))}catch{}try{let n=nr("pnpm",["bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}try{let n=nr("yarn",["global","bin"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}try{let n=nr("bun",["pm","bin","-g"],{encoding:"utf8"});n.status===0&&n.stdout.trim()&&e.add(n.stdout.trim())}catch{}e.add(ve.join(t,".local","share","pnpm")),e.add(ve.join(t,".local","bin")),e.add(ve.join(t,".bun","bin"));let r=ve.join(t,".nvm","versions","node");if(qe(r))for(let n of xn(r))e.add(ve.join(r,n,"bin"));return[...e].filter(qe)}var sk=["rcode","rcode","rcode"];function ok(t){let e=[];for(let r of sk){let n=ve.join(t,r);if(qe(n)){let s=null;try{s=ss.readlinkSync(n)}catch{}(!s||/rcode|rcode|@hanzlaa|@hanzlahabib/.test(s))&&e.push({name:r,path:n,target:s})}}return e}function Cg(t){let e=[];if(!qe(t))return e;let r=ve.join(t,"commands");if(qe(r)){for(let o of xn(r))o.startsWith("rcode-")&&(o.endsWith(".md")||o.endsWith(".mdc"))&&e.push({kind:"command",path:ve.join(r,o)});let i=ve.join(r,"rcode");qe(i)&&e.push({kind:"commands-dir",path:i})}let n=ve.join(t,"agents");if(qe(n))for(let i of xn(n))i.startsWith("rcode-")&&(i.endsWith(".md")||i.endsWith(".mdc"))&&e.push({kind:"agent",path:ve.join(n,i)});let s=ve.join(t,"skills");if(qe(s))for(let i of xn(s))i.startsWith("rcode-")&&e.push({kind:"skill-dir",path:ve.join(s,i)});return e}function ik({includePlanning:t}){let e=Ju(),r=process.cwd(),n={packages:[],bins:[],globalClaude:[],globalrcode:null,projectClaude:[],projectrcode:null,projectPlanning:null};for(let{manager:o,dir:a}of tk())for(let u of rk(a))n.packages.push({manager:o,...u});for(let o of nk())for(let a of ok(o))n.bins.push({binDir:o,...a});n.globalClaude=Cg(ve.join(e,".claude"));let s=ve.join(e,".rcode");qe(s)&&(n.globalrcode=s),n.projectClaude=Cg(ve.join(r,".claude"));let i=ve.join(r,".rcode");if(qe(i)&&r!==e&&(n.projectrcode=i),t){let o=ve.join(r,".planning");qe(o)&&r!==e&&(n.projectPlanning=o)}return n}function ak(t,{dryRun:e}){console.log(`
299
302
  \u{1F525} rcode nuke \xB7 by Hanzla Habib ${e?"[DRY RUN \u2014 pass --yes to remove]":"[REMOVING]"}
300
303
  `);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.
301
304
  `:` Total: ${n} item(s).
302
- `),n}function Qr(t){try{return ns.rmSync(t,{recursive:!0,force:!0}),!0}catch(e){return console.warn(` \u26A0 failed to remove ${t}: ${e.message}`),!1}}function z1(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 er(s[0],s[1],{stdio:"pipe",encoding:"utf8"}).status===0}catch{return!1}}function Y1(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=z1(n,r.scope,r.pkg);console.log(s?"\u2713":"\u26A0 failed via PM, falling back to rm"),s||Qr(r.dir),e++}for(let r of t.bins)qe(r.path)&&Qr(r.path)&&(console.log(` \u2713 removed bin ${r.path}`),e++);for(let r of t.globalClaude)Qr(r.path)&&(console.log(` \u2713 removed ${r.path}`),e++);t.globalrcode&&Qr(t.globalrcode)&&(console.log(` \u2713 removed ${t.globalRcode}`),e++);for(let r of t.projectClaude)Qr(r.path)&&(console.log(` \u2713 removed ${r.path}`),e++);return t.projectrcode&&Qr(t.projectrcode)&&(console.log(` \u2713 removed ${t.projectRcode}`),e++),t.projectPlanning&&Qr(t.projectPlanning)&&(console.log(` \u2713 removed ${t.projectPlanning}`),e++),e}mg.exports=function(e=[]){let r=!e.includes("--yes")&&!e.includes("-y"),n=e.includes("--include-planning"),s=ve.join(process.cwd(),"package.json");if(qe(s))try{let u=JSON.parse(ns.readFileSync(s,"utf8"));if((u.name==="@hanzlaa/rcode"||u.name==="@hanzlahabib/rihal-code")&&(console.log(`
305
+ `),n}function Qr(t){try{return ss.rmSync(t,{recursive:!0,force:!0}),!0}catch(e){return console.warn(` \u26A0 failed to remove ${t}: ${e.message}`),!1}}function uk(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 nr(s[0],s[1],{stdio:"pipe",encoding:"utf8"}).status===0}catch{return!1}}function ck(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=uk(n,r.scope,r.pkg);console.log(s?"\u2713":"\u26A0 failed via PM, falling back to rm"),s||Qr(r.dir),e++}for(let r of t.bins)qe(r.path)&&Qr(r.path)&&(console.log(` \u2713 removed bin ${r.path}`),e++);for(let r of t.globalClaude)Qr(r.path)&&(console.log(` \u2713 removed ${r.path}`),e++);t.globalrcode&&Qr(t.globalrcode)&&(console.log(` \u2713 removed ${t.globalrcode}`),e++);for(let r of t.projectClaude)Qr(r.path)&&(console.log(` \u2713 removed ${r.path}`),e++);return t.projectrcode&&Qr(t.projectrcode)&&(console.log(` \u2713 removed ${t.projectrcode}`),e++),t.projectPlanning&&Qr(t.projectPlanning)&&(console.log(` \u2713 removed ${t.projectPlanning}`),e++),e}wg.exports=function(e=[]){let r=!e.includes("--yes")&&!e.includes("-y"),n=e.includes("--include-planning"),s=ve.join(process.cwd(),"package.json");if(qe(s))try{let u=JSON.parse(ss.readFileSync(s,"utf8"));if((u.name==="@hanzlaa/rcode"||u.name==="@hanzlahabib/rihal-code")&&(console.log(`
303
306
  \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.
304
- `),!e.includes("--i-know-what-im-doing")))return}catch{}let i=V1({includePlanning:n}),o=G1(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
307
+ `),!e.includes("--i-know-what-im-doing")))return}catch{}let i=ik({includePlanning:n}),o=ak(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
305
308
  `));return}console.log(`Executing...
306
- `);let a=Y1(i);console.log(`
309
+ `);let a=ck(i);console.log(`
307
310
  \u2705 Done. Removed ${a} item(s). Reinstall: npm install -g @hanzlaa/rcode
308
- `)}});var Uu=_((z2,yg)=>{var Dg=require("path"),{spawn:K1}=require("child_process");yg.exports=function(e,{packageRoot:r}){let n=Dg.join(r,"server/dashboard.js"),s=process.cwd(),i=Dg.join(s,".rcode");console.log(`
309
- \u{1F54C} Starting Diwan dashboard...`),console.log(` Scanning: ${i}`);let o=K1("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(`
310
- Stopping dashboard...`),o.kill("SIGTERM"),process.exit(0)};process.on("SIGINT",a),process.on("SIGTERM",a)}});var bg=_((Y2,Eg)=>{var Cr=require("fs"),Fo=require("path");function X1(t){let e=t.replace(/^rcode-/,"");if(e.includes("..")||e.includes("/")||e.includes("\\"))throw new Error(`Invalid agent name: '${t}'`);return e}function vg(t,e){let r=Cr.existsSync(t)?Cr.readdirSync(t).filter(s=>s.endsWith(".md")&&s!=="README.md").map(s=>s.replace(".md","")):[],n=Cr.existsSync(e)?Cr.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 _g(t,e,r){let n=Fo.join(e,`${t}.md`);if(Cr.existsSync(n))return{file:n,source:"digest"};let s=Fo.join(r,`rcode-${t}.md`);return Cr.existsSync(s)?{file:s,source:"agent"}:null}Eg.exports=function(e,{packageRoot:r}){let n=Fo.join(r,"rcode/digests"),s=Fo.join(r,"rcode/agents"),i=e[0];if(i){let a=X1(i),u=_g(a,n,s);u||(console.error(`No digest or agent found for: ${i}`),console.error(`Available: ${vg(n,s).join(", ")}`),process.exit(1)),u.source==="agent"&&console.log(`# (fallback: full agent file \u2014 no curated digest exists)
311
- `),console.log(Cr.readFileSync(u.file,"utf8"));return}let o=vg(n,s);console.log(`
311
+ `)}});var Xu=v((cI,Ag)=>{var $g=require("path"),{spawn:lk}=require("child_process");Ag.exports=function(e,{packageRoot:r}){let n=$g.join(r,"server/dashboard.js"),s=process.cwd(),i=$g.join(s,".rcode");console.log(`
312
+ \u{1F54C} Starting Diwan dashboard...`),console.log(` Scanning: ${i}`);let o=lk("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(`
313
+ Stopping dashboard...`),o.kill("SIGTERM"),process.exit(0)};process.on("SIGINT",a),process.on("SIGTERM",a)}});var Ig=v((lI,jg)=>{var xr=require("fs"),Fo=require("path");function dk(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=xr.existsSync(t)?xr.readdirSync(t).filter(s=>s.endsWith(".md")&&s!=="README.md").map(s=>s.replace(".md","")):[],n=xr.existsSync(e)?xr.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 Fg(t,e,r){let n=Fo.join(e,`${t}.md`);if(xr.existsSync(n))return{file:n,source:"digest"};let s=Fo.join(r,`rcode-${t}.md`);return xr.existsSync(s)?{file:s,source:"agent"}:null}jg.exports=function(e,{packageRoot:r}){let n=Fo.join(r,"rcode/digests"),s=Fo.join(r,"rcode/agents"),i=e[0];if(i){let a=dk(i),u=Fg(a,n,s);u||(console.error(`No digest or agent found for: ${i}`),console.error(`Available: ${kg(n,s).join(", ")}`),process.exit(1)),u.source==="agent"&&console.log(`# (fallback: full agent file \u2014 no curated digest exists)
314
+ `),console.log(xr.readFileSync(u.file,"utf8"));return}let o=kg(n,s);console.log(`
312
315
  \u{1F54C} All rcode Agent Digests
313
- `);for(let a of o){let u=_g(a,n,s);u&&(console.log(Cr.readFileSync(u.file,"utf8")),console.log(`
316
+ `);for(let a of o){let u=Fg(a,n,s);u&&(console.log(xr.readFileSync(u.file,"utf8")),console.log(`
314
317
  `+"\u2550".repeat(80)+`
315
- `))}}});var wg=_((K2,Cg)=>{var Vu=require("fs"),Sg=require("path");Cg.exports=function(e,{packageRoot:r}){let n=Sg.join(r,"rcode/digests");Vu.existsSync(n)||(console.error("Agent digests not found. Is the package installed correctly?"),process.exit(1));let s=Vu.readdirSync(n).filter(i=>i.endsWith(".md")&&i!=="README.md");console.log(`
318
+ `))}}});var Pg=v((dI,Rg)=>{var Ku=require("fs"),Tg=require("path");Rg.exports=function(e,{packageRoot:r}){let n=Tg.join(r,"rcode/digests");Ku.existsSync(n)||(console.error("Agent digests not found. Is the package installed correctly?"),process.exit(1));let s=Ku.readdirSync(n).filter(i=>i.endsWith(".md")&&i!=="README.md");console.log(`
316
319
  \u{1F54C} rcode Team Roster (${s.length} agents)
317
- `),console.log("\u2500".repeat(80));for(let i of s.sort()){let o=Vu.readFileSync(Sg.join(n,i),"utf8"),a=o.split(`
320
+ `),console.log("\u2500".repeat(80));for(let i of s.sort()){let o=Ku.readFileSync(Tg.join(n,i),"utf8"),a=o.split(`
318
321
  `)[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(`
319
322
  For full agent details: cat rcode/digests/{agent}.md`),console.log(`For full skill: rcode/skills/agents/{agent-dir}/SKILL.md
320
- `)}});var Fg=_((X2,Ag)=>{var{spawnSync:xg}=require("child_process"),Gu=require("fs"),$g=require("path");Ag.exports=function(e,{packageRoot:r}){let n=$g.join(r,"rcode/agents");if(e.includes("--list")||e.length===0){let g=Gu.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
+ `)}});var Bg=v((fI,Lg)=>{var{spawnSync:Og}=require("child_process"),Qu=require("fs"),Ng=require("path");Lg.exports=function(e,{packageRoot:r}){let n=Ng.join(r,"rcode/agents");if(e.includes("--list")||e.length===0){let g=Qu.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]
321
324
  `),console.log(`Available agents (${g.length}):
322
- `),g.forEach(m=>console.log(` rcode agent ${m}`));return}let s=e[0],o=`rcode-${s.startsWith("rcode-")?s.slice(6):s}`,a=$g.join(n,`${o}.md`);if(!Gu.existsSync(a)){let g=Gu.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";xg(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=xg("claude",["--agent",o,...d],{stdio:"inherit"});process.exit(f.status??0)}});var Ku=_((J2,Og)=>{var en=require("fs"),ko=require("path"),J1=require("crypto"),{spawnSync:zu}=require("child_process"),{writeJsonAtomic:Q1}=Zt(),ss={commitsSinceInit:20,daysSinceInit:14},kg=["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 jg(t){return J1.createHash("sha256").update(t).digest("hex").slice(0,16)}function eA(t){if(!en.existsSync(t))return null;try{let e=en.readFileSync(t);return jg(e)}catch(e){return console.error("[memory-bank] hashFileIfExists: failed to read",t+":",e?.message||e),null}}function tA(t){for(let e of kg){let r=ko.join(t,e),n=eA(r);if(n)return{name:e,hash:n}}return null}function rA(t){try{let e=en.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:jg(e.join("|"))}}catch(e){return console.error("[memory-bank] structureFingerprint: failed to read directory:",e?.message||e),{dirs:[],hash:null}}}function nA(t){try{let e=zu("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8"});if(e.status!==0)return null;let r=zu("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 Ig(t,e,r){if(!e||!r)return null;try{let n=zu("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 Yu(t){let e=nA(t),r=tA(t),n=rA(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 Tg(t){return ko.join(t,".rcode","state.json")}function Rg(t){let e=Tg(t);if(!en.existsSync(e))return null;try{return JSON.parse(en.readFileSync(e,"utf8"))}catch(r){return console.error("[memory-bank] readState: failed to parse state.json at",e+":",r?.message||r),null}}function sA(t){let e=Rg(t)||{},r=Yu(t);return e.memory_bank={...e.memory_bank,last_init:r},Q1(Tg(t),e),r}function Pg(t){return Rg(t)?.memory_bank?.last_init||null}function oA(t){let e=Yu(t),r=Pg(t),n=ko.join(t,".rcode/context/active.md"),s=ko.join(t,".rcode/context/project-brief.md"),i={active:en.existsSync(n),brief:en.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=Ig(t,r.git_head,e.git_head);a!==null&&a>=ss.commitsSinceInit&&o.push(`${a} commits since last init (threshold: ${ss.commitsSinceInit})`)}if(r.timestamp){let a=Date.parse(r.timestamp);if(!Number.isNaN(a)){let u=(Date.now()-a)/864e5;u>=ss.daysSinceInit&&o.push(`${Math.floor(u)} days since last init (threshold: ${ss.daysSinceInit})`)}}return{status:o.length>0?"stale":"fresh",reasons:o,current:e,stored:r,context_files:i}}Og.exports={computeFingerprint:Yu,writeFingerprint:sA,readFingerprint:Pg,checkStaleness:oA,commitsBetween:Ig,STALE_THRESHOLDS:ss,MANIFEST_CANDIDATES:kg}});var Wg=_((Q2,qg)=>{var{z:ge}=Na();function iA(t){if(typeof t!="string"||!t.startsWith(`---
323
- `))return{frontmatter:{},body:t||""};let e=t.indexOf(`
325
+ `),g.forEach(m=>console.log(` rcode agent ${m}`));return}let s=e[0],o=`rcode-${s.startsWith("rcode-")?s.slice(6):s}`,a=Ng.join(n,`${o}.md`);if(!Qu.existsSync(a)){let g=Qu.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";Og(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=Og("claude",["--agent",o,...d],{stdio:"inherit"});process.exit(f.status??0)}});var rc=v((hI,Vg)=>{var en=require("fs"),jo=require("path"),fk=require("crypto"),{spawnSync:ec}=require("child_process"),{writeJsonAtomic:hk}=zt(),os={commitsSinceInit:20,daysSinceInit:14},Mg=["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 qg(t){return fk.createHash("sha256").update(t).digest("hex").slice(0,16)}function pk(t){if(!en.existsSync(t))return null;try{let e=en.readFileSync(t);return qg(e)}catch(e){return console.error("[memory-bank] hashFileIfExists: failed to read",t+":",e?.message||e),null}}function mk(t){for(let e of Mg){let r=jo.join(t,e),n=pk(r);if(n)return{name:e,hash:n}}return null}function gk(t){try{let e=en.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:qg(e.join("|"))}}catch(e){return console.error("[memory-bank] structureFingerprint: failed to read directory:",e?.message||e),{dirs:[],hash:null}}}function Dk(t){try{let e=ec("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8"});if(e.status!==0)return null;let r=ec("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 Wg(t,e,r){if(!e||!r)return null;try{let n=ec("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 tc(t){let e=Dk(t),r=mk(t),n=gk(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 Hg(t){return jo.join(t,".rcode","state.json")}function Zg(t){let e=Hg(t);if(!en.existsSync(e))return null;try{return JSON.parse(en.readFileSync(e,"utf8"))}catch(r){return console.error("[memory-bank] readState: failed to parse state.json at",e+":",r?.message||r),null}}function yk(t){let e=Zg(t)||{},r=tc(t);return e.memory_bank={...e.memory_bank,last_init:r},hk(Hg(t),e),r}function Ug(t){return Zg(t)?.memory_bank?.last_init||null}function vk(t){let e=tc(t),r=Ug(t),n=jo.join(t,".rcode/context/active.md"),s=jo.join(t,".rcode/context/project-brief.md"),i={active:en.existsSync(n),brief:en.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=Wg(t,r.git_head,e.git_head);a!==null&&a>=os.commitsSinceInit&&o.push(`${a} commits since last init (threshold: ${os.commitsSinceInit})`)}if(r.timestamp){let a=Date.parse(r.timestamp);if(!Number.isNaN(a)){let u=(Date.now()-a)/864e5;u>=os.daysSinceInit&&o.push(`${Math.floor(u)} days since last init (threshold: ${os.daysSinceInit})`)}}return{status:o.length>0?"stale":"fresh",reasons:o,current:e,stored:r,context_files:i}}Vg.exports={computeFingerprint:tc,writeFingerprint:yk,readFingerprint:Ug,checkStaleness:vk,commitsBetween:Wg,STALE_THRESHOLDS:os,MANIFEST_CANDIDATES:Mg}});var Kg=v((pI,Xg)=>{var{z:ge}=La();function _k(t){if(typeof t!="string")return{frontmatter:{},body:t||""};if(t=t.replace(/\r\n/g,`
326
+ `),!t.startsWith(`---
327
+ `))return{frontmatter:{},body:t};let e=t.indexOf(`
324
328
  ---
325
329
  `,4);if(e===-1)return{frontmatter:{},body:t};let r=t.slice(4,e),n=t.slice(e+5),s={},i=r.split(`
326
- `),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 Ng(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 Lg=ge.object({name:ge.string().min(1,"name is required"),description:ge.string().min(1,"description is required")}),aA=/not for|do not|does not|don't|never\b|audit-only|negative/i;function uA(t,e=""){let r=[],n=[],s=Lg.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=Ng(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:"";aA.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 Bg=ge.object({name:ge.string().min(1,"name is required").refine(t=>t.startsWith("rcode-"),'name must start with the "rcode-" prefix'),description:ge.string().min(1,"description is required"),color:ge.string().min(1,"color is required")});function cA(t){let e=[],r=Bg.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 Mg=ge.object({version:ge.union([ge.string(),ge.number()]),project:ge.string().min(1),phases:ge.array(ge.any()),schema_version:ge.number(),current_phase:ge.union([ge.string(),ge.number()]).optional(),current_plan:ge.union([ge.string(),ge.number()]).optional(),current_sprint:ge.union([ge.string(),ge.number()]).nullable().optional(),velocity_history:ge.array(ge.any()).optional(),milestones:ge.array(ge.any()).optional()}).passthrough();function lA(t){let e=[],r=Mg.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}}qg.exports={parseFrontmatter:iA,countTriggerPhrases:Ng,skillFrontmatterSchema:Lg,agentFrontmatterSchema:Bg,stateSchema:Mg,validateSkillFrontmatter:uA,validateAgentFrontmatter:cA,validateState:lA}});var Ug=_((eI,Zg)=>{var Ce=require("fs"),$e=require("path"),{spawnSync:Hg}=require("child_process"),{verifyInstall:dA,formatReport:fA}=Xn(),{checkStaleness:hA}=Ku(),{parseFrontmatter:Xu,validateSkillFrontmatter:pA,validateAgentFrontmatter:mA}=Wg();function Ju(t){let e=[];if(!Ce.existsSync(t))return e;for(let r of Ce.readdirSync(t,{withFileTypes:!0})){let n=$e.join(t,r.name);r.isDirectory()?e.push(...Ju(n)):r.isFile()&&r.name==="SKILL.md"&&e.push(n)}return e}function gA(t){return Ce.existsSync(t)?Ce.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(".md")).map(e=>$e.join(t,e.name)):[]}var DA=/not for|do not|does not|don't|never\b|audit-only|negative/i;function yA(t){let e=Ce.readFileSync(t,"utf8"),{frontmatter:r,body:n}=Xu(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=typeof r.description=="string"?r.description:"";return DA.test(i)||/##[^\n]*\bnot\b/i.test(n)||/\bdo not (use|include)\b/i.test(n)||s.push("negative-boundary clause"),s}function vA(t){try{return Ce.accessSync(t,Ce.constants.W_OK),!0}catch{return!1}}function jo(t){let e=process.platform==="win32"?"where":"which";return Hg(e,[t],{stdio:"ignore"}).status===0}function _A(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=$e.join(t,".rcode");Ce.existsSync(i)?r.push({label:".rcode/ writable",status:vA(i)?"ok":"fail",message:i}):r.push({label:".rcode/ state",status:"warn",message:"not initialized in this directory (run `rcode install`)"});let o=$e.join(e,"rcode/config/model-profiles.json");if(Ce.existsSync(o))try{let a=JSON.parse(Ce.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"});if(r.push({label:"git CLI",status:jo("git")?"ok":"warn",message:jo("git")?"available":"not found (some features disabled)"}),r.push({label:"gh CLI",status:jo("gh")?"ok":"warn",message:jo("gh")?"available (github-sync ready)":"not found (github-sync unavailable)"}),Ce.existsSync(i)){let a=[];if(Ce.existsSync($e.join(t,".claude/skills"))&&a.push("claude"),Ce.existsSync($e.join(t,".cursor/rules"))&&a.push("cursor"),Ce.existsSync($e.join(t,".windsurf/rules"))&&a.push("windsurf"),Ce.existsSync($e.join(t,".antigravity/agents"))&&a.push("antigravity"),a.length>0){let{reports:c,hasDrift:l}=dA(t,e,a);if(l)r.push({label:"Agent manifest",status:"fail",message:`drift detected across ${a.join(", ")}`,detail:fA(c)});else{let d=c.map(f=>`${f.editor}:${f.installedCount}`).join(" ");r.push({label:"Agent manifest",status:"ok",message:d})}}let u=hA(t);u.status==="fresh"?r.push({label:"Memory bank",status:"ok",message:"fresh"}):u.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 ${u.reasons[0]}${u.reasons.length>1?` (+${u.reasons.length-1} more)`:""}`})}return r}function EA(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 bA(t){let e=[$e.join(t,"rcode/skills/agents"),$e.join(t,"rcode/skills/actions")],r=0,n=0,s=[];for(let i of e){let o=Ju(i);for(let a of o){r++;let u=yA(a);if(u.length>0){n++;let c=$e.relative(t,a);s.push({file:c,missing:u})}}}if(s.length>0){console.log(` \u2717 ${n} / ${r} skills are non-compliant:
327
- `);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 SA(t){let e=[$e.join(t,"rcode/skills/agents"),$e.join(t,"rcode/skills/actions")],r=0,n=0,s=0,i=0;for(let o of e)for(let a of Ju(o)){r++;let{frontmatter:u,body:c}=Xu(Ce.readFileSync(a,"utf8")),l=pA(u,c),d=$e.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 gA($e.join(t,"rcode/agents"))){n++;let{frontmatter:a}=Xu(Ce.readFileSync(o,"utf8")),u=mA(a);if(!u.ok){s++;let c=$e.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 CA(){let e=require("os").homedir(),r=[],n=[];for(let i of[["npm",["root","-g"]],["pnpm",["root","-g"]]])try{let o=Hg(i[0],i[1],{encoding:"utf8"});o.status===0&&o.stdout.trim()&&n.push({manager:i[0],dir:o.stdout.trim()})}catch{}let s=$e.join(e,".nvm","versions","node");if(Ce.existsSync(s))for(let i of Ce.readdirSync(s)){let o=$e.join(s,i,"lib","node_modules");Ce.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=$e.join(o,a);if(Ce.existsSync(u)){for(let c of Ce.readdirSync(u))if(c==="rcode"||c==="rcode"||c.startsWith("rcode")){let l="unknown";try{l=JSON.parse(Ce.readFileSync($e.join(u,c,"package.json"),"utf8")).version}catch{}r.push({manager:i,scope:a,pkg:c,version:l,dir:$e.join(u,c)})}}}return{count:r.length,installs:r}}function wA(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(`
328
- Fix: rcode nuke --yes && npm install -g @hanzlaa/rcode`),1}Zg.exports=function(e,{packageRoot:r}){let n=process.cwd();console.log(`
330
+ `),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 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[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 Gg(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 zg=ge.object({name:ge.string().min(1,"name is required"),description:ge.string().min(1,"description is required")}),Ek=/not for|do not|does not|don't|never\b|audit-only|negative/i;function Sk(t,e=""){let r=[],n=[],s=zg.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=Gg(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:"";Ek.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 Yg=ge.object({name:ge.string().min(1,"name is required").refine(t=>t.startsWith("rcode-"),'name must start with the "rcode-" prefix'),description:ge.string().min(1,"description is required"),color:ge.string().min(1,"color is required")});function bk(t){let e=[],r=Yg.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 Jg=ge.object({version:ge.union([ge.string(),ge.number()]),project:ge.string().min(1),phases:ge.array(ge.any()),schema_version:ge.number(),current_phase:ge.union([ge.string(),ge.number()]).optional(),current_plan:ge.union([ge.string(),ge.number()]).optional(),current_sprint:ge.union([ge.string(),ge.number()]).nullable().optional(),velocity_history:ge.array(ge.any()).optional(),milestones:ge.array(ge.any()).optional()}).passthrough();function Ck(t){let e=[],r=Jg.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}}Xg.exports={parseFrontmatter:_k,countTriggerPhrases:Gg,skillFrontmatterSchema:zg,agentFrontmatterSchema:Yg,stateSchema:Jg,validateSkillFrontmatter:Sk,validateAgentFrontmatter:bk,validateState:Ck}});var tD=v((mI,eD)=>{var Ce=require("fs"),$e=require("path"),{spawnSync:Qg}=require("child_process"),{verifyInstall:wk,formatReport:xk}=Kn(),{checkStaleness:$k}=rc(),{parseFrontmatter:nc,validateSkillFrontmatter:Ak,validateAgentFrontmatter:kk}=Kg();function sc(t){let e=[];if(!Ce.existsSync(t))return e;for(let r of Ce.readdirSync(t,{withFileTypes:!0})){let n=$e.join(t,r.name);r.isDirectory()?e.push(...sc(n)):r.isFile()&&r.name==="SKILL.md"&&e.push(n)}return e}function Fk(t){return Ce.existsSync(t)?Ce.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(".md")).map(e=>$e.join(t,e.name)):[]}var jk=/not for|do not|does not|don't|never\b|audit-only|negative/i;function Ik(t){let e=Ce.readFileSync(t,"utf8"),{frontmatter:r,body:n}=nc(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=typeof r.description=="string"?r.description:"";return jk.test(i)||/##[^\n]*\bnot\b/i.test(n)||/\bdo not (use|include)\b/i.test(n)||s.push("negative-boundary clause"),s}function Tk(t){try{return Ce.accessSync(t,Ce.constants.W_OK),!0}catch{return!1}}function Io(t){let e=process.platform==="win32"?"where":"which";return Qg(e,[t],{stdio:"ignore"}).status===0}function Rk(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=$e.join(t,".rcode");Ce.existsSync(i)?r.push({label:".rcode/ writable",status:Tk(i)?"ok":"fail",message:i}):r.push({label:".rcode/ state",status:"warn",message:"not initialized in this directory (run `rcode install`)"});let o=$e.join(e,"rcode/config/model-profiles.json");if(Ce.existsSync(o))try{let a=JSON.parse(Ce.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"});if(r.push({label:"git CLI",status:Io("git")?"ok":"warn",message:Io("git")?"available":"not found (some features disabled)"}),r.push({label:"gh CLI",status:Io("gh")?"ok":"warn",message:Io("gh")?"available (github-sync ready)":"not found (github-sync unavailable)"}),Ce.existsSync(i)){let a=[];if(Ce.existsSync($e.join(t,".claude/skills"))&&a.push("claude"),Ce.existsSync($e.join(t,".cursor/rules"))&&a.push("cursor"),Ce.existsSync($e.join(t,".windsurf/rules"))&&a.push("windsurf"),Ce.existsSync($e.join(t,".antigravity/agents"))&&a.push("antigravity"),a.length>0){let{reports:c,hasDrift:l}=wk(t,e,a);if(l)r.push({label:"Agent manifest",status:"fail",message:`drift detected across ${a.join(", ")}`,detail:xk(c)});else{let d=c.map(f=>`${f.editor}:${f.installedCount}`).join(" ");r.push({label:"Agent manifest",status:"ok",message:d})}}let u=$k(t);u.status==="fresh"?r.push({label:"Memory bank",status:"ok",message:"fresh"}):u.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 ${u.reasons[0]}${u.reasons.length>1?` (+${u.reasons.length-1} more)`:""}`})}return r}function Pk(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 Ok(t){let e=[$e.join(t,"rcode/skills/agents"),$e.join(t,"rcode/skills/actions")],r=0,n=0,s=[];for(let i of e){let o=sc(i);for(let a of o){r++;let u=Ik(a);if(u.length>0){n++;let c=$e.relative(t,a);s.push({file:c,missing:u})}}}if(s.length>0){console.log(` \u2717 ${n} / ${r} skills are non-compliant:
331
+ `);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 Nk(t){let e=[$e.join(t,"rcode/skills/agents"),$e.join(t,"rcode/skills/actions")],r=0,n=0,s=0,i=0;for(let o of e)for(let a of sc(o)){r++;let{frontmatter:u,body:c}=nc(Ce.readFileSync(a,"utf8")),l=Ak(u,c),d=$e.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 Fk($e.join(t,"rcode/agents"))){n++;let{frontmatter:a}=nc(Ce.readFileSync(o,"utf8")),u=kk(a);if(!u.ok){s++;let c=$e.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 Lk(){let e=require("os").homedir(),r=[],n=[];for(let i of[["npm",["root","-g"]],["pnpm",["root","-g"]]])try{let o=Qg(i[0],i[1],{encoding:"utf8"});o.status===0&&o.stdout.trim()&&n.push({manager:i[0],dir:o.stdout.trim()})}catch{}let s=$e.join(e,".nvm","versions","node");if(Ce.existsSync(s))for(let i of Ce.readdirSync(s)){let o=$e.join(s,i,"lib","node_modules");Ce.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=$e.join(o,a);if(Ce.existsSync(u)){for(let c of Ce.readdirSync(u))if(c==="rcode"||c==="rcode"||c.startsWith("rcode")){let l="unknown";try{l=JSON.parse(Ce.readFileSync($e.join(u,c,"package.json"),"utf8")).version}catch{}r.push({manager:i,scope:a,pkg:c,version:l,dir:$e.join(u,c)})}}}return{count:r.length,installs:r}}function Bk(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(`
332
+ Fix: rcode nuke --yes && npm install -g @hanzlaa/rcode`),1}eD.exports=function(e,{packageRoot:r}){let n=process.cwd();console.log(`
329
333
  \u{1F54C} rcode \u2014 Doctor
330
- `),console.log("Preflight:");let s=_A(n,r),i=EA(s);console.log(`
331
- Duplicate installations:`);let o=CA(),a=wA(o);console.log(`
332
- Package compliance:`);let u=bA(r);console.log(`
333
- Artifact schema validation:`);let c=SA(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)}});var ec=_((tI,zg)=>{var Io=require("fs"),Qu=require("path"),Vg=["new-project","create-prd","discuss-phase","plan","execute-sprint","verify-phase","retrospective","ship"];zg.exports=function(e,{packageRoot:r}){let n=Qu.join(r,"rcode","workflows"),s=e[0];if(!s||s==="list"||s==="--list")return xA(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)),Gg(n,i)}return Gg(n,s)};function xA(t){let e=Io.readdirSync(t).filter(s=>s.endsWith(".md")).map(s=>s.replace(/\.md$/,"")).sort(),r=Vg.filter(s=>e.includes(s)),n=e.filter(s=>!Vg.includes(s));console.log(`\u{1F54C} rcode lifecycle workflows
334
+ `),console.log("Preflight:");let s=Rk(n,r),i=Pk(s);console.log(`
335
+ Duplicate installations:`);let o=Lk(),a=Bk(o);console.log(`
336
+ Package compliance:`);let u=Ok(r);console.log(`
337
+ Artifact schema validation:`);let c=Nk(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)}});var ic=v((gI,sD)=>{var To=require("fs"),oc=require("path"),rD=["new-project","create-prd","discuss-phase","plan","execute-sprint","verify-phase","retrospective","ship"];sD.exports=function(e,{packageRoot:r}){let n=oc.join(r,"rcode","workflows"),s=e[0];if(!s||s==="list"||s==="--list")return Mk(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)),nD(n,i)}return nD(n,s)};function Mk(t){let e=To.readdirSync(t).filter(s=>s.endsWith(".md")).map(s=>s.replace(/\.md$/,"")).sort(),r=rD.filter(s=>e.includes(s)),n=e.filter(s=>!rD.includes(s));console.log(`\u{1F54C} rcode lifecycle workflows
334
338
  `),console.log("Core lifecycle (in order):"),r.forEach(s=>console.log(` rcode workflow show ${s}`)),n.length&&(console.log(`
335
339
  Other workflows:`),n.forEach(s=>console.log(` rcode workflow show ${s}`))),console.log(`
336
- Usage: rcode workflow show <name> \u2014 print the full workflow instructions`)}function Gg(t,e){let r=e.startsWith("rcode-")?e.slice(6):e,n=[Qu.join(t,`${r}.md`),Qu.join(t,`${e}.md`)];for(let i of n)if(Io.existsSync(i)){process.stdout.write(Io.readFileSync(i,"utf8"));return}let s=Io.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 nc=_((rI,Qg)=>{var os=require("fs"),Ro=require("path");function $A(t){for(;t!==require("path").parse(t).root;){if(os.existsSync(Ro.join(t,"package.json")))return t;t=Ro.dirname(t)}throw new Error("Could not find package root")}var AA=$A(__dirname),tc=Ro.join(AA,"rcode/config/model-profiles.json"),To=null;function is(){if(To)return To;if(!os.existsSync(tc))throw new Error(`Model profiles not found at ${tc}`);return To=JSON.parse(os.readFileSync(tc,"utf8")),To}function Kg(){let t=is();return Object.keys(t.profiles)}function rc(t){let r=is().profiles[t];if(!r)throw new Error(`Unknown profile '${t}'. Valid: ${Kg().join(", ")}`);return r}function Po(){return is().default_profile}function Xg(){return is().model_aliases}function Jg(t,e={}){let{profile:r=Po(),overrides:n={}}=e;if(n[t])return Yg(n[t]);let i=rc(r).agents[t];if(!i)throw new Error(`Agent '${t}' not mapped in profile '${r}'. Check rcode/config/model-profiles.json.`);return Yg(i)}function Yg(t){if(t==="inherit")return null;let e=Xg();return e[t]!==void 0?e[t]:t}function FA(t){let e=rc(t),r={};for(let n of Object.keys(e.agents))r[n]=Jg(n,{profile:t});return r}function kA(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
+ Usage: rcode workflow show <name> \u2014 print the full workflow instructions`)}function nD(t,e){let r=e.startsWith("rcode-")?e.slice(6):e,n=[oc.join(t,`${r}.md`),oc.join(t,`${e}.md`)];for(let i of n)if(To.existsSync(i)){process.stdout.write(To.readFileSync(i,"utf8"));return}let s=To.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 cc=v((DI,cD)=>{var is=require("fs"),Po=require("path");function qk(t){for(;t!==require("path").parse(t).root;){if(is.existsSync(Po.join(t,"package.json")))return t;t=Po.dirname(t)}throw new Error("Could not find package root")}var Wk=qk(__dirname),ac=Po.join(Wk,"rcode/config/model-profiles.json"),Ro=null;function as(){if(Ro)return Ro;if(!is.existsSync(ac))throw new Error(`Model profiles not found at ${ac}`);return Ro=JSON.parse(is.readFileSync(ac,"utf8")),Ro}function iD(){let t=as();return Object.keys(t.profiles)}function uc(t){let r=as().profiles[t];if(!r)throw new Error(`Unknown profile '${t}'. Valid: ${iD().join(", ")}`);return r}function Oo(){return as().default_profile}function aD(){return as().model_aliases}function uD(t,e={}){let{profile:r=Oo(),overrides:n={}}=e;if(n[t])return oD(n[t]);let i=uc(r).agents[t];if(!i)throw new Error(`Agent '${t}' not mapped in profile '${r}'. Check rcode/config/model-profiles.json.`);return oD(i)}function oD(t){if(t==="inherit")return null;let e=aD();return e[t]!==void 0?e[t]:t}function Hk(t){let e=uc(t),r={};for(let n of Object.keys(e.agents))r[n]=uD(n,{profile:t});return r}function Zk(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)+`
337
341
  `;i+=s+`
338
342
  `;for(let[o,a]of Object.entries(t))i+=" "+o.padEnd(r)+" \u2502 "+(a??"inherit").padEnd(n)+`
339
- `;return i}function jA(t=process.cwd()){let e=Ro.join(t,".rcode","config.json");if(os.existsSync(e))try{let r=JSON.parse(os.readFileSync(e,"utf8"));return{profile:r.model_profile||Po(),overrides:r.model_overrides||{}}}catch{console.warn("Warning: .rcode/config.json is invalid JSON. Using defaults.")}return{profile:Po(),overrides:{}}}Qg.exports={loadProfiles:is,listProfiles:Kg,getProfile:rc,getDefaultProfile:Po,getModelAliases:Xg,resolveModelForAgent:Jg,getResolvedMapForProfile:FA,formatMapAsTable:kA,getProjectProfile:jA}});var ls=_((nI,nD)=>{var as=require("fs"),IA=require("os"),us=require("path"),{writeJsonAtomic:sc}=Zt(),oc=1,ic={schema_version:oc,installed_version:null,project_name:null,user_name:"Team",communication_language:"English",document_output_language:"English",output_folder:".rcode",planning_artifacts:".rcode/phases",project_knowledge:".rcode/context",model_profile:"balanced",communication_mode:"guided"},Bo=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"]),TA={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"},Oo=new Set(["quality","balanced","budget","inherit"]),No=new Set(["guided","yolo"]);function Mo(){return us.join(IA.homedir(),".rcode","defaults.json")}function qo(t){return us.join(t,".rcode","config.json")}function eD(t){return us.join(t,".rcode","config.yaml")}function tD(t){if(!as.existsSync(t))return null;try{return JSON.parse(as.readFileSync(t,"utf8"))}catch{return null}}function cs(){return tD(Mo())||{}}var RA={mode:"communication_mode"};function PA(t){if(!as.existsSync(t))return null;try{let e={};for(let r of as.readFileSync(t,"utf8").split(`
340
- `)){let n=r.match(/^([a-zA-Z_]+):\s*["']?([^"'\n#]+?)["']?\s*(?:#.*)?$/);if(!n)continue;let s=RA[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 ac(t){let e=tD(qo(t));return e||PA(eD(t))||{}}function rD(t){let e={...ic};e.project_name===null&&(e.project_name=us.basename(t));let r=cs(),n=ac(t);return{...e,...r,...n}}function OA(t,e){return Bo.has(e)?rD(t)[e]:void 0}function NA(t,e={}){let r=qo(t);if(as.existsSync(r))return!1;let n=cs(),s=o=>e[o]!==void 0?e[o]:n[o]!==void 0?n[o]:ic[o],i={schema_version:oc,installed_version:e.installed_version||null,project_name:e.project_name||us.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 sc(r,i),!0}function LA(t){let r={...cs(),...t};sc(Mo(),r)}function BA(t,e,r,{scope:n="project"}={}){if(!Bo.has(e)){let a=TA[e.toLowerCase()]||Lo(e,[...Bo]);return{ok:!1,error:`Unknown config key '${e}'`,suggestion:a}}if(e==="model_profile"&&!Oo.has(r))return{ok:!1,error:`Invalid model_profile '${r}' (valid: ${[...Oo].join(", ")})`,suggestion:Lo(r,[...Oo])};if(e==="communication_mode"&&!No.has(r))return{ok:!1,error:`Invalid communication_mode '${r}' (valid: ${[...No].join(", ")})`,suggestion:Lo(r,[...No])};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=Mo(),i=cs()):(s=qo(t),i=ac(t));let o={...i,[e]:r};return sc(s,o),{ok:!0,scope:n,target:s}}function Lo(t,e){if(!t)return null;let r=t.toLowerCase(),n=null,s=1/0;for(let o of e){let a=MA(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 MA(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:oc,HARDCODED_DEFAULTS:ic,VALID_CONFIG_KEYS:Bo,VALID_MODEL_PROFILES:Oo,VALID_COMMUNICATION_MODES:No,loadConfig:rD,getConfigValue:OA,setConfigValue:BA,initProjectConfig:NA,writeUserDefaults:LA,loadUserDefaults:cs,loadProjectConfig:ac,userLevelPath:Mo,projectLevelPath:qo,projectYamlPath:eD,suggestClosest:Lo}});var oD=_((sI,sD)=>{var qA=require("fs"),WA=require("path"),{listProfiles:HA,getProfile:ZA,getResolvedMapForProfile:UA,formatMapAsTable:VA,getProjectProfile:GA}=nc(),{setConfigValue:zA,getConfigValue:YA}=ls();sD.exports=function(e){let r=process.cwd(),n=WA.join(r,".rcode");qA.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=HA();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=GA(r);if(console.log(`
343
+ `;return i}function Uk(t=process.cwd()){let e=Po.join(t,".rcode","config.json");if(is.existsSync(e))try{let r=JSON.parse(is.readFileSync(e,"utf8"));return{profile:r.model_profile||Oo(),overrides:r.model_overrides||{}}}catch{console.warn("Warning: .rcode/config.json is invalid JSON. Using defaults.")}return{profile:Oo(),overrides:{}}}cD.exports={loadProfiles:as,listProfiles:iD,getProfile:uc,getDefaultProfile:Oo,getModelAliases:aD,resolveModelForAgent:uD,getResolvedMapForProfile:Hk,formatMapAsTable:Zk,getProjectProfile:Uk}});var ds=v((yI,hD)=>{var us=require("fs"),cs=require("path"),{writeJsonAtomic:lc}=zt(),{homedir:Vk}=An(),dc=1,fc={schema_version:dc,installed_version:null,project_name:null,user_name:"Team",communication_language:"English",document_output_language:"English",output_folder:".rcode",planning_artifacts:".rcode/phases",project_knowledge:".rcode/context",model_profile:"balanced",communication_mode:"guided"},Mo=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"]),Gk={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"},No=new Set(["quality","balanced","budget","inherit"]),Lo=new Set(["guided","yolo"]);function qo(){return cs.join(Vk(),".rcode","defaults.json")}function Wo(t){return cs.join(t,".rcode","config.json")}function lD(t){return cs.join(t,".rcode","config.yaml")}function dD(t){if(!us.existsSync(t))return null;try{return JSON.parse(us.readFileSync(t,"utf8"))}catch{return null}}function ls(){return dD(qo())||{}}var zk={mode:"communication_mode"};function Yk(t){if(!us.existsSync(t))return null;try{let e={};for(let r of us.readFileSync(t,"utf8").split(`
344
+ `)){let n=r.match(/^([a-zA-Z_]+):\s*["']?([^"'\n#]+?)["']?\s*(?:#.*)?$/);if(!n)continue;let s=zk[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 hc(t){let e=dD(Wo(t));return e||Yk(lD(t))||{}}function fD(t){let e={...fc};e.project_name===null&&(e.project_name=cs.basename(t));let r=ls(),n=hc(t);return{...e,...r,...n}}function Jk(t,e){return Mo.has(e)?fD(t)[e]:void 0}function Xk(t,e={}){let r=Wo(t);if(us.existsSync(r))return!1;let n=ls(),s=o=>e[o]!==void 0?e[o]:n[o]!==void 0?n[o]:fc[o],i={schema_version:dc,installed_version:e.installed_version||null,project_name:e.project_name||cs.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 lc(r,i),!0}function Kk(t){let r={...ls(),...t};lc(qo(),r)}function Qk(t,e,r,{scope:n="project"}={}){if(!Mo.has(e)){let a=Gk[e.toLowerCase()]||Bo(e,[...Mo]);return{ok:!1,error:`Unknown config key '${e}'`,suggestion:a}}if(e==="model_profile"&&!No.has(r))return{ok:!1,error:`Invalid model_profile '${r}' (valid: ${[...No].join(", ")})`,suggestion:Bo(r,[...No])};if(e==="communication_mode"&&!Lo.has(r))return{ok:!1,error:`Invalid communication_mode '${r}' (valid: ${[...Lo].join(", ")})`,suggestion:Bo(r,[...Lo])};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=qo(),i=ls()):(s=Wo(t),i=hc(t));let o={...i,[e]:r};return lc(s,o),{ok:!0,scope:n,target:s}}function Bo(t,e){if(!t)return null;let r=t.toLowerCase(),n=null,s=1/0;for(let o of e){let a=e1(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 e1(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]}hD.exports={SCHEMA_VERSION:dc,HARDCODED_DEFAULTS:fc,VALID_CONFIG_KEYS:Mo,VALID_MODEL_PROFILES:No,VALID_COMMUNICATION_MODES:Lo,loadConfig:fD,getConfigValue:Jk,setConfigValue:Qk,initProjectConfig:Xk,writeUserDefaults:Kk,loadUserDefaults:ls,loadProjectConfig:hc,userLevelPath:qo,projectLevelPath:Wo,projectYamlPath:lD,suggestClosest:Bo}});var mD=v((vI,pD)=>{var t1=require("fs"),r1=require("path"),{listProfiles:n1,getProfile:s1,getResolvedMapForProfile:o1,formatMapAsTable:i1,getProjectProfile:a1}=cc(),{setConfigValue:u1,getConfigValue:c1}=ds();pD.exports=function(e){let r=process.cwd(),n=r1.join(r,".rcode");t1.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=n1();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=a1(r);if(console.log(`
341
345
  \u{1F54C} Current profile: ${c.profile}
342
- `),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=ZA(l),f=l===c.profile?" \u2190 current":"";console.log(` \u2022 ${l}${f}`),console.log(` ${d.description}`)}console.log(`
343
- Usage: rcode set-profile <name>`);return}let o=YA(r,"model_profile")||"(default)",a=zA(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(`
346
+ `),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=s1(l),f=l===c.profile?" \u2190 current":"";console.log(` \u2022 ${l}${f}`),console.log(` ${d.description}`)}console.log(`
347
+ Usage: rcode set-profile <name>`);return}let o=c1(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(`
344
348
  \u2705 Profile changed: ${o} \u2192 ${s}
345
- `);let u=UA(s);console.log(VA(u)),console.log()}});var cD=_((oI,uD)=>{var KA=require("fs"),XA=require("path"),{loadConfig:iD,setConfigValue:JA,VALID_COMMUNICATION_MODES:uc}=ls(),aD={guided:`Ask questions, confirm at every major gate, halt at decision menus.
349
+ `);let u=o1(s);console.log(i1(u)),console.log()}});var vD=v((_I,yD)=>{var l1=require("fs"),d1=require("path"),{loadConfig:gD,setConfigValue:f1,VALID_COMMUNICATION_MODES:pc}=ds(),DD={guided:`Ask questions, confirm at every major gate, halt at decision menus.
346
350
  Recommended for: first-time use, critical projects, new domains.`,yolo:`Skip menus, use sensible defaults, report decisions in the final summary.
347
351
  Destructive ops (github push, rm, force-push) STILL require
348
352
  explicit confirmation unless you also pass --force-yolo.
349
- Recommended for: experienced solo projects, prototypes, CI.`};uD.exports=function(e){let r=process.cwd(),n=XA.join(r,".rcode");KA.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: ${[...uc].join(", ")}`),process.exit(0)),!s){let u=iD(r).communication_mode||"guided";console.log(`
353
+ Recommended for: experienced solo projects, prototypes, CI.`};yD.exports=function(e){let r=process.cwd(),n=d1.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];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: ${[...pc].join(", ")}`),process.exit(0)),!s){let u=gD(r).communication_mode||"guided";console.log(`
350
354
  \u{1F54C} Communication mode: ${u}
351
- `);for(let c of uc)console.log(` \u2022 ${c}${c===u?" \u2190 current":""}`),console.log(` ${aD[c]}`),console.log();console.log(`Usage: rcode set-mode <${[...uc].join("|")}>`),console.log();return}let i=iD(r).communication_mode||"guided",o=JA(r,"communication_mode",s);o.ok||(console.error(`
355
+ `);for(let c of pc)console.log(` \u2022 ${c}${c===u?" \u2190 current":""}`),console.log(` ${DD[c]}`),console.log();console.log(`Usage: rcode set-mode <${[...pc].join("|")}>`),console.log();return}let i=gD(r).communication_mode||"guided",o=f1(r,"communication_mode",s);o.ok||(console.error(`
352
356
  \u274C ${o.error}`),o.suggestion&&console.error(` Did you mean '${o.suggestion}'?`),console.error(),process.exit(1)),console.log(`
353
- \u2705 Communication mode: ${i} \u2192 ${s}`),console.log(),console.log(` ${aD[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 mD=_((aI,pD)=>{var lD=require("fs"),dD=require("path"),{loadConfig:QA,loadUserDefaults:eF,loadProjectConfig:tF,setConfigValue:rF,getConfigValue:nF,VALID_CONFIG_KEYS:cc,HARDCODED_DEFAULTS:iI,userLevelPath:fD,projectLevelPath:hD}=ls();function sF(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 oF(t,e){let r=tF(t);if(e in r)return"project";let n=eF();return e in n?"user":"default"}function iF(t){let e=QA(t),r=[...cc],n=Math.max(...r.map(i=>i.length)),s=Math.max(...r.map(i=>String(e[i]??"").length),5);console.log(`
357
+ \u2705 Communication mode: ${i} \u2192 ${s}`),console.log(),console.log(` ${DD[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 wD=v((SI,CD)=>{var _D=require("fs"),ED=require("path"),{loadConfig:h1,loadUserDefaults:p1,loadProjectConfig:m1,setConfigValue:g1,getConfigValue:D1,VALID_CONFIG_KEYS:mc,HARDCODED_DEFAULTS:EI,userLevelPath:SD,projectLevelPath:bD}=ds();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 v1(t,e){let r=m1(t);if(e in r)return"project";let n=p1();return e in n?"user":"default"}function _1(t){let e=h1(t),r=[...mc],n=Math.max(...r.map(i=>i.length)),s=Math.max(...r.map(i=>String(e[i]??"").length),5);console.log(`
354
358
  \u{1F54C} rcode \u2014 configuration
355
- `),console.log(` Project: ${hD(t)}`),console.log(` User: ${fD()}
356
- `),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=oF(t,i);console.log(` ${i.padEnd(n)} ${String(o??"").padEnd(s)} ${a}`)}console.log()}pD.exports=function(e){let r=process.cwd(),n=sF(e);if(n.positional.length===0||n.list){let s=dD.join(r,".rcode");!lD.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)),iF(r);return}if(n.positional.length===1){let s=n.positional[0];cc.has(s)||(console.error(`\u274C Unknown config key '${s}'`),console.error(` Valid keys: ${[...cc].join(", ")}`),process.exit(1));let i=nF(r,s);console.log(i??"");return}if(n.positional.length===2){let[s,i]=n.positional,o=n.global?"global":"project";o==="project"&&!lD.existsSync(dD.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=rF(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"?fD():hD(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 vD=_((cI,yD)=>{var tn=require("fs"),Wo=require("path"),{computeFingerprint:uI,writeFingerprint:aF,checkStaleness:gD,commitsBetween:uF,STALE_THRESHOLDS:cF}=Ku();function lF(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 DD(t){tn.existsSync(Wo.join(t,".rcode"))||(console.error(`\u274C No .rcode/ directory found in ${t}`),console.error(" Run 'rcode install' first."),process.exit(1))}function dF(t){let e=gD(t),r=e.status==="fresh"?"\u2713":e.status==="stale"?"\u26A0":"\u2717",n=e.status.toUpperCase();if(console.log(`
359
+ `),console.log(` Project: ${bD(t)}`),console.log(` User: ${SD()}
360
+ `),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=v1(t,i);console.log(` ${i.padEnd(n)} ${String(o??"").padEnd(s)} ${a}`)}console.log()}CD.exports=function(e){let r=process.cwd(),n=y1(e);if(n.positional.length===0||n.list){let s=ED.join(r,".rcode");!_D.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)),_1(r);return}if(n.positional.length===1){let s=n.positional[0];mc.has(s)||(console.error(`\u274C Unknown config key '${s}'`),console.error(` Valid keys: ${[...mc].join(", ")}`),process.exit(1));let i=D1(r,s);console.log(i??"");return}if(n.positional.length===2){let[s,i]=n.positional,o=n.global?"global":"project";o==="project"&&!_D.existsSync(ED.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"?SD():bD(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 kD=v((CI,AD)=>{var tn=require("fs"),Ho=require("path"),{computeFingerprint:bI,writeFingerprint:E1,checkStaleness:xD,commitsBetween:S1,STALE_THRESHOLDS:b1}=rc();function C1(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 $D(t){tn.existsSync(Ho.join(t,".rcode"))||(console.error(`\u274C No .rcode/ directory found in ${t}`),console.error(" Run 'rcode install' first."),process.exit(1))}function w1(t){let e=xD(t),r=e.status==="fresh"?"\u2713":e.status==="stale"?"\u26A0":"\u2717",n=e.status.toUpperCase();if(console.log(`
357
361
  \u{1F9E0} Memory bank status: ${r} ${n}
358
- `),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=uF(t,e.stored.git_head,e.current.git_head);o!==null&&console.log(`
359
- Commits since init: ${o} (threshold: ${cF.commitsSinceInit})`)}console.log(),e.status!=="fresh"&&(console.log(" \u27A1 Refresh with: /rcode-init (in your editor)"),console.log())}function fF(t){DD(t);let e=aF(t);console.log(`
360
- \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 hF(t){let e=Wo.join(t,".git");tn.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=Wo.join(e,"hooks");tn.mkdirSync(r,{recursive:!0});let n=Wo.join(r,"post-commit"),s=`#!/bin/sh
362
+ `),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=S1(t,e.stored.git_head,e.current.git_head);o!==null&&console.log(`
363
+ Commits since init: ${o} (threshold: ${b1.commitsSinceInit})`)}console.log(),e.status!=="fresh"&&(console.log(" \u27A1 Refresh with: /rcode-init (in your editor)"),console.log())}function x1(t){$D(t);let e=E1(t);console.log(`
364
+ \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 $1(t){let e=Ho.join(t,".git");tn.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=Ho.join(e,"hooks");tn.mkdirSync(r,{recursive:!0});let n=Ho.join(r,"post-commit"),s=`#!/bin/sh
361
365
  # rcode \u2014 memory bank freshness check
362
366
  # Installed by: rcode context --install-hook
363
367
  # Non-blocking: prints a one-line warning if the memory bank is stale.
@@ -369,39 +373,39 @@ if command -v rcode >/dev/null 2>&1; then
369
373
  echo " $(echo "$output" | grep '\u2022' | head -1 | sed 's/^ *//')"
370
374
  fi
371
375
  fi
372
- `;if(tn.existsSync(n)){if(tn.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)}tn.writeFileSync(n,s),tn.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=lF(e);if(n.installHook){hF(r);return}if(n.refresh){fF(r);return}DD(r),dF(r),n.check&&gD(r).status!=="fresh"&&process.exit(1)}});var SD=_((lI,bD)=>{var{listProfiles:_D,getProfile:pF,resolveModelForAgent:ED,getResolvedMapForProfile:mF,formatMapAsTable:gF,getProjectProfile:DF}=nc();function yF(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}bD.exports=function(e){let r=yF(e),n=DF(),s=r.profile||n.profile;_D().includes(s)||(console.error(`\u274C Unknown profile '${s}'`),console.error(` Available: ${_D().join(", ")}`),process.exit(1));let i=pF(s);if(r.agent){try{let a=ED(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
+ `;if(tn.existsSync(n)){if(tn.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)}tn.writeFileSync(n,s),tn.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}`)}AD.exports=function(e){let r=process.cwd(),n=C1(e);if(n.installHook){$1(r);return}if(n.refresh){x1(r);return}$D(r),w1(r),n.check&&xD(r).status!=="fresh"&&process.exit(1)}});var TD=v((wI,ID)=>{var{listProfiles:FD,getProfile:A1,resolveModelForAgent:jD,getResolvedMapForProfile:k1,formatMapAsTable:F1,getProjectProfile:j1}=cc();function I1(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}ID.exports=function(e){let r=I1(e),n=j1(),s=r.profile||n.profile;FD().includes(s)||(console.error(`\u274C Unknown profile '${s}'`),console.error(` Available: ${FD().join(", ")}`),process.exit(1));let i=A1(s);if(r.agent){try{let a=jD(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(`
373
377
  \u{1F54C} Profile: ${s}`),console.log(` ${i.description}
374
- `);let o=mF(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=ED(a,{profile:s,overrides:n.overrides});o[a]=c,console.log(` ${a} \u2192 ${u} (resolved: ${c??"inherit"})`)}console.log()}console.log(gF(o))}});var xD=_((fI,wD)=>{var{execSync:dI,spawnSync:CD}=require("child_process");function vF(t){return t?t.replace(/\b(ghp_|ghs_|github_pat_)[A-Za-z0-9_]{10,}\b/g,"[REDACTED]").slice(0,2e3):""}function Ge(t,{input:e=null,allowFailure:r=!1}={}){let n=CD("gh",t,{encoding:"utf8",input:e,stdio:e?["pipe","pipe","pipe"]:["ignore","pipe","pipe"]});if(n.status!==0&&!r){let s=vF(n.stderr||n.stdout||"(no output)");throw new Error(`gh ${t.join(" ")} failed:
375
- ${s}`)}return{status:n.status,stdout:n.stdout||"",stderr:n.stderr||""}}function _F(){try{let t=Ge(["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 EF(t=process.cwd()){try{let e=CD("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 bF(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=Ge(["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=Ge(o,{allowFailure:!0});return{created:a.status===0,name:t,error:a.status!==0?a.stderr:null}}function SF(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=Ge(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 CF(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=Ge(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 wF({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=Ge(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 xF(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=Ge(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=Ge(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=Ge(f,{allowFailure:!0});g.status!==0&&l.push(`reopen: ${g.stderr}`)}return l.length>0?{error:l.join("; ")}:{updated:!0,number:t}}function $F(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=Ge(c,{allowFailure:!0});return l.status!==0?{error:l.stderr}:{updated:!0,number:t}}function AF(t,{execute:e=!0}={}){let r=Ge(["project","list","--owner",t,"--format","json"],{allowFailure:!0});if(r.status!==0)return null;try{return JSON.parse(r.stdout)}catch{return null}}function FF(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=Ge(["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=Ge(["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 jF(){try{let t=Ge(["api","rate_limit"],{allowFailure:!0});return t.status!==0?null:JSON.parse(t.stdout)}catch{return null}}wD.exports={runGh:Ge,checkAuth:_F,detectRepo:EF,ensureLabel:bF,createMilestone:SF,updateMilestone:$F,getIssue:CF,createIssue:wF,updateIssue:xF,listProjects:AF,createProject:FF,addIssueToProject:kF,getRateLimit:jF}});var kD=_((hI,FD)=>{var We=require("fs"),Ft=require("path"),IF=require("crypto"),At=xD(),{askText:TF,PromptAbortError:RF}=ts(),{writeJsonAtomic:PF}=Zt(),{loadConfig:OF}=ls();function $n(t){return IF.createHash("sha256").update(t||"").digest("hex").slice(0,12)}function NF(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 $D(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 LF(t){if(!t)return{};let e={},r=null;for(let n of t.split(/\r?\n/)){let s=n.match(/^##\s+Sprint\s+(\S+)/i);if(s){r=`sprint-${s[1].replace(/[^\w-]/g,"")}`,e[r]=[];continue}if(r){let i=n.match(/^\s*-\s*\[[ xX]\]\s+(\S+)/);i&&e[r].push(i[1])}}return e}function BF(t){let e=Ft.join(t,".rcode/state.json");if(!We.existsSync(e))return null;try{return JSON.parse(We.readFileSync(e,"utf8"))}catch{return null}}function MF(t){let e=Ft.join(t,".rcode/phases");if(!We.existsSync(e))return[];let r=[];for(let n of We.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let s=Ft.join(e,n.name),i=Ft.join(s,"brief.md"),o=Ft.join(s,"sprints.md"),a=Ft.join(s,"stories"),u=Ft.join(s,"tasks"),c=We.existsSync(o)?We.readFileSync(o,"utf8"):null,l={id:n.name,brief:We.existsSync(i)?We.readFileSync(i,"utf8"):null,sprints:c,sprintMap:LF(c),stories:[],epics:[]};if(We.existsSync(a))for(let d of We.readdirSync(a)){if(!d.endsWith(".md"))continue;let f=We.readFileSync(Ft.join(a,d),"utf8"),g=$D(f),m=d.replace(".md",""),D=g.epic||null;if(!D){let C=m.match(/^story-(\d+)/);C&&(D=`epic-${C[1]}`)}let h=g.sprint||null;if(!h){for(let[C,b]of Object.entries(l.sprintMap))if(b.some(I=>I===m||m.startsWith(I))){h=C;break}}l.stories.push({id:m,file:d,content:f,title:AD(f)||m,parentEpic:D,sprintId:h,frontmatter:g})}if(We.existsSync(u))for(let d of We.readdirSync(u)){if(!d.endsWith(".md"))continue;let f=We.readFileSync(Ft.join(u,d),"utf8"),g=$D(f);l.epics.push({id:d.replace(".md",""),file:d,content:f,title:AD(f)||d.replace(".md",""),frontmatter:g})}r.push(l)}return r}function qF(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)for(let n of r){n.stories=n.stories.filter(i=>i.sprintId===e.sprint);let s=new Set(n.stories.map(i=>i.parentEpic).filter(Boolean));n.epics=n.epics.filter(i=>s.has(i.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)}function AD(t){let e=t.match(/^#\s+(.+)$/m);return e?e[1].trim():null}function WF(t){let e=Ft.join(t,".rcode/integrations/github-map.json");if(!We.existsSync(e))return{phases:{},epics:{},stories:{},project:null,labels:[]};try{return JSON.parse(We.readFileSync(e,"utf8"))}catch{return{phases:{},epics:{},stories:{},project:null,labels:[]}}}function ds(t,e){let r=Ft.join(t,".rcode/integrations/github-map.json");PF(r,e)}async function HF(t){let e=NF(t),r=process.cwd(),s=OF(r).communication_mode||"guided";console.log(`
376
- \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=At.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=At.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=BF(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=MF(r);if(e.phase&&(u=u.filter(h=>h.id===e.phase),u.length===0&&(console.error(`\u274C Phase '${e.phase}' not found.`),process.exit(1))),u=qF(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 .rcode/phases/ \u2014 nothing to sync."),console.log(" Run 'rcode init' or create a phase 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=WF(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=>!c.phases[h.id]),epics:u.flatMap(h=>h.epics.filter(C=>!c.epics[C.id]).map(C=>({...C,phase:h.id}))),stories:u.flatMap(h=>h.stories.filter(C=>!c.stories[C.id]).map(C=>({...C,phase:h.id}))),updateEpics:e.updateEnabled?u.flatMap(h=>h.epics.filter(C=>c.epics[C.id]).map(C=>({...C,phase:h.id,issueNumber:c.epics[C.id].issue_number,lastSyncedAt:c.epics[C.id].synced_at,lastSyncedContentHash:c.epics[C.id].content_hash}))):[],updateStories:e.updateEnabled?u.flatMap(h=>h.stories.filter(C=>c.stories[C.id]).map(C=>({...C,phase:h.id,issueNumber:c.stories[C.id].issue_number,lastSyncedAt:c.stories[C.id].synced_at,lastSyncedContentHash:c.stories[C.id].content_hash}))):[]};console.log(`
377
- \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 C=await TF(" Proceed? Type 'yes' to continue: ",{default:"no",validate:b=>{let I=b.toLowerCase();return["yes","y","no","n"].includes(I)?!0:"Please type 'yes' to confirm, or 'no' to abort."}});["yes","y"].includes(C.toLowerCase())||(console.log(`
378
- \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(`
379
- \u{1F3F7}\uFE0F Labels`);for(let h of d.labels){let C=At.ensureLabel(h.name,h.color,h.description,D);m.labels.push(C),C.error?m.errors.push(`label ${h.name}: ${C.error}`):C.dryRun||(c.labels.includes(h.name)||c.labels.push(h.name),e.execute&&ds(r,c),console.log(` \u2713 ${C.existed?"exists":"created"}: ${h.name}`))}}if(!e.only||e.only==="milestones"){console.log(`
380
- \u{1F3AF} Milestones (phases)`);for(let h of d.milestones){let C=h.brief?h.brief.split(`
378
+ `);let o=k1(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=jD(a,{profile:s,overrides:n.overrides});o[a]=c,console.log(` ${a} \u2192 ${u} (resolved: ${c??"inherit"})`)}console.log()}console.log(F1(o))}});var OD=v(($I,PD)=>{var{execSync:xI,spawnSync:RD}=require("child_process");function T1(t){return t?t.replace(/\b(ghp_|ghs_|github_pat_)[A-Za-z0-9_]{10,}\b/g,"[REDACTED]").slice(0,2e3):""}function ze(t,{input:e=null,allowFailure:r=!1}={}){let n=RD("gh",t,{encoding:"utf8",input:e,stdio:e?["pipe","pipe","pipe"]:["ignore","pipe","pipe"]});if(n.status!==0&&!r){let s=T1(n.stderr||n.stdout||"(no output)");throw new Error(`gh ${t.join(" ")} failed:
379
+ ${s}`)}return{status:n.status,stdout:n.stdout||"",stderr:n.stderr||""}}function R1(){try{let t=ze(["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 P1(t=process.cwd()){try{let e=RD("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 O1(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=ze(["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=ze(o,{allowFailure:!0});return{created:a.status===0,name:t,error:a.status!==0?a.stderr:null}}function N1(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=ze(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 L1(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=ze(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 B1({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=ze(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 M1(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=ze(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=ze(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=ze(f,{allowFailure:!0});g.status!==0&&l.push(`reopen: ${g.stderr}`)}return l.length>0?{error:l.join("; ")}:{updated:!0,number:t}}function q1(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=ze(c,{allowFailure:!0});return l.status!==0?{error:l.stderr}:{updated:!0,number:t}}function W1(t,{execute:e=!0}={}){let r=ze(["project","list","--owner",t,"--format","json"],{allowFailure:!0});if(r.status!==0)return null;try{return JSON.parse(r.stdout)}catch{return null}}function H1(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=ze(["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 Z1(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=ze(["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 U1(){try{let t=ze(["api","rate_limit"],{allowFailure:!0});return t.status!==0?null:JSON.parse(t.stdout)}catch{return null}}PD.exports={runGh:ze,checkAuth:R1,detectRepo:P1,ensureLabel:O1,createMilestone:N1,updateMilestone:q1,getIssue:L1,createIssue:B1,updateIssue:M1,listProjects:W1,createProject:H1,addIssueToProject:Z1,getRateLimit:U1}});var MD=v((AI,BD)=>{var We=require("fs"),jt=require("path"),V1=require("crypto"),Ft=OD(),{askText:G1,PromptAbortError:z1}=rs(),{writeJsonAtomic:Y1}=zt(),{loadConfig:J1}=ds();function $n(t){return V1.createHash("sha256").update(t||"").digest("hex").slice(0,12)}function X1(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 ND(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 K1(t){if(!t)return{};let e={},r=null;for(let n of t.split(/\r?\n/)){let s=n.match(/^##\s+Sprint\s+(\S+)/i);if(s){r=`sprint-${s[1].replace(/[^\w-]/g,"")}`,e[r]=[];continue}if(r){let i=n.match(/^\s*-\s*\[[ xX]\]\s+(\S+)/);i&&e[r].push(i[1])}}return e}function Q1(t){let e=jt.join(t,".rcode/state.json");if(!We.existsSync(e))return null;try{return JSON.parse(We.readFileSync(e,"utf8"))}catch{return null}}function eF(t){let e=jt.join(t,".rcode/phases");if(!We.existsSync(e))return[];let r=[];for(let n of We.readdirSync(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let s=jt.join(e,n.name),i=jt.join(s,"brief.md"),o=jt.join(s,"sprints.md"),a=jt.join(s,"stories"),u=jt.join(s,"tasks"),c=We.existsSync(o)?We.readFileSync(o,"utf8"):null,l={id:n.name,brief:We.existsSync(i)?We.readFileSync(i,"utf8"):null,sprints:c,sprintMap:K1(c),stories:[],epics:[]};if(We.existsSync(a))for(let d of We.readdirSync(a)){if(!d.endsWith(".md"))continue;let f=We.readFileSync(jt.join(a,d),"utf8"),g=ND(f),m=d.replace(".md",""),y=g.epic||null;if(!y){let C=m.match(/^story-(\d+)/);C&&(y=`epic-${C[1]}`)}let p=g.sprint||null;if(!p){for(let[C,S]of Object.entries(l.sprintMap))if(S.some(I=>I===m||m.startsWith(I))){p=C;break}}l.stories.push({id:m,file:d,content:f,title:LD(f)||m,parentEpic:y,sprintId:p,frontmatter:g})}if(We.existsSync(u))for(let d of We.readdirSync(u)){if(!d.endsWith(".md"))continue;let f=We.readFileSync(jt.join(u,d),"utf8"),g=ND(f);l.epics.push({id:d.replace(".md",""),file:d,content:f,title:LD(f)||d.replace(".md",""),frontmatter:g})}r.push(l)}return r}function tF(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)for(let n of r){n.stories=n.stories.filter(i=>i.sprintId===e.sprint);let s=new Set(n.stories.map(i=>i.parentEpic).filter(Boolean));n.epics=n.epics.filter(i=>s.has(i.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)}function LD(t){let e=t.match(/^#\s+(.+)$/m);return e?e[1].trim():null}function rF(t){let e=jt.join(t,".rcode/integrations/github-map.json");if(!We.existsSync(e))return{phases:{},epics:{},stories:{},project:null,labels:[]};try{return JSON.parse(We.readFileSync(e,"utf8"))}catch{return{phases:{},epics:{},stories:{},project:null,labels:[]}}}function fs(t,e){let r=jt.join(t,".rcode/integrations/github-map.json");Y1(r,e)}async function nF(t){let e=X1(t),r=process.cwd(),s=J1(r).communication_mode||"guided";console.log(`
380
+ \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=Ft.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 p=Ft.detectRepo(r);p||(console.error("\u274C Could not detect GitHub repo. Run from a git repo or pass --repo=owner/name"),process.exit(1)),o=p.nameWithOwner}console.log(` \u2713 Target repo: ${o}`);let a=Q1(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=eF(r);if(e.phase&&(u=u.filter(p=>p.id===e.phase),u.length===0&&(console.error(`\u274C Phase '${e.phase}' not found.`),process.exit(1))),u=tF(u,e),u.length===0){if(e.sprint||e.epic||e.story){let p=e.sprint?`sprint '${e.sprint}'`:e.epic?`epic '${e.epic}'`:`story '${e.story}'`;console.error(`\u274C No items matched ${p}.`),console.error(" Check the filter value or run without filters to see available ids."),process.exit(1)}console.log("\u2139 No phases found in .rcode/phases/ \u2014 nothing to sync."),console.log(" Run 'rcode init' or create a phase to get started."),process.exit(0)}console.log(` \u2713 Phases found: ${u.length}`);for(let p of u)console.log(` - ${p.id} (${p.epics.length} epics, ${p.stories.length} stories)`);let c=rF(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(p=>!c.phases[p.id]),epics:u.flatMap(p=>p.epics.filter(C=>!c.epics[C.id]).map(C=>({...C,phase:p.id}))),stories:u.flatMap(p=>p.stories.filter(C=>!c.stories[C.id]).map(C=>({...C,phase:p.id}))),updateEpics:e.updateEnabled?u.flatMap(p=>p.epics.filter(C=>c.epics[C.id]).map(C=>({...C,phase:p.id,issueNumber:c.epics[C.id].issue_number,lastSyncedAt:c.epics[C.id].synced_at,lastSyncedContentHash:c.epics[C.id].content_hash}))):[],updateStories:e.updateEnabled?u.flatMap(p=>p.stories.filter(C=>c.stories[C.id]).map(C=>({...C,phase:p.id,issueNumber:c.stories[C.id].issue_number,lastSyncedAt:c.stories[C.id].synced_at,lastSyncedContentHash:c.stories[C.id].content_hash}))):[]};console.log(`
381
+ \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 p=d.labels.length+d.milestones.length+d.epics.length+d.stories.length;console.log(` Items to create: ${p}`),(e.sprint||e.epic||e.story)&&console.log(` Granular filter: ${e.sprint||e.epic||e.story}`),console.log();let C=await G1(" Proceed? Type 'yes' to continue: ",{default:"no",validate:S=>{let I=S.toLowerCase();return["yes","y","no","n"].includes(I)?!0:"Please type 'yes' to confirm, or 'no' to abort."}});["yes","y"].includes(C.toLowerCase())||(console.log(`
382
+ \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(`
383
+ \u{1F3F7}\uFE0F Labels`);for(let p of d.labels){let C=Ft.ensureLabel(p.name,p.color,p.description,y);m.labels.push(C),C.error?m.errors.push(`label ${p.name}: ${C.error}`):C.dryRun||(c.labels.includes(p.name)||c.labels.push(p.name),e.execute&&fs(r,c),console.log(` \u2713 ${C.existed?"exists":"created"}: ${p.name}`))}}if(!e.only||e.only==="milestones"){console.log(`
384
+ \u{1F3AF} Milestones (phases)`);for(let p of d.milestones){let C=p.brief?p.brief.split(`
381
385
  `).slice(0,5).join(`
382
- `):"rcode phase",b=At.createMilestone(h.id,C,null,D);m.milestones.push({phase:h.id,...b}),b.error?m.errors.push(`milestone ${h.id}: ${b.error}`):b.dryRun||(c.phases[h.id]={milestone_number:b.number,milestone_id:b.id,url:b.url,synced_at:new Date().toISOString()},e.execute&&ds(r,c),console.log(` \u2713 created: ${h.id} \u2192 milestone #${b.number}`))}}if(!e.only||e.only==="epics"){console.log(`
383
- \u{1F4E6} Epics`);for(let h of d.epics){let C=["## \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:** \`.rcode/phases/${h.phase}/tasks/${h.file}\``,"- **Synced by:** rcode github-sync","","## \u{1F4DD} Child Stories","","_Child story issues will be appended here after they are created._"].join(`
384
- `),b=c.phases[h.phase]&&c.phases[h.phase].milestone_number,I=At.createIssue({title:`[Epic] ${h.title}`,body:C,labels:e.withLabels?["epic","priority:medium","status:backlog"]:[],milestone:b},D);m.epics.push({epic:h.id,...I}),I.error?m.errors.push(`epic ${h.id}: ${I.error}`):I.dryRun||(c.epics[h.id]={issue_number:I.number,url:I.url,phase:h.phase,synced_at:new Date().toISOString(),content_hash:$n(h.content),child_story_issues:[]},e.execute&&ds(r,c),console.log(` \u2713 created: ${h.id} \u2192 #${I.number}`))}}if(!e.only||e.only==="stories"){console.log(`
385
- \u{1F4C4} Stories`);for(let h of d.stories){let C=h.parentEpic?c.epics[h.parentEpic]:null,b=C?`- **Parent Epic:** #${C.issue_number} (Part of this epic)`:h.parentEpic?`- **Parent Epic:** \`${h.parentEpic}\` (not yet synced to GitHub)`:"- **Parent Epic:** (standalone \u2014 no parent epic)",I=h.sprintId?`- **Sprint:** \`${h.sprintId}\``:"- **Sprint:** (not assigned to a sprint)",R=["## \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","",b,I,`- **Phase:** \`${h.phase}\``,`- **Source:** \`.rcode/phases/${h.phase}/stories/${h.file}\``,"- **Synced by:** rcode github-sync","","> **Linking:** Reference this story in commits with `refs #{issue}`","> or close it via PR with `Closes #{issue}`."].join(`
386
- `),q=c.phases[h.phase]&&c.phases[h.phase].milestone_number,j=At.createIssue({title:h.title,body:R,labels:e.withLabels?["type:feature","priority:medium","status:backlog"]:[],milestone:q},D);m.stories.push({story:h.id,...j}),j.error?m.errors.push(`story ${h.id}: ${j.error}`):j.dryRun||(c.stories[h.id]={issue_number:j.number,url:j.url,phase:h.phase,parent_epic:h.parentEpic||null,sprint_id:h.sprintId||null,synced_at:new Date().toISOString(),content_hash:$n(h.content)},e.execute&&ds(r,c),C&&(C.child_story_issues=C.child_story_issues||[],C.child_story_issues.includes(j.number)||C.child_story_issues.push(j.number)),console.log(` \u2713 created: ${h.id} \u2192 #${j.number}`))}}if(e.execute&&(!e.only||e.only==="epics"||e.only==="stories")){let h=Object.entries(c.epics).filter(([,C])=>C.child_story_issues&&C.child_story_issues.length>0);if(h.length>0){console.log(`
387
- \u{1F517} Linking stories \u2192 epics (task lists)`);for(let[C,b]of h){let I=b.child_story_issues.sort((re,$)=>re-$).map(re=>`- [ ] #${re}`).join(`
388
- `),R=At.getIssue(b.issue_number,{repo:o});if(R.error){m.errors.push(`link epic #${b.issue_number}: ${R.error}`);continue}let q=R.body||"",j,P=/## 📝 Child Stories[\s\S]*?(?=\n## |$)/,k=`## \u{1F4DD} Child Stories
386
+ `):"rcode phase",S=Ft.createMilestone(p.id,C,null,y);m.milestones.push({phase:p.id,...S}),S.error?m.errors.push(`milestone ${p.id}: ${S.error}`):S.dryRun||(c.phases[p.id]={milestone_number:S.number,milestone_id:S.id,url:S.url,synced_at:new Date().toISOString()},e.execute&&fs(r,c),console.log(` \u2713 created: ${p.id} \u2192 milestone #${S.number}`))}}if(!e.only||e.only==="epics"){console.log(`
387
+ \u{1F4E6} Epics`);for(let p of d.epics){let C=["## \u{1F3AF} Epic Vision","","_Strategic goal this Epic contributes to._","","## \u{1F4CB} Source Content","",p.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${p.phase}\``,`- **Source:** \`.rcode/phases/${p.phase}/tasks/${p.file}\``,"- **Synced by:** rcode github-sync","","## \u{1F4DD} Child Stories","","_Child story issues will be appended here after they are created._"].join(`
388
+ `),S=c.phases[p.phase]&&c.phases[p.phase].milestone_number,I=Ft.createIssue({title:`[Epic] ${p.title}`,body:C,labels:e.withLabels?["epic","priority:medium","status:backlog"]:[],milestone:S},y);m.epics.push({epic:p.id,...I}),I.error?m.errors.push(`epic ${p.id}: ${I.error}`):I.dryRun||(c.epics[p.id]={issue_number:I.number,url:I.url,phase:p.phase,synced_at:new Date().toISOString(),content_hash:$n(p.content),child_story_issues:[]},e.execute&&fs(r,c),console.log(` \u2713 created: ${p.id} \u2192 #${I.number}`))}}if(!e.only||e.only==="stories"){console.log(`
389
+ \u{1F4C4} Stories`);for(let p of d.stories){let C=p.parentEpic?c.epics[p.parentEpic]:null,S=C?`- **Parent Epic:** #${C.issue_number} (Part of this epic)`:p.parentEpic?`- **Parent Epic:** \`${p.parentEpic}\` (not yet synced to GitHub)`:"- **Parent Epic:** (standalone \u2014 no parent epic)",I=p.sprintId?`- **Sprint:** \`${p.sprintId}\``:"- **Sprint:** (not assigned to a sprint)",P=["## \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","",p.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",S,I,`- **Phase:** \`${p.phase}\``,`- **Source:** \`.rcode/phases/${p.phase}/stories/${p.file}\``,"- **Synced by:** rcode github-sync","","> **Linking:** Reference this story in commits with `refs #{issue}`","> or close it via PR with `Closes #{issue}`."].join(`
390
+ `),W=c.phases[p.phase]&&c.phases[p.phase].milestone_number,F=Ft.createIssue({title:p.title,body:P,labels:e.withLabels?["type:feature","priority:medium","status:backlog"]:[],milestone:W},y);m.stories.push({story:p.id,...F}),F.error?m.errors.push(`story ${p.id}: ${F.error}`):F.dryRun||(c.stories[p.id]={issue_number:F.number,url:F.url,phase:p.phase,parent_epic:p.parentEpic||null,sprint_id:p.sprintId||null,synced_at:new Date().toISOString(),content_hash:$n(p.content)},e.execute&&fs(r,c),C&&(C.child_story_issues=C.child_story_issues||[],C.child_story_issues.includes(F.number)||C.child_story_issues.push(F.number)),console.log(` \u2713 created: ${p.id} \u2192 #${F.number}`))}}if(e.execute&&(!e.only||e.only==="epics"||e.only==="stories")){let p=Object.entries(c.epics).filter(([,C])=>C.child_story_issues&&C.child_story_issues.length>0);if(p.length>0){console.log(`
391
+ \u{1F517} Linking stories \u2192 epics (task lists)`);for(let[C,S]of p){let I=S.child_story_issues.sort((re,$)=>re-$).map(re=>`- [ ] #${re}`).join(`
392
+ `),P=Ft.getIssue(S.issue_number,{repo:o});if(P.error){m.errors.push(`link epic #${S.issue_number}: ${P.error}`);continue}let W=P.body||"",F,R=/## 📝 Child Stories[\s\S]*?(?=\n## |$)/,j=`## \u{1F4DD} Child Stories
389
393
 
390
394
  ${I}
391
- `;P.test(q)?j=q.replace(P,k):j=q.trimEnd()+`
392
-
393
- `+k;let M=At.updateIssue(b.issue_number,{body:j},D);M.error?m.errors.push(`update epic #${b.issue_number}: ${M.error}`):console.log(` \u2713 linked ${b.child_story_issues.length} stories \u2192 epic #${b.issue_number}`)}}}if(e.updateEnabled&&(!e.only||e.only==="epics")&&d.updateEpics.length>0){console.log(`
394
- \u{1F504} Update existing epics`);for(let h of d.updateEpics){let C=$n(h.content);if(C===h.lastSyncedContentHash)continue;let b=["## \u{1F3AF} Epic Vision","",`_Strategic goal this Epic contributes to. Fill in from \`.rcode/phases/${h.phase}/tasks/${h.file}\`._`,"","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${h.phase}\``,`- **Source:** \`.rcode/phases/${h.phase}/tasks/${h.file}\``,`- **Last synced:** ${new Date().toISOString()}`].join(`
395
- `),I=At.updateIssue(h.issueNumber,{title:e.updateBody?`[Epic] ${h.title}`:void 0,body:e.updateBody?b:void 0},D);I.error?m.errors.push(`update epic #${h.issueNumber}: ${I.error}`):I.dryRun||(c.epics[h.id].content_hash=C,c.epics[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(`
396
- \u{1F504} Update existing stories`);for(let h of d.updateStories){let C=$n(h.content);if(C===h.lastSyncedContentHash)continue;let b=["## \u{1F3AF} Problem Statement","",`_From \`.rcode/phases/${h.phase}/stories/${h.file}\`._`,"","## \u{1F4CB} Source Content","",h.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${h.phase}\``,`- **Source:** \`.rcode/phases/${h.phase}/stories/${h.file}\``,`- **Last synced:** ${new Date().toISOString()}`].join(`
397
- `),I=At.updateIssue(h.issueNumber,{title:e.updateBody?h.title:void 0,body:e.updateBody?b:void 0},D);I.error?m.errors.push(`update story #${h.issueNumber}: ${I.error}`):I.dryRun||(c.stories[h.id].content_hash=C,c.stories[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(`
398
- \u{1F4CA} Project v2`);let h=o.split("/")[0],C=a.project_name||o.split("/")[1],b=At.createProject(h,C,D);b.error?m.errors.push(`project: ${b.error}`):b.dryRun||(c.project={number:b.number,url:b.url,synced_at:new Date().toISOString()},console.log(` \u2713 created: Project v2 "${C}" \u2192 ${b.url}`))}if(e.execute&&(ds(r,c),console.log(`
395
+ `;R.test(W)?F=W.replace(R,j):F=W.trimEnd()+`
396
+
397
+ `+j;let M=Ft.updateIssue(S.issue_number,{body:F},y);M.error?m.errors.push(`update epic #${S.issue_number}: ${M.error}`):console.log(` \u2713 linked ${S.child_story_issues.length} stories \u2192 epic #${S.issue_number}`)}}}if(e.updateEnabled&&(!e.only||e.only==="epics")&&d.updateEpics.length>0){console.log(`
398
+ \u{1F504} Update existing epics`);for(let p of d.updateEpics){let C=$n(p.content);if(C===p.lastSyncedContentHash)continue;let S=["## \u{1F3AF} Epic Vision","",`_Strategic goal this Epic contributes to. Fill in from \`.rcode/phases/${p.phase}/tasks/${p.file}\`._`,"","## \u{1F4CB} Source Content","",p.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${p.phase}\``,`- **Source:** \`.rcode/phases/${p.phase}/tasks/${p.file}\``,`- **Last synced:** ${new Date().toISOString()}`].join(`
399
+ `),I=Ft.updateIssue(p.issueNumber,{title:e.updateBody?`[Epic] ${p.title}`:void 0,body:e.updateBody?S:void 0},y);I.error?m.errors.push(`update epic #${p.issueNumber}: ${I.error}`):I.dryRun||(c.epics[p.id].content_hash=C,c.epics[p.id].updated_at=new Date().toISOString(),console.log(` \u2713 updated: #${p.issueNumber} (${p.id})`))}}if(e.updateEnabled&&(!e.only||e.only==="stories")&&d.updateStories.length>0){console.log(`
400
+ \u{1F504} Update existing stories`);for(let p of d.updateStories){let C=$n(p.content);if(C===p.lastSyncedContentHash)continue;let S=["## \u{1F3AF} Problem Statement","",`_From \`.rcode/phases/${p.phase}/stories/${p.file}\`._`,"","## \u{1F4CB} Source Content","",p.content.slice(0,6e4),"","---","","## \u{1F4CA} Meta","",`- **Phase:** \`${p.phase}\``,`- **Source:** \`.rcode/phases/${p.phase}/stories/${p.file}\``,`- **Last synced:** ${new Date().toISOString()}`].join(`
401
+ `),I=Ft.updateIssue(p.issueNumber,{title:e.updateBody?p.title:void 0,body:e.updateBody?S:void 0},y);I.error?m.errors.push(`update story #${p.issueNumber}: ${I.error}`):I.dryRun||(c.stories[p.id].content_hash=C,c.stories[p.id].updated_at=new Date().toISOString(),console.log(` \u2713 updated: #${p.issueNumber} (${p.id})`))}}if(e.createProject&&(!e.only||e.only==="project")){console.log(`
402
+ \u{1F4CA} Project v2`);let p=o.split("/")[0],C=a.project_name||o.split("/")[1],S=Ft.createProject(p,C,y);S.error?m.errors.push(`project: ${S.error}`):S.dryRun||(c.project={number:S.number,url:S.url,synced_at:new Date().toISOString()},console.log(` \u2713 created: Project v2 "${C}" \u2192 ${S.url}`))}if(e.execute&&(fs(r,c),console.log(`
399
403
  \u{1F4BE} Sync map saved to .rcode/integrations/github-map.json`)),console.log(`
400
- \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(b=>$n(b.content)!==b.lastSyncedContentHash).length,C=d.updateStories.filter(b=>$n(b.content)!==b.lastSyncedContentHash).length;console.log(` Updated: ${h} epics, ${C} 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
+ \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 p=d.updateEpics.filter(S=>$n(S.content)!==S.lastSyncedContentHash).length,C=d.updateStories.filter(S=>$n(S.content)!==S.lastSyncedContentHash).length;console.log(` Updated: ${p} epics, ${C} stories (content changed since last sync)`)}if(m.errors.length>0){console.log(` Errors: ${m.errors.length}`);for(let p of m.errors)console.log(` \u274C ${p}`)}e.dryRun?(console.log(`
401
405
  \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(`
402
- \u2705 Sync complete. View on GitHub: https://github.com/${o}`)}FD.exports=function(e){HF(e).catch(r=>{r instanceof RF&&(console.log(`
406
+ \u2705 Sync complete. View on GitHub: https://github.com/${o}`)}BD.exports=function(e){nF(e).catch(r=>{r instanceof z1&&(console.log(`
403
407
  \u274C GitHub sync cancelled \u2014 ${r.message}.`),process.exit(0)),console.error(`
404
- \u274C GitHub sync failed:`,r.message),process.env.DEBUG&&console.error(r.stack),process.exit(1)})}});var ID=_((pI,jD)=>{jD.exports=function(e,{packageJson:r}){console.log(`
408
+ \u274C GitHub sync failed:`,r.message),process.env.DEBUG&&console.error(r.stack),process.exit(1)})}});var WD=v((kI,qD)=>{qD.exports=function(e,{packageJson:r}){console.log(`
405
409
  \u{1F54C} rcode v${r.version} \u2014 Tiers
406
410
 
407
411
  Everything is organized into 4 tiers + a preview track. Start with \u{1F331} Starter.
@@ -440,8 +444,8 @@ Everything is organized into 4 tiers + a preview track. Start with \u{1F331} Sta
440
444
  See: docs/V2-PREVIEW.md
441
445
 
442
446
  Full detail: docs/TIERS.md
443
- `.trim())}});var fs=require("path"),rn=require("fs"),TD=fs.resolve(__dirname,".."),hs=JSON.parse(rn.readFileSync(fs.join(TD,"package.json"),"utf8")),ZF={install:es(),init:es(),update:sg(),uninstall:Hu(),remove:Hu(),nuke:gg(),dashboard:Uu(),serve:Uu(),digest:bg(),team:wg(),agent:Fg(),doctor:Ug(),workflow:ec(),plan:(t,e)=>lc("plan",t,e),execute:(t,e)=>lc("execute-sprint",t,e),ship:(t,e)=>lc("ship",t,e),"set-profile":oD(),"set-mode":cD(),config:mD(),context:vD(),"show-model":SD(),"github-sync":kD(),tiers:ID(),version:()=>console.log(hs.version),help:RD};function RD(){console.log(`
444
- \u{1F54C} rcode v${hs.version}
447
+ `.trim())}});var hs=require("path"),rn=require("fs"),HD=hs.resolve(__dirname,".."),ps=JSON.parse(rn.readFileSync(hs.join(HD,"package.json"),"utf8")),sF={install:ts(),init:ts(),update:mg(),uninstall:Yu(),remove:Yu(),nuke:xg(),dashboard:Xu(),serve:Xu(),digest:Ig(),team:Pg(),agent:Bg(),doctor:tD(),workflow:ic(),plan:(t,e)=>gc("plan",t,e),execute:(t,e)=>gc("execute-sprint",t,e),ship:(t,e)=>gc("ship",t,e),"set-profile":mD(),"set-mode":vD(),config:wD(),context:kD(),"show-model":TD(),"github-sync":MD(),tiers:WD(),version:()=>console.log(ps.version),help:ZD};function ZD(){console.log(`
448
+ \u{1F54C} rcode v${ps.version}
445
449
  Context-aware AI team methodology. See tiers: \`rcode tiers\`
446
450
 
447
451
  Usage:
@@ -507,14 +511,14 @@ Getting started:
507
511
  rcode set-profile # choose model profile (quality | balanced | budget)
508
512
 
509
513
  Documentation: https://github.com/hanzlahabib/rihal-code
510
- `.trim())}function lc(t,e,r){ec()(["show",t,...e],r);let n=e.includes("--auto")||e.includes("--run");console.log(`
514
+ `.trim())}function gc(t,e,r){ic()(["show",t,...e],r);let n=e.includes("--auto")||e.includes("--run");console.log(`
511
515
  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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(`
512
- AUTO mode detected \u2014 in Claude Code run: /rcode-`+(t==="execute-sprint"?"execute-sprint":t)+" --auto (applies yolo defaults, skips confirmation prompts)")}function UF(){let e=require("os").homedir(),r=fs.join(e,".rcode"),n=fs.join(r,".welcome-shown");if(rn.existsSync(n))return;let s=fs.join(e,".claude","commands"),i=!1;try{i=rn.existsSync(s)&&rn.readdirSync(s).some(o=>o.startsWith("rcode-")&&o.endsWith(".md"))}catch{}if(i){console.log(`
513
- \u{1F54C} rcode v${hs.version} \u2014 first run detected.
514
- `),console.log(` \u2713 ${VF(s)} slash commands installed \u2192 ~/.claude/commands/`),console.log(" \u2713 All /rcode-* commands available in every Claude Code project."),console.log(`
516
+ AUTO mode detected \u2014 in Claude Code run: /rcode-`+(t==="execute-sprint"?"execute-sprint":t)+" --auto (applies yolo defaults, skips confirmation prompts)")}function oF(){let e=require("os").homedir(),r=hs.join(e,".rcode"),n=hs.join(r,".welcome-shown");if(rn.existsSync(n))return;let s=hs.join(e,".claude","commands"),i=!1;try{i=rn.existsSync(s)&&rn.readdirSync(s).some(o=>o.startsWith("rcode-")&&o.endsWith(".md"))}catch{}if(i){console.log(`
517
+ \u{1F54C} rcode v${ps.version} \u2014 first run detected.
518
+ `),console.log(` \u2713 ${iF(s)} slash commands installed \u2192 ~/.claude/commands/`),console.log(" \u2713 All /rcode-* commands available in every Claude Code project."),console.log(`
515
519
  To set up a project: cd my-project && rcode install`),console.log(" Show all commands: rcode help"),console.log(` Diagnose issues: rcode doctor
516
- `);try{rn.mkdirSync(r,{recursive:!0}),rn.writeFileSync(n,`installed ${hs.version} at ${new Date().toISOString()}
517
- `)}catch{}}}function VF(t){try{return rn.readdirSync(t).filter(e=>e.startsWith("rcode-")&&e.endsWith(".md")).length}catch{return 0}}async function GF(){let[,,t="help",...e]=process.argv;(t==="--help"||t==="-h")&&(t="help"),(t==="--version"||t==="-v")&&(t="version"),UF();let r=ZF[t];r||(console.error(`Unknown command: ${t}`),RD(),process.exit(1));try{await r(e,{packageRoot:TD,packageJson:hs})}catch(n){console.error(`Error running '${t}':`,n.message),process.env.DEBUG&&console.error(n.stack),process.exit(1)}finally{try{ts().closeSession()}catch{}}}GF();
520
+ `);try{rn.mkdirSync(r,{recursive:!0}),rn.writeFileSync(n,`installed ${ps.version} at ${new Date().toISOString()}
521
+ `)}catch{}}}function iF(t){try{return rn.readdirSync(t).filter(e=>e.startsWith("rcode-")&&e.endsWith(".md")).length}catch{return 0}}async function aF(){let[,,t="help",...e]=process.argv;(t==="--help"||t==="-h")&&(t="help"),(t==="--version"||t==="-v")&&(t="version"),oF();let r=sF[t];r||(console.error(`Unknown command: ${t}`),ZD(),process.exit(1));try{await r(e,{packageRoot:HD,packageJson:ps})}catch(n){console.error(`Error running '${t}':`,n.message),process.env.DEBUG&&console.error(n.stack),process.exit(1)}finally{try{rs().closeSession()}catch{}}}aF();
518
522
  /*! Bundled license information:
519
523
 
520
524
  is-extglob/index.js: