@stacksjs/dtsx 0.9.13 → 0.9.15

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 (86) hide show
  1. package/README.md +4 -8
  2. package/dist/bin/cli.js +6 -6
  3. package/dist/branded-types.d.ts +10 -18
  4. package/dist/chunk-14gh6ezz.js +80 -0
  5. package/dist/chunk-285mqzvx.js +16 -0
  6. package/dist/chunk-2n1bbm2c.js +448 -0
  7. package/dist/chunk-2r21f44d.js +25 -0
  8. package/dist/chunk-3xqchdwd.js +2 -0
  9. package/dist/{chunk-e0gx49tv.js → chunk-3zjt21t1.js} +1 -1
  10. package/dist/chunk-4s9jv983.js +3 -0
  11. package/dist/chunk-5hzvjjt0.js +2 -0
  12. package/dist/chunk-83e9a4fq.js +4 -0
  13. package/dist/chunk-8cv1t8qg.js +2 -0
  14. package/dist/{chunk-pdt5pc9f.js → chunk-8g7jyxbr.js} +1 -1
  15. package/dist/chunk-8z31rkfp.js +3 -0
  16. package/dist/chunk-a3txc27m.js +33 -0
  17. package/dist/chunk-bh9ey0vw.js +2 -0
  18. package/dist/chunk-bsxtpwx6.js +2 -0
  19. package/dist/{chunk-0f9tt1yd.js → chunk-c09v68yx.js} +1 -1
  20. package/dist/{chunk-emwe4zbk.js → chunk-f4c389mj.js} +1 -1
  21. package/dist/{chunk-hbd2nj9p.js → chunk-fef6249b.js} +1 -1
  22. package/dist/{chunk-57agx6g8.js → chunk-gssantc8.js} +1 -1
  23. package/dist/chunk-j2yw0d45.js +6 -0
  24. package/dist/{chunk-ns3hznyf.js → chunk-mcdb3q06.js} +1 -1
  25. package/dist/{chunk-tzrvp0n2.js → chunk-mn46jafe.js} +1 -1
  26. package/dist/{chunk-mrk48ejm.js → chunk-mxam9312.js} +8 -8
  27. package/dist/chunk-nf54b52t.js +6 -0
  28. package/dist/{chunk-f0mvmcmj.js → chunk-npj0c002.js} +1 -1
  29. package/dist/chunk-pep9jyxn.js +2 -0
  30. package/dist/chunk-qrht3d5g.js +2 -0
  31. package/dist/chunk-rh2bqn7v.js +2 -0
  32. package/dist/{chunk-ck86m3vf.js → chunk-sw3m29sw.js} +1 -1
  33. package/dist/{chunk-a592hfkt.js → chunk-tne5n3h1.js} +1 -1
  34. package/dist/{chunk-1t76q5wk.js → chunk-trm0gptj.js} +1 -1
  35. package/dist/chunk-vpjw38x7.js +34 -0
  36. package/dist/chunk-w71syh0b.js +2 -0
  37. package/dist/chunk-w8d9jjsa.js +2 -0
  38. package/dist/{chunk-188ep5ns.js → chunk-xhs0tsnn.js} +1 -1
  39. package/dist/{chunk-e38jw5aa.js → chunk-xmje6xfw.js} +1 -1
  40. package/dist/{chunk-vf7ywnxz.js → chunk-xtee8g1a.js} +1 -1
  41. package/dist/chunk-y581wnfe.js +19 -0
  42. package/dist/{chunk-6qv7p9sg.js → chunk-zf17s33e.js} +18 -11
  43. package/dist/compat.d.ts +5 -2
  44. package/dist/extractor/cache.d.ts +6 -2
  45. package/dist/extractor/directives.d.ts +0 -4
  46. package/dist/generator.d.ts +1 -1
  47. package/dist/logger.d.ts +4 -0
  48. package/dist/optimizer.d.ts +4 -0
  49. package/dist/process-source.d.ts +1 -0
  50. package/dist/processor/cache.d.ts +4 -2
  51. package/dist/processor/imports.d.ts +1 -0
  52. package/dist/src/index.js +52 -51
  53. package/dist/src/plugins/bun.js +1 -1
  54. package/dist/src/plugins/esbuild.js +1 -1
  55. package/dist/src/plugins/index.js +1 -1
  56. package/dist/src/plugins/tsup.js +1 -1
  57. package/dist/src/plugins/vite.js +1 -1
  58. package/dist/src/plugins/webpack.js +1 -1
  59. package/dist/transformers.d.ts +4 -1
  60. package/dist/type-mappings.d.ts +16 -16
  61. package/dist/types.d.ts +2 -0
  62. package/package.json +3 -3
  63. package/dist/chunk-2vw7w2j4.js +0 -23
  64. package/dist/chunk-365avtde.js +0 -32
  65. package/dist/chunk-446n992h.js +0 -2
  66. package/dist/chunk-49b3ran6.js +0 -4
  67. package/dist/chunk-50hbgzrj.js +0 -3
  68. package/dist/chunk-6jpqpjkc.js +0 -3
  69. package/dist/chunk-94h87sgb.js +0 -449
  70. package/dist/chunk-at36dtgx.js +0 -2
  71. package/dist/chunk-b0bkjk0p.js +0 -19
  72. package/dist/chunk-chbk4344.js +0 -2
  73. package/dist/chunk-ez568rby.js +0 -2
  74. package/dist/chunk-hwm87z68.js +0 -2
  75. package/dist/chunk-jfk0hw36.js +0 -75
  76. package/dist/chunk-myvmq7hz.js +0 -2
  77. package/dist/chunk-nd0xbpbz.js +0 -2
  78. package/dist/chunk-nfeqwqca.js +0 -6
  79. package/dist/chunk-nr1gxnen.js +0 -2
  80. package/dist/chunk-pdvve1gm.js +0 -33
  81. package/dist/chunk-sv136qag.js +0 -17
  82. package/dist/chunk-te9r0j9z.js +0 -6
  83. package/dist/chunk-trftkghj.js +0 -2
  84. package/dist/chunk-xqymptjk.js +0 -2
  85. package/dist/extractor/extract.d.ts +0 -10
  86. package/dist/extractor/scanner.d.ts +0 -6
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{tb as C}from"./chunk-jfk0hw36.js";function y(F={}){let{onStart:H=!1,onEnd:I=!0,onGenerated:J,onError:z,...q}=F,B=async()=>{try{let k=await C(q);J?.(k)}catch(k){let j=k instanceof Error?k:Error(String(k));if(z?.(j),!z)console.error("[dtsx] Generation failed:",j.message)}};return{name:"dtsx",setup(k){let j=k.initialOptions;if(!q.entrypoints&&j.entryPoints)if(Array.isArray(j.entryPoints))q.entrypoints=j.entryPoints;else q.entrypoints=Object.values(j.entryPoints);if(!q.outdir){if(j.outdir)q.outdir=j.outdir;else if(j.outfile){let w=j.outfile.lastIndexOf("/");if(w!==-1)q.outdir=j.outfile.substring(0,w)}}if(H)k.onStart(async()=>{await B()});if(I)k.onEnd(async(w)=>{if(w.errors.length===0)await B()})}}}var L=y,M=y,P=y;
2
+ import{tb as C}from"./chunk-14gh6ezz.js";function y(F={}){let{onStart:H=!1,onEnd:I=!0,onGenerated:J,onError:z,...q}=F,B=async()=>{try{let k=await C(q);J?.(k)}catch(k){let j=k instanceof Error?k:Error(String(k));if(z?.(j),!z)console.error("[dtsx] Generation failed:",j.message)}};return{name:"dtsx",setup(k){let j=k.initialOptions;if(!q.entrypoints&&j.entryPoints)if(Array.isArray(j.entryPoints))q.entrypoints=j.entryPoints;else q.entrypoints=Object.values(j.entryPoints);if(!q.outdir){if(j.outdir)q.outdir=j.outdir;else if(j.outfile){let w=j.outfile.lastIndexOf("/");if(w!==-1)q.outdir=j.outfile.substring(0,w)}}if(H)k.onStart(async()=>{await B()});if(I)k.onEnd(async(w)=>{if(w.errors.length===0)await B()})}}}var L=y,M=y,P=y;
3
3
  export{y as ia,L as ja,M as ka,P as la};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{s as a,t as b,u as c,v as d,w as e,x as f,y as g}from"./chunk-xhs0tsnn.js";import"./chunk-y581wnfe.js";import"./chunk-2n1bbm2c.js";import"./chunk-8z31rkfp.js";import"./chunk-2r21f44d.js";import"./chunk-vpjw38x7.js";import"./chunk-285mqzvx.js";import"./chunk-mcdb3q06.js";export{f as startLSPServer,g as createFileWatcher,b as SymbolKind,a as LspDiagnosticSeverity,e as DtsxLanguageServer,d as DocumentHighlightKind,c as CompletionItemKind};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{l as a,m as b,n as c,o as d,p as e,q as f,r as g}from"./chunk-j2yw0d45.js";import"./chunk-14gh6ezz.js";import"./chunk-y581wnfe.js";import"./chunk-2n1bbm2c.js";import"./chunk-4s9jv983.js";import"./chunk-8z31rkfp.js";import"./chunk-2r21f44d.js";import"./chunk-vpjw38x7.js";import"./chunk-285mqzvx.js";import"./chunk-a3txc27m.js";import"./chunk-gssantc8.js";import"./chunk-mcdb3q06.js";export{b as sortProjectsByDependencies,f as resolveWorkspacePatterns,c as generateWorkspace,d as generateMonorepo,g as generateFromPackageWorkspaces,a as discoverWorkspaceProjects,e as discoverWorkspaceFromPackageJson};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{tb as c,ub as d,vb as e}from"./chunk-14gh6ezz.js";import"./chunk-y581wnfe.js";import"./chunk-2n1bbm2c.js";import{ic as a,jc as b}from"./chunk-4s9jv983.js";import"./chunk-8z31rkfp.js";import"./chunk-2r21f44d.js";import"./chunk-vpjw38x7.js";import"./chunk-285mqzvx.js";import"./chunk-a3txc27m.js";import"./chunk-gssantc8.js";import"./chunk-mcdb3q06.js";export{e as watch,a as processSource,d as processFile,c as generate,b as clearResultCache};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{A as b,B as c,C as d,D as e,E as f,F as g,G as h,H as i,z as a}from"./chunk-mrk48ejm.js";import"./chunk-94h87sgb.js";import"./chunk-ns3hznyf.js";export{i as validateGeneratedDeclarations,c as validateDeclarations,h as typeCheckWithConfig,b as typeCheck,a as loadCompilerOptions,e as getTypeAtPosition,f as getQuickInfo,g as formatTypeCheckResults,d as checkIsolatedDeclarations};
2
+ import{A as b,B as c,C as d,D as e,E as f,F as g,G as h,H as i,z as a}from"./chunk-mxam9312.js";import"./chunk-2n1bbm2c.js";import"./chunk-mcdb3q06.js";export{i as validateGeneratedDeclarations,c as validateDeclarations,h as typeCheckWithConfig,b as typeCheck,a as loadCompilerOptions,e as getTypeAtPosition,f as getQuickInfo,g as formatTypeCheckResults,d as checkIsolatedDeclarations};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Q as a,R as b,S as c,T as d,U as e,V as f,W as g,X as h,Y as i}from"./chunk-te9r0j9z.js";import"./chunk-94h87sgb.js";import"./chunk-ns3hznyf.js";export{e as getGraphSummary,d as formatCircularAnalysis,f as findAllDependents,g as findAllDependencies,i as exportGraphAsJson,h as exportGraphAsDot,b as detectCircularDependencies,a as buildDependencyGraph,c as analyzeCircularDependencies};
2
+ import{Q as a,R as b,S as c,T as d,U as e,V as f,W as g,X as h,Y as i}from"./chunk-nf54b52t.js";import"./chunk-2n1bbm2c.js";import"./chunk-mcdb3q06.js";export{e as getGraphSummary,d as formatCircularAnalysis,f as findAllDependents,g as findAllDependencies,i as exportGraphAsJson,h as exportGraphAsDot,b as detectCircularDependencies,a as buildDependencyGraph,c as analyzeCircularDependencies};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-ns3hznyf.js";import{EventEmitter as r0}from"events";import iZ from"process";import yZ from"process";import OZ from"process";import L0,{stdin as U$,stdout as q$}from"process";import*as ZZ from"readline";import{ReadStream as eZ,WriteStream as j$}from"tty";import tZ,{stdin as W$,stdout as L$}from"process";import M$ from"readline";import l$ from"process";import ZQ from"process";import{WriteStream as $Q}from"tty";import JQ from"process";import cZ from"process";import XQ from"process";import{stripVTControlCharacters as hZ}from"util";import{existsSync as qQ,lstatSync as U0,readdirSync as jQ}from"fs";import{dirname as q0,join as FQ}from"path";import GQ from"process";import x from"process";import jZ from"process";import{stripVTControlCharacters as vZ}from"util";import HQ from"process";import{Buffer as G0}from"buffer";import n from"fs/promises";import VQ from"os";import BZ from"path";import w from"process";import{Readable as DQ,Writable as WQ}from"stream";var{create:x0,getPrototypeOf:l0,defineProperty:pZ,getOwnPropertyNames:a0}=Object,n0=Object.prototype.hasOwnProperty,A=(Z,$,Q)=>{Q=Z!=null?x0(l0(Z)):{};let z=$||!Z||!Z.__esModule?pZ(Q,"default",{value:Z,enumerable:!0}):Q;for(let J of a0(Z))if(!n0.call(z,J))pZ(z,J,{get:()=>Z[J],enumerable:!0});return z},dZ=(Z,$)=>()=>($||Z(($={exports:{}}).exports,$),$.exports),c0=dZ((Z,$)=>{function Q(J){return J==null?[]:Array.isArray(J)?J:[J]}function z(J,Y,X,U){var q,j=J[Y],F=~U.string.indexOf(Y)?X==null||X===!0?"":String(X):typeof X==="boolean"?X:~U.boolean.indexOf(Y)?X==="false"?!1:X==="true"||(J._.push((q=+X,q*0===0)?q:X),!!X):(q=+X,q*0===0)?q:X;J[Y]=j==null?F:Array.isArray(j)?j.concat(F):[j,F]}$.exports=function(J,Y){J=J||[],Y=Y||{};var X,U,q,j,F,G={_:[]},K=0,H=0,D=0,N=J.length;let W=Y.alias!==void 0,O=Y.unknown!==void 0,P=Y.default!==void 0;if(Y.alias=Y.alias||{},Y.string=Q(Y.string),Y.boolean=Q(Y.boolean),W)for(X in Y.alias){U=Y.alias[X]=Q(Y.alias[X]);for(K=0;K<U.length;K++)(Y.alias[U[K]]=U.concat(X)).splice(K,1)}for(K=Y.boolean.length;K-- >0;){U=Y.alias[Y.boolean[K]]||[];for(H=U.length;H-- >0;)Y.boolean.push(U[H])}for(K=Y.string.length;K-- >0;){U=Y.alias[Y.string[K]]||[];for(H=U.length;H-- >0;)Y.string.push(U[H])}if(P){for(X in Y.default)if(j=typeof Y.default[X],U=Y.alias[X]=Y.alias[X]||[],Y[j]!==void 0){Y[j].push(X);for(K=0;K<U.length;K++)Y[j].push(U[K])}}let T=O?Object.keys(Y.alias):[];for(K=0;K<N;K++){if(q=J[K],q==="--"){G._=G._.concat(J.slice(++K));break}for(H=0;H<q.length;H++)if(q.charCodeAt(H)!==45)break;if(H===0)G._.push(q);else if(q.substring(H,H+3)==="no-"){if(j=q.substring(H+3),O&&!~T.indexOf(j))return Y.unknown(q);G[j]=!1}else{for(D=H+1;D<q.length;D++)if(q.charCodeAt(D)===61)break;j=q.substring(H,D),F=q.substring(++D)||(K+1===N||(""+J[K+1]).charCodeAt(0)===45||J[++K]),U=H===2?[j]:j;for(D=0;D<U.length;D++){if(j=U[D],O&&!~T.indexOf(j))return Y.unknown("-".repeat(H)+j);z(G,j,D+1<U.length||F,Y)}}}if(P){for(X in Y.default)if(G[X]===void 0)G[X]=Y.default[X]}if(W)for(X in G){U=Y.alias[X]||[];while(U.length>0)G[U.shift()]=G[X]}return G}}),k=dZ((Z,$)=>{var Q=process||{},z=Q.argv||[],J=Q.env||{},Y=!(!!J.NO_COLOR||z.includes("--no-color"))&&(!!J.FORCE_COLOR||z.includes("--color")||Q.platform==="win32"||(Q.stdout||{}).isTTY&&J.TERM!=="dumb"||!!J.CI),X=(j,F,G=j)=>(K)=>{let H=""+K,D=H.indexOf(F,j.length);return~D?j+U(H,F,G,D)+F:j+H+F},U=(j,F,G,K)=>{let H="",D=0;do H+=j.substring(D,K)+G,D=K+F.length,K=j.indexOf(F,D);while(~K);return H+j.substring(D)},q=(j=Y)=>{let F=j?X:()=>String;return{isColorSupported:j,reset:F("\x1B[0m","\x1B[0m"),bold:F("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:F("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:F("\x1B[3m","\x1B[23m"),underline:F("\x1B[4m","\x1B[24m"),inverse:F("\x1B[7m","\x1B[27m"),hidden:F("\x1B[8m","\x1B[28m"),strikethrough:F("\x1B[9m","\x1B[29m"),black:F("\x1B[30m","\x1B[39m"),red:F("\x1B[31m","\x1B[39m"),green:F("\x1B[32m","\x1B[39m"),yellow:F("\x1B[33m","\x1B[39m"),blue:F("\x1B[34m","\x1B[39m"),magenta:F("\x1B[35m","\x1B[39m"),cyan:F("\x1B[36m","\x1B[39m"),white:F("\x1B[37m","\x1B[39m"),gray:F("\x1B[90m","\x1B[39m"),bgBlack:F("\x1B[40m","\x1B[49m"),bgRed:F("\x1B[41m","\x1B[49m"),bgGreen:F("\x1B[42m","\x1B[49m"),bgYellow:F("\x1B[43m","\x1B[49m"),bgBlue:F("\x1B[44m","\x1B[49m"),bgMagenta:F("\x1B[45m","\x1B[49m"),bgCyan:F("\x1B[46m","\x1B[49m"),bgWhite:F("\x1B[47m","\x1B[49m"),blackBright:F("\x1B[90m","\x1B[39m"),redBright:F("\x1B[91m","\x1B[39m"),greenBright:F("\x1B[92m","\x1B[39m"),yellowBright:F("\x1B[93m","\x1B[39m"),blueBright:F("\x1B[94m","\x1B[39m"),magentaBright:F("\x1B[95m","\x1B[39m"),cyanBright:F("\x1B[96m","\x1B[39m"),whiteBright:F("\x1B[97m","\x1B[39m"),bgBlackBright:F("\x1B[100m","\x1B[49m"),bgRedBright:F("\x1B[101m","\x1B[49m"),bgGreenBright:F("\x1B[102m","\x1B[49m"),bgYellowBright:F("\x1B[103m","\x1B[49m"),bgBlueBright:F("\x1B[104m","\x1B[49m"),bgMagentaBright:F("\x1B[105m","\x1B[49m"),bgCyanBright:F("\x1B[106m","\x1B[49m"),bgWhiteBright:F("\x1B[107m","\x1B[49m")}};$.exports=q(),$.exports.createColors=q}),p0=dZ((Z,$)=>{$.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}}),i0=A(c0(),1);function K0(Z){return Z.replace(/[<[].+/,"").trim()}function s0(Z){let $=/<([^>]+)>/g,Q=/\[([^\]]+)\]/g,z=[],J=(U)=>{let q=!1,j=U[1];if(j.startsWith("..."))j=j.slice(3),q=!0;return{required:U[0].startsWith("<"),value:j,variadic:q}},Y;while(Y=$.exec(Z))z.push(J(Y));let X;while(X=Q.exec(Z))z.push(J(X));return z}function e0(Z){let $={alias:{},boolean:[]};for(let[Q,z]of Z.entries()){if(z.names.length>1)$.alias[z.names[0]]=z.names.slice(1);if(z.isBoolean)if(z.negated){if(!Z.some((Y,X)=>{return X!==Q&&Y.names.some((U)=>z.names.includes(U))&&typeof Y.required==="boolean"}))$.boolean.push(z.names[0])}else $.boolean.push(z.names[0])}return $}function rZ(Z){return Z.sort(($,Q)=>{return $.length>Q.length?-1:1})[0]}function sZ(Z,$){return Z.length>=$?Z:`${Z}${" ".repeat($-Z.length)}`}function t0(Z){return Z.replace(/([a-z])-([a-z])/g,($,Q,z)=>{return Q+z.toUpperCase()})}function o0(Z,$,Q){let z=0,J=$.length,Y=Z,X;for(;z<J;++z)X=Y[$[z]],Y=Y[$[z]]=z===J-1?Q:X!=null?X:!!~$[z+1].indexOf(".")||!(+$[z+1]>-1)?{}:[]}function Z$(Z,$){for(let Q of Object.keys($)){let z=$[Q];if(z.shouldTransform){if(Z[Q]=Array.prototype.concat.call([],Z[Q]),typeof z.transformFunction==="function")Z[Q]=Z[Q].map(z.transformFunction)}}}function $$(Z){let $=/([^\\/]+)$/.exec(Z);return $?$[1]:""}function H0(Z){return Z.split(".").map(($,Q)=>{return Q===0?t0($):$}).join(".")}class NZ extends Error{constructor(Z){super(Z);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(Z).stack}}function Q$(){let{env:Z}=iZ,{TERM:$,TERM_PROGRAM:Q}=Z;if(iZ.platform!=="win32")return $!=="linux";return Boolean(Z.WT_SESSION)||Boolean(Z.TERMINUS_SUBLIME)||Z.ConEmuTask==="{cmd::Cmder}"||Q==="Terminus-Sublime"||Q==="vscode"||$==="xterm-256color"||$==="alacritty"||$==="rxvt-unicode"||$==="rxvt-unicode-256color"||Z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var TZ="\x1B",E=`${TZ}[`,BQ="\x07",_={to(Z,$){if(!$)return`${E}${Z+1}G`;return`${E}${$+1};${Z+1}H`},move(Z,$){let Q="";if(Z<0)Q+=`${E}${-Z}D`;else if(Z>0)Q+=`${E}${Z}C`;if($<0)Q+=`${E}${-$}A`;else if($>0)Q+=`${E}${$}B`;return Q},up:(Z=1)=>`${E}${Z}A`,down:(Z=1)=>`${E}${Z}B`,forward:(Z=1)=>`${E}${Z}C`,backward:(Z=1)=>`${E}${Z}D`,nextLine:(Z=1)=>`${E}E`.repeat(Z),prevLine:(Z=1)=>`${E}F`.repeat(Z),left:`${E}G`,hide:`${E}?25l`,show:`${E}?25h`,save:`${TZ}7`,restore:`${TZ}8`},TQ={up:(Z=1)=>`${E}S`.repeat(Z),down:(Z=1)=>`${E}T`.repeat(Z)},FZ={screen:`${E}2J`,up:(Z=1)=>`${E}1J`.repeat(Z),down:(Z=1)=>`${E}J`.repeat(Z),line:`${E}2K`,lineEnd:`${E}K`,lineStart:`${E}1K`,lines(Z){let $="";for(let Q=0;Q<Z;Q++)$+=this.line+(Q<Z-1?_.up():"");if(Z)$+=_.left;return $}},wQ={screen:`${TZ}c`};class V0{rawName;description;name;names;isBoolean;required;config;negated;constructor(Z,$,Q){if(this.rawName=Z,this.description=$,this.config=Object.assign({},Q),Z=Z.replace(/\.\*/g,""),this.negated=!1,this.names=K0(Z).split(",").map((z)=>{let J=z.trim().replace(/^-{1,2}/,"");if(J.startsWith("no-"))this.negated=!0,J=J.replace(/^no-/,"");return H0(J)}).sort((z,J)=>z.length>J.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(Z.includes("<"))this.required=!0;else if(Z.includes("["))this.required=!1;else this.isBoolean=!0}}var IQ=yZ.argv,z$=`${yZ.platform}-${yZ.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,J$=OZ.argv,Y$=`${OZ.platform}-${OZ.arch} node-${OZ.version}`;class uZ{rawName;description;config;cli;options;aliasNames;name;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;constructor(Z,$,Q,z){if(this.rawName=Z,this.description=$,this.config=Q,this.cli=z,this.options=[],this.aliasNames=[],this.name=K0(Z),this.args=s0(Z),this.examples=[],!Q)this.config={}}usage(Z){return this.usageText=Z,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(Z,$="-v, --version"){return this.versionNumber=Z,this.option($,"Display version number"),this}example(Z){return this.examples.push(Z),this}option(Z,$,Q){let z=new V0(Z,$,Q);return this.options.push(z),this}alias(Z){return this.aliasNames.push(Z),this}action(Z){return this.commandAction=Z,this}isMatched(Z){return this.name===Z||this.aliasNames.includes(Z)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof mZ}hasOption(Z){return Z=Z.split(".")[0],!!this.options.find(($)=>{return $.names.includes(Z)})}outputHelp(){let{name:Z,commands:$}=this.cli,{versionNumber:Q,options:z,helpCallback:J}=this.cli.globalCommand,Y=[{body:`${Z}${Q?`/${Q}`:""}`}];if(Y.push({title:"Usage",body:` $ ${Z} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&$.length>0){let q=rZ($.map((j)=>j.rawName));Y.push({title:"Commands",body:$.map((j)=>{return` ${sZ(j.rawName,q.length)} ${j.description}`}).join(`
2
+ import"./chunk-mcdb3q06.js";import{EventEmitter as r0}from"events";import iZ from"process";import yZ from"process";import OZ from"process";import L0,{stdin as U$,stdout as q$}from"process";import*as ZZ from"readline";import{ReadStream as eZ,WriteStream as j$}from"tty";import tZ,{stdin as W$,stdout as L$}from"process";import M$ from"readline";import l$ from"process";import ZQ from"process";import{WriteStream as $Q}from"tty";import JQ from"process";import cZ from"process";import XQ from"process";import{stripVTControlCharacters as hZ}from"util";import{existsSync as qQ,lstatSync as U0,readdirSync as jQ}from"fs";import{dirname as q0,join as FQ}from"path";import GQ from"process";import x from"process";import jZ from"process";import{stripVTControlCharacters as vZ}from"util";import HQ from"process";import{Buffer as G0}from"buffer";import n from"fs/promises";import VQ from"os";import BZ from"path";import w from"process";import{Readable as DQ,Writable as WQ}from"stream";var{create:x0,getPrototypeOf:l0,defineProperty:pZ,getOwnPropertyNames:a0}=Object,n0=Object.prototype.hasOwnProperty,A=(Z,$,Q)=>{Q=Z!=null?x0(l0(Z)):{};let z=$||!Z||!Z.__esModule?pZ(Q,"default",{value:Z,enumerable:!0}):Q;for(let J of a0(Z))if(!n0.call(z,J))pZ(z,J,{get:()=>Z[J],enumerable:!0});return z},dZ=(Z,$)=>()=>($||Z(($={exports:{}}).exports,$),$.exports),c0=dZ((Z,$)=>{function Q(J){return J==null?[]:Array.isArray(J)?J:[J]}function z(J,Y,X,U){var q,j=J[Y],F=~U.string.indexOf(Y)?X==null||X===!0?"":String(X):typeof X==="boolean"?X:~U.boolean.indexOf(Y)?X==="false"?!1:X==="true"||(J._.push((q=+X,q*0===0)?q:X),!!X):(q=+X,q*0===0)?q:X;J[Y]=j==null?F:Array.isArray(j)?j.concat(F):[j,F]}$.exports=function(J,Y){J=J||[],Y=Y||{};var X,U,q,j,F,G={_:[]},K=0,H=0,D=0,N=J.length;let W=Y.alias!==void 0,O=Y.unknown!==void 0,P=Y.default!==void 0;if(Y.alias=Y.alias||{},Y.string=Q(Y.string),Y.boolean=Q(Y.boolean),W)for(X in Y.alias){U=Y.alias[X]=Q(Y.alias[X]);for(K=0;K<U.length;K++)(Y.alias[U[K]]=U.concat(X)).splice(K,1)}for(K=Y.boolean.length;K-- >0;){U=Y.alias[Y.boolean[K]]||[];for(H=U.length;H-- >0;)Y.boolean.push(U[H])}for(K=Y.string.length;K-- >0;){U=Y.alias[Y.string[K]]||[];for(H=U.length;H-- >0;)Y.string.push(U[H])}if(P){for(X in Y.default)if(j=typeof Y.default[X],U=Y.alias[X]=Y.alias[X]||[],Y[j]!==void 0){Y[j].push(X);for(K=0;K<U.length;K++)Y[j].push(U[K])}}let T=O?Object.keys(Y.alias):[];for(K=0;K<N;K++){if(q=J[K],q==="--"){G._=G._.concat(J.slice(++K));break}for(H=0;H<q.length;H++)if(q.charCodeAt(H)!==45)break;if(H===0)G._.push(q);else if(q.substring(H,H+3)==="no-"){if(j=q.substring(H+3),O&&!~T.indexOf(j))return Y.unknown(q);G[j]=!1}else{for(D=H+1;D<q.length;D++)if(q.charCodeAt(D)===61)break;j=q.substring(H,D),F=q.substring(++D)||(K+1===N||(""+J[K+1]).charCodeAt(0)===45||J[++K]),U=H===2?[j]:j;for(D=0;D<U.length;D++){if(j=U[D],O&&!~T.indexOf(j))return Y.unknown("-".repeat(H)+j);z(G,j,D+1<U.length||F,Y)}}}if(P){for(X in Y.default)if(G[X]===void 0)G[X]=Y.default[X]}if(W)for(X in G){U=Y.alias[X]||[];while(U.length>0)G[U.shift()]=G[X]}return G}}),k=dZ((Z,$)=>{var Q=process||{},z=Q.argv||[],J=Q.env||{},Y=!(!!J.NO_COLOR||z.includes("--no-color"))&&(!!J.FORCE_COLOR||z.includes("--color")||Q.platform==="win32"||(Q.stdout||{}).isTTY&&J.TERM!=="dumb"||!!J.CI),X=(j,F,G=j)=>(K)=>{let H=""+K,D=H.indexOf(F,j.length);return~D?j+U(H,F,G,D)+F:j+H+F},U=(j,F,G,K)=>{let H="",D=0;do H+=j.substring(D,K)+G,D=K+F.length,K=j.indexOf(F,D);while(~K);return H+j.substring(D)},q=(j=Y)=>{let F=j?X:()=>String;return{isColorSupported:j,reset:F("\x1B[0m","\x1B[0m"),bold:F("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:F("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:F("\x1B[3m","\x1B[23m"),underline:F("\x1B[4m","\x1B[24m"),inverse:F("\x1B[7m","\x1B[27m"),hidden:F("\x1B[8m","\x1B[28m"),strikethrough:F("\x1B[9m","\x1B[29m"),black:F("\x1B[30m","\x1B[39m"),red:F("\x1B[31m","\x1B[39m"),green:F("\x1B[32m","\x1B[39m"),yellow:F("\x1B[33m","\x1B[39m"),blue:F("\x1B[34m","\x1B[39m"),magenta:F("\x1B[35m","\x1B[39m"),cyan:F("\x1B[36m","\x1B[39m"),white:F("\x1B[37m","\x1B[39m"),gray:F("\x1B[90m","\x1B[39m"),bgBlack:F("\x1B[40m","\x1B[49m"),bgRed:F("\x1B[41m","\x1B[49m"),bgGreen:F("\x1B[42m","\x1B[49m"),bgYellow:F("\x1B[43m","\x1B[49m"),bgBlue:F("\x1B[44m","\x1B[49m"),bgMagenta:F("\x1B[45m","\x1B[49m"),bgCyan:F("\x1B[46m","\x1B[49m"),bgWhite:F("\x1B[47m","\x1B[49m"),blackBright:F("\x1B[90m","\x1B[39m"),redBright:F("\x1B[91m","\x1B[39m"),greenBright:F("\x1B[92m","\x1B[39m"),yellowBright:F("\x1B[93m","\x1B[39m"),blueBright:F("\x1B[94m","\x1B[39m"),magentaBright:F("\x1B[95m","\x1B[39m"),cyanBright:F("\x1B[96m","\x1B[39m"),whiteBright:F("\x1B[97m","\x1B[39m"),bgBlackBright:F("\x1B[100m","\x1B[49m"),bgRedBright:F("\x1B[101m","\x1B[49m"),bgGreenBright:F("\x1B[102m","\x1B[49m"),bgYellowBright:F("\x1B[103m","\x1B[49m"),bgBlueBright:F("\x1B[104m","\x1B[49m"),bgMagentaBright:F("\x1B[105m","\x1B[49m"),bgCyanBright:F("\x1B[106m","\x1B[49m"),bgWhiteBright:F("\x1B[107m","\x1B[49m")}};$.exports=q(),$.exports.createColors=q}),p0=dZ((Z,$)=>{$.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}}),i0=A(c0(),1);function K0(Z){return Z.replace(/[<[].+/,"").trim()}function s0(Z){let $=/<([^>]+)>/g,Q=/\[([^\]]+)\]/g,z=[],J=(U)=>{let q=!1,j=U[1];if(j.startsWith("..."))j=j.slice(3),q=!0;return{required:U[0].startsWith("<"),value:j,variadic:q}},Y;while(Y=$.exec(Z))z.push(J(Y));let X;while(X=Q.exec(Z))z.push(J(X));return z}function e0(Z){let $={alias:{},boolean:[]};for(let[Q,z]of Z.entries()){if(z.names.length>1)$.alias[z.names[0]]=z.names.slice(1);if(z.isBoolean)if(z.negated){if(!Z.some((Y,X)=>{return X!==Q&&Y.names.some((U)=>z.names.includes(U))&&typeof Y.required==="boolean"}))$.boolean.push(z.names[0])}else $.boolean.push(z.names[0])}return $}function rZ(Z){return Z.sort(($,Q)=>{return $.length>Q.length?-1:1})[0]}function sZ(Z,$){return Z.length>=$?Z:`${Z}${" ".repeat($-Z.length)}`}function t0(Z){return Z.replace(/([a-z])-([a-z])/g,($,Q,z)=>{return Q+z.toUpperCase()})}function o0(Z,$,Q){let z=0,J=$.length,Y=Z,X;for(;z<J;++z)X=Y[$[z]],Y=Y[$[z]]=z===J-1?Q:X!=null?X:!!~$[z+1].indexOf(".")||!(+$[z+1]>-1)?{}:[]}function Z$(Z,$){for(let Q of Object.keys($)){let z=$[Q];if(z.shouldTransform){if(Z[Q]=Array.prototype.concat.call([],Z[Q]),typeof z.transformFunction==="function")Z[Q]=Z[Q].map(z.transformFunction)}}}function $$(Z){let $=/([^\\/]+)$/.exec(Z);return $?$[1]:""}function H0(Z){return Z.split(".").map(($,Q)=>{return Q===0?t0($):$}).join(".")}class NZ extends Error{constructor(Z){super(Z);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(Z).stack}}function Q$(){let{env:Z}=iZ,{TERM:$,TERM_PROGRAM:Q}=Z;if(iZ.platform!=="win32")return $!=="linux";return Boolean(Z.WT_SESSION)||Boolean(Z.TERMINUS_SUBLIME)||Z.ConEmuTask==="{cmd::Cmder}"||Q==="Terminus-Sublime"||Q==="vscode"||$==="xterm-256color"||$==="alacritty"||$==="rxvt-unicode"||$==="rxvt-unicode-256color"||Z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var TZ="\x1B",E=`${TZ}[`,BQ="\x07",_={to(Z,$){if(!$)return`${E}${Z+1}G`;return`${E}${$+1};${Z+1}H`},move(Z,$){let Q="";if(Z<0)Q+=`${E}${-Z}D`;else if(Z>0)Q+=`${E}${Z}C`;if($<0)Q+=`${E}${-$}A`;else if($>0)Q+=`${E}${$}B`;return Q},up:(Z=1)=>`${E}${Z}A`,down:(Z=1)=>`${E}${Z}B`,forward:(Z=1)=>`${E}${Z}C`,backward:(Z=1)=>`${E}${Z}D`,nextLine:(Z=1)=>`${E}E`.repeat(Z),prevLine:(Z=1)=>`${E}F`.repeat(Z),left:`${E}G`,hide:`${E}?25l`,show:`${E}?25h`,save:`${TZ}7`,restore:`${TZ}8`},TQ={up:(Z=1)=>`${E}S`.repeat(Z),down:(Z=1)=>`${E}T`.repeat(Z)},FZ={screen:`${E}2J`,up:(Z=1)=>`${E}1J`.repeat(Z),down:(Z=1)=>`${E}J`.repeat(Z),line:`${E}2K`,lineEnd:`${E}K`,lineStart:`${E}1K`,lines(Z){let $="";for(let Q=0;Q<Z;Q++)$+=this.line+(Q<Z-1?_.up():"");if(Z)$+=_.left;return $}},wQ={screen:`${TZ}c`};class V0{rawName;description;name;names;isBoolean;required;config;negated;constructor(Z,$,Q){if(this.rawName=Z,this.description=$,this.config=Object.assign({},Q),Z=Z.replace(/\.\*/g,""),this.negated=!1,this.names=K0(Z).split(",").map((z)=>{let J=z.trim().replace(/^-{1,2}/,"");if(J.startsWith("no-"))this.negated=!0,J=J.replace(/^no-/,"");return H0(J)}).sort((z,J)=>z.length>J.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(Z.includes("<"))this.required=!0;else if(Z.includes("["))this.required=!1;else this.isBoolean=!0}}var IQ=yZ.argv,z$=`${yZ.platform}-${yZ.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,J$=OZ.argv,Y$=`${OZ.platform}-${OZ.arch} node-${OZ.version}`;class uZ{rawName;description;config;cli;options;aliasNames;name;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;constructor(Z,$,Q,z){if(this.rawName=Z,this.description=$,this.config=Q,this.cli=z,this.options=[],this.aliasNames=[],this.name=K0(Z),this.args=s0(Z),this.examples=[],!Q)this.config={}}usage(Z){return this.usageText=Z,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(Z,$="-v, --version"){return this.versionNumber=Z,this.option($,"Display version number"),this}example(Z){return this.examples.push(Z),this}option(Z,$,Q){let z=new V0(Z,$,Q);return this.options.push(z),this}alias(Z){return this.aliasNames.push(Z),this}action(Z){return this.commandAction=Z,this}isMatched(Z){return this.name===Z||this.aliasNames.includes(Z)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof mZ}hasOption(Z){return Z=Z.split(".")[0],!!this.options.find(($)=>{return $.names.includes(Z)})}outputHelp(){let{name:Z,commands:$}=this.cli,{versionNumber:Q,options:z,helpCallback:J}=this.cli.globalCommand,Y=[{body:`${Z}${Q?`/${Q}`:""}`}];if(Y.push({title:"Usage",body:` $ ${Z} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&$.length>0){let q=rZ($.map((j)=>j.rawName));Y.push({title:"Commands",body:$.map((j)=>{return` ${sZ(j.rawName,q.length)} ${j.description}`}).join(`
3
3
  `)}),Y.push({title:"For more info, run any command with the `--help` flag",body:$.map((j)=>` $ ${Z}${j.name===""?"":` ${j.name}`} --help`).join(`
4
4
  `)})}let U=this.isGlobalCommand?z:[...this.options,...z||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand)U=U.filter((q)=>q.name!=="version");if(U.length>0){let q=rZ(U.map((j)=>j.rawName));Y.push({title:"Options",body:U.map((j)=>{return` ${sZ(j.rawName,q.length)} ${j.description} ${j.config.default===void 0?"":`(default: ${j.config.default})`}`}).join(`
5
5
  `)})}if(this.examples.length>0)Y.push({title:"Examples",body:this.examples.map((q)=>{if(typeof q==="function")return q(Z);return q}).join(`
@@ -0,0 +1,34 @@
1
+ // @bun
2
+ import{Dc as Uz,Ec as Yz,Fc as T,Mc as u,Nc as p,Oc as Gz}from"./chunk-285mqzvx.js";function k(z,$=!0){if(!$||!z||z.length===0)return"";if(z.length===1){let U=z[0];if(U.length>0&&U.charCodeAt(0)>32&&U.charCodeAt(U.length-1)>32)return`${U}
3
+ `;return`${U.trim()}
4
+ `}let K="";for(let U=0;U<z.length;U++){if(U>0)K+=`
5
+ `;K+=z[U].trim()}return`${K}
6
+ `}function Rz(z){if(z.includes(`
7
+ `))return`/**
8
+ * ${z}
9
+ */
10
+ `;return`/** ${z} */
11
+ `}function Wz(z){let $=z.indexOf("{");if($===-1)return-1;let K=z.indexOf("<");if(K===-1||K>$)return $;let U=0,H=!1,X="";for(let Z=0;Z<z.length;Z++){let j=z[Z],G=Z>0?z[Z-1]:"";if(!H&&(j==='"'||j==="'"||j==="`"))H=!0,X=j;else if(H&&j===X&&G!=="\\")H=!1;if(!H){if(j==="<")U++;else if(j===">")U--;else if(j==="{"&&U===0)return Z}}return-1}function n(z,$=!0){return k(z.leadingComments,$)+z.text}function l(z,$=!0){let K=k(z.leadingComments,$);if(z.typeAnnotation&&!z.value)return K+z.text;let U="";if(z.isExported)U+="export ";U+="declare ";let H=z.modifiers?.[0]||"const";U+=`${H} `,U+=z.name;let{typeAnnotation:X,value:Z}=z;if(Z&&Z.includes(" satisfies ")){let G=p(Z);if(G)X=G}else if(Z&&Z.trim().endsWith("as const"))X=T(Z,!0);else if(!X&&Z&&H==="const"){let G=Z.trim(),W=G.startsWith("{")||G.startsWith("[");if(W)Uz();X=T(Z,!W)}else if(X&&Z&&H==="const"&&u(X)){let G=T(Z,!0);if(G!=="unknown")X=G}else if(!X&&Z)X=T(Z,H==="const");if(!X)X="unknown";let j="";if(Z&&!z.typeAnnotation&&!Z.trim().endsWith("as const")){let G=Z.trim();if(H!=="const"){if((X==="string"||X==="number"||X==="boolean")&&G.length>0)j=`@defaultValue ${G}`}else if(G.startsWith("{")||G.startsWith("[")){let W=Yz();if(W)if(W.includes(`
12
+ `))j=`@defaultValue
13
+ * \`\`\`ts
14
+ ${W.split(`
15
+ `).map((R)=>` * ${R}`).join(`
16
+ `)}
17
+ * \`\`\``;else j=`@defaultValue \`${W}\``}}if(U+=`: ${X};`,j&&K&&K.includes("@defaultValue"))j="";if(j&&K){let G=K.trimEnd(),W=G.lastIndexOf("*/");if(W!==-1){let R=G.slice(0,W).trimEnd();if(R.startsWith("/** ")&&!R.includes(`
18
+ `))R=`/**
19
+ * ${R.slice(4)}`;return`${R}
20
+ * ${j}
21
+ */
22
+ `+U}return`/**
23
+ * ${G.replace(/^\/\/\s*/,"")}
24
+ * ${j}
25
+ */
26
+ ${U}`}if(j)return`${Rz(j)}${U}`;return K+U}function d(z,$=!0){let K=k(z.leadingComments,$),U=z.text;if(U.startsWith("export declare interface")||U.startsWith("declare interface"))return K+U;let H="";if(z.isExported)H+="export ";if(H+="declare interface ",H+=z.name,z.generics)H+=z.generics;if(z.extends)H+=` extends ${z.extends}`;let X=Wz(z.text);if(X!==-1)H+=` ${z.text.slice(X)}`;else H+=" {}";return K+H}function c(z,$=!0){let K=k(z.leadingComments,$);if(z.text.includes("{")&&z.text.includes("}")&&z.text.includes("from"))return K+z.text;let U="";if(z.isExported)U+="export ";if(!z.isExported&&!z.text.includes(" from "))U+="declare ";let H=z.text.indexOf("type ");if(H!==-1){let Z=z.text.slice(H),j=Z.length;while(j>0&&(Z.charCodeAt(j-1)===59||Z.charCodeAt(j-1)===32||Z.charCodeAt(j-1)===10||Z.charCodeAt(j-1)===13))j--;if(j<Z.length)Z=Z.slice(0,j);U+=Z}else{if(U+=`type ${z.name}`,z.generics)U+=z.generics;U+=" = any"}let X=U.trimEnd();if(!X.endsWith(";")&&!X.endsWith("}"))U+=";";return K+U}function o(z,$=!0){return k(z.leadingComments,$)+z.text}function i(z,$=!0){let K=k(z.leadingComments,$),U="";if(z.isExported)U+="export ";if(U+="declare ",z.modifiers?.includes("const"))U+="const ";U+="enum ",U+=z.name;let H=z.text.indexOf("{");if(H!==-1)U+=` ${z.text.slice(H)}`;else U+=" {}";return K+U}function Vz(z){let $=z.text.trim(),K=$.length;while(K>0&&$.charCodeAt(K-1)===59)K--;if(K<$.length)$=$.slice(0,K);return $+=";",$}function Qz(z,$=!0){return k(z.leadingComments,$)+z.text.trim()}function s(z,$=!0){let K=k(z.leadingComments,$);if(z.text.startsWith("declare global"))return K+z.text;if(z.source||(z.name.startsWith('"')||z.name.startsWith("'")||z.name.startsWith("`"))){let Z="declare module ";Z+=z.name;let j=z.text.indexOf("{");if(j!==-1)Z+=` ${z.text.slice(j)}`;else Z+=" {}";return K+Z}let H="";if(z.isExported)H+="export ";if(!z.modifiers?.includes("declare"))H+="declare ";H+="namespace ",H+=z.name;let X=z.text.indexOf("{");if(X!==-1)H+=` ${z.text.slice(X)}`;else H+=" {}";return K+H}var Mz=new Map,g=new Map;function Zz(z){let $=g.get(z);if($)return g.delete(z),g.set(z,$),$;return null}function m(z,$){if(g.set(z,$),g.size>200){let K=0;for(let U of g.keys()){if(K++>=20)break;g.delete(U)}}}function qz(){Mz.clear(),g.clear()}function a(z){let $=z.indexOf(" from ");if($===-1)return null;let K=z.slice($+6).trim(),U=K[0];if(U!=='"'&&U!=="'")return null;let H=K.indexOf(U,1);if(H===-1)return null;let X=K.slice(1,H),Z=z.slice(0,$).trim(),j=Z.startsWith("import type ");if(Z.startsWith("import "))Z=Z.slice(7).trim();if(Z.startsWith("type "))Z=Z.slice(5).trim();let G=null,W=[],w=!1,R=Z.indexOf("{"),S=Z.lastIndexOf("}");if(R!==-1&&S!==-1){let N=Z.slice(0,R).trim();if(N.endsWith(","))G=N.slice(0,-1).trim()||null;let B=Z.slice(R+1,S),C=0;for(let v=0;v<=B.length;v++)if(v===B.length||B.charCodeAt(v)===44){let D=C,_=v;while(D<_&&(B.charCodeAt(D)===32||B.charCodeAt(D)===9||B.charCodeAt(D)===10))D++;while(_>D&&(B.charCodeAt(_-1)===32||B.charCodeAt(_-1)===9||B.charCodeAt(_-1)===10))_--;if(D<_)W.push(B.slice(D,_));C=v+1}}else{let N=Z.trim();if(N.startsWith("* as "))G=N.slice(5).trim()||null,w=!0;else G=N||null}return{defaultName:G,namedItems:W,source:X,isTypeOnly:j,isNamespace:w}}function r(z){let $=Zz(z);if($)return $;let K=[],U=z.indexOf(" from ");if(U===-1)return m(z,K),K;let H=z.slice(0,U).trim();if(H.startsWith("import "))H=H.slice(7).trim();if(H.startsWith("type "))H=H.slice(5).trim();let X=H.indexOf("{"),Z=H.lastIndexOf("}");if(X!==-1&&Z!==-1){let j=H.slice(0,X).trim();if(j.endsWith(",")){let w=j.slice(0,-1).trim();if(w)K.push(w)}else if(j&&!j.includes(","))K.push(j);let W=H.slice(X+1,Z).split(",");for(let w=0;w<W.length;w++){let R=W[w].trim();if(!R)continue;if(R.startsWith("type "))R=R.slice(5).trim();let S=R.indexOf(" as ");if(S!==-1)R=R.slice(S+4).trim();if(R)K.push(R)}}else{let j=H.trim();if(j.startsWith("* as ")){let G=j.slice(5).trim();if(G)K.push(G)}else if(j)K.push(j)}return m(z,K),K}function $z(z,$){throw Error($||`Unexpected value: ${z}`)}function wz(z){return z>=65&&z<=90||z>=97&&z<=122||z>=48&&z<=57||z===95||z===36||z>127}function jz(z){let $=new Set,K=0,U=z.length;while(K<U){let H=z.charCodeAt(K);if(H>=65&&H<=90||H>=97&&H<=122||H===95||H===36||H>127){let X=K;K++;while(K<U&&wz(z.charCodeAt(K)))K++;$.add(z.substring(X,K))}else K++}return $}var Bz=/export\s+(?:type\s+)?\{\s*([^}]+)\s*\}/,Jz=null,Xz=[],Lz=[];function Iz(z,$,K=!0,U=["bun"]){let H="",X=$.sourceCode;if(X){let Y=0;while(Y<X.length&&(X.charCodeAt(Y)===32||X.charCodeAt(Y)===9||X.charCodeAt(Y)===10||X.charCodeAt(Y)===13))Y++;if(Y<X.length-2&&X.charCodeAt(Y)===47&&X.charCodeAt(Y+1)===47&&X.charCodeAt(Y+2)===47){let L=Gz(X);if(L.length>0)for(let V=0;V<L.length;V++){if(H)H+=`
27
+ `;H+=L[V]}}}let Z=[],j=[],G=[],W=[],w=[],R=[],S=[],N=[],B=[];for(let Y of z){let L=Y.kind;switch(L){case"import":Z.push(Y);break;case"function":j.push(Y);break;case"variable":G.push(Y);break;case"interface":W.push(Y);break;case"type":w.push(Y);break;case"class":R.push(Y);break;case"enum":S.push(Y);break;case"module":N.push(Y);break;case"export":B.push(Y);break;case"namespace":N.push(Y);break;case"unknown":break;default:$z(L,`Unhandled declaration kind: ${L}`)}}let C=new Set,v=[],D=[],_=[],t=new Set;for(let Y of B){let L=k(Y.leadingComments,K);if(Y.text.startsWith("export default")){let V=Y.text.endsWith(";")?Y.text:`${Y.text};`;_.push(L+V)}else{let V=Y.text.trim();if(!V.endsWith(";"))V+=";";let F=V.match(Bz);if(F){let M=F[1],E=0;for(let Q=0;Q<=M.length;Q++)if(Q===M.length||M.charCodeAt(Q)===44){let A=E,q=Q;while(A<q&&M.charCodeAt(A)<=32)A++;while(q>A&&M.charCodeAt(q-1)<=32)q--;if(A<q)C.add(M.slice(A,q));E=Q+1}}let J=L+V;if(!t.has(J))if(t.add(J),J.includes("export type"))v.push(J);else D.push(J)}}let h=new Map;if(Z.length>0)for(let Y of Z){let L=r(Y.text);for(let V of L)h.set(V,Y)}let e=new Set;if(W.length>0){let Y=[];for(let L of j)if(L.isExported)Y.push(L.text);for(let L of R)Y.push(L.text);for(let L of w)Y.push(L.text);if(Y.length>0){let L=jz(Y.join(`
28
+ `));for(let V of W)if(L.has(V.name))e.add(V.name)}}let b=[];if(Z.length>0){let Y=new Set,L=[];for(let J of j)if(J.isExported)L.push(J.text);for(let J of G)if(J.isExported){if(L.push(J.text),J.typeAnnotation)L.push(J.typeAnnotation)}for(let J of W)if(J.isExported||e.has(J.name))L.push(J.text);for(let J of w)L.push(J.text);for(let J of R)L.push(J.text);for(let J of S)L.push(J.text);for(let J of N)L.push(J.text);for(let J of B)L.push(J.text);let V=L.join(`
29
+ `);if(V&&h.size>0){let J=jz(V);for(let M of h.keys())if(J.has(M))Y.add(M)}for(let J of C)if(h.has(J))Y.add(J);for(let J of Z){if(J.isSideEffect){let O=J.text.trim(),P=O.endsWith(";")?O:`${O};`;b.push(P);continue}let M=a(J.text);if(!M)continue;let{defaultName:E,namedItems:Q,source:A,isTypeOnly:q,isNamespace:I}=M,Hz=E?Y.has(E):!1,f="",y=0;for(let O=0;O<Q.length;O++){let P=Q[O],x=P.charCodeAt(0)===116&&P.startsWith("type ")?P.slice(5).trim():P.trim(),Kz=x.indexOf(" as ");if(Kz!==-1)x=x.slice(Kz+4).trim();if(Y.has(x)){if(y>0)f+=", ";f+=P,y++}}if(Hz||y>0){let O=q?"import type ":"import ";if(Hz&&E)if(I)O+=`* as ${E}`;else O+=y>0?`${E}, { ${f} }`:E;else if(y>0)O+=`{ ${f} }`;O+=` from '${A}';`,b.push(O)}}let F=U.length;if(b.length>1){if(Jz!==U)Jz=U,Xz=U.map((Q)=>`from '${Q}`),Lz=U.map((Q)=>`from "${Q}`);let J=Xz,M=Lz,E=new Map;for(let Q of b){let A=F;for(let q=0;q<U.length;q++)if(Q.includes(J[q])||Q.includes(M[q])){A=q;break}E.set(Q,A)}b.sort((Q,A)=>{let q=E.get(Q),I=E.get(A);return q!==I?q-I:Q.localeCompare(A)})}}for(let Y=0;Y<b.length;Y++){if(H)H+=`
30
+ `;H+=b[Y]}for(let Y=0;Y<v.length;Y++){if(H)H+=`
31
+ `;H+=v[Y]}let zz=[j,G,W,w,R,S,N];for(let Y=0;Y<zz.length;Y++){let L=zz[Y];for(let V=0;V<L.length;V++){let F=L[V],J="",M=F.kind;switch(M){case"function":J=n(F,K);break;case"variable":J=l(F,K);break;case"interface":J=d(F,K);break;case"type":J=c(F,K);break;case"class":J=o(F,K);break;case"enum":J=i(F,K);break;case"module":case"namespace":J=s(F,K);break;case"import":case"export":case"unknown":break;default:$z(M,`Unhandled declaration kind in processor: ${M}`)}if(J){if(H)H+=`
32
+ `;H+=J}}}for(let Y=0;Y<D.length;Y++){if(H)H+=`
33
+ `;H+=D[Y]}for(let Y=0;Y<_.length;Y++){if(H)H+=`
34
+ `;H+=_[Y]}return H}export{k as pc,n as qc,l as rc,d as sc,c as tc,o as uc,i as vc,Vz as wc,Qz as xc,s as yc,qz as zc,a as Ac,r as Bc,Iz as Cc};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Pc as a,Qc as b,Rc as c,Sc as d,Tc as e,Uc as f}from"./chunk-a3txc27m.js";import"./chunk-gssantc8.js";import"./chunk-mcdb3q06.js";export{c as resetConfig,b as getConfig,e as defineConfigAsync,d as defineConfig,a as defaultConfig,f as config};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{a,b,c}from"./chunk-83e9a4fq.js";import"./chunk-y581wnfe.js";import"./chunk-2n1bbm2c.js";import"./chunk-8z31rkfp.js";import"./chunk-2r21f44d.js";import"./chunk-285mqzvx.js";import"./chunk-mcdb3q06.js";export{b as optimizeFile,a as optimizeDeclarations,c as minifyDts};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ec as F}from"./chunk-b0bkjk0p.js";import{Bc as N}from"./chunk-pdvve1gm.js";import{existsSync as H,readFileSync as P,unwatchFile as T}from"fs";var k;((J)=>{J[J.Error=1]="Error";J[J.Warning=2]="Warning";J[J.Information=3]="Information";J[J.Hint=4]="Hint"})(k||={});var L;((O)=>{O[O.File=1]="File";O[O.Module=2]="Module";O[O.Namespace=3]="Namespace";O[O.Package=4]="Package";O[O.Class=5]="Class";O[O.Method=6]="Method";O[O.Property=7]="Property";O[O.Field=8]="Field";O[O.Constructor=9]="Constructor";O[O.Enum=10]="Enum";O[O.Interface=11]="Interface";O[O.Function=12]="Function";O[O.Variable=13]="Variable";O[O.Constant=14]="Constant";O[O.String=15]="String";O[O.Number=16]="Number";O[O.Boolean=17]="Boolean";O[O.Array=18]="Array";O[O.Object=19]="Object";O[O.Key=20]="Key";O[O.Null=21]="Null";O[O.EnumMember=22]="EnumMember";O[O.Struct=23]="Struct";O[O.Event=24]="Event";O[O.Operator=25]="Operator";O[O.TypeParameter=26]="TypeParameter"})(L||={});var M;((Q)=>{Q[Q.Text=1]="Text";Q[Q.Method=2]="Method";Q[Q.Function=3]="Function";Q[Q.Constructor=4]="Constructor";Q[Q.Field=5]="Field";Q[Q.Variable=6]="Variable";Q[Q.Class=7]="Class";Q[Q.Interface=8]="Interface";Q[Q.Module=9]="Module";Q[Q.Property=10]="Property";Q[Q.Unit=11]="Unit";Q[Q.Value=12]="Value";Q[Q.Enum=13]="Enum";Q[Q.Keyword=14]="Keyword";Q[Q.Snippet=15]="Snippet";Q[Q.Color=16]="Color";Q[Q.File=17]="File";Q[Q.Reference=18]="Reference";Q[Q.Folder=19]="Folder";Q[Q.EnumMember=20]="EnumMember";Q[Q.Constant=21]="Constant";Q[Q.Struct=22]="Struct";Q[Q.Event=23]="Event";Q[Q.Operator=24]="Operator";Q[Q.TypeParameter=25]="TypeParameter"})(M||={});var v;((A)=>{A[A.Text=1]="Text";A[A.Read=2]="Read";A[A.Write=3]="Write"})(v||={});class E{documents=new Map;rootUri=null;config={};messageId=0;watchers=new Map;initialize(j){return this.rootUri=j.rootUri,{capabilities:{textDocumentSync:1,hoverProvider:!0,completionProvider:{triggerCharacters:[".",":","<",'"',"'","/"],resolveProvider:!0},definitionProvider:!0,referencesProvider:!0,renameProvider:{prepareProvider:!0},documentSymbolProvider:!0,workspaceSymbolProvider:!0,codeActionProvider:{codeActionKinds:["quickfix","refactor","source"]},signatureHelpProvider:{triggerCharacters:["(",","],retriggerCharacters:[","]},documentHighlightProvider:!0,documentFormattingProvider:!0,diagnosticProvider:{interFileDependencies:!0,workspaceDiagnostics:!0}}}}didOpen(j){let{uri:z,text:G,version:A}=j.textDocument;this.updateDocument(z,G,A)}didChange(j){let{uri:z,version:G}=j.textDocument,A=j.contentChanges[0]?.text||"";this.updateDocument(z,A,G)}didClose(j){let z=j.textDocument.uri;if(this.documents.delete(z),this.watchers.get(z))T(this.uriToPath(z)),this.watchers.delete(z)}updateDocument(j,z,G){let A=this.uriToPath(j),J=F(z,A,!0);this.documents.set(j,{content:z,version:G,declarations:J})}getDiagnostics(j){let z=this.documents.get(j);if(!z)return[];let G=[];for(let A of z.declarations){if(A.isExported&&A.kind==="variable"&&!A.typeAnnotation)G.push({range:this.getDeclarationRange(A,z.content),severity:2,code:"missing-type",source:"dtsx",message:`Exported variable '${A.name}' should have an explicit type annotation for better declaration generation`});if(A.typeAnnotation==="any"||A.returnType==="any")G.push({range:this.getDeclarationRange(A,z.content),severity:3,code:"any-type",source:"dtsx",message:"Consider using a more specific type instead of 'any'"});if(A.kind==="function"&&A.isExported&&!A.returnType)G.push({range:this.getDeclarationRange(A,z.content),severity:3,code:"missing-return-type",source:"dtsx",message:`Function '${A.name}' should have an explicit return type for better declaration generation`})}return G}hover(j){let z=this.documents.get(j.textDocument.uri);if(!z)return null;let{line:G,character:A}=j.position,R=z.content.split(`
2
+ import{ec as F}from"./chunk-y581wnfe.js";import{Cc as N}from"./chunk-vpjw38x7.js";import{existsSync as H,readFileSync as P,unwatchFile as T}from"fs";var k;((J)=>{J[J.Error=1]="Error";J[J.Warning=2]="Warning";J[J.Information=3]="Information";J[J.Hint=4]="Hint"})(k||={});var L;((O)=>{O[O.File=1]="File";O[O.Module=2]="Module";O[O.Namespace=3]="Namespace";O[O.Package=4]="Package";O[O.Class=5]="Class";O[O.Method=6]="Method";O[O.Property=7]="Property";O[O.Field=8]="Field";O[O.Constructor=9]="Constructor";O[O.Enum=10]="Enum";O[O.Interface=11]="Interface";O[O.Function=12]="Function";O[O.Variable=13]="Variable";O[O.Constant=14]="Constant";O[O.String=15]="String";O[O.Number=16]="Number";O[O.Boolean=17]="Boolean";O[O.Array=18]="Array";O[O.Object=19]="Object";O[O.Key=20]="Key";O[O.Null=21]="Null";O[O.EnumMember=22]="EnumMember";O[O.Struct=23]="Struct";O[O.Event=24]="Event";O[O.Operator=25]="Operator";O[O.TypeParameter=26]="TypeParameter"})(L||={});var M;((Q)=>{Q[Q.Text=1]="Text";Q[Q.Method=2]="Method";Q[Q.Function=3]="Function";Q[Q.Constructor=4]="Constructor";Q[Q.Field=5]="Field";Q[Q.Variable=6]="Variable";Q[Q.Class=7]="Class";Q[Q.Interface=8]="Interface";Q[Q.Module=9]="Module";Q[Q.Property=10]="Property";Q[Q.Unit=11]="Unit";Q[Q.Value=12]="Value";Q[Q.Enum=13]="Enum";Q[Q.Keyword=14]="Keyword";Q[Q.Snippet=15]="Snippet";Q[Q.Color=16]="Color";Q[Q.File=17]="File";Q[Q.Reference=18]="Reference";Q[Q.Folder=19]="Folder";Q[Q.EnumMember=20]="EnumMember";Q[Q.Constant=21]="Constant";Q[Q.Struct=22]="Struct";Q[Q.Event=23]="Event";Q[Q.Operator=24]="Operator";Q[Q.TypeParameter=25]="TypeParameter"})(M||={});var v;((A)=>{A[A.Text=1]="Text";A[A.Read=2]="Read";A[A.Write=3]="Write"})(v||={});class E{documents=new Map;rootUri=null;config={};messageId=0;watchers=new Map;initialize(j){return this.rootUri=j.rootUri,{capabilities:{textDocumentSync:1,hoverProvider:!0,completionProvider:{triggerCharacters:[".",":","<",'"',"'","/"],resolveProvider:!0},definitionProvider:!0,referencesProvider:!0,renameProvider:{prepareProvider:!0},documentSymbolProvider:!0,workspaceSymbolProvider:!0,codeActionProvider:{codeActionKinds:["quickfix","refactor","source"]},signatureHelpProvider:{triggerCharacters:["(",","],retriggerCharacters:[","]},documentHighlightProvider:!0,documentFormattingProvider:!0,diagnosticProvider:{interFileDependencies:!0,workspaceDiagnostics:!0}}}}didOpen(j){let{uri:z,text:G,version:A}=j.textDocument;this.updateDocument(z,G,A)}didChange(j){let{uri:z,version:G}=j.textDocument,A=j.contentChanges[0]?.text||"";this.updateDocument(z,A,G)}didClose(j){let z=j.textDocument.uri;if(this.documents.delete(z),this.watchers.get(z))T(this.uriToPath(z)),this.watchers.delete(z)}updateDocument(j,z,G){let A=this.uriToPath(j),J=F(z,A,!0);this.documents.set(j,{content:z,version:G,declarations:J})}getDiagnostics(j){let z=this.documents.get(j);if(!z)return[];let G=[];for(let A of z.declarations){if(A.isExported&&A.kind==="variable"&&!A.typeAnnotation)G.push({range:this.getDeclarationRange(A,z.content),severity:2,code:"missing-type",source:"dtsx",message:`Exported variable '${A.name}' should have an explicit type annotation for better declaration generation`});if(A.typeAnnotation==="any"||A.returnType==="any")G.push({range:this.getDeclarationRange(A,z.content),severity:3,code:"any-type",source:"dtsx",message:"Consider using a more specific type instead of 'any'"});if(A.kind==="function"&&A.isExported&&!A.returnType)G.push({range:this.getDeclarationRange(A,z.content),severity:3,code:"missing-return-type",source:"dtsx",message:`Function '${A.name}' should have an explicit return type for better declaration generation`})}return G}hover(j){let z=this.documents.get(j.textDocument.uri);if(!z)return null;let{line:G,character:A}=j.position,R=z.content.split(`
3
3
  `)[G]||"",U=R.slice(0,A).match(/[\w$]+$/),V=R.slice(A).match(/^[\w$]+/);if(!U&&!V)return null;let X=(U?.[0]||"")+(V?.[0]||""),Y=z.declarations.find((W)=>W.name===X);if(!Y)return null;let B=`\`\`\`typescript
4
4
  ${this.buildSignature(Y)}
5
5
  \`\`\``;if(Y.leadingComments&&Y.leadingComments.length>0){let q=Y.leadingComments.join(`
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ac as v,Bc as w,oc as j,pc as k,qc as l,rc as m,sc as n,tc as o,uc as p,vc as q,wc as r,xc as s,yc as t,zc as u}from"./chunk-pdvve1gm.js";import{Ec as a,Fc as b,Gc as c,Hc as d,Ic as e,Jc as f,Kc as g,Lc as h,Mc as i}from"./chunk-sv136qag.js";import"./chunk-ns3hznyf.js";export{l as processVariableDeclaration,n as processTypeDeclaration,s as processModuleDeclaration,m as processInterfaceDeclaration,q as processImportDeclaration,k as processFunctionDeclaration,r as processExportDeclaration,p as processEnumDeclaration,w as processDeclarations,o as processClassDeclaration,u as parseImportStatement,d as parseArrayElements,h as isGenericType,e as inferObjectType,b as inferNarrowTypeInUnion,a as inferNarrowType,g as inferFunctionType,c as inferArrayType,j as formatComments,f as findMatchingBracket,i as extractSatisfiesType,v as extractAllImportedItems,t as clearProcessorCaches};
2
+ import{Ac as u,Bc as v,Cc as w,pc as j,qc as k,rc as l,sc as m,tc as n,uc as o,vc as p,wc as q,xc as r,yc as s,zc as t}from"./chunk-vpjw38x7.js";import{Fc as a,Gc as b,Hc as c,Ic as d,Jc as e,Kc as f,Lc as g,Mc as h,Nc as i}from"./chunk-285mqzvx.js";import"./chunk-mcdb3q06.js";export{l as processVariableDeclaration,n as processTypeDeclaration,s as processModuleDeclaration,m as processInterfaceDeclaration,q as processImportDeclaration,k as processFunctionDeclaration,r as processExportDeclaration,p as processEnumDeclaration,w as processDeclarations,o as processClassDeclaration,u as parseImportStatement,d as parseArrayElements,h as isGenericType,e as inferObjectType,b as inferNarrowTypeInUnion,a as inferNarrowType,g as inferFunctionType,c as inferArrayType,j as formatComments,f as findMatchingBracket,i as extractSatisfiesType,v as extractAllImportedItems,t as clearProcessorCaches};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{I as a,J as b,K as c,L as d,M as e,N as f,O as g,P as h}from"./chunk-d0p3jzwb.js";import"./chunk-ns3hznyf.js";export{b as toZod,e as toYup,c as toValibot,a as toJsonSchema,d as toIoTs,f as toArkType,h as getFormatExtension,g as convertToFormat};
2
+ import{I as a,J as b,K as c,L as d,M as e,N as f,O as g,P as h}from"./chunk-d0p3jzwb.js";import"./chunk-mcdb3q06.js";export{b as toZod,e as toYup,c as toValibot,a as toJsonSchema,d as toIoTs,f as toArkType,h as getFormatExtension,g as convertToFormat};
@@ -0,0 +1,19 @@
1
+ // @bun
2
+ import{hc as E}from"./chunk-2n1bbm2c.js";import{lc as p,mc as Rq,nc as zq}from"./chunk-8z31rkfp.js";import{Fc as Jq}from"./chunk-285mqzvx.js";import{bd as D}from"./chunk-mcdb3q06.js";var L=D(E(),1);var v=D(E(),1);var I=new Map,S=new Map,Oq=100;function Lq(){while(I.size>Oq){let q=I.keys().next().value;if(q===void 0)break;I.delete(q)}}function Vq(){I.clear()}function _q(){return I.size}var Uq={asyncThreshold:1e5,chunkSize:50000,yieldInterval:0};function u(q){return new Promise(($)=>{if(q===0)if(typeof setImmediate<"u")setImmediate($);else setTimeout($,0);else setTimeout($,q)})}async function Iq(q,$,Q){if($.length<Q.asyncThreshold)return v.createSourceFile(q,$,v.ScriptTarget.Latest,!0,v.ScriptKind.TS);await u(Q.yieldInterval);let W=v.createSourceFile(q,$,v.ScriptTarget.Latest,!1,v.ScriptKind.TS);return await u(Q.yieldInterval),W}async function g(q,$,Q={}){let W={...Uq,...Q},V=p($),Z=q,U=Date.now(),j=I.get(Z);if(j&&j.contentHash===V)return j.lastAccess=U,I.delete(Z),I.set(Z,j),j.sourceFile;let X=S.get(Z);if(X)return X;let w=(async()=>{try{let H=await Iq(q,$,W);return I.set(Z,{sourceFile:H,contentHash:V,lastAccess:U}),Lq(),H}finally{S.delete(Z)}})();return S.set(Z,w),w}async function vq(q,$={}){let Q=$.concurrency??4,W=new Map,V=[];for(let Z=0;Z<q.length;Z+=Q){let U=q.slice(Z,Z+Q),j=await Promise.allSettled(U.map(async({filePath:X,sourceCode:w})=>{let H=await g(X,w,$);return{filePath:X,sourceFile:H}}));for(let X=0;X<j.length;X++){let w=j[X];if(w.status==="fulfilled")W.set(w.value.filePath,w.value.sourceFile);else V.push({filePath:U[X].filePath,error:w.reason})}if(Z+Q<q.length)await u(0)}if(V.length>0)console.warn(`[dtsx] ${V.length} file(s) failed to parse:`,V.map((Z)=>Z.filePath));return W}function Aq(q,$={}){let Q=$.asyncThreshold??Uq.asyncThreshold;return q.length>=Q}function kq(){return S.size}var R=D(E(),1);var Y=D(E(),1);var O=D(E(),1);function P(q,$,Q){return $.slice(Q?q.getStart(Q):q.getStart(),q.getEnd())}var wq=/\/\*[\s\S]*?\*\//g;function _(q,$){let Q=[],W=q.getFullStart(),V=q.getStart($);if(W===V)return Q;let Z=$.text.substring(W,V);if(Z.indexOf("/*")!==-1){wq.lastIndex=0;let U;while((U=wq.exec(Z))!==null)Q.push(U[0])}if(Z.indexOf("//")!==-1){let U=Z.split(`
3
+ `),j=[];for(let X=U.length-1;X>=0;X--){let w=U[X].trim();if(w.startsWith("//"))j.unshift(w);else if(w==="")continue;else break}if(j.length>0)Q.push(j.join(`
4
+ `))}return Q}function k(q,$){if(O.isObjectBindingPattern(q.name)){let Q=q.name.elements.map((W)=>{if(O.isBindingElement(W)&&O.isIdentifier(W.name))return W.name.getText($);return""}).filter(Boolean);if(Q.length>3)return`{
5
+ ${Q.join(`,
6
+ `)},
7
+ }`;return`{ ${Q.join(", ")} }`}else if(O.isArrayBindingPattern(q.name))return`[${q.name.elements.map((W)=>{if(W&&O.isBindingElement(W)&&O.isIdentifier(W.name))return W.name.getText($);return""}).filter(Boolean).join(", ")}]`;else return q.name.getText($)}function B(q){if(!("modifiers"in q)||!q.modifiers)return!1;return q.modifiers.some((Q)=>Q.kind===O.SyntaxKind.ExportKeyword)}function l(q){return q.modifiers?.some(($)=>$.kind===O.SyntaxKind.AsyncKeyword)||!1}function c(q,$){return!1}var N=new Map;function d(q,$){let Q=N.get(q);if(!Q){let W=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(Q={funcPattern:new RegExp(`export\\s+[^\\n]*:\\s*[^\\n]*\\b${W}\\b`,"gm"),typePattern:new RegExp(`export\\s+[^\\n]*\\b${W}\\b`,"gm")},N.set(q,Q),N.size>200){let V=Array.from(N.keys()).slice(0,50);for(let Z of V)N.delete(Z)}}return Q.funcPattern.lastIndex=0,Q.typePattern.lastIndex=0,Q.funcPattern.test($)||Q.typePattern.test($)}var Mq=new Set(["string","number","boolean","object","any","unknown","never","void","undefined","null","Array","Promise","Record","Partial","Required","Pick","Omit","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisType","Function","Date","RegExp","Error","Map","Set","WeakMap","WeakSet","T","K","V","U","R","P","E","A","B","C","D","F","G","H","I","J","L","M","N","O","Q","S","W","X","Y","Z"]);function m(q){return Mq.has(q)}var Yq=/(?:export\s+)?(?:declare\s+)?(?:const\s+)?(?:interface|type|class|enum)\s+([A-Z][a-zA-Z0-9]*)/g;function i(q){let $=[];Yq.lastIndex=0;let Q;while((Q=Yq.exec(q))!==null)$.push(Q[1]);return $}var Pq=/\s+as\s+(\S+)\s*$/;function K(q,$){let Q=q.trim();if(!Q.endsWith("as const")){let V=Q.match(Pq);if(V)return V[1]}let W=Jq(Q,$);if(W==="unknown")return"unknown";if(!$){if(W==="true"||W==="false")return"boolean";if(/^-?\d+(\.\d+)?$/.test(W))return"number";if(W.startsWith('"')&&W.endsWith('"')||W.startsWith("'")&&W.endsWith("'"))return"string"}return W}function t(q,$){let Q=[],W=q.modifiers?.some((j)=>j.kind===Y.SyntaxKind.AsyncKeyword),V=!!q.asteriskToken;if(B(q))Q.push("export ");if(Q.push("declare function "),q.name)Q.push(q.name.getText($));if(q.typeParameters){let j=q.typeParameters.map((X)=>X.getText($)).join(", ");Q.push("<",j,">")}let Z=q.parameters.map((j)=>{let X=k(j,$),w=j.type?.getText($)||(j.initializer?K(j.initializer.getText($),!1):"unknown"),H=j.questionToken||j.initializer?"?":"";if(!!j.dotDotDotToken)return`...${X}: ${w}`;return`${X}${H}: ${w}`}).join(", ");Q.push("(",Z,")");let U=q.type?.getText($);if(!U)if(W&&V)U="AsyncGenerator<unknown, void, unknown>";else if(V)U="Generator<unknown, void, unknown>";else if(W)U="Promise<void>";else U="void";return Q.push(": ",U,";"),Q.join("")}function a(q,$,Q,W){let V=[];if(W)V.push("export ");if(V.push("declare ",Q," ",q),$)V.push(": ",$);return V.push(";"),V.join("")}function n(q,$,Q){let W=[];if($)W.push("export ");if(W.push("declare interface ",q.name.getText(Q)),q.typeParameters){let Z=q.typeParameters.map((U)=>U.getText(Q)).join(", ");W.push("<",Z,">")}if(q.heritageClauses){let Z=q.heritageClauses.find((U)=>U.token===Y.SyntaxKind.ExtendsKeyword);if(Z){let U=Z.types.map((j)=>j.getText(Q)).join(", ");W.push(" extends ",U)}}let V=s(q,Q);return W.push(" ",V),W.join("")}function Hq(q,$){if(!q.name)return"";return q.name.getText($)}function s(q,$){let Q=[];for(let W of q.members)if(Y.isPropertySignature(W)){let V=Hq(W,$),Z=W.type?.getText($)||"unknown",U=W.questionToken?"?":"",j=W.modifiers?.some((X)=>X.kind===Y.SyntaxKind.ReadonlyKeyword)?"readonly ":"";Q.push(` ${j}${V}${U}: ${Z}`)}else if(Y.isMethodSignature(W)){let V=Hq(W,$),Z="";if(W.typeParameters&&W.typeParameters.length>0)Z=`<${W.typeParameters.map((w)=>w.getText($)).join(", ")}>`;let U=W.parameters.map((w)=>{let H=w.name.getText($),G=w.type?.getText($)||"unknown",J=w.questionToken?"?":"";if(!!w.dotDotDotToken)return`...${H}: ${G}`;return`${H}${J}: ${G}`}).join(", "),j=W.type?.getText($)||"void",X=W.questionToken?"?":"";Q.push(` ${V}${X}${Z}(${U}): ${j}`)}else if(Y.isCallSignatureDeclaration(W)){let V=W.parameters.map((U)=>{let j=U.name.getText($),X=U.type?.getText($)||"unknown",w=U.questionToken?"?":"";if(!!U.dotDotDotToken)return`...${j}: ${X}`;return`${j}${w}: ${X}`}).join(", "),Z=W.type?.getText($)||"void";Q.push(` (${V}): ${Z}`)}else if(Y.isConstructSignatureDeclaration(W)){let V=W.parameters.map((U)=>{let j=U.name.getText($),X=U.type?.getText($)||"unknown",w=U.questionToken?"?":"";if(!!U.dotDotDotToken)return`...${j}: ${X}`;return`${j}${w}: ${X}`}).join(", "),Z=W.type?.getText($)||"unknown";Q.push(` new (${V}): ${Z}`)}else if(Y.isIndexSignatureDeclaration(W)){let V=W.parameters.map((U)=>{let j=U.name.getText($),X=U.type?.getText($)||"any";return`${j}: ${X}`}).join(", "),Z=W.type?.getText($)||"unknown";Q.push(` [${V}]: ${Z}`)}return`{
8
+ ${Q.join(`
9
+ `)}
10
+ }`}function o(q,$,Q){let W=[];if($)W.push("export ");if(W.push("type ",q.name.getText(Q)),q.typeParameters){let V=q.typeParameters.map((Z)=>Z.getText(Q)).join(", ");W.push("<",V,">")}return W.push(" = ",q.type.getText(Q)),W.join("")}function r(q,$,Q){let W=[];if($)W.push("export ");if(W.push("declare "),q.modifiers?.some((j)=>j.kind===Y.SyntaxKind.AbstractKeyword))W.push("abstract ");if(W.push("class ",q.name?.getText(Q)||"AnonymousClass"),q.typeParameters){let j=q.typeParameters.map((X)=>X.getText(Q)).join(", ");W.push("<",j,">")}let Z=q.heritageClauses?.find((j)=>j.token===Y.SyntaxKind.ExtendsKeyword)?.types[0]?.getText(Q);if(Z)W.push(" extends ",Z);let U=q.heritageClauses?.find((j)=>j.token===Y.SyntaxKind.ImplementsKeyword)?.types.map((j)=>j.getText(Q));if(U&&U.length>0)W.push(" implements ",U.join(", "));return W.push(" ",Gq(q,Q)),W.join("")}function T(q,$,Q,W,V){let Z=[" "];if(W)Z.push("private ");else if(V)Z.push("protected ");if(q)Z.push("static ");if($)Z.push("abstract ");if(Q)Z.push("readonly ");return Z.join("")}function h(q){return q.name?Y.isPrivateIdentifier(q.name):!1}function b(q,$){if(!q.name)return"";return q.name.getText($)}function Gq(q,$){let Q=[];for(let W of q.members){if(W.kind===Y.SyntaxKind.ClassStaticBlockDeclaration)continue;if(Y.isConstructorDeclaration(W)){for(let Z of W.parameters)if(Z.modifiers&&Z.modifiers.length>0){if(Z.modifiers.some((J)=>J.kind===Y.SyntaxKind.PrivateKeyword))continue;let j=k(Z,$),X=Z.type?.getText($)||(Z.initializer?K(Z.initializer.getText($),!1):"unknown"),w=Z.questionToken||Z.initializer?"?":"",H=Z.modifiers.map((J)=>J.getText($)).join(" "),G=H?`${H} `:"";Q.push(` ${G}${j}${w}: ${X};`)}let V=W.parameters.map((Z)=>{let U=k(Z,$),j=Z.type?.getText($)||(Z.initializer?K(Z.initializer.getText($),!1):"unknown"),X=Z.questionToken||Z.initializer?"?":"";return`${U}${X}: ${j}`}).join(", ");Q.push(` constructor(${V});`)}else if(Y.isMethodDeclaration(W)){if(h(W))continue;if(W.modifiers?.some((J)=>J.kind===Y.SyntaxKind.PrivateKeyword))continue;let Z=b(W,$),U=!!W.asteriskToken,X=[T(!!W.modifiers?.some((J)=>J.kind===Y.SyntaxKind.StaticKeyword),!!W.modifiers?.some((J)=>J.kind===Y.SyntaxKind.AbstractKeyword),!1,!1,!!W.modifiers?.some((J)=>J.kind===Y.SyntaxKind.ProtectedKeyword))];if(U)X.push("*");if(X.push(Z),W.typeParameters){let J=W.typeParameters.map((z)=>z.getText($)).join(", ");X.push("<",J,">")}let w=W.parameters.map((J)=>{let z=k(J,$),M=J.type?.getText($)||(J.initializer?K(J.initializer.getText($),!1):"unknown"),A=J.questionToken||J.initializer?"?":"";return`${z}${A}: ${M}`}).join(", ");X.push("(",w,")");let H=!!W.modifiers?.some((J)=>J.kind===Y.SyntaxKind.AsyncKeyword),G=W.type?.getText($);if(!G)if(H&&U)G="AsyncGenerator<unknown, void, unknown>";else if(U)G="Generator<unknown, void, unknown>";else if(H)G="Promise<void>";else G="void";X.push(": ",G,";"),Q.push(X.join(""))}else if(Y.isPropertyDeclaration(W)){if(h(W))continue;if(W.modifiers?.some((J)=>J.kind===Y.SyntaxKind.PrivateKeyword))continue;let Z=b(W,$),U=T(!!W.modifiers?.some((J)=>J.kind===Y.SyntaxKind.StaticKeyword),!!W.modifiers?.some((J)=>J.kind===Y.SyntaxKind.AbstractKeyword),!!W.modifiers?.some((J)=>J.kind===Y.SyntaxKind.ReadonlyKeyword),!1,!!W.modifiers?.some((J)=>J.kind===Y.SyntaxKind.ProtectedKeyword)),j=W.questionToken?"?":"",X=!!W.modifiers?.some((J)=>J.kind===Y.SyntaxKind.StaticKeyword),w=!!W.modifiers?.some((J)=>J.kind===Y.SyntaxKind.ReadonlyKeyword),H=X&&w,G=W.type?.getText($)||(W.initializer?K(W.initializer.getText($),H):"unknown");Q.push(`${U}${Z}${j}: ${G};`)}else if(Y.isGetAccessorDeclaration(W)){if(h(W))continue;if(W.modifiers?.some((X)=>X.kind===Y.SyntaxKind.PrivateKeyword))continue;let Z=b(W,$),U=T(!!W.modifiers?.some((X)=>X.kind===Y.SyntaxKind.StaticKeyword),!!W.modifiers?.some((X)=>X.kind===Y.SyntaxKind.AbstractKeyword),!1,!1,!!W.modifiers?.some((X)=>X.kind===Y.SyntaxKind.ProtectedKeyword)),j=W.type?.getText($)||"unknown";Q.push(`${U}get ${Z}(): ${j};`)}else if(Y.isSetAccessorDeclaration(W)){if(h(W))continue;if(W.modifiers?.some((H)=>H.kind===Y.SyntaxKind.PrivateKeyword))continue;let Z=b(W,$),U=T(!!W.modifiers?.some((H)=>H.kind===Y.SyntaxKind.StaticKeyword),!!W.modifiers?.some((H)=>H.kind===Y.SyntaxKind.AbstractKeyword),!1,!1,!!W.modifiers?.some((H)=>H.kind===Y.SyntaxKind.ProtectedKeyword)),j=W.parameters[0],X=j?.type?.getText($)||"unknown",w=j?.name?.getText($)||"value";Q.push(`${U}set ${Z}(${w}: ${X});`)}}return`{
11
+ ${Q.join(`
12
+ `)}
13
+ }`}function e(q,$,Q){let W=[];if(q.flags&Y.NodeFlags.GlobalAugmentation)return`declare global ${x(q,Q)}`;if($)W.push("export ");W.push("declare ");let Z=q.flags&Y.NodeFlags.Namespace;return W.push(Z?"namespace ":"module "),W.push(q.name.getText(Q)),W.push(" ",x(q,Q)),W.join("")}function x(q,$){if(!q.body)return"{}";let Q=[];function W(V){if(Y.isFunctionDeclaration(V)){let Z=B(V),U=V.name?.getText($)||"",j=[" "];if(Z)j.push("export ");if(j.push("function ",U),V.typeParameters){let H=V.typeParameters.map((G)=>G.getText($)).join(", ");j.push("<",H,">")}let X=V.parameters.map((H)=>{let G=k(H,$),J=H.type?.getText($)||(H.initializer?K(H.initializer.getText($),!1):"unknown"),z=H.questionToken||H.initializer?"?":"";return`${G}${z}: ${J}`}).join(", ");j.push("(",X,")");let w=V.type?.getText($)||"void";j.push(": ",w,";"),Q.push(j.join(""))}else if(Y.isVariableStatement(V)){let Z=B(V);for(let U of V.declarationList.declarations)if(U.name&&Y.isIdentifier(U.name)){let j=U.name.getText($),X=U.type?.getText($),w=U.initializer?.getText($),H=V.declarationList.flags&Y.NodeFlags.Const?"const":V.declarationList.flags&Y.NodeFlags.Let?"let":"var",G=[" "];if(Z)G.push("export ");if(G.push(H," ",j),X)G.push(": ",X);else if(w){let J=K(w,H==="const");G.push(": ",J)}else G.push(": unknown");G.push(";"),Q.push(G.join(""))}}else if(Y.isInterfaceDeclaration(V)){let Z=B(V),U=V.name.getText($),j=[" "];if(Z)j.push("export ");if(j.push("interface ",U),V.typeParameters){let w=V.typeParameters.map((H)=>H.getText($)).join(", ");j.push("<",w,">")}if(V.heritageClauses){let w=V.heritageClauses.find((H)=>H.token===Y.SyntaxKind.ExtendsKeyword);if(w){let H=w.types.map((G)=>G.getText($)).join(", ");j.push(" extends ",H)}}let X=s(V,$);j.push(" ",X),Q.push(j.join(""))}else if(Y.isTypeAliasDeclaration(V)){let Z=B(V),U=V.name.getText($),j=[" "];if(Z)j.push("export ");if(j.push("type ",U),V.typeParameters){let X=V.typeParameters.map((w)=>w.getText($)).join(", ");j.push("<",X,">")}j.push(" = ",V.type.getText($)),Q.push(j.join(""))}else if(Y.isEnumDeclaration(V)){let Z=B(V),U=V.name.getText($),j=V.modifiers?.some((H)=>H.kind===Y.SyntaxKind.ConstKeyword),X=[" "];if(Z)X.push("export ");if(j)X.push("const ");X.push("enum ",U);let w=[];for(let H of V.members)if(Y.isEnumMember(H)){let G=H.name.getText($);if(H.initializer){let J=H.initializer.getText($);w.push(` ${G} = ${J}`)}else w.push(` ${G}`)}X.push(` {
14
+ `,w.join(`,
15
+ `),`
16
+ }`),Q.push(X.join(""))}else if(Y.isModuleDeclaration(V)){let Z=B(V),U=V.name.getText($),j=[" "];if(Z)j.push("export ");let X=V.flags&Y.NodeFlags.Namespace;j.push(X?"namespace ":"module "),j.push(U," ",x(V,$)),Q.push(j.join(""))}else if(Y.isExportAssignment(V)){let Z=[" export default "];if(V.expression)Z.push(V.expression.getText($));Z.push(";"),Q.push(Z.join(""))}}if(Y.isModuleBlock(q.body))for(let V of q.body.statements)W(V);else if(Y.isModuleDeclaration(q.body))W(q.body);return`{
17
+ ${Q.join(`
18
+ `)}
19
+ }`}function qq(q,$,Q){let W=P(q,$,Q),V=!!q.importClause?.isTypeOnly,Z=!q.importClause;return{kind:"import",name:"",text:W,isExported:!1,isTypeOnly:V,isSideEffect:Z,source:q.moduleSpecifier.getText(Q).slice(1,-1),start:q.getStart(Q),end:q.getEnd()}}function Qq(q,$,Q,W=!1){let V=P(q,$,Q),Z=!!q.isTypeOnly,U=W?_(q,Q):void 0;return{kind:"export",name:"",text:V,isExported:!0,isTypeOnly:Z,leadingComments:U,source:q.moduleSpecifier?.getText(Q).slice(1,-1),start:q.getStart(Q),end:q.getEnd()}}function Wq(q,$,Q,W=!1){let V=P(q,$,Q),Z=W?_(q,Q):void 0;return{kind:"export",name:"default",text:V,isExported:!0,isTypeOnly:!1,leadingComments:Z,start:q.getStart(Q),end:q.getEnd()}}function $q(q,$,Q,W){if(!q.name)return null;if(q.body){let z=q.name.getText(Q),M=!1;if(R.forEachChild(Q,(A)=>{if(R.isFunctionDeclaration(A)&&A!==q&&A.name?.getText(Q)===z&&!A.body)M=!0}),M)return null}let V=q.name.getText(Q),Z=B(q),U=l(q),j=!!q.asteriskToken,X=t(q,Q),w=q.parameters.map((z)=>({name:z.name.getText(Q),type:z.type?.getText(Q)||"any",optional:!!z.questionToken,defaultValue:z.initializer?.getText(Q)})),H=q.type?.getText(Q);if(!H)if(U&&j)H="AsyncGenerator<unknown, void, unknown>";else if(j)H="Generator<unknown, void, unknown>";else if(U)H="Promise<void>";else H="void";let G=q.typeParameters?.map((z)=>z.getText(Q)).join(", "),J=W?_(q,Q):void 0;return{kind:"function",name:V,text:X,isExported:Z,isAsync:U,isGenerator:j,parameters:w,returnType:H,generics:G?`<${G}>`:void 0,leadingComments:J,start:q.getStart(Q),end:q.getEnd()}}function Dq(q,$){let Q=q.getText($);if(q.kind===R.SyntaxKind.ObjectLiteralExpression)return`typeof ${Q} as const`;if(q.kind===R.SyntaxKind.ArrayLiteralExpression)return`readonly ${Q}`;if(q.kind===R.SyntaxKind.StringLiteral)return Q;if(q.kind===R.SyntaxKind.NumericLiteral)return Q;if(q.kind===R.SyntaxKind.TrueKeyword||q.kind===R.SyntaxKind.FalseKeyword)return Q;return`typeof ${Q}`}function jq(q,$,Q,W){let V=[];if(!B(q))return V;for(let U of q.declarationList.declarations){if(!U.name||!R.isIdentifier(U.name))continue;let j=U.name.getText(Q),X=U.type?.getText(Q),w=U.initializer,H=w?.getText(Q),G=q.declarationList.flags&R.NodeFlags.Const?"const":q.declarationList.flags&R.NodeFlags.Let?"let":"var",J=!1;if(w&&R.isAsExpression(w)){if(w.type.getText(Q)==="const"){J=!0;let Bq=w.expression;if(!X)X=Dq(Bq,Q)}}let z=a(j,X,G,!0),M=W?_(q,Q):void 0;V.push({kind:"variable",name:j,text:z,isExported:!0,typeAnnotation:X,value:H,modifiers:J?[G,"const assertion"]:[G],leadingComments:M,start:q.getStart(Q),end:q.getEnd()})}return V}function F(q,$,Q,W){let V=q.name.getText(Q),Z=B(q),U=n(q,Z,Q),j=q.heritageClauses?.find((H)=>H.token===R.SyntaxKind.ExtendsKeyword)?.types.map((H)=>H.getText(Q)).join(", "),X=q.typeParameters?.map((H)=>H.getText(Q)).join(", "),w=W?_(q,Q):void 0;return{kind:"interface",name:V,text:U,isExported:Z,extends:j,generics:X?`<${X}>`:void 0,leadingComments:w,start:q.getStart(Q),end:q.getEnd()}}function C(q,$,Q,W){let V=q.name.getText(Q),Z=B(q),U=o(q,Z,Q),j=q.typeParameters?.map((w)=>w.getText(Q)).join(", "),X=W?_(q,Q):void 0;return{kind:"type",name:V,text:U,isExported:Z,generics:j?`<${j}>`:void 0,leadingComments:X,start:q.getStart(Q),end:q.getEnd()}}function y(q,$,Q,W){let V=q.name?.getText(Q)||"AnonymousClass",Z=B(q),U=r(q,Z,Q),j=q.heritageClauses?.find((J)=>J.token===R.SyntaxKind.ExtendsKeyword)?.types[0]?.getText(Q),X=q.heritageClauses?.find((J)=>J.token===R.SyntaxKind.ImplementsKeyword)?.types.map((J)=>J.getText(Q)),w=q.typeParameters?.map((J)=>J.getText(Q)).join(", "),H=q.modifiers?.some((J)=>J.kind===R.SyntaxKind.AbstractKeyword),G=W?_(q,Q):void 0;return{kind:"class",name:V,text:U,isExported:Z,extends:j,implements:X,generics:w?`<${w}>`:void 0,modifiers:H?["abstract"]:void 0,leadingComments:G,start:q.getStart(Q),end:q.getEnd()}}function f(q,$,Q,W){let V=q.name.getText(Q),Z=B(q),U=P(q,$,Q),j=q.modifiers?.some((w)=>w.kind===R.SyntaxKind.ConstKeyword),X=W?_(q,Q):void 0;return{kind:"enum",name:V,text:U,isExported:Z,modifiers:j?["const"]:void 0,leadingComments:X,start:q.getStart(Q),end:q.getEnd()}}function Xq(q,$,Q,W){let V=q.name.getText(Q),Z=B(q),U=e(q,Z,Q),j=R.isStringLiteral(q.name),X=W?_(q,Q):void 0;return{kind:"module",name:V,text:U,isExported:Z,source:j?V.slice(1,-1):void 0,leadingComments:X,start:q.getStart(Q),end:q.getEnd()}}function Zq(q,$){let Q=new Set,W=new Set,V=new Set;for(let Z of q)if(Z.kind==="import"){let U=Z.text.match(/import\s+(?:type\s+)?\{([^}]+)\}/g);if(U)for(let j of U){let X=j.replace(/import\s+(?:type\s+)?\{([^}]+)\}/,"$1").split(",");for(let w of X){let H=w.replace(/^type\s+/,"").trim();W.add(H)}}}for(let Z of q){if(["interface","type","class","enum"].includes(Z.kind))V.add(Z.name);if(Z.kind==="module")i(Z.text).forEach((j)=>V.add(j))}for(let Z of q)if(Z.kind!=="import"&&Z.kind!=="export"){let U=Z.text.match(/:\s*([A-Z][a-zA-Z0-9]*)/g)||[];for(let j of U){let X=j.replace(/:\s*/,"");if(!W.has(X)&&!V.has(X)&&!m(X))Q.add(X)}}return Q}function Eq(q,$,Q,W=!0){let V=[];if($.size===0)return V;function Z(U){switch(U.kind){case R.SyntaxKind.InterfaceDeclaration:{let j=U,X=j.name.getText(q);if($.has(X)){let w=F(j,Q,q,W);V.push(w),$.delete(X)}break}case R.SyntaxKind.TypeAliasDeclaration:{let j=U,X=j.name.getText(q);if($.has(X)){let w=C(j,Q,q,W);V.push(w),$.delete(X)}break}case R.SyntaxKind.ClassDeclaration:{let j=U;if(j.name){let X=j.name.getText(q);if($.has(X)){let w=y(j,Q,q,W);V.push(w),$.delete(X)}}break}case R.SyntaxKind.EnumDeclaration:{let j=U,X=j.name.getText(q);if($.has(X)){let w=f(j,Q,q,W);V.push(w),$.delete(X)}break}}R.forEachChild(U,Z)}return Z(q),V}function tq(){Vq(),zq()}function aq(q,$,Q=!0,W=!1){return Rq(q,$,Q,W)}function Nq(q,$,Q){let W=[],V=new Map,Z=0;function U(j){if(Z!==1){Z++,L.forEachChild(j,U),Z--;return}switch(j.kind){case L.SyntaxKind.ImportDeclaration:W.push(qq(j,$,q));break;case L.SyntaxKind.ExportDeclaration:W.push(Qq(j,$,q,Q));break;case L.SyntaxKind.ExportAssignment:W.push(Wq(j,$,q,Q));break;case L.SyntaxKind.FunctionDeclaration:{let X=$q(j,$,q,Q);if(X&&(X.isExported||c(X.name,$)))W.push(X);break}case L.SyntaxKind.VariableStatement:{let X=jq(j,$,q,Q);W.push(...X);break}case L.SyntaxKind.InterfaceDeclaration:{let X=F(j,$,q,Q);if(X.isExported||d(X.name,$))W.push(X);else V.set(X.name,X);break}case L.SyntaxKind.TypeAliasDeclaration:{let X=C(j,$,q,Q);if(W.push(X),!X.isExported)V.set(X.name,X);break}case L.SyntaxKind.ClassDeclaration:{let X=y(j,$,q,Q);if(W.push(X),!X.isExported&&X.name)V.set(X.name,X);break}case L.SyntaxKind.EnumDeclaration:{let X=f(j,$,q,Q);if(W.push(X),!X.isExported)V.set(X.name,X);break}case L.SyntaxKind.ModuleDeclaration:W.push(Xq(j,$,q,Q));break}}if(U(q),V.size>0){let j=Zq(W,$);for(let X of j){let w=V.get(X);if(w)W.push(w)}}return W}async function Sq(q,$,Q=!0,W={}){let V=await g($,q,W);return Nq(V,q,Q)}async function nq(q,$={}){let Q=$.concurrency??4,W=new Map;for(let V=0;V<q.length;V+=Q){let Z=q.slice(V,V+Q),U=await Promise.all(Z.map(async({filePath:j,sourceCode:X,keepComments:w})=>{let H=await Sq(X,j,w,$);return{filePath:j,declarations:H}}));for(let{filePath:j,declarations:X}of U)W.set(j,X)}return W}export{_q as wb,g as xb,vq as yb,Aq as zb,kq as Ab,P as Bb,_ as Cb,k as Db,B as Eb,l as Fb,c as Gb,d as Hb,m as Ib,i as Jb,t as Kb,a as Lb,n as Mb,s as Nb,o as Ob,r as Pb,Gq as Qb,e as Rb,x as Sb,qq as Tb,Qq as Ub,Wq as Vb,$q as Wb,jq as Xb,F as Yb,C as Zb,y as _b,f as $b,Xq as ac,Zq as bc,Eq as cc,tq as dc,aq as ec,Sq as fc,nq as gc};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Vc as I}from"./chunk-57agx6g8.js";import{cpus as K}from"os";import{resolve as J}from"path";import{Worker as M}from"worker_threads";var __dirname="/home/runner/work/dtsx/dtsx/packages/dtsx/src";class L{workers=[];taskQueue=[];config;stats={totalTasks:0,completedTasks:0,failedTasks:0,averageDuration:0,activeWorkers:0,idleWorkers:0};isShuttingDown=!1;idleCheckInterval=null;constructor(q={}){let y=q.maxWorkers??Math.max(1,K().length-1);this.config={maxWorkers:y,taskTimeout:q.taskTimeout??30000,recycleAfter:q.recycleAfter??100,idleTimeout:q.idleTimeout??1e4,initialWorkers:q.initialWorkers??Math.min(2,y)}}async init(){let q=Math.min(this.config.initialWorkers,this.config.maxWorkers);for(let y=0;y<q;y++)this.createWorker();if(this.config.idleTimeout>0){if(this.idleCheckInterval=setInterval(()=>{this.checkIdleWorkers()},5000),this.idleCheckInterval&&typeof this.idleCheckInterval==="object"&&"unref"in this.idleCheckInterval)this.idleCheckInterval.unref()}}createWorker(){let q=`
2
+ import{Wc as I}from"./chunk-gssantc8.js";import{cpus as K}from"os";import{resolve as J}from"path";import{Worker as M}from"worker_threads";var __dirname="/home/runner/work/dtsx/dtsx/packages/dtsx/src";class L{workers=[];taskQueue=[];config;stats={totalTasks:0,completedTasks:0,failedTasks:0,averageDuration:0,activeWorkers:0,idleWorkers:0};isShuttingDown=!1;idleCheckInterval=null;constructor(q={}){let y=q.maxWorkers??Math.max(1,K().length-1);this.config={maxWorkers:y,taskTimeout:q.taskTimeout??30000,recycleAfter:q.recycleAfter??100,idleTimeout:q.idleTimeout??1e4,initialWorkers:q.initialWorkers??Math.min(2,y)}}async init(){let q=Math.min(this.config.initialWorkers,this.config.maxWorkers);for(let y=0;y<q;y++)this.createWorker();if(this.config.idleTimeout>0){if(this.idleCheckInterval=setInterval(()=>{this.checkIdleWorkers()},5000),this.idleCheckInterval&&typeof this.idleCheckInterval==="object"&&"unref"in this.idleCheckInterval)this.idleCheckInterval.unref()}}createWorker(){let q=`
3
3
  const { parentPort } = require('worker_threads');
4
4
  const bun = typeof Bun !== 'undefined' ? Bun : null;
5
5
  const fs = bun ? null : require('node:fs');
@@ -39,9 +39,11 @@ import{Vc as I}from"./chunk-57agx6g8.js";import{cpus as K}from"os";import{resolv
39
39
  const filePath = filePaths ? filePaths[i] : file.filePath;
40
40
  if (sourceCode != null) {
41
41
  readPromises[i] = Promise.resolve(sourceCode);
42
- } else if (bun) {
42
+ }
43
+ else if (bun) {
43
44
  readPromises[i] = bun.file(filePath).text();
44
- } else {
45
+ }
46
+ else {
45
47
  readPromises[i] = Promise.resolve(fs.readFileSync(filePath, 'utf-8'));
46
48
  }
47
49
  }
@@ -66,14 +68,16 @@ import{Vc as I}from"./chunk-57agx6g8.js";import{cpus as K}from"os";import{resolv
66
68
 
67
69
  if (writeOutput) {
68
70
  if (!outPath) {
69
- throw new Error('Missing outPath for ' + filePath);
71
+ throw new Error(\`Missing outPath for \${filePath}\`);
70
72
  }
71
73
  if (bun) {
72
74
  writePromises[i] = bun.write(outPath, content);
73
- } else {
75
+ }
76
+ else {
74
77
  fs.writeFileSync(outPath, content);
75
78
  }
76
- } else if (results) {
79
+ }
80
+ else if (results) {
77
81
  results[i] = {
78
82
  filePath,
79
83
  success: true,
@@ -81,7 +85,8 @@ import{Vc as I}from"./chunk-57agx6g8.js";import{cpus as K}from"os";import{resolv
81
85
  declarations,
82
86
  };
83
87
  }
84
- } catch (error) {
88
+ }
89
+ catch (error) {
85
90
  const message = error && error.message ? error.message : String(error);
86
91
  if (writeOutput) {
87
92
  if (!errorResults) {
@@ -92,7 +97,8 @@ import{Vc as I}from"./chunk-57agx6g8.js";import{cpus as K}from"os";import{resolv
92
97
  success: false,
93
98
  error: message,
94
99
  });
95
- } else if (results) {
100
+ }
101
+ else if (results) {
96
102
  results[i] = {
97
103
  filePath,
98
104
  success: false,
@@ -108,7 +114,7 @@ import{Vc as I}from"./chunk-57agx6g8.js";import{cpus as K}from"os";import{resolv
108
114
  }
109
115
 
110
116
  const errorMessage = errorResults?.length
111
- ? (errorResults[0].filePath + ': ' + (errorResults[0].error || 'Worker batch failed'))
117
+ ? \`\${errorResults[0].filePath}: \${errorResults[0].error || 'Worker batch failed'}\`
112
118
  : undefined;
113
119
 
114
120
  return {
@@ -150,8 +156,9 @@ import{Vc as I}from"./chunk-57agx6g8.js";import{cpus as K}from"os";import{resolv
150
156
  };
151
157
  }
152
158
 
153
- throw new Error('Unknown task type: ' + task.type);
154
- } catch (error) {
159
+ throw new Error(\`Unknown task type: \${task.type}\`);
160
+ }
161
+ catch (error) {
155
162
  return {
156
163
  id: task.id,
157
164
  success: false,
package/dist/compat.d.ts CHANGED
@@ -15,11 +15,14 @@ export declare function write(path: string, content: string | Uint8Array | Array
15
15
  */
16
16
  export declare function spawnProcess(command: string | string[], options?: CompatSpawnOptions): SpawnResult;
17
17
  /**
18
- * Read a file as text with cross-runtime compatibility
18
+ * Read a file as text with cross-runtime compatibility.
19
+ * On Node.js we skip the FileHandle wrapper allocation and call readFile directly.
19
20
  */
20
21
  export declare function readTextFile(path: string): Promise<string>;
21
22
  /**
22
- * Check if a file exists with cross-runtime compatibility
23
+ * Check if a file exists with cross-runtime compatibility.
24
+ * On Node.js we go straight to stat() — the FileHandle indirection only
25
+ * mattered for Bun's optimized exists() check.
23
26
  */
24
27
  export declare function fileExists(path: string): Promise<boolean>;
25
28
  /**
@@ -1,8 +1,12 @@
1
1
  import { hashContent } from './hash';
2
2
  import type { SourceFile } from 'typescript';
3
3
  /**
4
- * Evict oldest entry if cache exceeds max size
5
- * Uses O(n) scan instead of O(n log n) sort since we add one entry at a time
4
+ * Evict the oldest entry if the cache exceeds max size.
5
+ *
6
+ * Map preserves insertion order, and the get* helpers below now promote on
7
+ * hit (delete + re-set), so the first key Map yields is always the LRU
8
+ * entry. That gives O(1) eviction — the previous implementation walked the
9
+ * full cache to find the oldest `lastAccess`.
6
10
  */
7
11
  export declare function evictOldestEntries(): void;
8
12
  /**
@@ -1,7 +1,3 @@
1
- /**
2
- * Triple-slash directive extraction — NO TypeScript dependency.
3
- * Pure string processing for maximum startup speed.
4
- */
5
1
  /**
6
2
  * Extract triple-slash directives from source code.
7
3
  * These are special comments like /// <reference types="..." />
@@ -15,4 +15,4 @@ export declare function watch(options?: Partial<DtsGenerationConfig>): Promise<v
15
15
  * Process TypeScript source code from a string (for stdin support)
16
16
  * Re-exported from process-source.ts for backward compatibility
17
17
  */
18
- export { processSource } from './process-source';
18
+ export { clearResultCache, processSource } from './process-source';
package/dist/logger.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Output to appropriate console method
3
+ */
4
+ declare function output(level: LogLevel, prefix: string, args: unknown[]): void;
1
5
  /**
2
6
  * Create a logger instance
3
7
  */
@@ -1,4 +1,8 @@
1
1
  import type { Declaration } from './types';
2
+ /**
3
+ * Sort import declarations
4
+ */
5
+ declare function sortImports(declarations: Declaration[]): Declaration[];
2
6
  /**
3
7
  * Optimize declarations
4
8
  */
@@ -4,6 +4,7 @@
4
4
  * like bun Glob, fs/promises, bundler, cache, config, etc.
5
5
  */
6
6
  export declare function processSource(sourceCode: string, filename?: string, keepComments?: boolean, importOrder?: string[], isolatedDeclarations?: boolean): string;
7
+ export declare function clearResultCache(): void;
7
8
  /**
8
9
  * Fast path for project mode — skips cache lookup/store.
9
10
  * Use when processing many files once (no cache benefit).
@@ -1,9 +1,11 @@
1
1
  /**
2
- * Get or create a cached RegExp for word boundary matching
2
+ * Get or create a cached RegExp for word boundary matching.
3
+ * Promotes the entry on a hit so the FIFO eviction approximates LRU.
3
4
  */
4
5
  export declare function getCachedRegex(pattern: string): RegExp;
5
6
  /**
6
- * Get cached import items or null if not cached
7
+ * Get cached import items or null if not cached.
8
+ * Promotes on hit for LRU-like semantics.
7
9
  */
8
10
  export declare function getImportItemsFromCache(importText: string): string[] | null;
9
11
  /**
@@ -7,6 +7,7 @@ export declare function parseImportStatement(importText: string): {
7
7
  namedItems: string[]
8
8
  source: string
9
9
  isTypeOnly: boolean
10
+ isNamespace: boolean
10
11
  } | null;
11
12
  /**
12
13
  * Extract all imported items from an import statement (with caching)