@dtsx/dtsx 0.11.48 → 0.11.50

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 (129) hide show
  1. package/dist/bin/cli.js +1 -1
  2. package/dist/{chunk-d27xpsa4.js → chunk-0rk4cvt6.js} +1 -1
  3. package/dist/{chunk-8qpzh9yc.js → chunk-0v6vmemf.js} +3 -3
  4. package/dist/{chunk-564pr6v4.js → chunk-1mg4cxd3.js} +1 -1
  5. package/dist/{chunk-pkdrq4sh.js → chunk-258337ef.js} +1 -1
  6. package/dist/{chunk-hzybfasv.js → chunk-25vpx6mq.js} +1 -1
  7. package/dist/{chunk-h6ngkqg7.js → chunk-2t2xwzj5.js} +1 -1
  8. package/dist/{chunk-c87yyjv7.js → chunk-31rb15pe.js} +1 -1
  9. package/dist/{chunk-qmg1535a.js → chunk-3mp0jaa7.js} +2 -2
  10. package/dist/{chunk-fn2xxavw.js → chunk-4p9dw996.js} +1 -1
  11. package/dist/{chunk-x5bspdyq.js → chunk-5rrxzd1e.js} +2 -2
  12. package/dist/{chunk-nf10pph8.js → chunk-5zzvxzey.js} +2 -2
  13. package/dist/{chunk-d0dbet9n.js → chunk-6exq13f9.js} +3 -3
  14. package/dist/{chunk-pp9aevcb.js → chunk-90jwk3zy.js} +2 -2
  15. package/dist/{chunk-rnvqc8st.js → chunk-937czex4.js} +2 -2
  16. package/dist/{chunk-bxjswrak.js → chunk-9xep96k0.js} +2 -2
  17. package/dist/{chunk-qpahzkm0.js → chunk-a5tvswq1.js} +1 -1
  18. package/dist/{chunk-r2h572w9.js → chunk-aj2n4x1b.js} +1 -1
  19. package/dist/{chunk-zesjexqf.js → chunk-av03sjse.js} +1 -1
  20. package/dist/{chunk-h5esm323.js → chunk-b6xcyrnx.js} +5 -5
  21. package/dist/{chunk-atzh1g6f.js → chunk-beg5vxdm.js} +1 -1
  22. package/dist/{chunk-rkdyetby.js → chunk-bkwzva5v.js} +1 -1
  23. package/dist/{chunk-fkngq7na.js → chunk-bsj770f8.js} +2 -2
  24. package/dist/{chunk-adhnnbe1.js → chunk-bvtzfznj.js} +1 -1
  25. package/dist/{chunk-wrvgt39b.js → chunk-c6bfdmfy.js} +1 -1
  26. package/dist/{chunk-gqk2s9wt.js → chunk-e29deb0h.js} +2 -2
  27. package/dist/{chunk-4e02xmrg.js → chunk-ef428m5g.js} +2 -2
  28. package/dist/{chunk-zerajrvv.js → chunk-fp40v5jx.js} +1 -1
  29. package/dist/{chunk-689tfwjh.js → chunk-fvr0rwgt.js} +1 -1
  30. package/dist/{chunk-cgz4sy6k.js → chunk-gcgtyjyj.js} +1 -1
  31. package/dist/{chunk-mm1cfz16.js → chunk-gyfbehkf.js} +2 -2
  32. package/dist/{chunk-w5m9qv5k.js → chunk-h12vphnz.js} +1 -1
  33. package/dist/{chunk-vhna4qch.js → chunk-h3r142dy.js} +1 -1
  34. package/dist/{chunk-mjaf2je8.js → chunk-j4t8d6p0.js} +1 -1
  35. package/dist/{chunk-475bjqea.js → chunk-ka9qyjzn.js} +3 -3
  36. package/dist/{chunk-kdz4gxdq.js → chunk-m7jndt3v.js} +4 -4
  37. package/dist/{chunk-agq858s0.js → chunk-n833rcmj.js} +1 -1
  38. package/dist/{chunk-8dyz1cte.js → chunk-nh71w1ta.js} +3 -3
  39. package/dist/{chunk-g4eb5tgt.js → chunk-ntps0jm2.js} +1 -1
  40. package/dist/{chunk-xs0ke3f2.js → chunk-p4dpq81g.js} +3 -3
  41. package/dist/chunk-qx0pxmvs.js +38 -0
  42. package/dist/{chunk-vwn5fx4f.js → chunk-r4dq05mh.js} +1 -1
  43. package/dist/{chunk-jjdjk59m.js → chunk-s6tmjqsc.js} +1 -1
  44. package/dist/{chunk-y3vhsctr.js → chunk-skydb7vs.js} +3 -3
  45. package/dist/{chunk-4kn7y9ns.js → chunk-taa77k3y.js} +1 -1
  46. package/dist/{chunk-8hwmssy9.js → chunk-tgfj7kre.js} +1 -1
  47. package/dist/{chunk-nqdc6n5d.js → chunk-txf9rw55.js} +15 -15
  48. package/dist/{chunk-znsgvx9t.js → chunk-vrvzmysf.js} +1 -1
  49. package/dist/{chunk-29m9mhwt.js → chunk-vvy85nm6.js} +2 -2
  50. package/dist/{chunk-0kvy1dh8.js → chunk-w60gzzxc.js} +2 -2
  51. package/dist/{chunk-h2007n8k.js → chunk-w9jg9761.js} +1 -1
  52. package/dist/{chunk-1dnqddk9.js → chunk-xawz3n8s.js} +1 -1
  53. package/dist/{chunk-cgrta603.js → chunk-xcfbw2r7.js} +1 -1
  54. package/dist/{chunk-a8djrg2n.js → chunk-xsaw8abt.js} +2 -2
  55. package/dist/{chunk-p458sykz.js → chunk-yapz0de1.js} +1 -1
  56. package/dist/chunk-zrfwvjq8.js +4 -0
  57. package/dist/{chunk-ex02f2vm.js → chunk-zrmg0q1q.js} +6 -6
  58. package/dist/src/augmentation-graph.js +1 -1
  59. package/dist/src/binding-patterns.js +1 -1
  60. package/dist/src/branded-types.js +1 -1
  61. package/dist/src/bundle-linker.js +1 -1
  62. package/dist/src/bundler.js +1 -1
  63. package/dist/src/cache.js +1 -1
  64. package/dist/src/call-signatures.js +1 -1
  65. package/dist/src/circular.js +1 -1
  66. package/dist/src/computed-keys.js +1 -1
  67. package/dist/src/config.js +1 -1
  68. package/dist/src/declaration-project.js +1 -1
  69. package/dist/src/declaration-publication.js +1 -1
  70. package/dist/src/declaration-references.d.ts +1 -1
  71. package/dist/src/declaration-references.js +1 -1
  72. package/dist/src/docs.js +1 -1
  73. package/dist/src/enum-declarations.js +1 -1
  74. package/dist/src/errors.js +1 -1
  75. package/dist/src/extractor/extract.js +1 -1
  76. package/dist/src/extractor/scanner.js +1 -1
  77. package/dist/src/extractor.js +1 -1
  78. package/dist/src/function-properties.js +1 -1
  79. package/dist/src/generator.js +1 -1
  80. package/dist/src/incremental.js +1 -1
  81. package/dist/src/index.js +1 -1
  82. package/dist/src/inferred-imports.js +1 -1
  83. package/dist/src/initializer-type-spans.js +1 -1
  84. package/dist/src/lexical.js +1 -1
  85. package/dist/src/logger.js +1 -1
  86. package/dist/src/lsp.js +1 -1
  87. package/dist/src/memory.js +1 -1
  88. package/dist/src/module-graph.js +1 -1
  89. package/dist/src/module-references.js +1 -1
  90. package/dist/src/native-checker.js +1 -1
  91. package/dist/src/native-extractor.js +1 -1
  92. package/dist/src/native-generation.js +1 -1
  93. package/dist/src/native-project.js +1 -1
  94. package/dist/src/optimizer.js +1 -1
  95. package/dist/src/parallel-processor.js +1 -1
  96. package/dist/src/parameters.js +1 -1
  97. package/dist/src/parser.js +1 -1
  98. package/dist/src/plugins/bun.js +1 -1
  99. package/dist/src/plugins/esbuild.js +1 -1
  100. package/dist/src/plugins/index.js +1 -1
  101. package/dist/src/plugins/tsdown.js +1 -1
  102. package/dist/src/plugins/tsup.js +1 -1
  103. package/dist/src/plugins/vite.js +1 -1
  104. package/dist/src/plugins/webpack.js +1 -1
  105. package/dist/src/process-source.js +1 -1
  106. package/dist/src/processor/declarations.js +1 -1
  107. package/dist/src/processor/import-usage.js +1 -1
  108. package/dist/src/processor/imports.js +1 -1
  109. package/dist/src/processor/index.js +1 -1
  110. package/dist/src/processor/type-inference.js +1 -1
  111. package/dist/src/processor.js +1 -1
  112. package/dist/src/return-type-scope.js +1 -1
  113. package/dist/src/source-cache.js +1 -1
  114. package/dist/src/sourcemap.js +1 -1
  115. package/dist/src/transformers.js +1 -1
  116. package/dist/src/utils.js +1 -1
  117. package/dist/src/value-inference.js +1 -1
  118. package/dist/src/worker-thread.js +1 -1
  119. package/dist/src/worker.js +1 -1
  120. package/dist/src/workspace.js +1 -1
  121. package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
  122. package/native/darwin-x64/libzig-dtsx.dylib +0 -0
  123. package/native/freebsd-x64/libzig-dtsx.so +0 -0
  124. package/native/linux-arm64/libzig-dtsx.so +0 -0
  125. package/native/linux-x64/libzig-dtsx.so +0 -0
  126. package/native/windows-x64/zig-dtsx.dll +0 -0
  127. package/package.json +1 -1
  128. package/dist/chunk-hnw7mwcw.js +0 -3
  129. package/dist/chunk-hzjesnf1.js +0 -38
@@ -1,17 +1,17 @@
1
1
  // @bun
2
- import{h,g}from"./chunk-mm1cfz16.js";import{t}from"./chunk-d0dbet9n.js";import{Ge}from"./chunk-h2007n8k.js";import{sr,or,ar}from"./chunk-c87yyjv7.js";import{y,ee,K}from"./chunk-vk5r6pgx.js";import{H}from"./chunk-d27xpsa4.js";import{_e,we,je}from"./chunk-564pr6v4.js";import{be}from"./chunk-587w6ktw.js";var lt=20,ft=!1,L=null;function ht(e){return Ot(e).replace(/\n[ \t]*(?=\n)/g,"")}function Ot(e){if(e.indexOf("/*")===-1)return e.trim();let i=[],s=0,r=0,l=e.length;while(r<l)if(e.charCodeAt(r)===47&&r+1<l&&e.charCodeAt(r+1)===42){if(r>s)i.push(e.substring(s,r));r+=2;while(r<l-1){if(e.charCodeAt(r)===42&&e.charCodeAt(r+1)===47){r+=2;break}r++}s=r}else r++;if(s<l)i.push(e.substring(s));return i.join("").trim()}function Vt(){ft=!0,L=null}function Ut(){ft=!1;let e=L;return L=null,e}function ut(e,c){let i=0,s=0;while((s=e.indexOf(c,s))!==-1)i++,s+=c.length;return i}function wt(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===36||e===95||e===46||e===58||e===45}function rt(e){let c=e.trim();if(c.length<3||c.charCodeAt(0)!==60)return!1;if(c.startsWith("<>"))return c.endsWith("</>");let i=c.charCodeAt(1);if(!(i>=65&&i<=90||i>=97&&i<=122||i===36||i===95))return!1;let r=2;while(r<c.length&&wt(c.charCodeAt(r)))r++;let l=c.slice(1,r),f=c.charCodeAt(r);if(f>32&&f!==62&&f!==47)return!1;if(c.endsWith("/>"))return!0;let u=c.lastIndexOf("</");if(u===-1)return!1;let a=u+2;while(a<c.length&&wt(c.charCodeAt(a)))a++;return c.slice(u+2,a)===l&&c.charCodeAt(a)===62&&a===c.length-1}function it(e){let c=e.length,i=!1;for(let f=1;f<c;f++)if(e.charCodeAt(f)<=32&&e.charCodeAt(f-1)<=32){i=!0;break}if(!i)for(let f=0;f<c;f++){let u=e.charCodeAt(f);if(u===10||u===13||u===9){i=!0;break}}if(!i)return e;let s=[],r=-1,l=!1;for(let f=0;f<c;f++)if(e.charCodeAt(f)<=32){if(!l){if(r>=0)s.push(e.substring(r,f));s.push(" "),l=!0,r=-1}}else{if(l||r<0)r=f;l=!1}if(r>=0)s.push(e.substring(r));return s.join("")}function n(e,c=!1,i=!1,s=0,r){if(!e||typeof e!=="string")return"unknown";if(s>=lt)return"unknown";let l=e.trim();if(rt(l))return"JSX.Element";let f=jt(l);if(f)return f;if(l.startsWith("BigInt("))return"bigint";if(l.startsWith("Symbol.for("))return"symbol";if(!(l.startsWith("[")&&l.endsWith("]")||l.startsWith("{")&&l.endsWith("}"))&&(l.includes(".raw`")||l.includes("String.raw`")))return"string";if(l.startsWith("`")&&l.endsWith("`")){if(!c||l.includes("${")||l.includes(`
3
- `)||l.includes("\r"))return"string";return l}if(l.charCodeAt(0)===39||l.charCodeAt(0)===34){let d=Bt(l);if(d!==null){if(d==="string"||!c)return"string";return d}}if(y(l)){if(!c)return"number";return K(l)}if(l==="true"||l==="false"){if(!c)return"boolean";return l}if(l==="null")return"null";if(l==="undefined")return"undefined";if(l.startsWith("[")&&l.endsWith("]"))return Be(l,c,s+1,r);if(l.startsWith("{")&&l.endsWith("}"))return dt(l,c,s+1,r);if(l.startsWith("class ")||l.startsWith("class{"))return oe(l);if(l.startsWith("new "))return Ht(l);if(l.endsWith("as const")){let d=l.slice(0,-8).trim();if(d.startsWith("[")&&d.endsWith("]")){let x=d.slice(1,-1).trim();if(!x)return"readonly []";let T=Q(x),w=[];for(let A=0;A<T.length;A++){let p=T[A].trim();if(p.startsWith("...")){let m=p.slice(3).trim();if(J(m))w.push(`...typeof ${m}`);else{let C=n(m,!0,!1,s+1,r);w.push(C.startsWith("readonly [")||C.endsWith("[]")?`...${C}`:"...unknown[]")}}else w.push(n(p,!0,!1,s+1,r))}return`readonly [${w.join(", ")}]`}return n(d,!0,i,s+1,r)}if(X(l)!==-1||l.startsWith("function")||l.startsWith("async"))return pt(l,i,s,c);if(l.startsWith("`")&&l.endsWith("`"))return se(l,c);if(l.startsWith("Promise."))return Nt(l,c,s,r);if(l.startsWith("await "))return"unknown";if(l.startsWith("typeof ")&&nt(l.slice(7)))return"string";if(l.startsWith("void ")&&nt(l.slice(5)))return"undefined";if(l.startsWith("delete ")&&nt(l.slice(7)))return"boolean";if(ee(l)){if(c)return K(l);return"bigint"}if(l.startsWith("Symbol(")||l==="Symbol.for")return"symbol";let a=U(l);if(a!==null)return a;if(Pt(l))return"boolean";if(Gt(l))return"number";return"unknown"}function $t(e){let c=e.charCodeAt(0);if(c!==39&&c!==34)return!1;return G(e,0,c)===e.length}function Bt(e){if($t(e))return e;let c=Dt(e);if(c.length<2)return null;let i=!1,s=!0,r="";for(let l of c){let f=l.trim();if($t(f))i=!0,r+=Ft(f);else s=!1}if(s)return qt(r);if(i)return"string";return null}function Dt(e){let c=[],i=0,s=0,r=0;while(r<e.length){let l=e.charCodeAt(r);if(l===39||l===34||l===96){r=G(e,r,l);continue}if(l===40||l===91||l===123)i++;else if(l===41||l===93||l===125)i--;else if(l===43&&i===0)c.push(e.slice(s,r)),s=r+1;r++}return c.push(e.slice(s)),c}function Ft(e){return e.slice(1,-1).replace(/\\(.)/g,(i,s)=>{if(s==="n")return`
4
- `;if(s==="t")return"\t";if(s==="r")return"\r";if(s==="0")return"\x00";return s})}function qt(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`}function Gt(e){if(e==="")return!1;let c=!1,i=!1;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);if(r>=48&&r<=57){c=!0;continue}if(r===43||r===45||r===42||r===47||r===37){i=!0;continue}if(r===60||r===62){let l=s+1;while(l<e.length&&e.charCodeAt(l)===r)l++;let f=l-s;if(f!==2&&!(r===62&&f===3))return!1;i=!0,s=l-1;continue}if(r===46||r===40||r===41||r<=32)continue;return!1}return c&&i}function Pt(e){let c=0,i;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=G(e,s,r)-1;continue}if(r===47){if(e[s+1]==="/"){let l=e.indexOf(`
5
- `,s+2);s=l===-1?e.length:l;continue}if(e[s+1]==="*"){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+1;continue}if(h(e,s)){s=g(e,s)-1;continue}}if(r===40||r===91||r===123){c++;continue}if(r===41||r===93||r===125){c--;continue}if(c!==0)continue;if(r===60){i??=H(e);let l=i(s,0);if(l){s=l.end-1;continue}}if(e.startsWith("===",s)||e.startsWith("!==",s)||e.startsWith("==",s)||e.startsWith("!=",s)||e.startsWith(">=",s)||e.startsWith("<=",s))return!0;if((r===62||r===60)&&e.charCodeAt(s+1)===r){while(e.charCodeAt(s+1)===r)s++;continue}if((r===62||r===60)&&e.charCodeAt(s-1)!==61&&e.charCodeAt(s+1)!==61)return!0}return!1}function zt(e,c=!1,i=0,s){return n(e,c,!0,i,s)}function B(e,c=!1,i="",s,r){let l=gt(i,s),f=[],u=!1,a=0;while(a<e.length){let x=e.charCodeAt(a);if(x===34||x===39||x===96){a=G(e,a,x);continue}if(x===47&&e.charCodeAt(a+1)===47){a+=2;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(x===47&&e.charCodeAt(a+1)===42){let w=e.indexOf("*/",a+2);a=w===-1?e.length:w+2;continue}if(e.startsWith("function",a)&&et(e,a,8)||e.startsWith("class",a)&&et(e,a,5)){let w=ie(e,a);if(w!==-1){a=ot(e,w);continue}}if(x===61&&e.charCodeAt(a+1)===62){let w=Mt(e,a+2);if(e.charCodeAt(w)===123){a=ot(e,w);continue}}if(e.startsWith("return",a)&&(a===0||!D(e.charCodeAt(a-1)))&&!D(e.charCodeAt(a+6))){a+=6;let w=!1;while(a<e.length&&e.charCodeAt(a)<=32){let k=e.charCodeAt(a);if(k===10||k===13)w=!0;a++}if(w||a>=e.length||e.charCodeAt(a)===59||e.charCodeAt(a)===125){u=!0;continue}let A=a,p=0,m=0,C=0;while(a<e.length){let k=e.charCodeAt(a);if(k===34||k===39||k===96){a=G(e,a,k);continue}if(k===47&&e.charCodeAt(a+1)===47){if(p===0&&m===0&&C===0)break;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(k===47&&e.charCodeAt(a+1)===42){let O=e.indexOf("*/",a+2);a=O===-1?e.length:O+2;continue}if(k===40)p++;else if(k===41)p--;else if(k===91)m++;else if(k===93)m--;else if(k===123)C++;else if(k===125){if(C===0&&p===0&&m===0)break;C--}else if(k===59&&p===0&&m===0&&C===0)break;else if((k===10||k===13)&&p===0&&m===0&&C===0){let O=a+1;while(O<e.length&&e.charCodeAt(O)<=32)O++;if(e.startsWith("return",O)&&!D(e.charCodeAt(O+6)))break}a++}let S=e.slice(A,a).trim(),b=ht(_(S,l,s,r,A));if(!f.includes(b))f.push(b);continue}a++}if(u&&!f.includes("undefined"))f.push("undefined");let d=f.includes("unknown")?"unknown":f.length===0?"void":Et(f);return c&&!d.startsWith("Promise<")?`Promise<${d}>`:d}function gt(e,c){let i=new Map,s=e.startsWith("(")&&e.endsWith(")")?e.slice(1,-1):e,r=t(s),l=0,f=0,u=[];for(let a of r){let d=s.slice(a.start,a.end);if(d===","&&f===0)u.push(s.slice(l,a.start)),l=a.end;if(["(","[","{","<"].includes(d))f++;else if([")","]","}"].includes(d)||d===">"&&s[a.start-1]!=="=")f--}u.push(s.slice(l));for(let a of u){let d=t(a),x=-1,T=-1,w=0;for(let C of d){let S=a.slice(C.start,C.end);if(w===0&&S===":"&&x===-1)x=C.start;if(w===0&&S==="="&&a[C.end]!==">"){T=C.start;break}if(["(","[","{","<"].includes(S))w++;else if([")","]","}"].includes(S)||S===">"&&a[C.start-1]!=="=")w--}let A=a.slice(0,x!==-1?x:T!==-1?T:void 0).trim().replace(/^\.\.\./,"").replace(/\?$/,""),p=x===-1&&T!==-1&&!a.trim().startsWith("...")?we(A,a.slice(T+1)):null;if(p){for(let C of p)i.set(C.alias,c?.(C.value)??n(C.value,!1));continue}if(!Z(A)){if(A.startsWith("{")||A.startsWith("["))for(let C of Ge(A))i.set(C,"unknown");continue}let m=x!==-1?a.slice(x+1,T!==-1?T:void 0).trim():"";if(!m&&T!==-1){let C=a.slice(T+1).trim();m=c?.(C)??n(C,!1)}if(m){if(T===-1&&a.slice(0,x).trim().endsWith("?"))m=`(${m}) | undefined`;i.set(A,m)}else i.set(A,"unknown")}return i}var Wt={string:{at:"string | undefined",charAt:"string",charCodeAt:"number",codePointAt:"number | undefined",concat:"string",endsWith:"boolean",includes:"boolean",indexOf:"number",lastIndexOf:"number",localeCompare:"number",normalize:"string",padEnd:"string",padStart:"string",repeat:"string",replace:"string",replaceAll:"string",search:"number",slice:"string",split:"string[]",startsWith:"boolean",substring:"string",toLocaleLowerCase:"string",toLocaleUpperCase:"string",toLowerCase:"string",toString:"string",toUpperCase:"string",trim:"string",trimEnd:"string",trimStart:"string",valueOf:"string"},number:{toExponential:"string",toFixed:"string",toLocaleString:"string",toPrecision:"string",toString:"string",valueOf:"number"},bigint:{toLocaleString:"string",toString:"string",valueOf:"bigint"},boolean:{toString:"string",valueOf:"boolean"}};function Sa(e,c){let i=Object.hasOwn(Wt,e)?Wt[e]:void 0;return i&&Object.hasOwn(i,c)?i[c]:void 0}function W(e){return e.includes(`
2
+ import{h,g}from"./chunk-gyfbehkf.js";import{t}from"./chunk-6exq13f9.js";import{Ge}from"./chunk-w9jg9761.js";import{sr,or,ar}from"./chunk-31rb15pe.js";import{y,ee,K}from"./chunk-vk5r6pgx.js";import{H}from"./chunk-0rk4cvt6.js";import{_e,we,je}from"./chunk-1mg4cxd3.js";import{be}from"./chunk-587w6ktw.js";var lt=20,ft=!1,_=null;function ht(e){return Ot(e).replace(/\n[ \t]*(?=\n)/g,"")}function Ot(e){if(e.indexOf("/*")===-1)return e.trim();let i=[],s=0,r=0,l=e.length;while(r<l)if(e.charCodeAt(r)===47&&r+1<l&&e.charCodeAt(r+1)===42){if(r>s)i.push(e.substring(s,r));r+=2;while(r<l-1){if(e.charCodeAt(r)===42&&e.charCodeAt(r+1)===47){r+=2;break}r++}s=r}else r++;if(s<l)i.push(e.substring(s));return i.join("").trim()}function Vt(){ft=!0,_=null}function zt(){ft=!1;let e=_;return _=null,e}function ut(e,c){let i=0,s=0;while((s=e.indexOf(c,s))!==-1)i++,s+=c.length;return i}function wt(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===36||e===95||e===46||e===58||e===45}function rt(e){let c=e.trim();if(c.length<3||c.charCodeAt(0)!==60)return!1;if(c.startsWith("<>"))return c.endsWith("</>");let i=c.charCodeAt(1);if(!(i>=65&&i<=90||i>=97&&i<=122||i===36||i===95))return!1;let r=2;while(r<c.length&&wt(c.charCodeAt(r)))r++;let l=c.slice(1,r),f=c.charCodeAt(r);if(f>32&&f!==62&&f!==47)return!1;if(c.endsWith("/>"))return!0;let u=c.lastIndexOf("</");if(u===-1)return!1;let a=u+2;while(a<c.length&&wt(c.charCodeAt(a)))a++;return c.slice(u+2,a)===l&&c.charCodeAt(a)===62&&a===c.length-1}function it(e){let c=e.length,i=!1;for(let f=1;f<c;f++)if(e.charCodeAt(f)<=32&&e.charCodeAt(f-1)<=32){i=!0;break}if(!i)for(let f=0;f<c;f++){let u=e.charCodeAt(f);if(u===10||u===13||u===9){i=!0;break}}if(!i)return e;let s=[],r=-1,l=!1;for(let f=0;f<c;f++)if(e.charCodeAt(f)<=32){if(!l){if(r>=0)s.push(e.substring(r,f));s.push(" "),l=!0,r=-1}}else{if(l||r<0)r=f;l=!1}if(r>=0)s.push(e.substring(r));return s.join("")}function n(e,c=!1,i=!1,s=0,r){if(!e||typeof e!=="string")return"unknown";if(s>=lt)return"unknown";let l=e.trim();if(rt(l))return"JSX.Element";let f=jt(l);if(f)return f;if(l.startsWith("BigInt("))return"bigint";if(l.startsWith("Symbol.for("))return"symbol";if(!(l.startsWith("[")&&l.endsWith("]")||l.startsWith("{")&&l.endsWith("}"))&&(l.includes(".raw`")||l.includes("String.raw`")))return"string";if(l.startsWith("`")&&l.endsWith("`")){if(!c||l.includes("${")||l.includes(`
3
+ `)||l.includes("\r"))return"string";return l}if(l.charCodeAt(0)===39||l.charCodeAt(0)===34){let d=Bt(l);if(d!==null){if(d==="string"||!c)return"string";return d}}if(y(l)){if(!c)return"number";return K(l)}if(l==="true"||l==="false"){if(!c)return"boolean";return l}if(l==="null")return"null";if(l==="undefined")return"undefined";if(l.startsWith("[")&&l.endsWith("]"))return Be(l,c,s+1,r);if(l.startsWith("{")&&l.endsWith("}"))return dt(l,c,s+1,r);if(l.startsWith("class ")||l.startsWith("class{"))return oe(l);if(l.startsWith("new "))return Ht(l);if(l.endsWith("as const")){let d=l.slice(0,-8).trim();if(d.startsWith("[")&&d.endsWith("]")){let x=d.slice(1,-1).trim();if(!x)return"readonly []";let T=Q(x),w=[];for(let A=0;A<T.length;A++){let p=T[A].trim();if(p.startsWith("...")){let m=p.slice(3).trim();if(Y(m))w.push(`...typeof ${m}`);else{let C=n(m,!0,!1,s+1,r);w.push(C.startsWith("readonly [")||C.endsWith("[]")?`...${C}`:"...unknown[]")}}else w.push(n(p,!0,!1,s+1,r))}return`readonly [${w.join(", ")}]`}return n(d,!0,i,s+1,r)}if(Z(l)!==-1||l.startsWith("function")||l.startsWith("async"))return pt(l,i,s,c);if(l.startsWith("`")&&l.endsWith("`"))return se(l,c);if(l.startsWith("Promise."))return Nt(l,c,s,r);if(l.startsWith("await "))return"unknown";if(l.startsWith("typeof ")&&nt(l.slice(7)))return"string";if(l.startsWith("void ")&&nt(l.slice(5)))return"undefined";if(l.startsWith("delete ")&&nt(l.slice(7)))return"boolean";if(ee(l)){if(c)return K(l);return"bigint"}if(l.startsWith("Symbol(")||l==="Symbol.for")return"symbol";let a=z(l);if(a!==null)return a;if(Pt(l))return"boolean";if(Gt(l))return"number";return"unknown"}function $t(e){let c=e.charCodeAt(0);if(c!==39&&c!==34)return!1;return J(e,0,c)===e.length}function Bt(e){if($t(e))return e;let c=Dt(e);if(c.length<2)return null;let i=!1,s=!0,r="";for(let l of c){let f=l.trim();if($t(f))i=!0,r+=Ft(f);else s=!1}if(s)return qt(r);if(i)return"string";return null}function Dt(e){let c=[],i=0,s=0,r=0;while(r<e.length){let l=e.charCodeAt(r);if(l===39||l===34||l===96){r=J(e,r,l);continue}if(l===40||l===91||l===123)i++;else if(l===41||l===93||l===125)i--;else if(l===43&&i===0)c.push(e.slice(s,r)),s=r+1;r++}return c.push(e.slice(s)),c}function Ft(e){return e.slice(1,-1).replace(/\\(.)/g,(i,s)=>{if(s==="n")return`
4
+ `;if(s==="t")return"\t";if(s==="r")return"\r";if(s==="0")return"\x00";return s})}function qt(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`}function Gt(e){if(e==="")return!1;let c=!1,i=!1;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);if(r>=48&&r<=57){c=!0;continue}if(r===43||r===45||r===42||r===47||r===37){i=!0;continue}if(r===60||r===62){let l=s+1;while(l<e.length&&e.charCodeAt(l)===r)l++;let f=l-s;if(f!==2&&!(r===62&&f===3))return!1;i=!0,s=l-1;continue}if(r===46||r===40||r===41||r<=32)continue;return!1}return c&&i}function Pt(e){let c=0,i;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=J(e,s,r)-1;continue}if(r===47){if(e[s+1]==="/"){let l=e.indexOf(`
5
+ `,s+2);s=l===-1?e.length:l;continue}if(e[s+1]==="*"){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+1;continue}if(h(e,s)){s=g(e,s)-1;continue}}if(r===40||r===91||r===123){c++;continue}if(r===41||r===93||r===125){c--;continue}if(c!==0)continue;if(r===60){i??=H(e);let l=i(s,0);if(l){s=l.end-1;continue}}if(e.startsWith("===",s)||e.startsWith("!==",s)||e.startsWith("==",s)||e.startsWith("!=",s)||e.startsWith(">=",s)||e.startsWith("<=",s))return!0;if((r===62||r===60)&&e.charCodeAt(s+1)===r){while(e.charCodeAt(s+1)===r)s++;continue}if((r===62||r===60)&&e.charCodeAt(s-1)!==61&&e.charCodeAt(s+1)!==61)return!0}return!1}function Ut(e,c=!1,i=0,s){return n(e,c,!0,i,s)}function B(e,c=!1,i="",s,r){let l=gt(i,s),f=[],u=!1,a=0;while(a<e.length){let x=e.charCodeAt(a);if(x===34||x===39||x===96){a=J(e,a,x);continue}if(x===47&&e.charCodeAt(a+1)===47){a+=2;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(x===47&&e.charCodeAt(a+1)===42){let w=e.indexOf("*/",a+2);a=w===-1?e.length:w+2;continue}if(e.startsWith("function",a)&&tt(e,a,8)||e.startsWith("class",a)&&tt(e,a,5)){let w=ie(e,a);if(w!==-1){a=ot(e,w);continue}}if(x===61&&e.charCodeAt(a+1)===62){let w=Mt(e,a+2);if(e.charCodeAt(w)===123){a=ot(e,w);continue}}if(e.startsWith("return",a)&&(a===0||!V(e.charCodeAt(a-1)))&&!V(e.charCodeAt(a+6))){a+=6;let w=!1;while(a<e.length&&e.charCodeAt(a)<=32){let k=e.charCodeAt(a);if(k===10||k===13)w=!0;a++}if(w||a>=e.length||e.charCodeAt(a)===59||e.charCodeAt(a)===125){u=!0;continue}let A=a,p=0,m=0,C=0;while(a<e.length){let k=e.charCodeAt(a);if(k===34||k===39||k===96){a=J(e,a,k);continue}if(k===47&&e.charCodeAt(a+1)===47){if(p===0&&m===0&&C===0)break;while(a<e.length&&e.charCodeAt(a)!==10&&e.charCodeAt(a)!==13)a++;continue}if(k===47&&e.charCodeAt(a+1)===42){let O=e.indexOf("*/",a+2);a=O===-1?e.length:O+2;continue}if(k===40)p++;else if(k===41)p--;else if(k===91)m++;else if(k===93)m--;else if(k===123)C++;else if(k===125){if(C===0&&p===0&&m===0)break;C--}else if(k===59&&p===0&&m===0&&C===0)break;else if((k===10||k===13)&&p===0&&m===0&&C===0){let O=a+1;while(O<e.length&&e.charCodeAt(O)<=32)O++;if(e.startsWith("return",O)&&!V(e.charCodeAt(O+6)))break}a++}let S=e.slice(A,a).trim(),b=ht(F(S,l,s,r,A));if(!f.includes(b))f.push(b);continue}a++}if(u&&!f.includes("undefined"))f.push("undefined");let d=f.includes("unknown")?"unknown":f.length===0?"void":Et(f);return c&&!d.startsWith("Promise<")?`Promise<${d}>`:d}function gt(e,c){let i=new Map,s=e.startsWith("(")&&e.endsWith(")")?e.slice(1,-1):e,r=t(s),l=0,f=0,u=[];for(let a of r){let d=s.slice(a.start,a.end);if(d===","&&f===0)u.push(s.slice(l,a.start)),l=a.end;if(["(","[","{","<"].includes(d))f++;else if([")","]","}"].includes(d)||d===">"&&s[a.start-1]!=="=")f--}u.push(s.slice(l));for(let a of u){let d=t(a),x=-1,T=-1,w=0;for(let C of d){let S=a.slice(C.start,C.end);if(w===0&&S===":"&&x===-1)x=C.start;if(w===0&&S==="="&&a[C.end]!==">"){T=C.start;break}if(["(","[","{","<"].includes(S))w++;else if([")","]","}"].includes(S)||S===">"&&a[C.start-1]!=="=")w--}let A=a.slice(0,x!==-1?x:T!==-1?T:void 0).trim().replace(/^\.\.\./,"").replace(/\?$/,""),p=x===-1&&T!==-1&&!a.trim().startsWith("...")?we(A,a.slice(T+1)):null;if(p){for(let C of p)i.set(C.alias,c?.(C.value)??n(C.value,!1));continue}if(!v(A)){if(A.startsWith("{")||A.startsWith("["))for(let C of Ge(A))i.set(C,"unknown");continue}let m=x!==-1?a.slice(x+1,T!==-1?T:void 0).trim():"";if(!m&&T!==-1){let C=a.slice(T+1).trim();m=c?.(C)??n(C,!1)}if(m){if(T===-1&&a.slice(0,x).trim().endsWith("?"))m=`(${m}) | undefined`;i.set(A,m)}else i.set(A,"unknown")}return i}var Wt={string:{at:"string | undefined",charAt:"string",charCodeAt:"number",codePointAt:"number | undefined",concat:"string",endsWith:"boolean",includes:"boolean",indexOf:"number",lastIndexOf:"number",localeCompare:"number",normalize:"string",padEnd:"string",padStart:"string",repeat:"string",replace:"string",replaceAll:"string",search:"number",slice:"string",split:"string[]",startsWith:"boolean",substring:"string",toLocaleLowerCase:"string",toLocaleUpperCase:"string",toLowerCase:"string",toString:"string",toUpperCase:"string",trim:"string",trimEnd:"string",trimStart:"string",valueOf:"string"},number:{toExponential:"string",toFixed:"string",toLocaleString:"string",toPrecision:"string",toString:"string",valueOf:"number"},bigint:{toLocaleString:"string",toString:"string",valueOf:"bigint"},boolean:{toString:"string",valueOf:"boolean"}};function Sa(e,c){let i=Object.hasOwn(Wt,e)?Wt[e]:void 0;return i&&Object.hasOwn(i,c)?i[c]:void 0}function W(e){return e.includes(`
6
6
  `)?e.replaceAll(`
7
7
  `,`
8
- `):e}function Jt(e,c){if(e=e.trim(),!e.startsWith("{")||!e.endsWith("}"))return;let i=e.slice(1,-1),s=t(i),r=0,l=0;for(let f=0;f<=s.length;f++){let u=s[f],a=u?i.slice(u.start,u.end):";";if(l===0&&(a===";"||a===",")){let d=i.slice(r,u?.start).trim(),x=d.indexOf(":");if(x!==-1&&d.slice(0,x).trim()===c)return d.slice(x+1).trim();r=u?.end??i.length}if(["(","[","{","<"].includes(a))l++;else if([")","]","}"].includes(a)||a===">"&&u&&i[u.start-1]!=="=")l--}return}function _(e,c,i,s,r=0,l=0){if(l>=lt)return"unknown";let f=e.trim();while(at(f))f=f.slice(1,-1).trim();let u=i?.(f);if(u)return u;if(rt(f))return"JSX.Element";if(f.startsWith("await ")){let b=_(f.slice(6),c,i,s,r,l+1);return b.startsWith("Promise<")&&b.endsWith(">")?b.slice(8,-1):b}if(c.has(f))return c.get(f);let a=/^([\w$]+)\.([\w$]+(?:\.[\w$]+)*)$/.exec(f),d;if(a){let b=c.get(a[1]),k=b&&Jt(b,a[2]);if(k)return k;if(b)d=`typeof ${f}`}if(f.startsWith("!"))return"boolean";if(f.startsWith("fetch("))return"Promise<Response>";if(re(f))return n(f,!1);let x=Rt(f);if(x){let b=_(x.whenTrue,c,i,s,r,l+1),k=_(x.whenFalse,c,i,s,r,l+1);return b===k?b:Et([b,k])}for(let b of["??","||","&&"]){let k=It(f,b);if(k!==-1){let O=_(f.slice(0,k),c,i,s,r,l+1),P=_(f.slice(k+b.length),c,i,s,r,l+1);return vt(O,P,b)}}let T=Qt(f);if(T&&s)return s(T,r);let w=jt(f);if(w)return s?s(w,r):w;if(Pt(f))return"boolean";let A=0;for(let b=f.length-1;b>=0;b--){let k=f.charCodeAt(b);if(k===41||k===93||k===125)A++;else if(k===40||k===91||k===123)A--;else if(A===0&&(k===43||k===45||k===42||k===47||k===37)){let O=_(f.slice(0,b),c,i,s,r,l+1),P=_(f.slice(b+1),c,i,s,r,l+1);if(k===43&&(O==="string"||P==="string"))return"string";if(O==="number"&&P==="number")return"number";break}}if(f.startsWith("[")&&f.endsWith("]")){let b=Q(f.slice(1,-1));if(b.some((k)=>k.trim().startsWith("..."))){let k=b.map((O)=>{let P=O.trim();if(!P)return"undefined";let I=P.startsWith("..."),M=_(I?P.slice(3):P,c,i,s,r,l+1);return I?`(NonNullable<${M}> extends Iterable<infer Element> ? Element : never)`:M});return`(${[...new Set(k)].join(" | ")||"never"})[]`}}let p=d??(f.startsWith("{")&&f.endsWith("}")?dt(f,!1,l+1,void 0,(b)=>_(b,c,i,s,r,l+1)):n(f,!1));if(p==="unknown"&&Z(f)&&s)return s(`typeof ${f}`,r);let m=t(p),C="",S=0;for(let b=0;b<m.length;b++){let k=m[b];if(k.kind!=="word"||p.slice(k.start,k.end)!=="typeof")continue;let O=m[b+1];if(!O||O.kind!=="word")continue;let P=c.get(p.slice(O.start,O.end)),I=P,M=!P,V=k.start,F=O.end,E=b,N=[];b++;while(m[b+1]&&p.slice(m[b+1].start,m[b+1].end)==="."&&m[b+2]?.kind==="word"){let j=m[b+2];if(N.push(p.slice(j.start,j.end)),!M)P=`(${P})["${p.slice(j.start,j.end)}"]`;F=j.end,b+=2}let v=E>=2&&p.slice(m[E-2].start,m[E-2].end)==="ReturnType"&&p.slice(m[E-1].start,m[E-1].end)==="<"&&m[b+1]&&p.slice(m[b+1].start,m[b+1].end)===">",Y=I&&v&&N.length===1?Sa(I.trim(),N[0]):void 0;if(Y){V=m[E-2].start,F=m[++b].end;let j=V===0&&F===p.length;C+=p.slice(S,V)+(j||!Y.includes("|")?Y:`(${Y})`),S=F;continue}if(M&&v)V=m[E-2].start,F=m[++b].end;C+=p.slice(S,V)+(P??"unknown"),S=F}return C+p.slice(S)}function Qt(e){let c=t(e),i=0,s=-1;for(let l=0;l<c.length;l++){let f=c[l],u=e.slice(f.start,f.end);if(f.kind!=="punctuation"&&f.kind!=="word")continue;if(["(","[","{"].includes(u))i++;else if([")","]","}"].includes(u))i--;else if(!i&&u==="as"&&l>0&&e.slice(c[l-1].start,c[l-1].end)!==".")s=l}if(s===-1||s+1===c.length)return;let r=e.slice(c[s].end).trim();if(r==="const")return;i=0;for(let l of c.slice(s+1)){if(l.kind!=="punctuation")continue;let f=e.slice(l.start,l.end);if(!i&&["??","||","&&"].some((u)=>e.startsWith(u,l.start)))return;if(["(","[","{","<"].includes(f))i++;else if([")","]","}",">"].includes(f))i--;else if(!i&&["+","-","*","/","%","=","!",";"].includes(f))return}return r}function It(e,c){let i=0;for(let s of t(e)){if(s.kind!=="punctuation")continue;let r=e.slice(s.start,s.end);if(["(","[","{"].includes(r))i++;else if([")","]","}"].includes(r))i--;if(!i&&e.startsWith(c,s.start))return s.start}return-1}function Xt(e){if(e.includes("=>"))return null;let c=[],i=0,s=0;for(let r=0;r<=e.length;r++){let l=r===e.length?"|":e[r];if(l==="'"||l==='"'||l==="`"){r++;while(r<e.length&&e[r]!==l)r+=e[r]==="\\"?2:1;if(r>=e.length)return null}else if(l==="("||l==="["||l==="{"||l==="<")i++;else if(l===")"||l==="]"||l==="}"||l===">")i--;else if(l==="|"&&i===0){let f=e.slice(s,r).trim();if(f)c.push(f);s=r+1}if(i<0)return null}return i===0?c:null}function Yt(e,c){let i=Xt(c);if(!i)return`${e} | ${c}`;let s=[];for(let d of[e,...i]){if(d==="unknown")return"unknown";if(!s.includes(d))s.push(d)}let r=s.includes("boolean")||s.includes("true")&&s.includes("false"),l=s.includes("string"),f=s.includes("number"),u=[],a=!1;for(let d of s)if(r&&(d==="true"||d==="false"||d==="boolean")){if(!a)u.push("boolean");a=!0}else if(l&&Zt(d))continue;else if(f&&/^-?\d+(?:\.\d+)?$/.test(d))continue;else u.push(d);return u.join(" | ")}function Zt(e){let c=e[0];return e.length>=2&&(c==="'"||c==='"')&&e.endsWith(c)&&!e.slice(1,-1).includes(c)}function vt(e,c,i){let s=X(c)!==-1?`(${c.trim()})`:c;if(e.trim()==="unknown")return i==="&&"||s.trim()==="unknown"?"unknown":`{} | ${s}`;let r=e.trim();if(r==="boolean"||r==="string"||r==="number"){if(i==="??")return r;return Yt(i==="||"?r==="boolean"?"true":r:r==="boolean"?"false":r==="string"?"''":"0",s)}let l="false | 0 | 0n | '' | null | undefined";if(i==="??")return`([${e}] extends [NonNullable<${e}>] ? ${e} : NonNullable<${e}> | ${s})`;if(i==="||")return`([${e}] extends [object] ? ${e} : [Exclude<${e}, object> & (${l})] extends [never] ? ${e} : Exclude<NonNullable<${e}>, ${l}> | ${s})`;return`([${e}] extends [object] ? ${s} : [${e}] extends [${l}] ? ${e} : unknown extends (${e}) ? ${e} : (Exclude<${e}, object> & (${l})) | ${s})`}function te(e){let c=`(NonNullable<${e}> extends infer __dtsx_spread_value ? { -readonly [__dtsx_spread_key in keyof __dtsx_spread_value]: __dtsx_spread_value[__dtsx_spread_key] } : never)`,i=`(NonNullable<${e}> extends infer __dtsx_spread_value ? { -readonly [__dtsx_spread_key in keyof __dtsx_spread_value]?: __dtsx_spread_value[__dtsx_spread_key] } : never)`;return`([${e}] extends [null | undefined] ? {} : [${e}] extends [NonNullable<${e}>] ? ${c} : ${i})`}function ne(e,c){let i=e.trim();while(at(i))i=i.slice(1,-1).trim();let s=It(i,"??");if(s!==-1&&i.slice(s+2).trim()==="{}")return te(c(i.slice(0,s)));let r=Rt(i);if(r){if(r.whenFalse.trim()==="{}")return`Partial<${c(r.whenTrue)}>`;if(r.whenTrue.trim()==="{}")return`Partial<${c(r.whenFalse)}>`}return c(i)}function Et(e){return e.map((c)=>e.length>1&&X(c)!==-1?`(${c})`:c).join(" | ")}function st(e){let c=0;while(c<e.length){let r=e.charCodeAt(c);if(r<=32)c++;else if(r===47&&e.charCodeAt(c+1)===47){c+=2;while(c<e.length&&e.charCodeAt(c)!==10&&e.charCodeAt(c)!==13)c++}else if(r===47&&e.charCodeAt(c+1)===42){let l=e.indexOf("*/",c+2);c=l===-1?e.length:l+2}else break}let i=c,s=c;while(s<e.length){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=G(e,s,r),i=s;continue}if(r===92){s=Math.min(s+2,e.length),i=s;continue}if(r===47&&e.charCodeAt(s+1)===47){while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;continue}if(r===47&&e.charCodeAt(s+1)===42){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+2;continue}if(s++,r>32)i=s}return e.slice(c,i)}function jt(e){if(!e.startsWith("<"))return;let c=H(e)(0,0);if(!c||c.parameters||c.completeOperand||!e.slice(c.end).trim()||!nt(e.slice(c.end).trim()))return;return e.slice(1,c.end-1).trim()}function nt(e){e=st(e);let c=0,i;for(let s=0;s<e.length;s++){let r=e[s];if(r==="'"||r==='"'||r==="`"){let l=s+1;while(l<e.length&&e[l]!==r){if(e[l]==="\\")l++;l++}s=l;continue}if(r==="/"){if(e[s+1]==="/"){let l=e.indexOf(`
8
+ `):e}function Jt(e,c){if(e=e.trim(),!e.startsWith("{")||!e.endsWith("}"))return;let i=e.slice(1,-1),s=t(i),r=0,l=0;for(let f=0;f<=s.length;f++){let u=s[f],a=u?i.slice(u.start,u.end):";";if(l===0&&(a===";"||a===",")){let d=i.slice(r,u?.start).trim(),x=d.indexOf(":");if(x!==-1&&d.slice(0,x).trim()===c)return d.slice(x+1).trim();r=u?.end??i.length}if(["(","[","{","<"].includes(a))l++;else if([")","]","}"].includes(a)||a===">"&&u&&i[u.start-1]!=="=")l--}return}function F(e,c,i,s,r=0,l=0){if(l>=lt)return"unknown";let f=e.trim();while(at(f))f=f.slice(1,-1).trim();let u=i?.(f);if(u)return u;if(rt(f))return"JSX.Element";if(f.startsWith("await ")){let b=F(f.slice(6),c,i,s,r,l+1);return b.startsWith("Promise<")&&b.endsWith(">")?b.slice(8,-1):b}if(c.has(f))return c.get(f);let a=/^([\w$]+)\.([\w$]+(?:\.[\w$]+)*)$/.exec(f),d;if(a){let b=c.get(a[1]),k=b&&Jt(b,a[2]);if(k)return k;if(b)d=`typeof ${f}`}if(f.startsWith("!"))return"boolean";if(f.startsWith("fetch("))return"Promise<Response>";if(re(f))return n(f,!1);let x=Rt(f);if(x){let b=F(x.whenTrue,c,i,s,r,l+1),k=F(x.whenFalse,c,i,s,r,l+1);return b===k?b:Et([b,k])}for(let b of["??","||","&&"]){let k=It(f,b);if(k!==-1){let O=F(f.slice(0,k),c,i,s,r,l+1),P=F(f.slice(k+b.length),c,i,s,r,l+1);return vt(O,P,b)}}let T=Qt(f);if(T&&s)return s(T,r);let w=jt(f);if(w)return s?s(w,r):w;if(Pt(f))return"boolean";let A=0;for(let b=f.length-1;b>=0;b--){let k=f.charCodeAt(b);if(k===41||k===93||k===125)A++;else if(k===40||k===91||k===123)A--;else if(A===0&&(k===43||k===45||k===42||k===47||k===37)){let O=F(f.slice(0,b),c,i,s,r,l+1),P=F(f.slice(b+1),c,i,s,r,l+1);if(k===43&&(O==="string"||P==="string"))return"string";if(O==="number"&&P==="number")return"number";break}}if(f.startsWith("[")&&f.endsWith("]")){let b=Q(f.slice(1,-1));if(b.some((k)=>k.trim().startsWith("..."))){let k=b.map((O)=>{let P=O.trim();if(!P)return"undefined";let I=P.startsWith("..."),j=F(I?P.slice(3):P,c,i,s,r,l+1);return I?`(NonNullable<${j}> extends Iterable<infer Element> ? Element : never)`:j});return`(${[...new Set(k)].join(" | ")||"never"})[]`}}let p=d??(f.startsWith("{")&&f.endsWith("}")?dt(f,!1,l+1,void 0,(b)=>F(b,c,i,s,r,l+1)):n(f,!1));if(p==="unknown"&&v(f)&&s)return s(`typeof ${f}`,r);let m=t(p),C="",S=0;for(let b=0;b<m.length;b++){let k=m[b];if(k.kind!=="word"||p.slice(k.start,k.end)!=="typeof")continue;let O=m[b+1];if(!O||O.kind!=="word")continue;let P=c.get(p.slice(O.start,O.end)),I=P,j=!P,q=k.start,D=O.end,E=b,L=[];b++;while(m[b+1]&&p.slice(m[b+1].start,m[b+1].end)==="."&&m[b+2]?.kind==="word"){let N=m[b+2];if(L.push(p.slice(N.start,N.end)),!j)P=`(${P})["${p.slice(N.start,N.end)}"]`;D=N.end,b+=2}let X=m[b+1];if(X&&p.slice(X.start,X.end)==="<"){let N=o(p,X.start,"<",">");if(N!==-1){D=N+1;while(m[b+1]&&m[b+1].start<=N)b++;P=void 0,I=void 0,j=!0}}let et=E>=2&&p.slice(m[E-2].start,m[E-2].end)==="ReturnType"&&p.slice(m[E-1].start,m[E-1].end)==="<"&&m[b+1]&&p.slice(m[b+1].start,m[b+1].end)===">",M=I&&et&&L.length===1?Sa(I.trim(),L[0]):void 0;if(M){q=m[E-2].start,D=m[++b].end;let N=q===0&&D===p.length;C+=p.slice(S,q)+(N||!M.includes("|")?M:`(${M})`),S=D;continue}if(j&&et)q=m[E-2].start,D=m[++b].end;C+=p.slice(S,q)+(P??"unknown"),S=D}return C+p.slice(S)}function Qt(e){let c=t(e),i=0,s=-1;for(let l=0;l<c.length;l++){let f=c[l],u=e.slice(f.start,f.end);if(f.kind!=="punctuation"&&f.kind!=="word")continue;if(["(","[","{"].includes(u))i++;else if([")","]","}"].includes(u))i--;else if(!i&&u==="as"&&l>0&&e.slice(c[l-1].start,c[l-1].end)!==".")s=l}if(s===-1||s+1===c.length)return;let r=e.slice(c[s].end).trim();if(r==="const")return;i=0;for(let l of c.slice(s+1)){if(l.kind!=="punctuation")continue;let f=e.slice(l.start,l.end);if(!i&&["??","||","&&"].some((u)=>e.startsWith(u,l.start)))return;if(["(","[","{","<"].includes(f))i++;else if([")","]","}",">"].includes(f))i--;else if(!i&&["+","-","*","/","%","=","!",";"].includes(f))return}return r}function It(e,c){let i=0;for(let s of t(e)){if(s.kind!=="punctuation")continue;let r=e.slice(s.start,s.end);if(["(","[","{"].includes(r))i++;else if([")","]","}"].includes(r))i--;if(!i&&e.startsWith(c,s.start))return s.start}return-1}function Xt(e){if(e.includes("=>"))return null;let c=[],i=0,s=0;for(let r=0;r<=e.length;r++){let l=r===e.length?"|":e[r];if(l==="'"||l==='"'||l==="`"){r++;while(r<e.length&&e[r]!==l)r+=e[r]==="\\"?2:1;if(r>=e.length)return null}else if(l==="("||l==="["||l==="{"||l==="<")i++;else if(l===")"||l==="]"||l==="}"||l===">")i--;else if(l==="|"&&i===0){let f=e.slice(s,r).trim();if(f)c.push(f);s=r+1}if(i<0)return null}return i===0?c:null}function Yt(e,c){let i=Xt(c);if(!i)return`${e} | ${c}`;let s=[];for(let d of[e,...i]){if(d==="unknown")return"unknown";if(!s.includes(d))s.push(d)}let r=s.includes("boolean")||s.includes("true")&&s.includes("false"),l=s.includes("string"),f=s.includes("number"),u=[],a=!1;for(let d of s)if(r&&(d==="true"||d==="false"||d==="boolean")){if(!a)u.push("boolean");a=!0}else if(l&&Zt(d))continue;else if(f&&/^-?\d+(?:\.\d+)?$/.test(d))continue;else u.push(d);return u.join(" | ")}function Zt(e){let c=e[0];return e.length>=2&&(c==="'"||c==='"')&&e.endsWith(c)&&!e.slice(1,-1).includes(c)}function vt(e,c,i){let s=Z(c)!==-1?`(${c.trim()})`:c;if(e.trim()==="unknown")return i==="&&"||s.trim()==="unknown"?"unknown":`{} | ${s}`;let r=e.trim();if(r==="boolean"||r==="string"||r==="number"){if(i==="??")return r;return Yt(i==="||"?r==="boolean"?"true":r:r==="boolean"?"false":r==="string"?"''":"0",s)}let l="false | 0 | 0n | '' | null | undefined";if(i==="??")return`([${e}] extends [NonNullable<${e}>] ? ${e} : NonNullable<${e}> | ${s})`;if(i==="||")return`([${e}] extends [object] ? ${e} : [Exclude<${e}, object> & (${l})] extends [never] ? ${e} : Exclude<NonNullable<${e}>, ${l}> | ${s})`;return`([${e}] extends [object] ? ${s} : [${e}] extends [${l}] ? ${e} : unknown extends (${e}) ? ${e} : (Exclude<${e}, object> & (${l})) | ${s})`}function te(e){let c=`(NonNullable<${e}> extends infer __dtsx_spread_value ? { -readonly [__dtsx_spread_key in keyof __dtsx_spread_value]: __dtsx_spread_value[__dtsx_spread_key] } : never)`,i=`(NonNullable<${e}> extends infer __dtsx_spread_value ? { -readonly [__dtsx_spread_key in keyof __dtsx_spread_value]?: __dtsx_spread_value[__dtsx_spread_key] } : never)`;return`([${e}] extends [null | undefined] ? {} : [${e}] extends [NonNullable<${e}>] ? ${c} : ${i})`}function ne(e,c){let i=e.trim();while(at(i))i=i.slice(1,-1).trim();let s=It(i,"??");if(s!==-1&&i.slice(s+2).trim()==="{}")return te(c(i.slice(0,s)));let r=Rt(i);if(r){if(r.whenFalse.trim()==="{}")return`Partial<${c(r.whenTrue)}>`;if(r.whenTrue.trim()==="{}")return`Partial<${c(r.whenFalse)}>`}return c(i)}function Et(e){return e.map((c)=>e.length>1&&Z(c)!==-1?`(${c})`:c).join(" | ")}function st(e){let c=0;while(c<e.length){let r=e.charCodeAt(c);if(r<=32)c++;else if(r===47&&e.charCodeAt(c+1)===47){c+=2;while(c<e.length&&e.charCodeAt(c)!==10&&e.charCodeAt(c)!==13)c++}else if(r===47&&e.charCodeAt(c+1)===42){let l=e.indexOf("*/",c+2);c=l===-1?e.length:l+2}else break}let i=c,s=c;while(s<e.length){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=J(e,s,r),i=s;continue}if(r===92){s=Math.min(s+2,e.length),i=s;continue}if(r===47&&e.charCodeAt(s+1)===47){while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;continue}if(r===47&&e.charCodeAt(s+1)===42){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+2;continue}if(s++,r>32)i=s}return e.slice(c,i)}function jt(e){if(!e.startsWith("<"))return;let c=H(e)(0,0);if(!c||c.parameters||c.completeOperand||!e.slice(c.end).trim()||!nt(e.slice(c.end).trim()))return;return e.slice(1,c.end-1).trim()}function nt(e){e=st(e);let c=0,i;for(let s=0;s<e.length;s++){let r=e[s];if(r==="'"||r==='"'||r==="`"){let l=s+1;while(l<e.length&&e[l]!==r){if(e[l]==="\\")l++;l++}s=l;continue}if(r==="/"){if(e[s+1]==="/"){let l=e.indexOf(`
9
9
  `,s+2);s=l===-1?e.length:l;continue}if(e[s+1]==="*"){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+1;continue}if(h(e,s)){s=g(e,s)-1;continue}}if(r==="<"&&c===0){i??=H(e);let l=i(s,0);if(l){s=l.end-1;continue}}if(r==="("||r==="["||r==="{")c++;else if(r===")"||r==="]"||r==="}")c--;else if(c!==0)continue;else if(r==="?"){if(e[s+1]!==".")return!1}else if("=!<>&|+-*/%,:".includes(r))return!1;else if(r===" "||r==="\t"||r===`
10
- `||r==="\r"){let l=e.slice(s).trimStart(),f=/[A-Za-z]+$/.exec(st(e.slice(0,s)))?.[0];if(s=e.length-l.length-1,f&&["new","void","typeof","delete","await","yield"].includes(f))continue;if(l&&l[0]!=="."&&l[0]!=="?"&&l[0]!=="("&&l[0]!=="[")return!1}}return!0}function re(e){if(e.startsWith("function")&&et(e,0,8))return!0;let c=X(e);if(c===-1)return!1;let i=e.slice(0,c).trim();if(i.startsWith("async")&&et(i,0,5))i=i.slice(5).trim();if(i.startsWith("<")){let r=o(i,0,"<",">");if(r===-1)return!1;i=i.slice(r+1).trim()}if(i.startsWith("(")){let r=o(i,0,"(",")");if(r===-1)return!1;let l=i.slice(r+1).trim();if(l&&!l.startsWith(":"))return!1}let s=Ct(i);return at(s.params)||Z(s.params)}function at(e){if(!e.startsWith("(")||!e.endsWith(")"))return!1;let c=0;for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);if(s===40)c++;else if(s===41&&--c===0)return i===e.length-1}return!1}function Rt(e){let c=0,i=-1;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=G(e,s,r)-1;continue}if(r===47&&(e.charCodeAt(s+1)===47||e.charCodeAt(s+1)===42)){if(e.charCodeAt(s+1)===47)while(s+1<e.length&&e.charCodeAt(s+1)!==10&&e.charCodeAt(s+1)!==13)s++;else{let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+1}continue}if(r===40||r===91||r===123)c++;else if(r===41||r===93||r===125)c--;else if(r===63&&c===0&&e.charCodeAt(s+1)!==63)i=s;else if(r===58&&c===0&&i!==-1)return{whenTrue:st(e.slice(i+1,s)),whenFalse:st(e.slice(s+1))}}return null}function et(e,c,i){return(c===0||!D(e.charCodeAt(c-1)))&&!D(e.charCodeAt(c+i))}function Mt(e,c){let i=c;while(i<e.length){if(e.charCodeAt(i)<=32){i++;continue}if(e.startsWith("//",i)){while(i<e.length&&e.charCodeAt(i)!==10&&e.charCodeAt(i)!==13)i++;continue}if(e.startsWith("/*",i)){let s=e.indexOf("*/",i+2);i=s<0?e.length:s+2;continue}break}return i}function ie(e,c){let i=0,s=0,r=0,l=!1,f=!1;for(let u=c;u<e.length;u++){if(u=Mt(e,u),u>=e.length)break;let a=e.charCodeAt(u);if(a===34||a===39||a===96){u=G(e,u,a)-1,f=!1;continue}if(D(a)||a>=128){let d=u;while(u+1<e.length&&(D(e.charCodeAt(u+1))||e.charCodeAt(u+1)>=128))u++;f=l&&["keyof","typeof","readonly","unique","new","abstract","infer","extends"].includes(e.slice(d,u+1));continue}if(a===61&&e.charCodeAt(u+1)===62){u++,f=l;continue}if(a===40)i++;else if(a===41)i--,f=!1;else if(a===91)s++;else if(a===93)s--,f=!1;else if(a===60&&i===0&&s===0)r++;else if(a===62&&r>0&&i===0&&s===0)r--,f=!1;else if(a===123)if(i||s||r||l&&f)u=ot(e,u)-1,f=!1;else return u;else if(i===0&&s===0&&r===0){if(a===58)l=!0,f=!0;else if(l&&[124,38,63].includes(a))f=!0;else if(a===59)return-1}}return-1}function ot(e,c){let i=1,s=c+1;while(s<e.length&&i>0){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=G(e,s,r);continue}if(r===47&&e.charCodeAt(s+1)===47){s+=2;while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;continue}if(r===47&&e.charCodeAt(s+1)===42){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+2;continue}if(r===123)i++;else if(r===125)i--;s++}return s}function G(e,c,i){let s=c+1;while(s<e.length){let r=e.charCodeAt(s);if(r===92){s+=2;continue}if(i===96&&r===36&&e.charCodeAt(s+1)===123){s=ot(e,s+1);continue}if(s++,r===i)break}return s}function se(e,c){if(e.includes(".raw`")||e.includes("String.raw`"))return"string";if(!c||e.includes("${")||e.includes(`
10
+ `||r==="\r"){let l=e.slice(s).trimStart(),f=/[A-Za-z]+$/.exec(st(e.slice(0,s)))?.[0];if(s=e.length-l.length-1,f&&["new","void","typeof","delete","await","yield"].includes(f))continue;if(l&&l[0]!=="."&&l[0]!=="?"&&l[0]!=="("&&l[0]!=="[")return!1}}return!0}function re(e){if(e.startsWith("function")&&tt(e,0,8))return!0;let c=Z(e);if(c===-1)return!1;let i=e.slice(0,c).trim();if(i.startsWith("async")&&tt(i,0,5))i=i.slice(5).trim();if(i.startsWith("<")){let r=o(i,0,"<",">");if(r===-1)return!1;i=i.slice(r+1).trim()}if(i.startsWith("(")){let r=o(i,0,"(",")");if(r===-1)return!1;let l=i.slice(r+1).trim();if(l&&!l.startsWith(":"))return!1}let s=Ct(i);return at(s.params)||v(s.params)}function at(e){if(!e.startsWith("(")||!e.endsWith(")"))return!1;let c=0;for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);if(s===40)c++;else if(s===41&&--c===0)return i===e.length-1}return!1}function Rt(e){let c=0,i=-1;for(let s=0;s<e.length;s++){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=J(e,s,r)-1;continue}if(r===47&&(e.charCodeAt(s+1)===47||e.charCodeAt(s+1)===42)){if(e.charCodeAt(s+1)===47)while(s+1<e.length&&e.charCodeAt(s+1)!==10&&e.charCodeAt(s+1)!==13)s++;else{let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+1}continue}if(r===40||r===91||r===123)c++;else if(r===41||r===93||r===125)c--;else if(r===63&&c===0&&e.charCodeAt(s+1)!==63)i=s;else if(r===58&&c===0&&i!==-1)return{whenTrue:st(e.slice(i+1,s)),whenFalse:st(e.slice(s+1))}}return null}function tt(e,c,i){return(c===0||!V(e.charCodeAt(c-1)))&&!V(e.charCodeAt(c+i))}function Mt(e,c){let i=c;while(i<e.length){if(e.charCodeAt(i)<=32){i++;continue}if(e.startsWith("//",i)){while(i<e.length&&e.charCodeAt(i)!==10&&e.charCodeAt(i)!==13)i++;continue}if(e.startsWith("/*",i)){let s=e.indexOf("*/",i+2);i=s<0?e.length:s+2;continue}break}return i}function ie(e,c){let i=0,s=0,r=0,l=!1,f=!1;for(let u=c;u<e.length;u++){if(u=Mt(e,u),u>=e.length)break;let a=e.charCodeAt(u);if(a===34||a===39||a===96){u=J(e,u,a)-1,f=!1;continue}if(V(a)||a>=128){let d=u;while(u+1<e.length&&(V(e.charCodeAt(u+1))||e.charCodeAt(u+1)>=128))u++;f=l&&["keyof","typeof","readonly","unique","new","abstract","infer","extends"].includes(e.slice(d,u+1));continue}if(a===61&&e.charCodeAt(u+1)===62){u++,f=l;continue}if(a===40)i++;else if(a===41)i--,f=!1;else if(a===91)s++;else if(a===93)s--,f=!1;else if(a===60&&i===0&&s===0)r++;else if(a===62&&r>0&&i===0&&s===0)r--,f=!1;else if(a===123)if(i||s||r||l&&f)u=ot(e,u)-1,f=!1;else return u;else if(i===0&&s===0&&r===0){if(a===58)l=!0,f=!0;else if(l&&[124,38,63].includes(a))f=!0;else if(a===59)return-1}}return-1}function ot(e,c){let i=1,s=c+1;while(s<e.length&&i>0){let r=e.charCodeAt(s);if(r===34||r===39||r===96){s=J(e,s,r);continue}if(r===47&&e.charCodeAt(s+1)===47){s+=2;while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;continue}if(r===47&&e.charCodeAt(s+1)===42){let l=e.indexOf("*/",s+2);s=l===-1?e.length:l+2;continue}if(r===123)i++;else if(r===125)i--;s++}return s}function J(e,c,i){let s=c+1;while(s<e.length){let r=e.charCodeAt(s);if(r===92){s+=2;continue}if(i===96&&r===36&&e.charCodeAt(s+1)===123){s=ot(e,s+1);continue}if(s++,r===i)break}return s}function se(e,c){if(e.includes(".raw`")||e.includes("String.raw`"))return"string";if(!c||e.includes("${")||e.includes(`
11
11
  `)||e.includes("\r"))return"string";return e}function Ht(e,c){let i=t(e),s=(a)=>i[a]?e.slice(i[a].start,i[a].end):"";if(s(0)!=="new"||i[1]?.kind!=="word"||["class","function","new","super"].includes(s(1)))return"unknown";let r=2,l=[s(1)];while(s(r)==="."&&i[r+1]?.kind==="word")l.push(s(r+1)),r+=2;let f=l.join(".");if(!c&&(f.charCodeAt(0)<65||f.charCodeAt(0)>90))return"unknown";let u="";if(s(r)==="<"){let a=i[r].start,d=H(e)(a,0);if(!d||!d.completeOperand||d.parameters)return"unknown";u=e.slice(a,d.end);while(r<i.length&&i[r].start<d.end)r++}if(r<i.length){if(s(r)!=="(")return"unknown";let a=0,d=!1;for(;r<i.length;r++)if(s(r)==="(")a++;else if(s(r)===")"&&--a===0){d=r===i.length-1;break}if(!d)return"unknown"}if(c)return c(f)?f+u:`InstanceType<typeof ${f}${u}>`;if(u)return f+u;switch(f){case"Map":return"Map<any, any>";case"Set":return"Set<any>";case"WeakMap":return"WeakMap<any, any>";case"WeakSet":return"WeakSet<any>";case"Array":return"any[]";case"Object":return"object";case"Promise":return"Promise<any>";default:return f}}function oe(e){return"{ new (...args: any[]): any }"}function Nt(e,c,i=0,s){if(e.startsWith("Promise.resolve(")){let l=e.indexOf(")",16);if(l!==-1){let f=e.slice(16,l).trim();if(f)return`Promise<${n(f,c,!1,i+1,s)}>`}return"Promise<unknown>"}if(e.startsWith("Promise.reject("))return"Promise<never>";if(e.startsWith("Promise.all(")){let r=e.indexOf("[",12),l=e.lastIndexOf("]");if(r!==-1&&l>r){let f=e.slice(r+1,l).trim(),u=Q(f),a=[];for(let d=0;d<u.length;d++){let x=u[d].trim();if(x.startsWith("Promise.resolve(")){let T=Nt(x,c,i+1,s),w=T.indexOf("<"),A=T.lastIndexOf(">");a.push(w!==-1&&A>w?T.slice(w+1,A):"unknown")}else a.push(n(x,c,!1,i+1,s))}return`Promise<[${a.join(", ")}]>`}return"Promise<unknown[]>"}return"Promise<unknown>"}function Be(e,c,i=0,s){let r=e.slice(1,-1).trim();if(!r)return"never[]";if(i>=lt)return"unknown[]";let l=Q(r),f=!1;for(let A=0;A<l.length;A++){let p=l[A],m=p.length;while(m>0&&p.charCodeAt(m-1)<=32)m--;if(m>=8&&p.slice(m-8,m)==="as const"){f=!0;break}}if(f){let A=[];for(let p=0;p<l.length;p++){let m=l[p].trim();if(m.endsWith("as const")){let C=m.slice(0,-8).trim();if(C.startsWith("[")&&C.endsWith("]")){let S=C.slice(1,-1).trim(),b=Q(S),k=[];for(let O=0;O<b.length;O++)k.push(n(b[O].trim(),!0,!1,i+1,s));A.push(`readonly [${k.join(", ")}]`)}else A.push(n(C,!0,!1,i+1,s))}else if(m.startsWith("[")&&m.endsWith("]"))A.push(Be(m,!0,i+1,s));else A.push(n(m,!0,!1,i+1,s))}return`readonly [
12
12
  ${A.join(` |
13
13
  `)}
14
- ]`}let u=ft&&!c,a=[],d=[];for(let A of l){let p=A.trim(),m=L;if(L=null,p.startsWith("...")){let C=p.slice(3).trim(),S=n(C,!1,!1,i+1,s);if(S.endsWith("[]"))a.push(S.slice(0,-2));else if(S.startsWith("readonly [")&&S.endsWith("]"))a.push(S.slice(10,-1));else if(J(C))a.push(`(typeof ${C})[number]`);else a.push("unknown")}else if(p.startsWith("[")&&p.endsWith("]"))a.push(Be(p,c,i+1,s));else a.push(zt(p,c,i+1,s));if(u)d.push(L);L=m}if(u)if(mt(e))L=it(e);else{let A=[];for(let p=0;p<l.length;p++){let m=l[p].trim();if(m.endsWith("as const"))continue;if(ct(m)||m==="null"||m==="undefined")A.push(m);else if(m.startsWith("[")&&mt(m))A.push(it(m));else if(m.startsWith("{")){if(d[p])A.push(d[p])}else{let C=n(m,!1,!1,0,s);if(C!=="unknown")A.push(C)}}if(A.length>0)L=`[${A.join(", ")}]`}if(c)return`readonly [${a.join(", ")}]`;let x=new Set,T=[],w=!0;for(let A of a){if(!x.has(A))x.add(A),T.push(A);if(w){if(!(y(A)||A==="true"||A==="false"||A.charCodeAt(0)===34&&A.charCodeAt(A.length-1)===34||A.charCodeAt(0)===39&&A.charCodeAt(A.length-1)===39))w=!1}}if(w&&a.length<=10)return`readonly [${a.join(", ")}]`;if(T.length===1)return`${T[0]}[]`;return`(${T.join(" | ")})[]`}function Q(e){let c=[],i=0,s=!1,r=0,l=-1,f=0;for(let u=0;u<e.length;u++){let a=e.charCodeAt(u);if(s){if(a===92)u++;else if(a===r)s=!1;f=u+1;continue}if(a===47&&e.charCodeAt(u+1)===47){let d=e.indexOf(`
14
+ ]`}let u=ft&&!c,a=[],d=[];for(let A of l){let p=A.trim(),m=_;if(_=null,p.startsWith("...")){let C=p.slice(3).trim(),S=n(C,!1,!1,i+1,s);if(S.endsWith("[]"))a.push(S.slice(0,-2));else if(S.startsWith("readonly [")&&S.endsWith("]"))a.push(S.slice(10,-1));else if(Y(C))a.push(`(typeof ${C})[number]`);else a.push("unknown")}else if(p.startsWith("[")&&p.endsWith("]"))a.push(Be(p,c,i+1,s));else a.push(Ut(p,c,i+1,s));if(u)d.push(_);_=m}if(u)if(mt(e))_=it(e);else{let A=[];for(let p=0;p<l.length;p++){let m=l[p].trim();if(m.endsWith("as const"))continue;if(ct(m)||m==="null"||m==="undefined")A.push(m);else if(m.startsWith("[")&&mt(m))A.push(it(m));else if(m.startsWith("{")){if(d[p])A.push(d[p])}else{let C=n(m,!1,!1,0,s);if(C!=="unknown")A.push(C)}}if(A.length>0)_=`[${A.join(", ")}]`}if(c)return`readonly [${a.join(", ")}]`;let x=new Set,T=[],w=!0;for(let A of a){if(!x.has(A))x.add(A),T.push(A);if(w){if(!(y(A)||A==="true"||A==="false"||A.charCodeAt(0)===34&&A.charCodeAt(A.length-1)===34||A.charCodeAt(0)===39&&A.charCodeAt(A.length-1)===39))w=!1}}if(w&&a.length<=10)return`readonly [${a.join(", ")}]`;if(T.length===1)return`${T[0]}[]`;return`(${T.join(" | ")})[]`}function Q(e){let c=[],i=0,s=!1,r=0,l=-1,f=0;for(let u=0;u<e.length;u++){let a=e.charCodeAt(u);if(s){if(a===92)u++;else if(a===r)s=!1;f=u+1;continue}if(a===47&&e.charCodeAt(u+1)===47){let d=e.indexOf(`
15
15
  `,u+2);u=(d===-1?e.length:d)-1;continue}if(a===47&&e.charCodeAt(u+1)===42){let d=e.indexOf("*/",u+2);u=(d===-1?e.length:d+2)-1;continue}if(a===32||a===9||a===10||a===13)continue;if(a===44&&i===0){if(l!==-1)c.push(e.slice(l,f));l=-1;continue}if(a===34||a===39||a===96)s=!0,r=a;else if(a===91||a===123||a===40)i++;else if(a===93||a===125||a===41)i--;if(l===-1)l=u;f=u+1}if(l!==-1)c.push(e.slice(l,f));return c}function ct(e){if(y(e))return!0;if(e==="true"||e==="false")return!0;if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return!0;return!1}function Lt(e){return e==="number"||e==="string"||e==="boolean"}function rr(e){let c=[],i=0;while(i<e.length){while(i<e.length&&e.charCodeAt(i)<=32)i++;if(e.startsWith("/*",i)){let s=e.indexOf("*/",i+2);if(s===-1)break;c.push(e.slice(i,s+2)),i=s+2}else if(e.startsWith("//",i)){let s=i;while(s<e.length&&e.charCodeAt(s)!==10&&e.charCodeAt(s)!==13)s++;c.push(e.slice(i,s).trimEnd()),i=s}else break}return c}function Kt(e,c,i){let s=c.trim();if(!Lt(i)||!ct(s))return"";let r=(e??[]).map((f)=>f.trim()).filter((f)=>f.startsWith("/**")||f.startsWith("//")).join(`
16
16
  `),l;if(r.includes("@defaultValue"))l=r;else{let f=`@defaultValue ${be(s)}`;if(!r)l=`/** ${f} */`;else{let u=r.lastIndexOf("*/");if(u!==-1){let a=r.slice(0,u).trimEnd();if(a.startsWith("/** ")&&!a.includes(`
17
17
  `))a=`/**
@@ -24,17 +24,17 @@ import{h,g}from"./chunk-mm1cfz16.js";import{t}from"./chunk-d0dbet9n.js";import{G
24
24
  `).map((f)=>{let u=f.trim();if(!u)return"";return u.startsWith("*")?` ${u}`:` ${u}`}).join(`
25
25
  `)+`
26
26
  `}function mt(e){let c=!1,i=0,s=e.length;for(let r=0;r<s;r++){let l=e.charCodeAt(r);if(c){if(l===92){r++;continue}if(l===i)c=!1;continue}if(l===34||l===39||l===96){c=!0,i=l;continue}if(l===61&&r+1<s&&e.charCodeAt(r+1)===62)return!1;if(l===47&&(e.charCodeAt(r+1)===47||e.charCodeAt(r+1)===42))return!1;if(l>=97&&l<=122){let f=r;while(r<s&&(e.charCodeAt(r)>=97&&e.charCodeAt(r)<=122||e.charCodeAt(r)>=65&&e.charCodeAt(r)<=90||e.charCodeAt(r)>=48&&e.charCodeAt(r)<=57||e.charCodeAt(r)===95||e.charCodeAt(r)===36))r++;let u=e.slice(f,r);if(u==="new"||u==="async"||u==="await"||u==="function"||u==="yield"||u==="console"||u==="process")return!1;let a=r;while(a<s&&e.charCodeAt(a)<=32)a++;if(a<s&&e.charCodeAt(a)===40)return!1;r--}}return!0}function dt(e,c,i=0,s,r){let l=e.slice(1,-1).trim();if(!l)return"{}";if(i>=lt)return"Record<string, unknown>";let f=ae(l),u=new Set(f.flatMap(([S])=>{let b=Tt(At(S).key);return b?.kind==="get"?[b.name]:[]})),a=[],d=[],x=[],T=!1,w=ft&&!c,A=[],p=0;for(let[S,b]of f){let{comments:k,key:O}=At(S),P=k?`${k}
27
- `:"",I=Tt(O);if(I&&ar(I.name))continue;let M=O,V=!1;if(O==="..."){let R=b.trim(),q=r?ne(R,r):J(R)?`typeof ${R}`:n(R,c,!1,i+1,s);if(q!=="unknown")d.push(q);if(w&&(J(R)||R.startsWith("{")))A.push(`...${it(R)}`);continue}let F=L;L=null;let E,N=b.trim();if(N===O&&Z(N))E=r?.(b)??(c?void 0:s?.mutableBindingTypes?.get(N))??`typeof ${N}`;else if(he(N)){V=!0;let R=ge(O);if(R){M=R.name;let q="";if(N.startsWith("async "))q="async ";if(N.charCodeAt(q.length)===42)q+="*";E=St(R.name,q+R.typeParams+N.slice(q.length))}else E=St(O,N)}else{if(E=r?.(b)??n(b,c,!1,i+1,s),E==="unknown"&&J(N))E=(c?void 0:s?.mutableBindingTypes?.get(N))??`typeof ${N}`;if(E.includes("=>")||E.includes("function")||E.includes("async"))E=xt(E)}let v=L;L=F;let Y=M,j=b.trim(),tt=sr(M,s);if(!or(I?.name??M,s)&&!(I?.kind==="set"&&u.has(I.name)))x.push(I?de(I.kind,E):E);if(tt&&"index"in tt)T=!0;else{if(tt&&"name"in tt)M=tt.name;if(I){let R=ue(I.kind,I.name,E);if(R){a.push(`${P}${W(R)}`);continue}}if(!c&&Lt(E)&&ct(j))a.push(`${P}/** @defaultValue ${be(j)} */
28
- ${M}: ${W(E)}`);else a.push(`${P}${c?"readonly ":""}${M}: ${W(E)}`)}if(w){let R=Ot(Y);if(j.endsWith("as const"));else if(ct(j))A.push(`${R}: ${j}`);else if(j.startsWith("[")&&mt(j))A.push(`${R}: ${it(j)}`);else if(j.startsWith("{")){if(v)A.push(`${R}: ${v}`)}else if(V)A.push(`${R}: ${ht(xt(E))}`),p++;else if(!j.startsWith("[")&&(j.includes("=>")||j.startsWith("function")||j.startsWith("async"))){let q=pt(j,!1,0,!0);A.push(`${R}: ${ht(q)}`),p++}}}if(w&&A.length>p){let S=i>0?(i-1)/2:0,b=`{ ${A.join(", ")} }`;if(b.length<=80)L=b;else{let k=" ".repeat((S+1)*2),O=" ".repeat(S*2);L=`{
27
+ `:"",I=Tt(O);if(I&&ar(I.name))continue;let j=O,q=!1;if(O==="..."){let R=b.trim(),G=r?ne(R,r):Y(R)?`typeof ${R}`:n(R,c,!1,i+1,s);if(G!=="unknown")d.push(G);if(w&&(Y(R)||R.startsWith("{")))A.push(`...${it(R)}`);continue}let D=_;_=null;let E,L=b.trim();if(L===O&&v(L))E=r?.(b)??(c?void 0:s?.mutableBindingTypes?.get(L))??`typeof ${L}`;else if(he(L)){q=!0;let R=ge(O);if(R){j=R.name;let G="";if(L.startsWith("async "))G="async ";if(L.charCodeAt(G.length)===42)G+="*";E=St(R.name,G+R.typeParams+L.slice(G.length))}else E=St(O,L)}else{if(E=r?.(b)??n(b,c,!1,i+1,s),E==="unknown"&&Y(L))E=(c?void 0:s?.mutableBindingTypes?.get(L))??`typeof ${L}`;if(E.includes("=>")||E.includes("function")||E.includes("async"))E=xt(E)}let X=_;_=D;let et=j,M=b.trim(),N=sr(j,s);if(!or(I?.name??j,s)&&!(I?.kind==="set"&&u.has(I.name)))x.push(I?de(I.kind,E):E);if(N&&"index"in N)T=!0;else{if(N&&"name"in N)j=N.name;if(I){let R=ue(I.kind,I.name,E);if(R){a.push(`${P}${W(R)}`);continue}}if(!c&&Lt(E)&&ct(M))a.push(`${P}/** @defaultValue ${be(M)} */
28
+ ${j}: ${W(E)}`);else a.push(`${P}${c?"readonly ":""}${j}: ${W(E)}`)}if(w){let R=Ot(et);if(M.endsWith("as const"));else if(ct(M))A.push(`${R}: ${M}`);else if(M.startsWith("[")&&mt(M))A.push(`${R}: ${it(M)}`);else if(M.startsWith("{")){if(X)A.push(`${R}: ${X}`)}else if(q)A.push(`${R}: ${ht(xt(E))}`),p++;else if(!M.startsWith("[")&&(M.includes("=>")||M.startsWith("function")||M.startsWith("async"))){let G=pt(M,!1,0,!0);A.push(`${R}: ${ht(G)}`),p++}}}if(w&&A.length>p){let S=i>0?(i-1)/2:0,b=`{ ${A.join(", ")} }`;if(b.length<=80)_=b;else{let k=" ".repeat((S+1)*2),O=" ".repeat(S*2);_=`{
29
29
  ${k}${A.join(`,
30
30
  ${k}`)}
31
31
  ${O}}`}}if(T&&d.length===0){let S=[...new Set(x)].map((b)=>b.includes("=>")||b.includes(" & ")?`(${b})`:b);a.unshift(`${c?"readonly ":""}[x: string]: ${W(S.join(" | "))}`)}let m=a.length>0?`{
32
32
  ${a.join(`;
33
33
  `)}
34
- }`:"{}";if(d.length===0)return m;let C=d[0];for(let S=1;S<d.length;S++)C=`Omit<${C}, keyof ${d[S]}> & ${d[S]}`;return a.length>0?`Omit<${C}, keyof ${m}> & ${m}`:C}function Z(e){if(!e)return!1;let c=e.charCodeAt(0);if(!(c>=65&&c<=90||c>=97&&c<=122||c===95||c===36||c>127))return!1;for(let i=1;i<e.length;i++)if(!D(e.charCodeAt(i)))return!1;return!0}function J(e){let c=e.split(".");return c.length>0&&c.every(Z)}function ce(e){let c=!1,i="";for(let s=0;s<e.length;s++){let r=e[s];if(c){if(r==="\\")s++;else if(r===i)c=!1;continue}if(r==='"'||r==="'"||r==="`"){c=!0,i=r;continue}if(r==="(")return s;if(r==="<"){let l=o(e,s,"<",">");if(l!==-1)s=l}}return-1}function U(e){if(e.length<3||!e.endsWith(")"))return null;let c=ce(e);if(c===-1||o(e,c,"(",")")!==e.length-1)return null;let i=e.slice(0,c).trim(),s=!1;if(i.endsWith("?."))s=!0,i=i.slice(0,-2).trim();let r=i,l=!1,f=i.indexOf("<");if(f!==-1){if(o(i,f,"<",">")!==i.length-1)return null;r=i.slice(0,f).trim(),l=!0}if(r.endsWith("?.")){s=!0;let A=i.slice(r.length);r=r.slice(0,-2).trim(),i=r+A}if(!J(r))return null;let u=e.slice(c+1,-1).trim(),a=X(u)!==-1||u.startsWith("function")||u.startsWith("async function"),d=J(u),x=!a&&u.endsWith(")")&&U(u)!==null,T=r.indexOf(".");if(T!==-1){if(r.indexOf(".",T+1)!==-1)return null}else if(!l&&!s&&!a&&!d&&!x)return null;let w=`ReturnType<typeof ${i}>`;return s?`ReturnType<NonNullable<typeof ${i}>> | (null extends typeof ${r} ? undefined : undefined extends typeof ${r} ? undefined : never)`:w}function xt(e){let i=e.split(`
34
+ }`:"{}";if(d.length===0)return m;let C=d[0];for(let S=1;S<d.length;S++)C=`Omit<${C}, keyof ${d[S]}> & ${d[S]}`;return a.length>0?`Omit<${C}, keyof ${m}> & ${m}`:C}function v(e){if(!e)return!1;let c=e.charCodeAt(0);if(!(c>=65&&c<=90||c>=97&&c<=122||c===95||c===36||c>127))return!1;for(let i=1;i<e.length;i++)if(!V(e.charCodeAt(i)))return!1;return!0}function Y(e){let c=e.split(".");return c.length>0&&c.every(v)}function ce(e){let c=!1,i="";for(let s=0;s<e.length;s++){let r=e[s];if(c){if(r==="\\")s++;else if(r===i)c=!1;continue}if(r==='"'||r==="'"||r==="`"){c=!0,i=r;continue}if(r==="(")return s;if(r==="<"){let l=o(e,s,"<",">");if(l!==-1)s=l}}return-1}function z(e){if(e.length<3||!e.endsWith(")"))return null;let c=ce(e);if(c===-1||o(e,c,"(",")")!==e.length-1)return null;let i=e.slice(0,c).trim(),s=!1;if(i.endsWith("?."))s=!0,i=i.slice(0,-2).trim();let r=i,l=!1,f=i.indexOf("<");if(f!==-1){if(o(i,f,"<",">")!==i.length-1)return null;r=i.slice(0,f).trim(),l=!0}if(r.endsWith("?.")){s=!0;let A=i.slice(r.length);r=r.slice(0,-2).trim(),i=r+A}if(!Y(r))return null;let u=e.slice(c+1,-1).trim(),a=Z(u)!==-1||u.startsWith("function")||u.startsWith("async function"),d=Y(u),x=!a&&u.endsWith(")")&&z(u)!==null,T=r.indexOf(".");if(T!==-1){if(r.indexOf(".",T+1)!==-1)return null}else if(!l&&!s&&!a&&!d&&!x)return null;let w=`ReturnType<typeof ${i}>`;return s?`ReturnType<NonNullable<typeof ${i}>> | (null extends typeof ${r} ? undefined : undefined extends typeof ${r} ? undefined : never)`:w}function xt(e){let i=e.split(`
35
35
  `).map((x)=>_t(x)).join(`
36
- `),s=i.indexOf("async");if(s!==-1){let x=s>0?i.charCodeAt(s-1):32,T=s+5<i.length?i.charCodeAt(s+5):32;if(!D(x)&&!D(T))i=(i.slice(0,s)+i.slice(s+5)).trim()}let r=i.indexOf("(");if(r!==-1){let x=o(i,r,"(",")");if(x!==-1){let T=i.slice(r,x+1),w=ye(T);i=i.slice(0,r)+w+i.slice(x+1)}}let l=i.length,f="",u=[],a=!1,d=!1;for(let x=0;x<l;x++){let T=i.charCodeAt(x);if(T===123||T===40)u.push(T);else if(T===125||T===41)u.pop();if(T<=32){if(a=!0,T===10||T===13)d=!0;continue}if(a&&f.length>0){let A=(u.length>0?u[u.length-1]:0)===123;if(d&&A){let p=f.charCodeAt(f.length-1),m=p===59||p===44||p===123||T===125,C=f.length>=2&&f.charCodeAt(f.length-1)===47&&f.charCodeAt(f.length-2)===42;if(!m&&!C)f+="; ";else f+=" "}else f+=" "}a=!1,d=!1,f+=i[x]}return f.trim()}function D(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95||e===36}function ye(e){let c=e.trim(),i,s=!1;if(c.startsWith("(")&&c.endsWith(")"))i=c.slice(1,-1),s=!0;else i=c;let r=i.trim();if(!r)return s?"()":"";let l=!1;{let p=0;for(let m=0;m<r.length;m++){let C=r.charCodeAt(m);if(C===40||C===60||C===91||C===123)p++;else if(C===41||C===93||C===125||C===62&&r.charCodeAt(m-1)!==61)p--;else if(p===0&&C===61){let S=m>0?r.charCodeAt(m-1):0,b=m+1<r.length?r.charCodeAt(m+1):0;if(S!==61&&S!==33&&S!==60&&S!==62&&b!==61&&b!==62){l=!0;break}}}}if(!l)return c;let f=[],u=[],a=0,d=0,x=!1,T=0;for(let p=0;p<=r.length;p++){if(p===r.length){f.push(r.slice(a));break}let m=r.charCodeAt(p);if(x){if(m===92){p++;continue}if(m===T)x=!1;continue}if(m===47&&p+1<r.length){let C=r.charCodeAt(p+1);if(C===42){p+=2;while(p+1<r.length&&!(r.charCodeAt(p)===42&&r.charCodeAt(p+1)===47))p++;p++;continue}if(C===47){while(p<r.length&&r.charCodeAt(p)!==10)p++;continue}}if(m===39||m===34||m===96){x=!0,T=m;continue}if(m===40||m===60||m===91||m===123)d++;else if(m===41||m===93||m===125||m===62&&r.charCodeAt(p-1)!==61)d--;else if(m===44&&d===0){f.push(r.slice(a,p));let C=",",S=p+1;while(S<r.length&&r.charCodeAt(S)<=32)C+=r[S],S++;u.push(C),a=S}}let w=[];for(let p of f){let m=p.trim();if(!m){w.push(p);continue}if(m.startsWith("//"))continue;let C=_t(m),S=p.slice(0,p.length-p.trimStart().length);w.push(S+le(C))}let A=w[0]||"";for(let p=1;p<w.length;p++)A+=(u[p-1]||", ")+w[p];return _e(s?`(${A})`:A)}function _t(e){let c=!1,i=0;for(let s=0;s<e.length-1;s++){let r=e.charCodeAt(s);if(c){if(r===92){s++;continue}if(r===i)c=!1;continue}if(r===39||r===34||r===96){c=!0,i=r;continue}if(r===47&&e.charCodeAt(s+1)===47)return e.slice(0,s).trimEnd()}return e}function le(e){if(e.startsWith("..."))return e;let c=-1,i=-1,s=0,r=!1,l=0;for(let u=0;u<e.length;u++){let a=e.charCodeAt(u);if(r){if(a===92){u++;continue}if(a===l)r=!1;continue}if(a===47&&u+1<e.length){let d=e.charCodeAt(u+1);if(d===42){u+=2;while(u+1<e.length&&!(e.charCodeAt(u)===42&&e.charCodeAt(u+1)===47))u++;u++;continue}if(d===47){while(u<e.length&&e.charCodeAt(u)!==10)u++;continue}}if(a===39||a===34||a===96){r=!0,l=a;continue}if(a===40||a===60||a===91||a===123)s++;else if(a===41||a===93||a===125||a===62&&e.charCodeAt(u-1)!==61)s--;else if(s===0){if(a===58&&c===-1)c=u;else if(a===61&&i===-1&&(u===0||e.charCodeAt(u-1)!==61)&&(u+1>=e.length||e.charCodeAt(u+1)!==61&&e.charCodeAt(u+1)!==62))i=u}}let f=i!==-1;if(c!==-1&&(i===-1||c<i)){let u=e.slice(0,c).trim(),a=i!==-1?e.slice(c+1,i).trim():e.slice(c+1).trim(),d=f&&!u.endsWith("?")?"?":"";return`${u}${d}: ${a}`}else if(i!==-1){let u=e.slice(0,i).trim(),a=we(u,e.slice(i+1));if(a)return je(a,bt);let d=!u.endsWith("?")?"?":"";return`${u}${d}: ${bt(e.slice(i+1))}`}return e}function bt(e){let c=e.trim();if(c==="true"||c==="false")return"boolean";if(y(c))return"number";if(c.startsWith("'")&&c.endsWith("'")||c.startsWith('"')&&c.endsWith('"'))return"string";if(c.startsWith("["))return"unknown[]";if(c.startsWith("{"))return"Record<string, unknown>";return"unknown"}function fe(e){let c=0,i=e.length;while(c<i){while(c<i&&(e.charCodeAt(c)===32||e.charCodeAt(c)===9||e.charCodeAt(c)===10||e.charCodeAt(c)===13))c++;if(c+1<i&&e.charCodeAt(c)===47&&e.charCodeAt(c+1)===42){c+=2;while(c+1<i&&!(e.charCodeAt(c)===42&&e.charCodeAt(c+1)===47))c++;c+=2;continue}break}return c}function At(e){let c=[],i=0,s=e.length;while(i<s){while(i<s&&e.charCodeAt(i)<=32)i++;if(i+1>=s||e.charCodeAt(i)!==47||e.charCodeAt(i+1)!==42)break;let r=i;i+=2;while(i+1<s&&!(e.charCodeAt(i)===42&&e.charCodeAt(i+1)===47))i++;i=Math.min(i+2,s),c.push(e.slice(r,i).trim())}return{comments:c.join(`
37
- `),key:e.slice(i).trim()}}function ae(e){let c=[],i="",s="",r=0,l=!1,f="",u=!0,a=!1,d=0,x=!1,T=!1,w=0,A=!1,p=!1;for(let m=0;m<e.length;m++){let C=e.charCodeAt(m),S=m>0?e.charCodeAt(m-1):0,b=m<e.length-1?e.charCodeAt(m+1):0;if(!l&&!a&&C===47&&b===47){i=i.replace(/[ \t]+$/,""),m+=2;while(m<e.length&&e.charCodeAt(m)!==10)m++;m--;continue}if(!l&&!a&&C===47&&b===42){a=!0,d=1,i+="/*",m++;continue}else if(a&&C===42&&b===47){if(d--,i+="*/",m++,d===0)a=!1;continue}else if(a&&C===47&&b===42){d++,i+="/*",m++;continue}let k=e[m];if(!l&&!a&&(C===34||C===39||C===96))l=!0,f=k,i+=k;else if(l&&k===f&&S!==92)l=!1,i+=k;else if(!l&&!a)if(C===46&&b===46&&e.charCodeAt(m+2)===46&&r===0&&u)s=`${i.trim()}...`,i="",u=!1,A=!1,m+=2;else if(C===40&&r===0&&u&&w===0){s=i.trim();let O=fe(s),P=O>0?s.slice(0,O):"",I=s.slice(O),M="";if(I.startsWith("async ")||I.startsWith("async\t")||I.startsWith(`async
38
- `))I=I.slice(6).trimStart(),M="async ";if(I.startsWith("*"))I=I.slice(1).trimStart(),M+="*";s=P+I,i=M+k,u=!1,A=!0,p=!1,r=1}else if(C===123||C===91||C===40){if(r++,i+=k,p&&C===123)p=!1}else if(C===125||C===93||C===41){if(r--,i+=k,C===41&&r===0&&!u&&!A)x=!0;if(A){if(C===41&&r===0&&!p)p=!0;else if(C===125&&r===0)A=!1,p=!1}}else if(C===58&&r===0&&u&&w===0)s=i.trim(),i="",u=!1;else if(C===58&&r===0&&x)T=!0,i+=k;else if(C===60&&T)w++,i+=k;else if(C===60&&u&&r===0)w++,i+=k;else if(C===62&&w>0&&S!==61)w--,i+=k;else if(C===61&&b===62&&T&&w===0)T=!1,x=!1,i+=k;else if(C===44&&r===0&&w===0&&!p){if(s&&i.trim()){let O=i.trim();c.push([s,O])}else if(u&&i.trim())kt(c,i.trim());i="",s="",u=!0,x=!1,T=!1,w=0}else i+=k;else i+=k}if(s&&i.trim()){let m=i.trim();c.push([s,m])}else if(u&&i.trim())kt(c,i.trim());return c}function kt(e,c){let{comments:i,key:s}=At(c);if(Z(s))e.push([i?`${i}
39
- ${s}`:s,s]);else if(s.startsWith("...")&&s.length>3)e.push(["...",s.slice(3).trim()])}function Tt(e){let c=e.trim();if(c.startsWith("get ")&&c.length>4){let i=c.slice(4).trim();if(i)return{kind:"get",name:i}}if(c.startsWith("set ")&&c.length>4){let i=c.slice(4).trim();if(i)return{kind:"set",name:i}}return null}function ue(e,c,i){let s=i.trim();if(s.charCodeAt(0)!==40)return null;let r=o(s,0,"(",")");if(r===-1)return null;let l=s.slice(1,r).trim(),f=s.slice(r+1).trimStart();if(!f.startsWith("=>"))return null;let u=f.slice(2).trim();if(e==="get")return`get ${c}(): ${u||"unknown"}`;return`set ${c}(${l})`}function de(e,c){let i=c.trim(),s=o(i,0,"(",")");if(!i.startsWith("(")||s===-1)return"unknown";if(e==="get"){let u=i.slice(s+1).trim();return u.startsWith("=>")?u.slice(2).trim():"unknown"}let r=i.slice(1,s).trim(),l=r.startsWith("{")?o(r,0,"{","}"):r.startsWith("[")?o(r,0,"[","]"):0,f=r.indexOf(":",Math.max(0,l));return f===-1?"unknown":r.slice(f+1).trim()}function he(e){let c=e;if(c.startsWith("async ")||c.startsWith("async\t"))c=c.slice(5).trimStart();if(c.startsWith("*"))c=c.slice(1).trimStart();if(!c.startsWith("("))return!1;let i=0;for(let s=0;s<c.length;s++){let r=c.charCodeAt(s);if(r===40)i++;else if(r===41){if(i--,i===0){let l=c.slice(s+1).trimStart();if(l.startsWith("{"))return!0;if(l.startsWith(":")){let f=yt(l,1);if(f?.kind==="arrow")return!1;if(f?.kind==="body")return!0}return!1}}}return!1}function ge(e){let c=e.trimEnd();if(!c.endsWith(">"))return null;let i=0,s=-1;for(let l=c.length-1;l>=0;l--){let f=c.charCodeAt(l);if(f===62){if(l>0&&c.charCodeAt(l-1)===61)continue;i++}else if(f===60){if(i--,i===0){s=l;break}}}if(s===-1)return null;let r=c.slice(0,s).trimEnd();if(!r)return null;return{name:r,typeParams:c.slice(s)}}function St(e,c){let i=c.trimStart(),s=!1,r=!1;if(i.startsWith("async ")||i.startsWith("async\t"))s=!0,i=i.slice(5).trimStart();if(i.startsWith("*"))r=!0,i=i.slice(1).trimStart();let l="";if(i.charCodeAt(0)===60){let w=0,A=-1;for(let p=0;p<i.length;p++)if(i.charCodeAt(p)===60)w++;else if(i.charCodeAt(p)===62&&!(p>0&&i.charCodeAt(p-1)===61)){if(w--,w===0){A=p;break}}if(A!==-1)l=i.slice(0,A+1),i=i.slice(A+1).trimStart()}let f=i.indexOf("("),u=o(i,f,"(",")");if(f===-1||u===-1)return"() => unknown";let a=i.slice(f,u+1),d="unknown",x=i.slice(u+1).trimStart();if(x.charCodeAt(0)===58){let w=x.slice(1),A=yt(w,0);if(A)d=w.slice(0,A.index).trim();else d=w.trim()}if(d==="unknown"&&!r&&x.charCodeAt(0)===123){let w=o(x,0,"{","}");if(w!==-1){let A=B(x.slice(1,w),s,a);if(A!=="unknown"&&A!=="Promise<unknown>")d=s&&A.startsWith("Promise<")?A.slice(8,-1):A;else if(s)d="Promise<unknown>"}}if(d==="unknown"){if(s&&r)d="AsyncGenerator<unknown, void, unknown>";else if(r)d="Generator<unknown, void, unknown>";else if(s)d="Promise<void>"}else if(s&&!d.startsWith("Promise<")&&!d.startsWith("AsyncGenerator<"))d=`Promise<${d}>`;let T=ye(a);return`${l}${T} => ${d}`}function yt(e,c){let i=0,s=0,r=0,l=0,f=!1,u=0;for(let a=c;a<e.length;a++){let d=e.charCodeAt(a);if(f){if(d===92)a++;else if(d===u)f=!1;continue}if(d===34||d===39||d===96){f=!0,u=d;continue}if(d===40)i++;else if(d===41&&i>0)i--;else if(d===91)s++;else if(d===93&&s>0)s--;else if(d===60)r++;else if(d===62&&r>0&&e.charCodeAt(a-1)!==61)r--;else if(d===125&&l>0)l--;else if(d===123){let x=i>0||s>0||r>0||l>0,T=e.slice(c,a).trimEnd(),w=T.charCodeAt(T.length-1),A=T.length===0||w===38||w===124||w===40||w===44||w===58||w===61||w===91;if(x||A)l++;else return{index:a,kind:"body"}}else if(d===61&&a+1<e.length&&e.charCodeAt(a+1)===62&&i===0&&s===0&&r===0&&l===0)return{index:a,kind:"arrow"}}return null}function o(e,c,i,s){let r=0;for(let l=c;l<e.length;l++)if(e[l]===i)r++;else if(e[l]===s){if(s===">"&&l>0&&e[l-1]==="=")continue;if(r--,r===0)return l}return-1}function X(e){let c=0,i=0,s=!1,r="";for(let l=0;l<e.length-1;l++){let f=e[l],u=e[l+1],a=l>0?e[l-1]:"";if(!s&&(f==='"'||f==="'"||f==="`"))s=!0,r=f;else if(s&&f===r&&a!=="\\")s=!1;if(!s){if(f==="<"){let d=o(e,l,"<",">");if(d!==-1){l=d;continue}}if(f==="(")c++;else if(f===")")c--;else if(f==="[")i++;else if(f==="]")i--;if(f==="="&&u===">"&&c===0&&i===0)return l}}return-1}function pt(e,c=!1,i=0,s=!0){let r=e.trim();if(r.length>200&&ut(r,"=>")>2&&ut(r,"<")>5&&!r.startsWith("function"))return c?"((...args: any[]) => any)":"(...args: any[]) => any";if(r.startsWith("async ")&&r.includes("=>")){let f=r.slice(5).trim(),u=X(f);if(u===-1)return c?"(() => Promise<unknown>)":"() => Promise<unknown>";let a=f.substring(0,u).trim(),d=f.substring(u+2).trim(),x=Ct(a),{params:T,returnType:w}=x;if(T=ye(T),T==="()"||T==="")T="()";else if(!T.startsWith("("))T=`(${T})`;let A=w;if(A);else if(d.startsWith("{"))A=B(d.slice(1,d.endsWith("}")?-1:void 0),!0,x.params);else A=_(d,gt(x.params));let p=`${T} => ${w||A.startsWith("Promise<")?A:`Promise<${A}>`}`;return c?`(${p})`:p}if(r.includes("=>")){let f="",u=r;if(r.startsWith("<")){let C=o(r,0,"<",">");if(C!==-1)f=r.substring(0,C+1),u=r.substring(C+1).trim()}let a=X(u);if(a===-1)return c?"(() => unknown)":"() => unknown";let d=u.substring(0,a).trim(),x=u.substring(a+2).trim(),T=Ct(d),{params:w,returnType:A}=T;if(w=ye(w),w==="()"||w==="")w="()";else if(!w.startsWith("("))w=`(${w})`;let p="unknown";if(A)p=A;else if(x.startsWith("{"))p=B(x.slice(1,x.endsWith("}")?-1:void 0),!1,T.params);else if(rt(x)||at(x)&&rt(x.slice(1,-1).trim()))p="JSX.Element";else if(x.includes("=>")){let C=x.trimStart(),S=C.indexOf("("),b=S!==-1?o(C,S,"(",")"):-1,k=b!==-1?C.indexOf("=>",b):-1;if(S===0&&b!==-1&&k!==-1){let O=C.substring(S+1,b).trim(),P=ye(O);if(f.includes("T")&&P.includes("T"))p=`(${P}) => T`;else p=`(${P}) => any`}else p="any"}else p=_(x,gt(T.params));let m=`${f}${w} => ${p}`;return c?`(${m})`:m}if(r.startsWith("function")){let f=8,u=r.length;while(f<u&&r.charCodeAt(f)<=32)f++;let a=!1;if(f<u&&r.charCodeAt(f)===42){a=!0,f++;while(f<u&&r.charCodeAt(f)<=32)f++}let d="";if(f<u&&r.charCodeAt(f)===60){let w=f,A=1;f++;while(f<u&&A>0){let p=r.charCodeAt(f);if(p===60)A++;else if(p===62&&r.charCodeAt(f-1)!==61)A--;f++}d=r.substring(w,f);while(f<u&&r.charCodeAt(f)<=32)f++}let x=r.indexOf("(",f);if(x!==-1){let w=1,A=x+1;while(A<u&&w>0){let k=r.charCodeAt(A);if(k===40)w++;else if(k===41)w--;A++}let p=r.substring(x+1,A-1).trim(),m=p?ye(`(${p})`):"()";if(a){let k=r.substring(A).trim(),O=k.indexOf("Generator<");if(O!==-1){let I=O+10,M=k.indexOf(">",I);if(M!==-1){let V=k.substring(I,M),F=`${d}${m} => Generator<${V}>`;return c?`(${F})`:F}}let P=`${d}${m} => Generator<any, any, any>`;return c?`(${P})`:P}let C="unknown",S=r.substring(A).trimStart();if(S.charCodeAt(0)===58){let k=S.slice(1),O=yt(k,0),P=(O?k.slice(0,O.index):k).trim();if(P)C=P}let b=`${d}${m} => ${C}`;return c?`(${b})`:b}let T="(...args: any[]) => unknown";return c?`(${T})`:T}if(r.includes("=>")&&r.includes("(")&&r.includes(")")){if(r.length>100||ut(r,"=>")>2){let f="";if(r.charCodeAt(0)===60){let T=o(r,0,"<",">");if(T!==-1)f=r.substring(0,T+1)}let u=r.indexOf("("),a=u!==-1?o(r,u,"(",")"):-1,d=u!==-1&&a!==-1?r.substring(u,a+1):"(...args: any[])";d=ye(d);let x=`${f}${d} => any`;return c?`(${x})`:x}return c?`(${r})`:r}let l="() => unknown";return c?`(${l})`:l}function Ct(e){let c=e.trim();if(!c.startsWith("("))return{params:c,returnType:""};let i=o(c,0,"(",")");if(i===-1)return{params:c,returnType:""};let s=c.slice(i+1).trim();return{params:c.slice(0,i+1),returnType:s.startsWith(":")?s.slice(1).trim():""}}function We(e){let c=e.trim();if(c==="any"||c==="object"||c==="unknown")return!0;if(c.startsWith("Record<")&&c.endsWith(">"))return!0;if(c.startsWith("Array<")&&c.endsWith(">"))return!0;if(/^\{\s*\[[^\]]*\]:\s*(any|string|number|unknown)\s*\}$/.test(c))return!0;return!1}function z(e){let c=-1,i=0;for(let r=0;r<e.length;r++){let l=e.charCodeAt(r);if(l===34||l===39||l===96){r=G(e,r,l)-1;continue}if(l===47&&e.charCodeAt(r+1)===47){while(r<e.length&&e.charCodeAt(r)!==10)r++;continue}if(l===47&&e.charCodeAt(r+1)===42){let f=e.indexOf("*/",r+2);r=f===-1?e.length:f+1;continue}if(l===47){let f=r-1;while(f>=0&&e.charCodeAt(f)<=32)f--;if(f<0||"([{:;,=!?&|+*-~>".includes(e[f])){let u=!1;for(r++;r<e.length;r++){let a=e.charCodeAt(r);if(a===92)r++;else if(a===91)u=!0;else if(a===93)u=!1;else if(a===47&&!u)break}continue}}if(l===40||l===91||l===123)i++;else if(l===41||l===93||l===125)i--;else if(i===0&&e.startsWith("satisfies",r)&&et(e,r,9)&&e[r-1]!==".")c=r}if(c===-1)return null;let s=e.slice(c+9).trim();if(s.endsWith(";"))s=s.slice(0,-1).trim();return s||null}function Va(e){let c=e.trim(),i=c.match(/^\{\s*\[(\w+)\s+in\s+(.+?)\](\?)?\s*:\s*(.+)\s*\}$/);if(i){let[,l,f,u,a]=i;return`{ [${l} in ${f}]${u?"?":""}: ${a} }`}let s=c.match(/^\{\s*readonly\s+\[(\w+)\s+in\s+(.+?)\](\?)?\s*:\s*(.+)\s*\}$/);if(s){let[,l,f,u,a]=s;return`{ readonly [${l} in ${f}]${u?"?":""}: ${a} }`}let r=c.match(/^\{\s*(-?readonly\s+)?\[(\w+)\s+in\s+(.+?)\](-?\?)?\s*:\s*(.+)\s*\}$/);if(r){let[,l,f,u,a,d]=r;return`{ ${l?`${l.trim()} `:""}[${f} in ${u}]${a||""}: ${d} }`}return null}function Ua(e){let c=e.trim(),i=c.indexOf(" extends ");if(i===-1)return null;let s=c.slice(i+9),r=me(s);if(r===-1)return null;let l=pe(s,r);if(l===-1)return null;let f=c.slice(0,i).trim(),u=s.slice(0,r).trim(),a=s.slice(r+1,l).trim(),d=s.slice(l+1).trim();return`${f} extends ${u} ? ${a} : ${d}`}function me(e){let c=0,i=!1,s="";for(let r=0;r<e.length;r++){let l=e[r],f=r>0?e[r-1]:"";if(!i&&(l==='"'||l==="'"||l==="`"))i=!0,s=l;else if(i&&l===s&&f!=="\\")i=!1;if(!i){if(l==="<"||l==="("||l==="["||l==="{")c++;if(l===">"||l===")"||l==="]"||l==="}")c--;if(l==="?"&&c===0)return r}}return-1}function pe(e,c){let i=0,s=!1,r="";for(let l=c+1;l<e.length;l++){let f=e[l],u=l>0?e[l-1]:"";if(!s&&(f==='"'||f==="'"||f==="`"))s=!0,r=f;else if(s&&f===r&&u!=="\\")s=!1;if(!s){if(f==="<"||f==="("||f==="["||f==="{")i++;if(f===">"||f===")"||f==="]"||f==="}")i--;if(f==="?"&&i===0)i++;if(f===":"&&i===0)return l;if(f===":"&&i>0)i--}}return-1}function za(e){let c=e.trim();if(!c.startsWith("`")||!c.endsWith("`"))return null;let i=c.slice(1,-1);if(!i.includes("${"))return c;let s=[],r="",l=0;while(l<i.length)if(i[l]==="$"&&i[l+1]==="{"){if(r)s.push(`"${r}"`),r="";let f=1,u="";l+=2;while(l<i.length&&f>0){if(i[l]==="{")f++;if(i[l]==="}")f--;if(f>0)u+=i[l];l++}s.push(u.trim())}else r+=i[l],l++;if(r)s.push(`"${r}"`);return c}function Ha(e){let c=[],i=/infer\s+(\w+)/g,s;while((s=i.exec(e))!==null)c.push(s[1]);return c}function Ka(e){let i=e.trim(),s=i.indexOf("[");if(s!==-1){if(i.indexOf(" in ",s)!==-1)return!0}let r=i.indexOf(" extends ");if(r!==-1){let f=i.indexOf(" ? ",r);if(f!==-1&&i.indexOf(" : ",f)!==-1)return!0}if(i.charCodeAt(0)===96&&i.charCodeAt(i.length-1)===96){if(i.indexOf("${")!==-1)return!0}let l=i.indexOf("infer ");if(l!==-1){if(l===0||!D(i.charCodeAt(l-1)))return!0}return!1}function qa(e,c=3){let i=e.trim(),s=0,r=0;for(let l of i){if(l==="<"||l==="("||l==="["||l==="{")s++,r=Math.max(r,s);if(l===">"||l===")"||l==="]"||l==="}")s--}if(r>c){let l=i.match(/^(\w+)</);if(l)return`${l[1]}<any>`;return"unknown"}return i}function Ja(e){let i=e.trim().match(/^(\w+)<(.+)>$/);if(!i)return null;let s=i[1],r=i[2],l=$a(r);if(["Partial","Required","Readonly","Pick","Omit","Record","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisParameterType","OmitThisParameter","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","NoInfer"].includes(s))return{name:s,params:l};return null}function $a(e){let c=[],i="",s=0,r=!1,l="";for(let f=0;f<e.length;f++){let u=e[f],a=f>0?e[f-1]:"";if(!r&&(u==='"'||u==="'"||u==="`"))r=!0,l=u;else if(r&&u===l&&a!=="\\")r=!1;if(!r){if(u==="<"||u==="("||u==="["||u==="{")s++;if(u===">"||u===")"||u==="]"||u==="}")s--;if(u===","&&s===0){c.push(i.trim()),i="";continue}}i+=u}if(i.trim())c.push(i.trim());return c}function Ya(e){let c=e.trim();if(c.startsWith("keyof "))return c;return null}function Xa(e){let c=e.trim();if(c.startsWith("typeof "))return c;return null}function Za(e){let c=e.trim();if(c.length===0||c.charCodeAt(0)===91)return!1;if(c.charCodeAt(c.length-1)!==93)return!1;let i=c.indexOf("[");if(i<=0)return!1;for(let s=0;s<i;s++){let r=c.charCodeAt(s);if(!D(r)&&r!==46)return!1}return!0}
40
- export{Vt,Ut,n,zt,B,Sa,W,Ht,Be,Q,rr,Kt,dt,U,ye,o,pt,We,z,Va,Ua,za,Ha,Ka,qa,Ja,$a,Ya,Xa,Za};
36
+ `),s=i.indexOf("async");if(s!==-1){let x=s>0?i.charCodeAt(s-1):32,T=s+5<i.length?i.charCodeAt(s+5):32;if(!V(x)&&!V(T))i=(i.slice(0,s)+i.slice(s+5)).trim()}let r=i.indexOf("(");if(r!==-1){let x=o(i,r,"(",")");if(x!==-1){let T=i.slice(r,x+1),w=ye(T);i=i.slice(0,r)+w+i.slice(x+1)}}let l=i.length,f="",u=[],a=!1,d=!1;for(let x=0;x<l;x++){let T=i.charCodeAt(x);if(T===123||T===40)u.push(T);else if(T===125||T===41)u.pop();if(T<=32){if(a=!0,T===10||T===13)d=!0;continue}if(a&&f.length>0){let A=(u.length>0?u[u.length-1]:0)===123;if(d&&A){let p=f.charCodeAt(f.length-1),m=p===59||p===44||p===123||T===125,C=f.length>=2&&f.charCodeAt(f.length-1)===47&&f.charCodeAt(f.length-2)===42;if(!m&&!C)f+="; ";else f+=" "}else f+=" "}a=!1,d=!1,f+=i[x]}return f.trim()}function V(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95||e===36}function ye(e){let c=e.trim(),i,s=!1;if(c.startsWith("(")&&c.endsWith(")"))i=c.slice(1,-1),s=!0;else i=c;let r=i.trim();if(!r)return s?"()":"";let l=!1;{let p=0;for(let m=0;m<r.length;m++){let C=r.charCodeAt(m);if(C===40||C===60||C===91||C===123)p++;else if(C===41||C===93||C===125||C===62&&r.charCodeAt(m-1)!==61)p--;else if(p===0&&C===61){let S=m>0?r.charCodeAt(m-1):0,b=m+1<r.length?r.charCodeAt(m+1):0;if(S!==61&&S!==33&&S!==60&&S!==62&&b!==61&&b!==62){l=!0;break}}}}if(!l)return c;let f=[],u=[],a=0,d=0,x=!1,T=0;for(let p=0;p<=r.length;p++){if(p===r.length){f.push(r.slice(a));break}let m=r.charCodeAt(p);if(x){if(m===92){p++;continue}if(m===T)x=!1;continue}if(m===47&&p+1<r.length){let C=r.charCodeAt(p+1);if(C===42){p+=2;while(p+1<r.length&&!(r.charCodeAt(p)===42&&r.charCodeAt(p+1)===47))p++;p++;continue}if(C===47){while(p<r.length&&r.charCodeAt(p)!==10)p++;continue}}if(m===39||m===34||m===96){x=!0,T=m;continue}if(m===40||m===60||m===91||m===123)d++;else if(m===41||m===93||m===125||m===62&&r.charCodeAt(p-1)!==61)d--;else if(m===44&&d===0){f.push(r.slice(a,p));let C=",",S=p+1;while(S<r.length&&r.charCodeAt(S)<=32)C+=r[S],S++;u.push(C),a=S}}let w=[];for(let p of f){let m=p.trim();if(!m){w.push(p);continue}if(m.startsWith("//"))continue;let C=_t(m),S=p.slice(0,p.length-p.trimStart().length);w.push(S+le(C))}let A=w[0]||"";for(let p=1;p<w.length;p++)A+=(u[p-1]||", ")+w[p];return _e(s?`(${A})`:A)}function _t(e){let c=!1,i=0;for(let s=0;s<e.length-1;s++){let r=e.charCodeAt(s);if(c){if(r===92){s++;continue}if(r===i)c=!1;continue}if(r===39||r===34||r===96){c=!0,i=r;continue}if(r===47&&e.charCodeAt(s+1)===47)return e.slice(0,s).trimEnd()}return e}function le(e){if(e.startsWith("..."))return e;let c=-1,i=-1,s=0,r=!1,l=0;for(let u=0;u<e.length;u++){let a=e.charCodeAt(u);if(r){if(a===92){u++;continue}if(a===l)r=!1;continue}if(a===47&&u+1<e.length){let d=e.charCodeAt(u+1);if(d===42){u+=2;while(u+1<e.length&&!(e.charCodeAt(u)===42&&e.charCodeAt(u+1)===47))u++;u++;continue}if(d===47){while(u<e.length&&e.charCodeAt(u)!==10)u++;continue}}if(a===39||a===34||a===96){r=!0,l=a;continue}if(a===40||a===60||a===91||a===123)s++;else if(a===41||a===93||a===125||a===62&&e.charCodeAt(u-1)!==61)s--;else if(s===0){if(a===58&&c===-1)c=u;else if(a===61&&i===-1&&(u===0||e.charCodeAt(u-1)!==61)&&(u+1>=e.length||e.charCodeAt(u+1)!==61&&e.charCodeAt(u+1)!==62))i=u}}let f=i!==-1;if(c!==-1&&(i===-1||c<i)){let u=e.slice(0,c).trim(),a=i!==-1?e.slice(c+1,i).trim():e.slice(c+1).trim(),d=f&&!u.endsWith("?")?"?":"";return`${u}${d}: ${a}`}else if(i!==-1){let u=e.slice(0,i).trim(),a=we(u,e.slice(i+1));if(a)return je(a,bt);let d=!u.endsWith("?")?"?":"";return`${u}${d}: ${bt(e.slice(i+1))}`}return e}function bt(e){let c=e.trim();if(c==="true"||c==="false")return"boolean";if(y(c))return"number";if(c.startsWith("'")&&c.endsWith("'")||c.startsWith('"')&&c.endsWith('"'))return"string";if(c.startsWith("["))return"unknown[]";if(c.startsWith("{"))return"Record<string, unknown>";return"unknown"}function fe(e){let c=0,i=e.length;while(c<i){while(c<i&&(e.charCodeAt(c)===32||e.charCodeAt(c)===9||e.charCodeAt(c)===10||e.charCodeAt(c)===13))c++;if(c+1<i&&e.charCodeAt(c)===47&&e.charCodeAt(c+1)===42){c+=2;while(c+1<i&&!(e.charCodeAt(c)===42&&e.charCodeAt(c+1)===47))c++;c+=2;continue}break}return c}function At(e){let c=[],i=0,s=e.length;while(i<s){while(i<s&&e.charCodeAt(i)<=32)i++;if(i+1>=s||e.charCodeAt(i)!==47||e.charCodeAt(i+1)!==42)break;let r=i;i+=2;while(i+1<s&&!(e.charCodeAt(i)===42&&e.charCodeAt(i+1)===47))i++;i=Math.min(i+2,s),c.push(e.slice(r,i).trim())}return{comments:c.join(`
37
+ `),key:e.slice(i).trim()}}function ae(e){let c=[],i="",s="",r=0,l=!1,f="",u=!0,a=!1,d=0,x=!1,T=!1,w=0,A=!1,p=!1;for(let m=0;m<e.length;m++){let C=e.charCodeAt(m),S=m>0?e.charCodeAt(m-1):0,b=m<e.length-1?e.charCodeAt(m+1):0;if(!l&&!a&&C===47&&b===47){i=i.replace(/[ \t]+$/,""),m+=2;while(m<e.length&&e.charCodeAt(m)!==10)m++;m--;continue}if(!l&&!a&&C===47&&b===42){a=!0,d=1,i+="/*",m++;continue}else if(a&&C===42&&b===47){if(d--,i+="*/",m++,d===0)a=!1;continue}else if(a&&C===47&&b===42){d++,i+="/*",m++;continue}let k=e[m];if(!l&&!a&&(C===34||C===39||C===96))l=!0,f=k,i+=k;else if(l&&k===f&&S!==92)l=!1,i+=k;else if(!l&&!a)if(C===46&&b===46&&e.charCodeAt(m+2)===46&&r===0&&u)s=`${i.trim()}...`,i="",u=!1,A=!1,m+=2;else if(C===40&&r===0&&u&&w===0){s=i.trim();let O=fe(s),P=O>0?s.slice(0,O):"",I=s.slice(O),j="";if(I.startsWith("async ")||I.startsWith("async\t")||I.startsWith(`async
38
+ `))I=I.slice(6).trimStart(),j="async ";if(I.startsWith("*"))I=I.slice(1).trimStart(),j+="*";s=P+I,i=j+k,u=!1,A=!0,p=!1,r=1}else if(C===123||C===91||C===40){if(r++,i+=k,p&&C===123)p=!1}else if(C===125||C===93||C===41){if(r--,i+=k,C===41&&r===0&&!u&&!A)x=!0;if(A){if(C===41&&r===0&&!p)p=!0;else if(C===125&&r===0)A=!1,p=!1}}else if(C===58&&r===0&&u&&w===0)s=i.trim(),i="",u=!1;else if(C===58&&r===0&&x)T=!0,i+=k;else if(C===60&&T)w++,i+=k;else if(C===60&&u&&r===0)w++,i+=k;else if(C===62&&w>0&&S!==61)w--,i+=k;else if(C===61&&b===62&&T&&w===0)T=!1,x=!1,i+=k;else if(C===44&&r===0&&w===0&&!p){if(s&&i.trim()){let O=i.trim();c.push([s,O])}else if(u&&i.trim())kt(c,i.trim());i="",s="",u=!0,x=!1,T=!1,w=0}else i+=k;else i+=k}if(s&&i.trim()){let m=i.trim();c.push([s,m])}else if(u&&i.trim())kt(c,i.trim());return c}function kt(e,c){let{comments:i,key:s}=At(c);if(v(s))e.push([i?`${i}
39
+ ${s}`:s,s]);else if(s.startsWith("...")&&s.length>3)e.push(["...",s.slice(3).trim()])}function Tt(e){let c=e.trim();if(c.startsWith("get ")&&c.length>4){let i=c.slice(4).trim();if(i)return{kind:"get",name:i}}if(c.startsWith("set ")&&c.length>4){let i=c.slice(4).trim();if(i)return{kind:"set",name:i}}return null}function ue(e,c,i){let s=i.trim();if(s.charCodeAt(0)!==40)return null;let r=o(s,0,"(",")");if(r===-1)return null;let l=s.slice(1,r).trim(),f=s.slice(r+1).trimStart();if(!f.startsWith("=>"))return null;let u=f.slice(2).trim();if(e==="get")return`get ${c}(): ${u||"unknown"}`;return`set ${c}(${l})`}function de(e,c){let i=c.trim(),s=o(i,0,"(",")");if(!i.startsWith("(")||s===-1)return"unknown";if(e==="get"){let u=i.slice(s+1).trim();return u.startsWith("=>")?u.slice(2).trim():"unknown"}let r=i.slice(1,s).trim(),l=r.startsWith("{")?o(r,0,"{","}"):r.startsWith("[")?o(r,0,"[","]"):0,f=r.indexOf(":",Math.max(0,l));return f===-1?"unknown":r.slice(f+1).trim()}function he(e){let c=e;if(c.startsWith("async ")||c.startsWith("async\t"))c=c.slice(5).trimStart();if(c.startsWith("*"))c=c.slice(1).trimStart();if(!c.startsWith("("))return!1;let i=0;for(let s=0;s<c.length;s++){let r=c.charCodeAt(s);if(r===40)i++;else if(r===41){if(i--,i===0){let l=c.slice(s+1).trimStart();if(l.startsWith("{"))return!0;if(l.startsWith(":")){let f=yt(l,1);if(f?.kind==="arrow")return!1;if(f?.kind==="body")return!0}return!1}}}return!1}function ge(e){let c=e.trimEnd();if(!c.endsWith(">"))return null;let i=0,s=-1;for(let l=c.length-1;l>=0;l--){let f=c.charCodeAt(l);if(f===62){if(l>0&&c.charCodeAt(l-1)===61)continue;i++}else if(f===60){if(i--,i===0){s=l;break}}}if(s===-1)return null;let r=c.slice(0,s).trimEnd();if(!r)return null;return{name:r,typeParams:c.slice(s)}}function St(e,c){let i=c.trimStart(),s=!1,r=!1;if(i.startsWith("async ")||i.startsWith("async\t"))s=!0,i=i.slice(5).trimStart();if(i.startsWith("*"))r=!0,i=i.slice(1).trimStart();let l="";if(i.charCodeAt(0)===60){let w=0,A=-1;for(let p=0;p<i.length;p++)if(i.charCodeAt(p)===60)w++;else if(i.charCodeAt(p)===62&&!(p>0&&i.charCodeAt(p-1)===61)){if(w--,w===0){A=p;break}}if(A!==-1)l=i.slice(0,A+1),i=i.slice(A+1).trimStart()}let f=i.indexOf("("),u=o(i,f,"(",")");if(f===-1||u===-1)return"() => unknown";let a=i.slice(f,u+1),d="unknown",x=i.slice(u+1).trimStart();if(x.charCodeAt(0)===58){let w=x.slice(1),A=yt(w,0);if(A)d=w.slice(0,A.index).trim();else d=w.trim()}if(d==="unknown"&&!r&&x.charCodeAt(0)===123){let w=o(x,0,"{","}");if(w!==-1){let A=B(x.slice(1,w),s,a);if(A!=="unknown"&&A!=="Promise<unknown>")d=s&&A.startsWith("Promise<")?A.slice(8,-1):A;else if(s)d="Promise<unknown>"}}if(d==="unknown"){if(s&&r)d="AsyncGenerator<unknown, void, unknown>";else if(r)d="Generator<unknown, void, unknown>";else if(s)d="Promise<void>"}else if(s&&!d.startsWith("Promise<")&&!d.startsWith("AsyncGenerator<"))d=`Promise<${d}>`;let T=ye(a);return`${l}${T} => ${d}`}function yt(e,c){let i=0,s=0,r=0,l=0,f=!1,u=0;for(let a=c;a<e.length;a++){let d=e.charCodeAt(a);if(f){if(d===92)a++;else if(d===u)f=!1;continue}if(d===34||d===39||d===96){f=!0,u=d;continue}if(d===40)i++;else if(d===41&&i>0)i--;else if(d===91)s++;else if(d===93&&s>0)s--;else if(d===60)r++;else if(d===62&&r>0&&e.charCodeAt(a-1)!==61)r--;else if(d===125&&l>0)l--;else if(d===123){let x=i>0||s>0||r>0||l>0,T=e.slice(c,a).trimEnd(),w=T.charCodeAt(T.length-1),A=T.length===0||w===38||w===124||w===40||w===44||w===58||w===61||w===91;if(x||A)l++;else return{index:a,kind:"body"}}else if(d===61&&a+1<e.length&&e.charCodeAt(a+1)===62&&i===0&&s===0&&r===0&&l===0)return{index:a,kind:"arrow"}}return null}function o(e,c,i,s){let r=0;for(let l=c;l<e.length;l++)if(e[l]===i)r++;else if(e[l]===s){if(s===">"&&l>0&&e[l-1]==="=")continue;if(r--,r===0)return l}return-1}function Z(e){let c=0,i=0,s=!1,r="";for(let l=0;l<e.length-1;l++){let f=e[l],u=e[l+1],a=l>0?e[l-1]:"";if(!s&&(f==='"'||f==="'"||f==="`"))s=!0,r=f;else if(s&&f===r&&a!=="\\")s=!1;if(!s){if(f==="<"){let d=o(e,l,"<",">");if(d!==-1){l=d;continue}}if(f==="(")c++;else if(f===")")c--;else if(f==="[")i++;else if(f==="]")i--;if(f==="="&&u===">"&&c===0&&i===0)return l}}return-1}function pt(e,c=!1,i=0,s=!0){let r=e.trim();if(r.length>200&&ut(r,"=>")>2&&ut(r,"<")>5&&!r.startsWith("function"))return c?"((...args: any[]) => any)":"(...args: any[]) => any";if(r.startsWith("async ")&&r.includes("=>")){let f=r.slice(5).trim(),u=Z(f);if(u===-1)return c?"(() => Promise<unknown>)":"() => Promise<unknown>";let a=f.substring(0,u).trim(),d=f.substring(u+2).trim(),x=Ct(a),{params:T,returnType:w}=x;if(T=ye(T),T==="()"||T==="")T="()";else if(!T.startsWith("("))T=`(${T})`;let A=w;if(A);else if(d.startsWith("{"))A=B(d.slice(1,d.endsWith("}")?-1:void 0),!0,x.params);else A=F(d,gt(x.params));let p=`${T} => ${w||A.startsWith("Promise<")?A:`Promise<${A}>`}`;return c?`(${p})`:p}if(r.includes("=>")){let f="",u=r;if(r.startsWith("<")){let C=o(r,0,"<",">");if(C!==-1)f=r.substring(0,C+1),u=r.substring(C+1).trim()}let a=Z(u);if(a===-1)return c?"(() => unknown)":"() => unknown";let d=u.substring(0,a).trim(),x=u.substring(a+2).trim(),T=Ct(d),{params:w,returnType:A}=T;if(w=ye(w),w==="()"||w==="")w="()";else if(!w.startsWith("("))w=`(${w})`;let p="unknown";if(A)p=A;else if(x.startsWith("{"))p=B(x.slice(1,x.endsWith("}")?-1:void 0),!1,T.params);else if(rt(x)||at(x)&&rt(x.slice(1,-1).trim()))p="JSX.Element";else if(x.includes("=>")){let C=x.trimStart(),S=C.indexOf("("),b=S!==-1?o(C,S,"(",")"):-1,k=b!==-1?C.indexOf("=>",b):-1;if(S===0&&b!==-1&&k!==-1){let O=C.substring(S+1,b).trim(),P=ye(O);if(f.includes("T")&&P.includes("T"))p=`(${P}) => T`;else p=`(${P}) => any`}else p="any"}else p=F(x,gt(T.params));let m=`${f}${w} => ${p}`;return c?`(${m})`:m}if(r.startsWith("function")){let f=8,u=r.length;while(f<u&&r.charCodeAt(f)<=32)f++;let a=!1;if(f<u&&r.charCodeAt(f)===42){a=!0,f++;while(f<u&&r.charCodeAt(f)<=32)f++}let d="";if(f<u&&r.charCodeAt(f)===60){let w=f,A=1;f++;while(f<u&&A>0){let p=r.charCodeAt(f);if(p===60)A++;else if(p===62&&r.charCodeAt(f-1)!==61)A--;f++}d=r.substring(w,f);while(f<u&&r.charCodeAt(f)<=32)f++}let x=r.indexOf("(",f);if(x!==-1){let w=1,A=x+1;while(A<u&&w>0){let k=r.charCodeAt(A);if(k===40)w++;else if(k===41)w--;A++}let p=r.substring(x+1,A-1).trim(),m=p?ye(`(${p})`):"()";if(a){let k=r.substring(A).trim(),O=k.indexOf("Generator<");if(O!==-1){let I=O+10,j=k.indexOf(">",I);if(j!==-1){let q=k.substring(I,j),D=`${d}${m} => Generator<${q}>`;return c?`(${D})`:D}}let P=`${d}${m} => Generator<any, any, any>`;return c?`(${P})`:P}let C="unknown",S=r.substring(A).trimStart();if(S.charCodeAt(0)===58){let k=S.slice(1),O=yt(k,0),P=(O?k.slice(0,O.index):k).trim();if(P)C=P}let b=`${d}${m} => ${C}`;return c?`(${b})`:b}let T="(...args: any[]) => unknown";return c?`(${T})`:T}if(r.includes("=>")&&r.includes("(")&&r.includes(")")){if(r.length>100||ut(r,"=>")>2){let f="";if(r.charCodeAt(0)===60){let T=o(r,0,"<",">");if(T!==-1)f=r.substring(0,T+1)}let u=r.indexOf("("),a=u!==-1?o(r,u,"(",")"):-1,d=u!==-1&&a!==-1?r.substring(u,a+1):"(...args: any[])";d=ye(d);let x=`${f}${d} => any`;return c?`(${x})`:x}return c?`(${r})`:r}let l="() => unknown";return c?`(${l})`:l}function Ct(e){let c=e.trim();if(!c.startsWith("("))return{params:c,returnType:""};let i=o(c,0,"(",")");if(i===-1)return{params:c,returnType:""};let s=c.slice(i+1).trim();return{params:c.slice(0,i+1),returnType:s.startsWith(":")?s.slice(1).trim():""}}function We(e){let c=e.trim();if(c==="any"||c==="object"||c==="unknown")return!0;if(c.startsWith("Record<")&&c.endsWith(">"))return!0;if(c.startsWith("Array<")&&c.endsWith(">"))return!0;if(/^\{\s*\[[^\]]*\]:\s*(any|string|number|unknown)\s*\}$/.test(c))return!0;return!1}function U(e){let c=-1,i=0;for(let r=0;r<e.length;r++){let l=e.charCodeAt(r);if(l===34||l===39||l===96){r=J(e,r,l)-1;continue}if(l===47&&e.charCodeAt(r+1)===47){while(r<e.length&&e.charCodeAt(r)!==10)r++;continue}if(l===47&&e.charCodeAt(r+1)===42){let f=e.indexOf("*/",r+2);r=f===-1?e.length:f+1;continue}if(l===47){let f=r-1;while(f>=0&&e.charCodeAt(f)<=32)f--;if(f<0||"([{:;,=!?&|+*-~>".includes(e[f])){let u=!1;for(r++;r<e.length;r++){let a=e.charCodeAt(r);if(a===92)r++;else if(a===91)u=!0;else if(a===93)u=!1;else if(a===47&&!u)break}continue}}if(l===40||l===91||l===123)i++;else if(l===41||l===93||l===125)i--;else if(i===0&&e.startsWith("satisfies",r)&&tt(e,r,9)&&e[r-1]!==".")c=r}if(c===-1)return null;let s=e.slice(c+9).trim();if(s.endsWith(";"))s=s.slice(0,-1).trim();return s||null}function Va(e){let c=e.trim(),i=c.match(/^\{\s*\[(\w+)\s+in\s+(.+?)\](\?)?\s*:\s*(.+)\s*\}$/);if(i){let[,l,f,u,a]=i;return`{ [${l} in ${f}]${u?"?":""}: ${a} }`}let s=c.match(/^\{\s*readonly\s+\[(\w+)\s+in\s+(.+?)\](\?)?\s*:\s*(.+)\s*\}$/);if(s){let[,l,f,u,a]=s;return`{ readonly [${l} in ${f}]${u?"?":""}: ${a} }`}let r=c.match(/^\{\s*(-?readonly\s+)?\[(\w+)\s+in\s+(.+?)\](-?\?)?\s*:\s*(.+)\s*\}$/);if(r){let[,l,f,u,a,d]=r;return`{ ${l?`${l.trim()} `:""}[${f} in ${u}]${a||""}: ${d} }`}return null}function za(e){let c=e.trim(),i=c.indexOf(" extends ");if(i===-1)return null;let s=c.slice(i+9),r=me(s);if(r===-1)return null;let l=pe(s,r);if(l===-1)return null;let f=c.slice(0,i).trim(),u=s.slice(0,r).trim(),a=s.slice(r+1,l).trim(),d=s.slice(l+1).trim();return`${f} extends ${u} ? ${a} : ${d}`}function me(e){let c=0,i=!1,s="";for(let r=0;r<e.length;r++){let l=e[r],f=r>0?e[r-1]:"";if(!i&&(l==='"'||l==="'"||l==="`"))i=!0,s=l;else if(i&&l===s&&f!=="\\")i=!1;if(!i){if(l==="<"||l==="("||l==="["||l==="{")c++;if(l===">"||l===")"||l==="]"||l==="}")c--;if(l==="?"&&c===0)return r}}return-1}function pe(e,c){let i=0,s=!1,r="";for(let l=c+1;l<e.length;l++){let f=e[l],u=l>0?e[l-1]:"";if(!s&&(f==='"'||f==="'"||f==="`"))s=!0,r=f;else if(s&&f===r&&u!=="\\")s=!1;if(!s){if(f==="<"||f==="("||f==="["||f==="{")i++;if(f===">"||f===")"||f==="]"||f==="}")i--;if(f==="?"&&i===0)i++;if(f===":"&&i===0)return l;if(f===":"&&i>0)i--}}return-1}function Ua(e){let c=e.trim();if(!c.startsWith("`")||!c.endsWith("`"))return null;let i=c.slice(1,-1);if(!i.includes("${"))return c;let s=[],r="",l=0;while(l<i.length)if(i[l]==="$"&&i[l+1]==="{"){if(r)s.push(`"${r}"`),r="";let f=1,u="";l+=2;while(l<i.length&&f>0){if(i[l]==="{")f++;if(i[l]==="}")f--;if(f>0)u+=i[l];l++}s.push(u.trim())}else r+=i[l],l++;if(r)s.push(`"${r}"`);return c}function Ha(e){let c=[],i=/infer\s+(\w+)/g,s;while((s=i.exec(e))!==null)c.push(s[1]);return c}function Ka(e){let i=e.trim(),s=i.indexOf("[");if(s!==-1){if(i.indexOf(" in ",s)!==-1)return!0}let r=i.indexOf(" extends ");if(r!==-1){let f=i.indexOf(" ? ",r);if(f!==-1&&i.indexOf(" : ",f)!==-1)return!0}if(i.charCodeAt(0)===96&&i.charCodeAt(i.length-1)===96){if(i.indexOf("${")!==-1)return!0}let l=i.indexOf("infer ");if(l!==-1){if(l===0||!V(i.charCodeAt(l-1)))return!0}return!1}function qa(e,c=3){let i=e.trim(),s=0,r=0;for(let l of i){if(l==="<"||l==="("||l==="["||l==="{")s++,r=Math.max(r,s);if(l===">"||l===")"||l==="]"||l==="}")s--}if(r>c){let l=i.match(/^(\w+)</);if(l)return`${l[1]}<any>`;return"unknown"}return i}function Ja(e){let i=e.trim().match(/^(\w+)<(.+)>$/);if(!i)return null;let s=i[1],r=i[2],l=$a(r);if(["Partial","Required","Readonly","Pick","Omit","Record","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisParameterType","OmitThisParameter","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","NoInfer"].includes(s))return{name:s,params:l};return null}function $a(e){let c=[],i="",s=0,r=!1,l="";for(let f=0;f<e.length;f++){let u=e[f],a=f>0?e[f-1]:"";if(!r&&(u==='"'||u==="'"||u==="`"))r=!0,l=u;else if(r&&u===l&&a!=="\\")r=!1;if(!r){if(u==="<"||u==="("||u==="["||u==="{")s++;if(u===">"||u===")"||u==="]"||u==="}")s--;if(u===","&&s===0){c.push(i.trim()),i="";continue}}i+=u}if(i.trim())c.push(i.trim());return c}function Ya(e){let c=e.trim();if(c.startsWith("keyof "))return c;return null}function Xa(e){let c=e.trim();if(c.startsWith("typeof "))return c;return null}function Za(e){let c=e.trim();if(c.length===0||c.charCodeAt(0)===91)return!1;if(c.charCodeAt(c.length-1)!==93)return!1;let i=c.indexOf("[");if(i<=0)return!1;for(let s=0;s<i;s++){let r=c.charCodeAt(s);if(!V(r)&&r!==46)return!1}return!0}
40
+ export{Vt,zt,n,Ut,B,Sa,W,Ht,Be,Q,rr,Kt,dt,z,ye,o,pt,We,U,Va,za,Ua,Ha,Ka,qa,Ja,$a,Ya,Xa,Za};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{t}from"./chunk-d0dbet9n.js";function Ve(e,d){let i=t(e),o=0,r=0;for(let n=0;n<i.length;n++){let l=i[n],s=e.slice(l.start,l.end),c=i[n+1];if(o===0&&s==="function"&&c?.kind==="word"&&e.slice(c.start,c.end)===d)r++;if(["{","(","["].includes(s))o++;else if(["}",")","]"].includes(s))o--}return r}
2
+ import{t}from"./chunk-6exq13f9.js";function Ve(e,d){let i=t(e),o=0,r=0;for(let n=0;n<i.length;n++){let l=i[n],s=e.slice(l.start,l.end),c=i[n+1];if(o===0&&s==="function"&&c?.kind==="word"&&e.slice(c.start,c.end)===d)r++;if(["{","(","["].includes(s))o++;else if(["}",")","]"].includes(s))o--}return r}
3
3
  export{Ve};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{u}from"./chunk-02yqpwv0.js";import{e}from"./chunk-qmg1535a.js";import{E,b}from"./chunk-d0dbet9n.js";import{ce}from"./chunk-x6ddycvm.js";import{existsSync as W,readFileSync as P,realpathSync as w,statSync as q}from"fs";import{builtinModules as X}from"module";import{dirname as T,extname as F,isAbsolute as I,join as J,relative as U,resolve as S}from"path";var A=[".ts",".tsx",".mts",".cts",".vue",".stx",".js",".jsx",".mjs",".cjs",".d.ts",".d.mts",".d.cts"],V={".js":[".ts",".tsx",".d.ts"],".jsx":[".tsx",".ts",".d.ts"],".mjs":[".mts",".d.mts"],".cjs":[".cts",".d.cts"]};function k(t){try{return q(t).isFile()}catch{return!1}}function ae(t,i){let s=t.replace(/[?#].*$/,"");if(!(s.startsWith("./")||s.startsWith("../")||s==="."||s==="..")&&!I(s))return{resolved:null,isRelative:!1};let a=T(i),c=S(a,s);if(k(c))return{resolved:c,isRelative:!0};let p=F(c),d=V[p];if(d){let f=c.slice(0,-p.length);for(let r of d){let o=f+r;if(k(o))return{resolved:o,isRelative:!0}}}for(let f of A){let r=c+f;if(k(r))return{resolved:r,isRelative:!0}}if(W(c))for(let f of A){let r=J(c,`index${f}`);if(k(r))return{resolved:r,isRelative:!0}}return{resolved:null,isRelative:!0}}function C(t,i){let s=t.indexOf("*");return s===-1?i===t:i.startsWith(t.slice(0,s))&&i.endsWith(t.slice(s+1))&&i.length>=t.length-1}function K(t,i){if(Object.hasOwn(t,i))return t[i]!==null;let s=Object.keys(t).filter((l)=>l.includes("*")&&C(l,i)).sort((l,a)=>a.indexOf("*")-l.indexOf("*")||a.length-l.length)[0];return s!==void 0&&t[s]!==null}function B(t,i){if(!t.name||i!==t.name&&!i.startsWith(`${t.name}/`))return!1;if(t.exports===void 0)return!0;let s=i===t.name?".":`.${i.slice(t.name.length)}`;if(typeof t.exports==="string"||Array.isArray(t.exports))return s===".";if(!t.exports||typeof t.exports!=="object")return!1;let l=t.exports;if(!Object.keys(l).some((c)=>c.startsWith(".")))return s===".";return K(l,s)}function N(t,i){let s=U(t,i);return s!==".."&&!s.startsWith(`..${process.platform==="win32"?"\\":"/"}`)&&!I(s)}async function Oe(t){let i=await ce(S(t.cwd,t.tsconfigPath||"tsconfig.json")),s=Object.entries(i?.paths??{});if(s.length===0){let r=(o,n)=>ae(o,n);return r.cacheKey=(o)=>JSON.stringify(o.map((n)=>({file:n,references:D(P(n,"utf8"),{includeImports:!0}).map((g)=>({specifier:g.specifier,resolution:r(g.specifier,n)}))}))),r}let l=i?.baseUrl??i?.pathsBasePath??t.cwd,a=S(t.cwd,t.root),c=new Map,p=new Set([...X,"bun"]),d=(r)=>{let o=T(r),n=[];while(!0){if(c.has(o)){let m=c.get(o);for(let x of n)c.set(x,m);return m}n.push(o);let g=J(o,"package.json");if(W(g)){let x={...JSON.parse(P(g,"utf8")),directory:w(o)};for(let O of n)c.set(O,x);return x}let v=T(o);if(v===o)return;o=v}},f=(r,o)=>{if(r.startsWith(".")||I(r))return ae(r,o);if(r.startsWith("node:")||r.startsWith("bun:")||p.has(r))return{resolved:null,isRelative:!1};let n=d(o),g=r.startsWith("@")?/^@[^/]+\/[^/]+/.exec(r)?.[0]:r.split("/")[0];if(n&&(B(n,r)||K(n.imports??{},r)||g&&[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies].some((h)=>Object.hasOwn(h??{},g))))return{resolved:null,isRelative:!1};let v=s.filter(([h])=>C(h,r)).sort(([h],[y])=>{if(!h.includes("*"))return-1;if(!y.includes("*"))return 1;return y.indexOf("*")-h.indexOf("*")})[0];if(!v)return{resolved:null,isRelative:!1};let[m,x]=v,O=m.indexOf("*"),L=O===-1?"":r.slice(O,r.length-(m.length-O-1));for(let h of x){let y=S(l,h.replace("*",L)),M=d(y);if(M&&B(M,r)&&!M.private&&M.directory!==n?.directory)return{resolved:null,isRelative:!1};let j=ae(y,o);if(!j.resolved)continue;let R=w(j.resolved),_=t.outputStructure==="flat"||W(a)&&N(w(a),R);if(!n||!N(n.directory,R)||!_||d(R)?.directory!==n.directory||/\.d\.(?:ts|mts|cts)$/.test(R))throw Error(`Local alias ${JSON.stringify(r)} from ${o} resolves outside its emitted package source: ${R}`);return e.debug(`Resolved local declaration alias ${r} from ${o} to ${R}`),{resolved:t.outputStructure==="flat"?j.resolved:S(a,U(w(a),R)),isRelative:!0,isAlias:!0,suffix:y.match(/[?#].*$/)?.[0]??""}}throw Error(`Cannot resolve local alias ${JSON.stringify(r)} from ${o} using ${t.tsconfigPath||"tsconfig.json"} (${JSON.stringify(m)})`)};return f.isPackageLocal=(r,o)=>{let n=d(r);return!!n&&d(o)?.directory===n.directory&&N(n.directory,w(o))},f.cacheKey=(r)=>{let o=r.map((g)=>({file:g,references:D(P(g,"utf8"),{includeImports:!0}).map((v)=>({specifier:v.specifier,resolution:f(v.specifier,g)}))})),n=[...new Set(c.values())].filter((g)=>g!==void 0).sort((g,v)=>g.directory.localeCompare(v.directory));return JSON.stringify({root:a,compilerOptions:i,packages:n,edges:o})},f}function D(t,i={}){let s=b(t);return(i.includeImports?["export","static-import","import-type","augmentation"]:["export"]).flatMap((a)=>s.filter((c)=>c.category===a).map(({specifier:c,kind:p,isTypeOnly:d})=>({specifier:c,kind:p,isTypeOnly:d})))}function Fn(t,i){let s=[];for(let a of b(t)){let c=i(a.specifier);if(c!==a.specifier)s.push({start:a.start,end:a.end,value:E(c,t[a.start])})}let l=t;for(let a of s.reverse())l=l.slice(0,a.start)+a.value+l.slice(a.end);return l}async function Z(t,i={}){let s=new Set,l=new Map,a=[],c=new Map,p=[];for(let d of t){let f=S(d);if(!s.has(f))s.add(f),p.push(f)}while(p.length>0){let d=p.shift(),f;try{f=await u(d)}catch{continue}c.set(d,f);let r=D(f,i);l.set(d,r);for(let o of r){let n=(i.resolveSpecifier??ae)(o.specifier,d);if(!n.isRelative)continue;if(n.resolved){if(!s.has(n.resolved))s.add(n.resolved),p.push(n.resolved)}else a.push({from:d,specifier:o.specifier,isTypeOnly:o.isTypeOnly})}}return{reachable:s,reExports:l,unresolved:a,sources:c}}
3
- export{ae,Oe,D,Fn,Z};
2
+ import{u}from"./chunk-02yqpwv0.js";import{e}from"./chunk-3mp0jaa7.js";import{E,b}from"./chunk-6exq13f9.js";import{ce}from"./chunk-x6ddycvm.js";import{existsSync as T,readFileSync as N,realpathSync as w,statSync as q}from"fs";import{builtinModules as X}from"module";import{dirname as I,extname as F,isAbsolute as A,join as J,relative as U,resolve as S}from"path";var B=[".ts",".tsx",".mts",".cts",".vue",".stx",".js",".jsx",".mjs",".cjs",".d.ts",".d.mts",".d.cts"],V={".js":[".ts",".tsx",".d.ts"],".jsx":[".tsx",".ts",".d.ts"],".mjs":[".mts",".d.mts"],".cjs":[".cts",".d.cts"]};function k(t){try{return q(t).isFile()}catch{return!1}}function ae(t,i){let s=t.replace(/[?#].*$/,"");if(!(s.startsWith("./")||s.startsWith("../")||s==="."||s==="..")&&!A(s))return{resolved:null,isRelative:!1};let a=I(i),c=S(a,s);if(k(c))return{resolved:c,isRelative:!0};let p=F(c),d=V[p];if(d){let f=c.slice(0,-p.length);for(let r of d){let o=f+r;if(k(o))return{resolved:o,isRelative:!0}}}for(let f of B){let r=c+f;if(k(r))return{resolved:r,isRelative:!0}}if(T(c))for(let f of B){let r=J(c,`index${f}`);if(k(r))return{resolved:r,isRelative:!0}}return{resolved:null,isRelative:!0}}function C(t,i){let s=t.indexOf("*");return s===-1?i===t:i.startsWith(t.slice(0,s))&&i.endsWith(t.slice(s+1))&&i.length>=t.length-1}function K(t,i){if(Object.hasOwn(t,i))return t[i]!==null;let s=Object.keys(t).filter((l)=>l.includes("*")&&C(l,i)).sort((l,a)=>a.indexOf("*")-l.indexOf("*")||a.length-l.length)[0];return s!==void 0&&t[s]!==null}function D(t,i){if(!t.name||i!==t.name&&!i.startsWith(`${t.name}/`))return!1;if(t.exports===void 0)return!0;let s=i===t.name?".":`.${i.slice(t.name.length)}`;if(typeof t.exports==="string"||Array.isArray(t.exports))return s===".";if(!t.exports||typeof t.exports!=="object")return!1;let l=t.exports;if(!Object.keys(l).some((c)=>c.startsWith(".")))return s===".";return K(l,s)}function W(t,i){let s=U(t,i);return s!==".."&&!s.startsWith(`..${process.platform==="win32"?"\\":"/"}`)&&!A(s)}async function Oe(t){let i=await ce(S(t.cwd,t.tsconfigPath||"tsconfig.json")),s=Object.entries(i?.paths??{});if(s.length===0){let r=(o,n)=>ae(o,n);return r.cacheKey=(o)=>JSON.stringify(o.map((n)=>({file:n,references:P(N(n,"utf8"),{includeImports:!0}).map((g)=>({specifier:g.specifier,resolution:r(g.specifier,n)}))}))),r}let l=i?.baseUrl??i?.pathsBasePath??t.cwd,a=S(t.cwd,t.root),c=new Map,p=new Set([...X,"bun"]),d=(r)=>{let o=I(r),n=[];while(!0){if(c.has(o)){let m=c.get(o);for(let x of n)c.set(x,m);return m}n.push(o);let g=J(o,"package.json");if(T(g)){let x={...JSON.parse(N(g,"utf8")),directory:w(o)};for(let O of n)c.set(O,x);return x}let v=I(o);if(v===o)return;o=v}},f=(r,o)=>{if(r.startsWith(".")||A(r))return ae(r,o);if(r.startsWith("node:")||r.startsWith("bun:")||p.has(r))return{resolved:null,isRelative:!1};let n=d(o),g=r.startsWith("@")?/^@[^/]+\/[^/]+/.exec(r)?.[0]:r.split("/")[0];if(n&&(D(n,r)||K(n.imports??{},r)||g&&[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies].some((h)=>Object.hasOwn(h??{},g))))return{resolved:null,isRelative:!1};let v=s.filter(([h])=>C(h,r)).sort(([h],[y])=>{if(!h.includes("*"))return-1;if(!y.includes("*"))return 1;return y.indexOf("*")-h.indexOf("*")})[0];if(!v)return{resolved:null,isRelative:!1};let[m,x]=v,O=m.indexOf("*"),L=O===-1?"":r.slice(O,r.length-(m.length-O-1));for(let h of x){let y=S(l,h.replace("*",L)),M=d(y);if(M&&D(M,r)&&!M.private&&M.directory!==n?.directory)return{resolved:null,isRelative:!1};let j=ae(y,o);if(!j.resolved)continue;let R=w(j.resolved),_=t.outputStructure==="flat"||T(a)&&W(w(a),R);if(!n||!W(n.directory,R)||!_||d(R)?.directory!==n.directory||/\.d\.(?:ts|mts|cts)$/.test(R))throw Error(`Local alias ${JSON.stringify(r)} from ${o} resolves outside its emitted package source: ${R}`);return e.debug(`Resolved local declaration alias ${r} from ${o} to ${R}`),{resolved:t.outputStructure==="flat"?j.resolved:S(a,U(w(a),R)),isRelative:!0,isAlias:!0,suffix:y.match(/[?#].*$/)?.[0]??""}}throw Error(`Cannot resolve local alias ${JSON.stringify(r)} from ${o} using ${t.tsconfigPath||"tsconfig.json"} (${JSON.stringify(m)})`)};return f.isPackageLocal=(r,o)=>{let n=d(r);return!!n&&d(o)?.directory===n.directory&&W(n.directory,w(o))},f.cacheKey=(r)=>{let o=r.map((g)=>({file:g,references:P(N(g,"utf8"),{includeImports:!0}).map((v)=>({specifier:v.specifier,resolution:f(v.specifier,g)}))})),n=[...new Set(c.values())].filter((g)=>g!==void 0).sort((g,v)=>g.directory.localeCompare(v.directory));return JSON.stringify({root:a,compilerOptions:i,packages:n,edges:o})},f}function P(t,i={}){let s=b(t);return(i.includeImports?["export","static-import","import-type","augmentation"]:["export"]).flatMap((a)=>s.filter((c)=>c.category===a).map(({specifier:c,kind:p,isTypeOnly:d})=>({specifier:c,kind:p,isTypeOnly:d})))}function Fn(t,i){let s=[];for(let a of b(t)){let c=i(a.specifier);if(c!==a.specifier)s.push({start:a.start,end:a.end,value:E(c,t[a.start])})}let l=t;for(let a of s.reverse())l=l.slice(0,a.start)+a.value+l.slice(a.end);return l}async function Z(t,i={}){let s=new Set,l=new Map,a=[],c=new Map,p=[];for(let d of t){let f=S(d);if(!s.has(f))s.add(f),p.push(f)}while(p.length>0){let d=p.shift(),f;try{f=await u(d)}catch{continue}c.set(d,f);let r=P(f,i);l.set(d,r);for(let o of r){let n=(i.resolveSpecifier??ae)(o.specifier,d);if(!n.isRelative)continue;if(n.resolved){if(!s.has(n.resolved))s.add(n.resolved),p.push(n.resolved)}else a.push({from:d,specifier:o.specifier,isTypeOnly:o.isTypeOnly})}}return{reachable:s,reExports:l,unresolved:a,sources:c}}
3
+ export{ae,Oe,P,Fn,Z};
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{readFile as M,writeFile as S}from"fs/promises";import{basename as x,dirname as d,relative as b,resolve as C}from"path";function f(e){return`${String.fromCharCode(47,47,35)} sourceMappingURL=${e}`}class dn{file;sourceRoot;sources=[];sourcesContent=[];names=[];mappings=[];sourceIndexMap=new Map;nameIndexMap=new Map;constructor(e){this.file=e.file,this.sourceRoot=e.sourceRoot}addSource(e,n){let r=this.sourceIndexMap.get(e);if(r===void 0)r=this.sources.length,this.sources.push(e),this.sourcesContent.push(n??null),this.sourceIndexMap.set(e,r);else if(n&&!this.sourcesContent[r])this.sourcesContent[r]=n;return r}addName(e){let n=this.nameIndexMap.get(e);if(n===void 0)n=this.names.length,this.names.push(e),this.nameIndexMap.set(e,n);return n}addMapping(e){let n=this.addSource(e.source),r;if(e.name)r=this.addName(e.name);this.mappings.push({generated:e.generated,original:e.original,sourceIndex:n,nameIndex:r})}generate(e=!1){this.mappings.sort((r,t)=>{if(r.generated.line!==t.generated.line)return r.generated.line-t.generated.line;return r.generated.column-t.generated.column});let n={version:3,file:this.file,sources:this.sources,names:this.names,mappings:this.encodeMappings()};if(this.sourceRoot)n.sourceRoot=this.sourceRoot;if(e)n.sourcesContent=this.sourcesContent;return n}encodeMappings(){let e=[],n=0,r=0,t=0,i=0,o=0,s=0,u=[];for(let a of this.mappings){while(n<a.generated.line)e.push(u.join(",")),u=[],n++,r=0;let l=[];if(l.push(a.generated.column-r),r=a.generated.column,l.push(a.sourceIndex-t),t=a.sourceIndex,l.push(a.original.line-i),i=a.original.line,l.push(a.original.column-o),o=a.original.column,a.nameIndex!==void 0)l.push(a.nameIndex-s),s=a.nameIndex;u.push(I(l))}return e.push(u.join(",")),e.join(";")}toString(e=!1){return JSON.stringify(this.generate(e))}toDataUrl(e=!1){let n=this.toString(e);return`data:application/json;charset=utf-8;base64,${Buffer.from(n).toString("base64")}`}toComment(e=!1){return f(this.toDataUrl(e))}}class Ct{map;decodedMappings=null;constructor(e){this.map=typeof e==="string"?JSON.parse(e):e}originalPositionFor(e){let n=this.getMappings(),r=0,t=n.length-1,i=null;while(r<=t){let o=Math.floor((r+t)/2),s=n[o];if(s.generated.line===e.line)if(s.generated.column===e.column){i=s;break}else if(s.generated.column<e.column)i=s,r=o+1;else t=o-1;else if(s.generated.line<e.line)r=o+1;else t=o-1}if(!i)return{source:null,line:null,column:null,name:null};return{source:this.map.sources[i.sourceIndex]||null,line:i.original.line,column:i.original.column,name:i.nameIndex!==void 0?this.map.names[i.nameIndex]:null}}generatedPositionFor(e){let n=this.map.sources.indexOf(e.source);if(n===-1)return null;let r=this.getMappings();for(let t of r)if(t.sourceIndex===n&&t.original.line===e.line&&t.original.column<=e.column)return t.generated;return null}getMappings(){if(!this.decodedMappings)this.decodedMappings=v(this.map.mappings);return this.decodedMappings}sourceContentFor(e){let n=this.map.sources.indexOf(e);if(n===-1||!this.map.sourcesContent)return null;return this.map.sourcesContent[n]}}function I(e){return e.map(L).join("")}function L(e){let o="",s=e<0?-e<<1|1:e<<1;do{let u=s&31;if(s>>>=5,s>0)u|=32;o+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[u]}while(s>0);return o}function v(e){let n=[],r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,i=0,o=0,s=0,u=0,a=0,l=e.split(";");for(let g of l){if(i=0,g){let h=g.split(",");for(let p of h){if(!p)continue;let c=N(p,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");if(c.length>=1)i+=c[0];if(c.length>=4){o+=c[1],s+=c[2],u+=c[3];let m={generated:{line:t,column:i},original:{line:s,column:u},sourceIndex:o};if(c.length>=5)a+=c[4],m.nameIndex=a;n.push(m)}}}t++}return n}function N(e,n){let t=[],i=0,o=0;for(let s of e){let u=n.indexOf(s);if(u===-1)continue;let a=u&32;if(o+=(u&31)<<i,a)i+=5;else{let l=o&1;o>>=1,t.push(l?-o:o),o=0,i=0}}return t}function zs(e){let n=new dn({file:x(e.generatedFile),sourceRoot:e.sourceRoot}),r=b(d(e.generatedFile),e.sourceFile);n.addSource(r,e.sourceContent);for(let t of e.mappings)n.addMapping({generated:{line:t.generatedLine,column:t.generatedColumn},original:{line:t.originalLine,column:t.originalColumn},source:r,name:t.name});return n}function Hs(e,n){return`${e}
2
+ import{readFile as M,writeFile as S}from"fs/promises";import{basename as x,dirname as d,relative as b,resolve as C}from"path";function f(e){return`${String.fromCharCode(47,47,35)} sourceMappingURL=${e}`}class dn{file;sourceRoot;sources=[];sourcesContent=[];names=[];mappings=[];sourceIndexMap=new Map;nameIndexMap=new Map;constructor(e){this.file=e.file,this.sourceRoot=e.sourceRoot}addSource(e,n){let r=this.sourceIndexMap.get(e);if(r===void 0)r=this.sources.length,this.sources.push(e),this.sourcesContent.push(n??null),this.sourceIndexMap.set(e,r);else if(n&&!this.sourcesContent[r])this.sourcesContent[r]=n;return r}addName(e){let n=this.nameIndexMap.get(e);if(n===void 0)n=this.names.length,this.names.push(e),this.nameIndexMap.set(e,n);return n}addMapping(e){let n=this.addSource(e.source),r;if(e.name)r=this.addName(e.name);this.mappings.push({generated:e.generated,original:e.original,sourceIndex:n,nameIndex:r})}generate(e=!1){this.mappings.sort((r,t)=>{if(r.generated.line!==t.generated.line)return r.generated.line-t.generated.line;return r.generated.column-t.generated.column});let n={version:3,file:this.file,sources:this.sources,names:this.names,mappings:this.encodeMappings()};if(this.sourceRoot)n.sourceRoot=this.sourceRoot;if(e)n.sourcesContent=this.sourcesContent;return n}encodeMappings(){let e=[],n=0,r=0,t=0,i=0,o=0,s=0,u=[];for(let a of this.mappings){while(n<a.generated.line)e.push(u.join(",")),u=[],n++,r=0;let l=[];if(l.push(a.generated.column-r),r=a.generated.column,l.push(a.sourceIndex-t),t=a.sourceIndex,l.push(a.original.line-i),i=a.original.line,l.push(a.original.column-o),o=a.original.column,a.nameIndex!==void 0)l.push(a.nameIndex-s),s=a.nameIndex;u.push(I(l))}return e.push(u.join(",")),e.join(";")}toString(e=!1){return JSON.stringify(this.generate(e))}toDataUrl(e=!1){let n=this.toString(e);return`data:application/json;charset=utf-8;base64,${Buffer.from(n).toString("base64")}`}toComment(e=!1){return f(this.toDataUrl(e))}}class Ct{map;decodedMappings=null;constructor(e){this.map=typeof e==="string"?JSON.parse(e):e}originalPositionFor(e){let n=this.getMappings(),r=0,t=n.length-1,i=null;while(r<=t){let o=Math.floor((r+t)/2),s=n[o];if(s.generated.line===e.line)if(s.generated.column===e.column){i=s;break}else if(s.generated.column<e.column)i=s,r=o+1;else t=o-1;else if(s.generated.line<e.line)r=o+1;else t=o-1}if(!i)return{source:null,line:null,column:null,name:null};return{source:this.map.sources[i.sourceIndex]||null,line:i.original.line,column:i.original.column,name:i.nameIndex!==void 0?this.map.names[i.nameIndex]:null}}generatedPositionFor(e){let n=this.map.sources.indexOf(e.source);if(n===-1)return null;let r=this.getMappings();for(let t of r)if(t.sourceIndex===n&&t.original.line===e.line&&t.original.column<=e.column)return t.generated;return null}getMappings(){if(!this.decodedMappings)this.decodedMappings=v(this.map.mappings);return this.decodedMappings}sourceContentFor(e){let n=this.map.sources.indexOf(e);if(n===-1||!this.map.sourcesContent)return null;return this.map.sourcesContent[n]}}function I(e){return e.map(L).join("")}function L(e){let o="",s=e<0?-e<<1|1:e<<1;do{let u=s&31;if(s>>>=5,s>0)u|=32;o+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[u]}while(s>0);return o}function v(e){let n=[],r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,i=0,o=0,s=0,u=0,a=0,l=e.split(";");for(let g of l){if(i=0,g){let h=g.split(",");for(let p of h){if(!p)continue;let c=N(p,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");if(c.length>=1)i+=c[0];if(c.length>=4){o+=c[1],s+=c[2],u+=c[3];let m={generated:{line:t,column:i},original:{line:s,column:u},sourceIndex:o};if(c.length>=5)a+=c[4],m.nameIndex=a;n.push(m)}}}t++}return n}function N(e,n){let t=[],i=0,o=0;for(let s of e){let u=n.indexOf(s);if(u===-1)continue;let a=u&32;if(o+=(u&31)<<i,a)i+=5;else{let l=o&1;o>>=1,t.push(l?-o:o),o=0,i=0}}return t}function Us(e){let n=new dn({file:x(e.generatedFile),sourceRoot:e.sourceRoot}),r=b(d(e.generatedFile),e.sourceFile);n.addSource(r,e.sourceContent);for(let t of e.mappings)n.addMapping({generated:{line:t.generatedLine,column:t.generatedColumn},original:{line:t.originalLine,column:t.originalColumn},source:r,name:t.name});return n}function Hs(e,n){return`${e}
3
3
  ${f(n)}`}function Ks(e,n,r=!1){return`${e}
4
4
  ${n.toComment(r)}`}async function qs(e,n,r=!1){await S(e,n.toString(r))}async function qr(e){let n=await M(e,"utf-8");return new Ct(n)}async function Js(e,n){let r=e.match(/\/\/# sourceMappingURL=data:application\/json[^,]+,(\S+)/);if(r){let i=r[1],o=Buffer.from(i,"base64").toString("utf-8");return new Ct(o)}let t=e.match(/\/\/# sourceMappingURL=(.+)$/);if(t){let i=C(d(n),t[1].trim());try{return await qr(i)}catch{return null}}return null}function Ys(e,n){let r=e,t=n,i=r.split(`
5
5
  `),o=[],s=0,u=0;for(let a of t){while(s+i[u].length+1<=a.generatedStart&&u<i.length-1)s+=i[u].length+1,u++;let l=a.generatedStart-s;o.push({generatedLine:u,generatedColumn:Math.max(0,l),originalLine:a.originalLine,originalColumn:a.originalColumn,name:a.name})}return o}
6
- export{dn,Ct,zs,Hs,Ks,qs,qr,Js,Ys};
6
+ export{dn,Ct,Us,Hs,Ks,qs,qr,Js,Ys};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{t}from"./chunk-d0dbet9n.js";function j(n){let s=t(n),r=(e)=>s[e]?n.slice(s[e].start,s[e].end):"",d=new Map,k=[];for(let e=0;e<s.length;e++)if(["(","[","{"].includes(r(e)))k.push(e);else if([")","]","}"].includes(r(e))){let i=k.pop();if(i===void 0||!["()","[]","{}"].includes(r(i)+r(e)))throw Error("Unbalanced binding pattern");d.set(i,e)}if(k.length)throw Error("Unbalanced binding pattern");for(let e=0;e<s.length;e++){if(r(e)!=="<")continue;let i=["=",",","(",":","?","[","{"].includes(r(e-1)),f=1;for(let a=e+1;a<s.length;a++){if(r(a)==="="&&r(a+1)!==">"&&f===1&&!i)break;if(r(a)==="<")f++;else if(r(a)===">"&&r(a-1)!=="="&&--f===0){if(a+1===s.length||["(","[",".",",","}","]",")","?",":",";","=",">"].includes(r(a+1)))d.set(e,a);break}let u=d.get(a);if(u!==void 0)a=u}}let g=(e,i)=>({text:e<i?n.slice(s[e].start,s[i-1].end):"",offset:s[e]?.start??n.length}),w=(e,i,f)=>{for(let a=e;a<i;a++){if(r(a)===f)return a;let u=d.get(a);if(u!==void 0)a=u}return},b=(e,i)=>{let f=w(e,i,"="),a=f===void 0?void 0:g(f+1,i);if(f!==void 0)i=f;if(e+1===i&&s[e]?.kind==="word")return{kind:"name",name:r(e),defaultValue:a};let u=r(e)==="{"?"object":r(e)==="["?"array":void 0;if(!u||d.get(e)!==i-1)throw Error(`Invalid binding target: ${g(e,i).text}`);let m=[],o=e+1;while(o<i-1){let h=w(o,i-1,","),p=h??i-1;if(o===p)m.push(void 0);else if(r(o)==="."&&r(o+1)==="."&&r(o+2)===".")m.push({rest:!0,target:b(o+3,p)});else if(u==="array")m.push({rest:!1,target:b(o,p)});else if(r(o)==="["){let c=d.get(o);if(c===void 0||r(c+1)!==":")throw Error("Computed binding needs a target");m.push({computed:g(o+1,c),rest:!1,target:b(c+2,p)})}else{let c=o+1;if(s[o].kind!=="word"&&s[o].kind!=="quoted")while(c<p&&r(c)!==":")c++;let l=r(c)===":";if(!l&&s[o].kind!=="word")throw Error("Invalid object binding key");m.push({key:g(o,l?c:o+1).text,rest:!1,target:b(l?c+1:o,p)})}if(h===void 0)break;o=h+1}return{kind:u,elements:m,defaultValue:a}};return b(0,s.length)}function y(n,s){if(n.kind==="name")s.push(n.name);else for(let r of n.elements)if(r)y(r.target,s)}function Ge(n){let s=[];return y(j(n),s),s}function cr(n){let s=j(n.pattern),r=[];if(y(s,r),!r.length)return[];let d=[n.root],k=!1,g={start:n.root.start,end:n.root.end},w=(e,i)=>{let f=n.allocateName();return d.push({kind:"variable",name:f,text:`declare ${i} ${f}: unknown;`,value:e.text,initializerStart:n.patternOffset+e.offset,modifiers:[i],isExported:!1,...g}),f},b=(e,i)=>{if(e.defaultValue){let l=w(e.defaultValue,n.kind),x=n.allocateName();i=`(${i}) extends infer ${x} ? ${x} extends undefined ? typeof ${l} : ${x} : never`}if(e.kind==="name"){let l=k?void 0:n.comments;k=!0,d.push({kind:"variable",name:e.name,text:`${n.exported?"export ":""}declare ${n.kind} ${e.name}: ${i};`,typeAnnotation:i,modifiers:[n.kind],isExported:n.exported,leadingComments:l,...g});return}let f=e.elements,a=[],u=[],m=[];for(let l of f){if(!l){a.push("");continue}let x=n.allocateName(),E=l.key;if(l.computed)E=`[${w(l.computed,"const")}]`;a.push(l.rest?`...${x}`:e.kind==="object"?`${E}: ${x}`:x),u.push({target:l.target,index:m.length}),m.push(`typeof ${x}`)}let o=n.allocateName(),h=n.allocateName(),p=n.allocateName(),c=e.kind==="object"?`{ ${a.join(", ")} }`:`[${a.join(", ")}]`;d.push({kind:"function",name:o,text:`declare function ${o}(${c}: ${i}): [${m.join(", ")}];`,isExported:!1,...g}),d.push({kind:"type",name:h,text:`type ${h} = (typeof ${o}) extends (...args: never[]) => infer ${p} ? ${p} : never;`,isExported:!1,...g});for(let l of u)b(l.target,`${h}[${l.index}]`)};return b(s,`typeof ${n.root.name}`),d}
2
+ import{t}from"./chunk-6exq13f9.js";function j(n){let s=t(n),r=(e)=>s[e]?n.slice(s[e].start,s[e].end):"",d=new Map,k=[];for(let e=0;e<s.length;e++)if(["(","[","{"].includes(r(e)))k.push(e);else if([")","]","}"].includes(r(e))){let i=k.pop();if(i===void 0||!["()","[]","{}"].includes(r(i)+r(e)))throw Error("Unbalanced binding pattern");d.set(i,e)}if(k.length)throw Error("Unbalanced binding pattern");for(let e=0;e<s.length;e++){if(r(e)!=="<")continue;let i=["=",",","(",":","?","[","{"].includes(r(e-1)),f=1;for(let a=e+1;a<s.length;a++){if(r(a)==="="&&r(a+1)!==">"&&f===1&&!i)break;if(r(a)==="<")f++;else if(r(a)===">"&&r(a-1)!=="="&&--f===0){if(a+1===s.length||["(","[",".",",","}","]",")","?",":",";","=",">"].includes(r(a+1)))d.set(e,a);break}let u=d.get(a);if(u!==void 0)a=u}}let g=(e,i)=>({text:e<i?n.slice(s[e].start,s[i-1].end):"",offset:s[e]?.start??n.length}),w=(e,i,f)=>{for(let a=e;a<i;a++){if(r(a)===f)return a;let u=d.get(a);if(u!==void 0)a=u}return},b=(e,i)=>{let f=w(e,i,"="),a=f===void 0?void 0:g(f+1,i);if(f!==void 0)i=f;if(e+1===i&&s[e]?.kind==="word")return{kind:"name",name:r(e),defaultValue:a};let u=r(e)==="{"?"object":r(e)==="["?"array":void 0;if(!u||d.get(e)!==i-1)throw Error(`Invalid binding target: ${g(e,i).text}`);let m=[],o=e+1;while(o<i-1){let h=w(o,i-1,","),p=h??i-1;if(o===p)m.push(void 0);else if(r(o)==="."&&r(o+1)==="."&&r(o+2)===".")m.push({rest:!0,target:b(o+3,p)});else if(u==="array")m.push({rest:!1,target:b(o,p)});else if(r(o)==="["){let c=d.get(o);if(c===void 0||r(c+1)!==":")throw Error("Computed binding needs a target");m.push({computed:g(o+1,c),rest:!1,target:b(c+2,p)})}else{let c=o+1;if(s[o].kind!=="word"&&s[o].kind!=="quoted")while(c<p&&r(c)!==":")c++;let l=r(c)===":";if(!l&&s[o].kind!=="word")throw Error("Invalid object binding key");m.push({key:g(o,l?c:o+1).text,rest:!1,target:b(l?c+1:o,p)})}if(h===void 0)break;o=h+1}return{kind:u,elements:m,defaultValue:a}};return b(0,s.length)}function y(n,s){if(n.kind==="name")s.push(n.name);else for(let r of n.elements)if(r)y(r.target,s)}function Ge(n){let s=[];return y(j(n),s),s}function cr(n){let s=j(n.pattern),r=[];if(y(s,r),!r.length)return[];let d=[n.root],k=!1,g={start:n.root.start,end:n.root.end},w=(e,i)=>{let f=n.allocateName();return d.push({kind:"variable",name:f,text:`declare ${i} ${f}: unknown;`,value:e.text,initializerStart:n.patternOffset+e.offset,modifiers:[i],isExported:!1,...g}),f},b=(e,i)=>{if(e.defaultValue){let l=w(e.defaultValue,n.kind),x=n.allocateName();i=`(${i}) extends infer ${x} ? ${x} extends undefined ? typeof ${l} : ${x} : never`}if(e.kind==="name"){let l=k?void 0:n.comments;k=!0,d.push({kind:"variable",name:e.name,text:`${n.exported?"export ":""}declare ${n.kind} ${e.name}: ${i};`,typeAnnotation:i,modifiers:[n.kind],isExported:n.exported,leadingComments:l,...g});return}let f=e.elements,a=[],u=[],m=[];for(let l of f){if(!l){a.push("");continue}let x=n.allocateName(),E=l.key;if(l.computed)E=`[${w(l.computed,"const")}]`;a.push(l.rest?`...${x}`:e.kind==="object"?`${E}: ${x}`:x),u.push({target:l.target,index:m.length}),m.push(`typeof ${x}`)}let o=n.allocateName(),h=n.allocateName(),p=n.allocateName(),c=e.kind==="object"?`{ ${a.join(", ")} }`:`[${a.join(", ")}]`;d.push({kind:"function",name:o,text:`declare function ${o}(${c}: ${i}): [${m.join(", ")}];`,isExported:!1,...g}),d.push({kind:"type",name:h,text:`type ${h} = (typeof ${o}) extends (...args: never[]) => infer ${p} ? ${p} : never;`,isExported:!1,...g});for(let l of u)b(l.target,`${h}[${l.index}]`)};return b(s,`typeof ${n.root.name}`),d}
3
3
  export{Ge,cr};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{r}from"./chunk-wrvgt39b.js";import{e}from"./chunk-qmg1535a.js";import{existsSync as j,mkdirSync as S,readFileSync as E,writeFileSync as f}from"fs";import{basename as h,join as g}from"path";function an(t){let n={description:"",params:[],examples:[],tags:{},see:[],throws:[]};if(!t||t.length===0)return n;for(let s of t){let o=s.replace(/^\/\*\*/,"").replace(/\*\/$/,"").split(`
2
+ import{r}from"./chunk-c6bfdmfy.js";import{e}from"./chunk-3mp0jaa7.js";import{existsSync as j,mkdirSync as S,readFileSync as E,writeFileSync as f}from"fs";import{basename as h,join as g}from"path";function an(t){let n={description:"",params:[],examples:[],tags:{},see:[],throws:[]};if(!t||t.length===0)return n;for(let s of t){let o=s.replace(/^\/\*\*/,"").replace(/\*\/$/,"").split(`
3
3
  `).map((p)=>p.replace(/^\s*\*\s?/,"")).join(`
4
4
  `).trim(),i=o.search(/@\w+/);if(i===-1){n.description=o;continue}else if(i>0)n.description=o.slice(0,i).trim(),o=o.slice(i);let a=/@(\w+)(?:\s+\{([^}]+)\})?\s*([^\n@]*(?:\n(?!@)[^\n@]*)*)/g,c;while((c=a.exec(o))!==null){let[,p,u,d]=c,m=d.trim();switch(p){case"param":{let l=m.match(/^(\[)?(\w+)\]?\s*(?:-\s*)?(.*)/);if(l)n.params.push({name:l[2],type:u,description:l[3].trim(),optional:!!l[1]});break}case"returns":case"return":n.returns={type:u,description:m};break;case"example":n.examples.push(m);break;case"deprecated":n.deprecated=m||"Deprecated";break;case"since":n.since=m;break;case"see":n.see.push(m);break;case"throws":case"throw":n.throws.push({type:u,description:m});break;case"category":n.category=m;break;default:if(!n.tags[p])n.tags[p]=[];n.tags[p].push(m)}}}return n}function w(t,n){let s=an(t.leadingComments),o="";switch(t.kind){case"function":o=M(t);break;case"variable":o=C(t);break;case"interface":o=P(t);break;case"type":o=v(t);break;case"class":o=T(t);break;case"enum":o=F(t);break;default:o=t.text||t.name}let i={name:t.name,kind:t.kind,signature:o,jsdoc:s,isExported:t.isExported,isDefault:t.isDefault,sourceFile:n};if(t.members&&t.members.length>0)i.members=t.members.map((a)=>w(a,n));return i}function M(t){let n=[];if(t.isExported)n.push("export");if(t.isDefault)n.push("default");if(n.push("function"),n.push(t.name),t.generics)n.push(t.generics);if(t.parameters){let s=t.parameters.map((o)=>{let i="";if(o.rest)i+="...";if(i+=o.name,o.optional)i+="?";if(o.type)i+=`: ${o.type}`;return i}).join(", ");n.push(`(${s})`)}else n.push("()");if(t.returnType)n.push(`: ${t.returnType}`);return n.join(" ").replace(/\s+/g," ")}function C(t){let n=[];if(t.isExported)n.push("export");if(n.push("const"),n.push(t.name),t.typeAnnotation)n.push(`: ${t.typeAnnotation}`);return n.join(" ")}function P(t){let n=[];if(t.isExported)n.push("export");if(n.push("interface"),n.push(t.name),t.generics)n.push(t.generics);if(t.extends)n.push(`extends ${t.extends}`);return n.join(" ")}function v(t){let n=[];if(t.isExported)n.push("export");if(n.push("type"),n.push(t.name),t.generics)n.push(t.generics);if(n.push("="),t.typeAnnotation)n.push(t.typeAnnotation);return n.join(" ")}function T(t){let n=[];if(t.isExported)n.push("export");if(t.isDefault)n.push("default");if(n.push("class"),n.push(t.name),t.generics)n.push(t.generics);if(t.extends)n.push(`extends ${t.extends}`);if(t.implements&&t.implements.length>0)n.push(`implements ${t.implements.join(", ")}`);return n.join(" ")}function F(t){let n=[];if(t.isExported)n.push("export");return n.push("enum"),n.push(t.name),n.join(" ")}async function cn(t,n={}){let s=[],o=new Map;for(let i of t){if(!j(i)){e.warn(`File not found: ${i}`);continue}let a=E(i,"utf-8"),c=r(a,i,!0);for(let p of c){if(p.kind==="import")continue;if(!n.includePrivate&&p.name.startsWith("_"))continue;if(!n.includeInternal&&p.leadingComments?.some((d)=>d.includes("@internal")))continue;let u=w(p,i);if(s.push(u),n.groupByCategory&&u.jsdoc.category){let d=u.jsdoc.category;if(!o.has(d))o.set(d,[]);o.get(d).push(u)}}}return{title:n.title||"API Documentation",description:n.description,entries:s,categories:o,generatedAt:new Date}}function Je(t,n={}){let s=[];if(s.push(`# ${t.title}`),s.push(""),t.description)s.push(t.description),s.push("");if(s.push(`> Generated on ${t.generatedAt.toISOString()}`),s.push(""),s.push("## Table of Contents"),s.push(""),n.groupByCategory&&t.categories.size>0)for(let o of t.categories.keys())s.push(`- [${o}](#${D(o)})`);else{let o=x(t.entries);for(let[i,a]of o)if(a.length>0)s.push(`- [${b(i)}](#${D(b(i))})`)}if(s.push(""),n.groupByCategory&&t.categories.size>0)for(let[o,i]of t.categories){s.push(`## ${o}`),s.push("");for(let a of i)s.push(...k(a,n))}else{let o=x(t.entries);for(let[i,a]of o)if(a.length>0){s.push(`## ${b(i)}`),s.push("");for(let c of a)s.push(...k(c,n))}}return s.join(`
5
5
  `)}function k(t,n){let s=[];if(s.push(`### ${t.name}`),s.push(""),t.jsdoc.deprecated)s.push(`> **Deprecated:** ${t.jsdoc.deprecated}`),s.push("");if(s.push("```typescript"),s.push(t.signature),s.push("```"),s.push(""),t.jsdoc.description)s.push(t.jsdoc.description),s.push("");if(t.jsdoc.params.length>0){s.push("**Parameters:**"),s.push(""),s.push("| Name | Type | Description |"),s.push("|------|------|-------------|");for(let o of t.jsdoc.params){let i=o.optional?" (optional)":"",a=o.type||"any";s.push(`| \`${o.name}\`${i} | \`${a}\` | ${o.description} |`)}s.push("")}if(t.jsdoc.returns){s.push("**Returns:**"),s.push("");let o=t.jsdoc.returns.type?`\`${t.jsdoc.returns.type}\``:"";s.push(`${o} ${t.jsdoc.returns.description}`),s.push("")}if(t.jsdoc.throws.length>0){s.push("**Throws:**"),s.push("");for(let o of t.jsdoc.throws){let i=o.type?`\`${o.type}\``:"";s.push(`- ${i} ${o.description}`)}s.push("")}if(t.jsdoc.examples.length>0){s.push("**Examples:**"),s.push("");for(let o of t.jsdoc.examples)s.push("```typescript"),s.push(o),s.push("```"),s.push("")}if(t.jsdoc.see.length>0){s.push("**See also:**"),s.push("");for(let o of t.jsdoc.see)s.push(`- ${o}`);s.push("")}if(t.jsdoc.since)s.push(`*Since: ${t.jsdoc.since}*`),s.push("");if(n.includeSourceLinks&&t.sourceFile){let o=t.sourceFile;if(n.sourceBaseUrl)s.push(`[Source](${n.sourceBaseUrl}/${o})`);else s.push(`*Source: ${o}*`);s.push("")}if(t.members&&t.members.length>0){s.push("**Members:**"),s.push("");for(let o of t.members)if(s.push(`#### ${o.name}`),s.push(""),s.push("```typescript"),s.push(o.signature),s.push("```"),s.push(""),o.jsdoc.description)s.push(o.jsdoc.description),s.push("")}return s.push("---"),s.push(""),s}function ln(t,n={}){let s=Je(t,n);return`<!DOCTYPE html>
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{A}from"./chunk-475bjqea.js";import{Y}from"./chunk-h5esm323.js";import{chmod as G,lstat as P,mkdir as y,readdir as j,realpath as q,rename as D,rm as N,rmdir as L,stat as R,writeFile as W}from"fs/promises";import{basename as _,dirname as m,isAbsolute as M,parse as B,relative as F,resolve as l}from"path";function f(a,e){return a instanceof Error&&"code"in a&&a.code===e}async function w(a){try{return await P(a)}catch(e){if(f(e,"ENOENT"))return;throw e}}async function g(a){let e=l(a);try{return await q(e)}catch(n){if(!f(n,"ENOENT")||m(e)===e)throw n;return l(await g(m(e)),_(e))}}async function ne(a){let e=l(a.cwd,a.outdir);if(a.bundle&&a.bundleOutput){if(M(a.bundleOutput))throw Error("bundleOutput must be relative to outdir");if(!A(l(e,a.bundleOutput),e))throw Error("bundleOutput must stay within outdir")}if(!a.clean||a.dryRun)return;if(e===B(e).root)throw Error("Refusing to clean declarations from the filesystem root");let[n,r]=await Promise.all([g(e),g(l(a.cwd,a.root))]);if(A(r,n))throw Error("Refusing to clean an outdir that contains the source root")}function z(a){return[".d.ts",".d.mts",".d.cts",".d.ts.map",".d.mts.map",".d.cts.map"].some((e)=>a.endsWith(e))}function k(a,e){return a.dev===e.dev&&a.ino===e.ino}async function S(a,e){try{if(!(await R(a)).isDirectory())throw Error(`Declaration output parent is not a directory: ${a}`);return}catch(r){if(!f(r,"ENOENT"))throw r}let n=m(a);if(n===a)throw Error(`Cannot create declaration output directory: ${a}`);await S(n,e);try{await y(a),e.push(a)}catch(r){if(!f(r,"EEXIST")||!(await R(a)).isDirectory())throw r}}async function X(a,e,n){for(let r of(await j(a,{withFileTypes:!0})).sort((s,p)=>s.name.localeCompare(p.name))){let s=l(a,r.name);if(s===e)continue;if(r.isDirectory())await X(s,e,n);else if(z(r.name)){let p=await w(s);if(!p)throw Error(`Declaration output changed during inventory: ${s}`);n.set(s,p)}}}function O(a,e,n,r,s){return Object.assign(AggregateError(e,a),{code:"DTSX_PUBLICATION_FAILED",phase:n,recoveryDirectory:r,outputsCommitted:s})}async function $e(a,e){if(a.dryRun||e.size===0&&!a.clean)return;await ne(a);let n=l(a.cwd,a.outdir);if(e.size===0&&!await w(n))return;let r=l(n,".dtsx-publication"),s=new Map;for(let[o,c]of e){let t=l(o);if(!M(o)||t===n||!A(t,n)||A(t,r)||!z(t))throw Error(`Invalid declaration publication target: ${o}`);if(s.has(t))throw Error(`Duplicate declaration publication target: ${o}`);s.set(t,c)}let p=[],x=[],T=[],b=!1,E,d,I=!1;async function h(o,c){let t=await g(m(o));if(!A(t,c))throw Error(`Declaration publication parent escapes outdir: ${o}`);if(A(t,l(c,".dtsx-publication")))throw Error(`Declaration publication target overlaps its transaction directory: ${o}`)}async function C(){if(!b)return;if(!E)throw Error(`Cannot verify declaration publication ownership: ${r}`);let o=await w(r);if(!o||!k(o,E))throw Error(`Declaration publication ownership changed: ${r}`);if(d&&await g(r)!==l(d,".dtsx-publication"))throw Error(`Declaration publication location changed: ${r}`);await N(r,{recursive:!0})}try{await S(n,p);try{await y(r)}catch(t){if(f(t,"EEXIST"))throw Error(`Declaration publication is active or requires recovery at ${r}`,{cause:t});throw t}b=!0,E=await P(r),d=await g(n);let o=new Map;if(a.clean)await X(n,r,o);for(let t of s.keys()){await h(t,d);let i=await w(t);if(i&&!i.isFile())throw Error(`Declaration publication target is not a regular file: ${t}`);if(i)o.set(t,i)}for(let t of o.keys())await h(t,d);await y(l(r,"staged")),await y(l(r,"backups"));let c=new Map;for(let t of new Set([...o.keys(),...s.keys()])){let i=c.size.toString();c.set(t,{path:t,existing:o.get(t),backup:l(r,"backups",i),staged:s.has(t)?l(r,"staged",i):void 0})}await W(l(r,"manifest.json"),JSON.stringify({version:1,outdir:n,targets:[...c.values()].map((t)=>({path:F(n,t.path),backup:F(r,t.backup),hadPrevious:!!t.existing}))}));for(let[t,i]of s){let u=c.get(t),v=u.staged;if(await Y(v,i.content,i.lineEnding),!a.clean&&u.existing)await G(v,u.existing.mode&511);u.stagedIdentity=await P(v)}for(let t of c.values()){if(!t.existing)continue;await h(t.path,d);let i=await w(t.path);if(!i||!k(i,t.existing))throw Error(`Declaration output changed before commit: ${t.path}`);await D(t.path,t.backup),x.push(t)}for(let t of c.values()){if(!t.staged||!t.stagedIdentity)continue;if(await h(t.path,d),await S(m(t.path),p),await h(t.path,d),await w(t.path))throw Error(`Declaration output appeared during commit: ${t.path}`);await D(t.staged,t.path),T.push({path:t.path,identity:t.stagedIdentity})}I=!0;try{await C()}catch(t){throw O(`Declaration outputs committed, but transaction cleanup failed at ${r}`,[t],"finalize",r,!0)}}catch(o){if(I)throw o;let c=[];for(let i of T.toReversed())try{if(d)await h(i.path,d);let u=await w(i.path);if(!u)continue;if(!k(u,i.identity))throw Error(`Installed declaration changed before rollback: ${i.path}`);await N(i.path)}catch(u){c.push(u)}for(let i of x.toReversed())try{if(d)await h(i.path,d);if(await w(i.path))throw Error(`Cannot restore declaration over an existing path: ${i.path}`);await D(i.backup,i.path)}catch(u){c.push(u)}if(c.length>0)throw O(`Declaration rollback failed; recovery data retained at ${r}`,[o,...c],"rollback",r,!1);let t=[];try{await C()}catch(i){t.push(i)}for(let i of p.toReversed())try{await L(i)}catch(u){if(!f(u,"ENOENT")&&!f(u,"ENOTEMPTY")&&!f(u,"EEXIST"))t.push(u)}if(t.length>0)throw O(`Prior declarations retained, but publication cleanup failed at ${r}`,[o,...t],"cleanup",b?r:void 0,!1);throw o}}
2
+ import{A}from"./chunk-ka9qyjzn.js";import{Y}from"./chunk-b6xcyrnx.js";import{chmod as G,lstat as P,mkdir as y,readdir as j,realpath as q,rename as D,rm as N,rmdir as L,stat as R,writeFile as W}from"fs/promises";import{basename as _,dirname as m,isAbsolute as M,parse as B,relative as F,resolve as l}from"path";function f(a,e){return a instanceof Error&&"code"in a&&a.code===e}async function w(a){try{return await P(a)}catch(e){if(f(e,"ENOENT"))return;throw e}}async function g(a){let e=l(a);try{return await q(e)}catch(n){if(!f(n,"ENOENT")||m(e)===e)throw n;return l(await g(m(e)),_(e))}}async function ne(a){let e=l(a.cwd,a.outdir);if(a.bundle&&a.bundleOutput){if(M(a.bundleOutput))throw Error("bundleOutput must be relative to outdir");if(!A(l(e,a.bundleOutput),e))throw Error("bundleOutput must stay within outdir")}if(!a.clean||a.dryRun)return;if(e===B(e).root)throw Error("Refusing to clean declarations from the filesystem root");let[n,r]=await Promise.all([g(e),g(l(a.cwd,a.root))]);if(A(r,n))throw Error("Refusing to clean an outdir that contains the source root")}function z(a){return[".d.ts",".d.mts",".d.cts",".d.ts.map",".d.mts.map",".d.cts.map"].some((e)=>a.endsWith(e))}function k(a,e){return a.dev===e.dev&&a.ino===e.ino}async function S(a,e){try{if(!(await R(a)).isDirectory())throw Error(`Declaration output parent is not a directory: ${a}`);return}catch(r){if(!f(r,"ENOENT"))throw r}let n=m(a);if(n===a)throw Error(`Cannot create declaration output directory: ${a}`);await S(n,e);try{await y(a),e.push(a)}catch(r){if(!f(r,"EEXIST")||!(await R(a)).isDirectory())throw r}}async function X(a,e,n){for(let r of(await j(a,{withFileTypes:!0})).sort((s,p)=>s.name.localeCompare(p.name))){let s=l(a,r.name);if(s===e)continue;if(r.isDirectory())await X(s,e,n);else if(z(r.name)){let p=await w(s);if(!p)throw Error(`Declaration output changed during inventory: ${s}`);n.set(s,p)}}}function O(a,e,n,r,s){return Object.assign(AggregateError(e,a),{code:"DTSX_PUBLICATION_FAILED",phase:n,recoveryDirectory:r,outputsCommitted:s})}async function $e(a,e){if(a.dryRun||e.size===0&&!a.clean)return;await ne(a);let n=l(a.cwd,a.outdir);if(e.size===0&&!await w(n))return;let r=l(n,".dtsx-publication"),s=new Map;for(let[o,c]of e){let t=l(o);if(!M(o)||t===n||!A(t,n)||A(t,r)||!z(t))throw Error(`Invalid declaration publication target: ${o}`);if(s.has(t))throw Error(`Duplicate declaration publication target: ${o}`);s.set(t,c)}let p=[],x=[],T=[],b=!1,E,d,I=!1;async function h(o,c){let t=await g(m(o));if(!A(t,c))throw Error(`Declaration publication parent escapes outdir: ${o}`);if(A(t,l(c,".dtsx-publication")))throw Error(`Declaration publication target overlaps its transaction directory: ${o}`)}async function C(){if(!b)return;if(!E)throw Error(`Cannot verify declaration publication ownership: ${r}`);let o=await w(r);if(!o||!k(o,E))throw Error(`Declaration publication ownership changed: ${r}`);if(d&&await g(r)!==l(d,".dtsx-publication"))throw Error(`Declaration publication location changed: ${r}`);await N(r,{recursive:!0})}try{await S(n,p);try{await y(r)}catch(t){if(f(t,"EEXIST"))throw Error(`Declaration publication is active or requires recovery at ${r}`,{cause:t});throw t}b=!0,E=await P(r),d=await g(n);let o=new Map;if(a.clean)await X(n,r,o);for(let t of s.keys()){await h(t,d);let i=await w(t);if(i&&!i.isFile())throw Error(`Declaration publication target is not a regular file: ${t}`);if(i)o.set(t,i)}for(let t of o.keys())await h(t,d);await y(l(r,"staged")),await y(l(r,"backups"));let c=new Map;for(let t of new Set([...o.keys(),...s.keys()])){let i=c.size.toString();c.set(t,{path:t,existing:o.get(t),backup:l(r,"backups",i),staged:s.has(t)?l(r,"staged",i):void 0})}await W(l(r,"manifest.json"),JSON.stringify({version:1,outdir:n,targets:[...c.values()].map((t)=>({path:F(n,t.path),backup:F(r,t.backup),hadPrevious:!!t.existing}))}));for(let[t,i]of s){let u=c.get(t),v=u.staged;if(await Y(v,i.content,i.lineEnding),!a.clean&&u.existing)await G(v,u.existing.mode&511);u.stagedIdentity=await P(v)}for(let t of c.values()){if(!t.existing)continue;await h(t.path,d);let i=await w(t.path);if(!i||!k(i,t.existing))throw Error(`Declaration output changed before commit: ${t.path}`);await D(t.path,t.backup),x.push(t)}for(let t of c.values()){if(!t.staged||!t.stagedIdentity)continue;if(await h(t.path,d),await S(m(t.path),p),await h(t.path,d),await w(t.path))throw Error(`Declaration output appeared during commit: ${t.path}`);await D(t.staged,t.path),T.push({path:t.path,identity:t.stagedIdentity})}I=!0;try{await C()}catch(t){throw O(`Declaration outputs committed, but transaction cleanup failed at ${r}`,[t],"finalize",r,!0)}}catch(o){if(I)throw o;let c=[];for(let i of T.toReversed())try{if(d)await h(i.path,d);let u=await w(i.path);if(!u)continue;if(!k(u,i.identity))throw Error(`Installed declaration changed before rollback: ${i.path}`);await N(i.path)}catch(u){c.push(u)}for(let i of x.toReversed())try{if(d)await h(i.path,d);if(await w(i.path))throw Error(`Cannot restore declaration over an existing path: ${i.path}`);await D(i.backup,i.path)}catch(u){c.push(u)}if(c.length>0)throw O(`Declaration rollback failed; recovery data retained at ${r}`,[o,...c],"rollback",r,!1);let t=[];try{await C()}catch(i){t.push(i)}for(let i of p.toReversed())try{await L(i)}catch(u){if(!f(u,"ENOENT")&&!f(u,"ENOTEMPTY")&&!f(u,"EEXIST"))t.push(u)}if(t.length>0)throw O(`Prior declarations retained, but publication cleanup failed at ${r}`,[o,...t],"cleanup",b?r:void 0,!1);throw o}}
3
3
  export{ne,$e};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{p}from"./chunk-v6fwy63g.js";import{createHash as g}from"crypto";import{mkdir as y,readFile as l,stat as m,writeFile as v}from"fs/promises";import{dirname as C,join as o}from"path";var c="1.0.0",b=".dtsx-cache",d="manifest.json";class mi{config;manifest=null;dirty=!1;stats={totalEntries:0,hits:0,misses:0,hitRatio:0,sizeBytes:0,timeSavedMs:0};constructor(t={}){this.config={enabled:t.enabled??!0,cacheDir:t.cacheDir??b,format:t.format??"json",maxAge:t.maxAge??86400000,force:t.force??!1,validateCache:t.validateCache??!0}}async init(){if(!this.config.enabled)return;try{await y(this.config.cacheDir,{recursive:!0}),await this.loadManifest()}catch{this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()}}}async loadManifest(){let t=o(this.config.cacheDir,d);try{let e=await l(t,"utf-8");if(this.manifest=JSON.parse(e),this.manifest.version!==c){await this.clear();return}this.stats.totalEntries=Object.keys(this.manifest.entries).length}catch{this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()}}}async save(){if(!this.config.enabled||!this.manifest||!this.dirty)return;let t=o(this.config.cacheDir,d);this.manifest.updatedAt=Date.now(),await v(t,JSON.stringify(this.manifest,null,2)),this.dirty=!1}async get(t,e){if(!this.config.enabled||!this.manifest||this.config.force)return this.stats.misses++,null;let s=this.manifest.entries[t];if(!s)return this.stats.misses++,null;if(s.configHash!==e)return this.stats.misses++,null;if(Date.now()-s.cachedAt>this.config.maxAge)return this.stats.misses++,delete this.manifest.entries[t],this.dirty=!0,null;if(this.config.validateCache)try{let a=(await m(t)).mtimeMs;if(a!==s.mtime){let i=await l(t,"utf-8");if(this.hashContent(i)!==s.hash)return this.stats.misses++,null;s.mtime=a,this.dirty=!0}}catch{return this.stats.misses++,delete this.manifest.entries[t],this.dirty=!0,null}if(s.dependencies.length>0){if((await Promise.all(s.dependencies.map(async(a)=>{let i=this.manifest.entries[a];if(!i)return!0;try{return(await m(a)).mtimeMs===i.mtime}catch{return!1}}))).some((a)=>!a))return this.stats.misses++,null}return this.stats.hits++,this.stats.timeSavedMs+=50,this.updateHitRatio(),s}async set(t,e,s,r,a,i){if(!this.config.enabled||!this.manifest)return;let n=Date.now();try{n=(await m(t)).mtimeMs}catch{}let h={filePath:t,hash:this.hashContent(e),mtime:n,declarations:s,dtsContent:r,dependencies:a,cachedAt:Date.now(),configHash:i};if(!(t in this.manifest.entries))this.stats.totalEntries++;this.manifest.entries[t]=h,this.dirty=!0}invalidate(t){if(!this.manifest)return;delete this.manifest.entries[t],this.dirty=!0;for(let[e,s]of Object.entries(this.manifest.entries))if(s.dependencies.includes(t))delete this.manifest.entries[e]}async clear(){this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()},this.stats={totalEntries:0,hits:0,misses:0,hitRatio:0,sizeBytes:0,timeSavedMs:0},this.dirty=!0,await this.save()}getStats(){return{...this.stats}}hashContent(t){return String(p(t))}updateHitRatio(){let t=this.stats.hits+this.stats.misses;this.stats.hitRatio=t>0?this.stats.hits/t:0}static hashConfig(t){let e={outdir:t.outdir,clean:t.clean,tsconfigPath:t.tsconfigPath};return g("sha256").update(JSON.stringify(e)).digest("hex").slice(0,16)}}function Ao(t,e){let s=[],r=[],a=[];return{async needsRebuild(i){return await t.get(i,e)===null},async getCachedDeclarations(i){let n=await t.get(i,e);if(n)return r.push(i),n.declarations;return null},async getCachedDts(i){let n=await t.get(i,e);if(n)return n.dtsContent;return null},async cacheResult(i,n,h,u,f=[]){await t.set(i,n,h,u,f,e),s.push(i)},skip(i){a.push(i)},getResult(){return{rebuilt:s,cached:r,skipped:a,stats:t.getStats()}},async save(){await t.save()}}}async function Po(t,e=604800000){let s=t.getStats();if(s.totalEntries>1000)return await t.clear(),s.totalEntries;return 0}function Do(t){let e=[];return e.push("Incremental Build Results:"),e.push(` Rebuilt: ${t.rebuilt.length} files`),e.push(` From cache: ${t.cached.length} files`),e.push(` Skipped: ${t.skipped.length} files`),e.push(""),e.push("Cache Statistics:"),e.push(` Total entries: ${t.stats.totalEntries}`),e.push(` Hit ratio: ${(t.stats.hitRatio*100).toFixed(1)}%`),e.push(` Time saved: ~${t.stats.timeSavedMs}ms`),e.join(`
2
+ import{p}from"./chunk-v6fwy63g.js";import{createHash as g}from"crypto";import{mkdir as y,readFile as l,stat as m,writeFile as v}from"fs/promises";import{dirname as C,join as o}from"path";var c="1.0.0",b=".dtsx-cache",d="manifest.json";class mi{config;manifest=null;dirty=!1;stats={totalEntries:0,hits:0,misses:0,hitRatio:0,sizeBytes:0,timeSavedMs:0};constructor(t={}){this.config={enabled:t.enabled??!0,cacheDir:t.cacheDir??b,format:t.format??"json",maxAge:t.maxAge??86400000,force:t.force??!1,validateCache:t.validateCache??!0}}async init(){if(!this.config.enabled)return;try{await y(this.config.cacheDir,{recursive:!0}),await this.loadManifest()}catch{this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()}}}async loadManifest(){let t=o(this.config.cacheDir,d);try{let e=await l(t,"utf-8");if(this.manifest=JSON.parse(e),this.manifest.version!==c){await this.clear();return}this.stats.totalEntries=Object.keys(this.manifest.entries).length}catch{this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()}}}async save(){if(!this.config.enabled||!this.manifest||!this.dirty)return;let t=o(this.config.cacheDir,d);this.manifest.updatedAt=Date.now(),await v(t,JSON.stringify(this.manifest,null,2)),this.dirty=!1}async get(t,e){if(!this.config.enabled||!this.manifest||this.config.force)return this.stats.misses++,null;let s=this.manifest.entries[t];if(!s)return this.stats.misses++,null;if(s.configHash!==e)return this.stats.misses++,null;if(Date.now()-s.cachedAt>this.config.maxAge)return this.stats.misses++,delete this.manifest.entries[t],this.dirty=!0,null;if(this.config.validateCache)try{let a=(await m(t)).mtimeMs;if(a!==s.mtime){let i=await l(t,"utf-8");if(this.hashContent(i)!==s.hash)return this.stats.misses++,null;s.mtime=a,this.dirty=!0}}catch{return this.stats.misses++,delete this.manifest.entries[t],this.dirty=!0,null}if(s.dependencies.length>0){if((await Promise.all(s.dependencies.map(async(a)=>{let i=this.manifest.entries[a];if(!i)return!0;try{return(await m(a)).mtimeMs===i.mtime}catch{return!1}}))).some((a)=>!a))return this.stats.misses++,null}return this.stats.hits++,this.stats.timeSavedMs+=50,this.updateHitRatio(),s}async set(t,e,s,r,a,i){if(!this.config.enabled||!this.manifest)return;let n=Date.now();try{n=(await m(t)).mtimeMs}catch{}let h={filePath:t,hash:this.hashContent(e),mtime:n,declarations:s,dtsContent:r,dependencies:a,cachedAt:Date.now(),configHash:i};if(!(t in this.manifest.entries))this.stats.totalEntries++;this.manifest.entries[t]=h,this.dirty=!0}invalidate(t){if(!this.manifest)return;delete this.manifest.entries[t],this.dirty=!0;for(let[e,s]of Object.entries(this.manifest.entries))if(s.dependencies.includes(t))delete this.manifest.entries[e]}async clear(){this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()},this.stats={totalEntries:0,hits:0,misses:0,hitRatio:0,sizeBytes:0,timeSavedMs:0},this.dirty=!0,await this.save()}getStats(){return{...this.stats}}hashContent(t){return String(p(t))}updateHitRatio(){let t=this.stats.hits+this.stats.misses;this.stats.hitRatio=t>0?this.stats.hits/t:0}static hashConfig(t){let e={outdir:t.outdir,clean:t.clean,tsconfigPath:t.tsconfigPath};return g("sha256").update(JSON.stringify(e)).digest("hex").slice(0,16)}}function Ao(t,e){let s=[],r=[],a=[];return{async needsRebuild(i){return await t.get(i,e)===null},async getCachedDeclarations(i){let n=await t.get(i,e);if(n)return r.push(i),n.declarations;return null},async getCachedDts(i){let n=await t.get(i,e);if(n)return n.dtsContent;return null},async cacheResult(i,n,h,u,f=[]){await t.set(i,n,h,u,f,e),s.push(i)},skip(i){a.push(i)},getResult(){return{rebuilt:s,cached:r,skipped:a,stats:t.getStats()}},async save(){await t.save()}}}async function Do(t,e=604800000){let s=t.getStats();if(s.totalEntries>1000)return await t.clear(),s.totalEntries;return 0}function Po(t){let e=[];return e.push("Incremental Build Results:"),e.push(` Rebuilt: ${t.rebuilt.length} files`),e.push(` From cache: ${t.cached.length} files`),e.push(` Skipped: ${t.skipped.length} files`),e.push(""),e.push("Cache Statistics:"),e.push(` Total entries: ${t.stats.totalEntries}`),e.push(` Hit ratio: ${(t.stats.hitRatio*100).toFixed(1)}%`),e.push(` Time saved: ~${t.stats.timeSavedMs}ms`),e.join(`
3
3
  `)}function Ro(t,e){let s=[],r=/import\s+(?:type\s+)?(?:.+(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF])from\s+)?['"]([^'"]+)['"]/g,a;while((a=r.exec(t))!==null){let i=a[1];if(i.startsWith(".")){let n=o(C(e),i);s.push(n),s.push(`${n}.ts`),s.push(`${n}.tsx`),s.push(o(n,"index.ts")),s.push(o(n,"index.tsx"))}}return s}
4
- export{mi,Ao,Po,Do,Ro};
4
+ export{mi,Ao,Do,Po,Ro};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{u}from"./chunk-02yqpwv0.js";import{b}from"./chunk-d0dbet9n.js";import{C}from"./chunk-vhna4qch.js";import{r}from"./chunk-wrvgt39b.js";import{Me}from"./chunk-atzh1g6f.js";function sa(c){if(!c.includes("declare")||!c.includes("module"))return[];return b(c).filter((d)=>d.category==="augmentation").map((d)=>d.specifier)}function A(c,d){let m=new Set([c]);for(let S of m)for(let p of d(S))m.add(p);return m}async function Re(c,d,m=!1,S){let p=new Map,v=new Map;for(let e of c){let g=S?.get(e)??await u(e);p.set(e,g);let s=sa(g);if(s.length)v.set(e,s)}let w=new Map;if(v.size===0)return w;let l=new Map,x=(e,g)=>{let s=d(e,g);if(s.resolved)return s.resolved;if(!s.isRelative&&!s.isAlias)return`external:${e}`;return};for(let[e,g]of p){let s=r(g,e,!1,m),a=Me(s),f={edges:[],declarations:new Set,augmentations:new Set},h=(n,i,t)=>{let o=x(n.specifier,e);if(!o)return;if(p.has(o))f.edges.push({specifier:n.specifier,target:o,import:i});if(t)f.declarations.add(o)};for(let n of s){if(n.kind!=="import")continue;let i=n.isSideEffect||C(n.text).some((t)=>a.usedItems.has(t));for(let t of b(n.text))h(t,!0,!!i)}for(let n of b(a.referenceText))h(n,!1,!0);for(let n of v.get(e)??[]){let i=x(n,e);if(i)f.augmentations.add(i),f.declarations.add(i)}l.set(e,f)}let y=!0;while(y){y=!1;for(let[e,g]of l){let s=A(e,(a)=>l.get(a)?.declarations??[]);for(let[a,f]of l){if(s.has(a)||!f.augmentations.size||![...f.augmentations].some((t)=>s.has(t)))continue;let h=[e],n=new Map,i=new Set([e]);for(let t of h){if(t===a)break;for(let o of l.get(t).edges){if(i.has(o.target))continue;i.add(o.target),n.set(o.target,{from:t,edge:o}),h.push(o.target)}}if(!n.has(a))continue;for(let t=a;t!==e;){let{from:o,edge:R}=n.get(t),I=l.get(o);if(R.import){let M=w.get(o);if(!M)M=new Set,w.set(o,M);M.add(R.specifier)}if(!I.declarations.has(t))I.declarations.add(t),y=!0;t=o}}}}return w}
2
+ import{u}from"./chunk-02yqpwv0.js";import{b}from"./chunk-6exq13f9.js";import{C}from"./chunk-h3r142dy.js";import{r}from"./chunk-c6bfdmfy.js";import{Me}from"./chunk-beg5vxdm.js";function sa(c){if(!c.includes("declare")||!c.includes("module"))return[];return b(c).filter((d)=>d.category==="augmentation").map((d)=>d.specifier)}function A(c,d){let m=new Set([c]);for(let S of m)for(let p of d(S))m.add(p);return m}async function Re(c,d,m=!1,S){let p=new Map,v=new Map;for(let e of c){let g=S?.get(e)??await u(e);p.set(e,g);let s=sa(g);if(s.length)v.set(e,s)}let w=new Map;if(v.size===0)return w;let l=new Map,x=(e,g)=>{let s=d(e,g);if(s.resolved)return s.resolved;if(!s.isRelative&&!s.isAlias)return`external:${e}`;return};for(let[e,g]of p){let s=r(g,e,!1,m),a=Me(s),f={edges:[],declarations:new Set,augmentations:new Set},h=(n,i,t)=>{let o=x(n.specifier,e);if(!o)return;if(p.has(o))f.edges.push({specifier:n.specifier,target:o,import:i});if(t)f.declarations.add(o)};for(let n of s){if(n.kind!=="import")continue;let i=n.isSideEffect||C(n.text).some((t)=>a.usedItems.has(t));for(let t of b(n.text))h(t,!0,!!i)}for(let n of b(a.referenceText))h(n,!1,!0);for(let n of v.get(e)??[]){let i=x(n,e);if(i)f.augmentations.add(i),f.declarations.add(i)}l.set(e,f)}let y=!0;while(y){y=!1;for(let[e,g]of l){let s=A(e,(a)=>l.get(a)?.declarations??[]);for(let[a,f]of l){if(s.has(a)||!f.augmentations.size||![...f.augmentations].some((t)=>s.has(t)))continue;let h=[e],n=new Map,i=new Set([e]);for(let t of h){if(t===a)break;for(let o of l.get(t).edges){if(i.has(o.target))continue;i.add(o.target),n.set(o.target,{from:t,edge:o}),h.push(o.target)}}if(!n.has(a))continue;for(let t=a;t!==e;){let{from:o,edge:R}=n.get(t),I=l.get(o);if(R.import){let M=w.get(o);if(!M)M=new Set,w.set(o,M);M.add(R.specifier)}if(!I.declarations.has(t))I.declarations.add(t),y=!0;t=o}}}}return w}
3
3
  export{sa,Re};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{t,m}from"./chunk-6exq13f9.js";import{Ge}from"./chunk-w9jg9761.js";function ft(l){let u=t(l);if(u.length!==1||u[0].kind!=="word")return;let f=l.slice(u[0].start,u[0].end);return["true","false","null","undefined","this","super"].includes(f)?void 0:f}function Gt(l){let u=t(l);if(u.length===0)return!0;let f=u[u.length-1],g=l.slice(f.start,f.end);if(f.kind==="word"&&(g==="is"||g==="extends"))return!0;if(g==="|"||g==="&")return!0;let o=u[u.length-2];return g===">"&&o!==void 0&&l.slice(o.start,o.end)==="="}function V(l){return C(l,m(l))}function er(l){for(let u=1024;u<l.length;u*=8){let f=l.slice(0,u),g=I(f,t(f),u);if(g!==void 0)return g}return C(l,t(l))}function C(l,u){return I(l,u,1/0)??!1}function I(l,u,f){let g=0;for(let o=0;o<u.length;o++){let e=u[o];if(e.end>=f)return;if(e.kind==="punctuation"){let a=l.charCodeAt(e.start);if(a===123||a===40||a===91)g++;else if(a===125||a===41||a===93)g--;continue}if(g!==0||e.kind!=="word"||e.end-e.start!==6)continue;let b=l.slice(e.start,e.end);if(b==="export")return!0;if(b==="import"){let a=u[o+1];if(a===void 0?f!==1/0:a.end>=f)return;let w=a?l.slice(a.start,a.end):"";if(w!=="("&&w!==".")return!0}}return f===1/0?!1:void 0}function tr(l){if(l.isExported)return!1;if(["function","variable","interface","type","class","enum","namespace"].includes(l.kind))return!0;return l.kind==="module"&&(l.moduleForm==="namespace"||l.moduleForm==="identifier")}function nr(l,u,f){let g=l.text,o=t(g),e=(s)=>o[s]?g.slice(o[s].start,o[s].end):"",b=(s)=>o[s]?.kind==="word",a=new Map,w=new Map,y=[];for(let s=0;s<o.length;s++){let n=e(s);if(n==="("||n==="["||n==="{"||n==="<")y.push(s);else if(n===")"||n==="]"||n==="}"||n===">"&&e(s-1)!=="="){let i=y.at(-1);if(i!==void 0&&(e(i)==="("&&n===")"||e(i)==="["&&n==="]"||e(i)==="{"&&n==="}"||e(i)==="<"&&n===">")){if(y.pop(),a.set(i,s),e(i)==="<")w.set(s,i)}}}let O=(s)=>{let n=s;while(["readonly","public","private","protected","static","abstract","override","declare","accessor","get","set","async"].includes(e(n))&&(b(n+1)||o[n+1]?.kind==="quoted"||e(n+1)==="["||/^[0-9]/.test(e(n+1))))n++;if(e(n)==="(")return e((a.get(n)??o.length)+1)===":";if(e(n)==="<")return e((a.get(n)??o.length)+1)==="(";let i=n+1;if(e(n)==="[")i=(a.get(n)??o.length)+1;else if(g.charCodeAt(o[n]?.start??g.length)>=48&&g.charCodeAt(o[n]?.start??g.length)<=57)while(i<o.length&&o[i-1].end===o[i].start&&/^[\da-fxob_e.+-]+$/i.test(e(i)))i++;else if(!b(n)&&o[n]?.kind!=="quoted"&&o[n]?.kind!=="literal")return!1;if(e(i)==="?")i++;if(e(i)==="<")i=(a.get(i)??o.length)+1;return e(i)===":"||e(i)==="("},D=[],A=[];for(let s=0;s<o.length;s++){if(e(s)!=="(")continue;let n=a.get(s);if(n===void 0||!(e(n+1)===":"||e(n+1)==="="&&e(n+2)===">"))continue;let i=new Set,h=s+1;while(h<n){let p=h;while(p<n&&e(p)!==","){let x=a.get(p);if(x!==void 0)p=x+1;else p++}let r=h;while(r<p&&e(r)!==":"&&e(r)!=="="){let x=a.get(r);if(x!==void 0)r=x+1;else r++}let c=h;while([".","public","private","protected","readonly","override"].includes(e(c)))c++;if(e(c)==="{"||e(c)==="[")for(let x of Ge(g.slice(o[c].start,o[r-1].end)))i.add(x);else if(b(c))i.add(e(c));h=p+1}let d=n+(e(n+1)===":"?2:3);while(d<o.length){if(d>n+2&&g.slice(o[d-1].end,o[d].start).includes(`
3
+ `)&&!["|","&","?","extends","keyof","typeof","readonly","new","infer","is"].includes(e(d-1))&&O(d))break;if([";",",",")","]","}"].includes(e(d))||e(d)===">"&&e(d-1)!=="=")break;let p=a.get(d);if(p!==void 0)d=p+1;else d++}D.push({start:s,end:d,names:i});let k=w.get(s-1);if(f&&k!==void 0){let p=new Set,r=k+1;while(r<s-1){while(["const","in","out"].includes(e(r)))r++;if(b(r))p.add(e(r));while(r<s-1&&e(r)!==",")r=(a.get(r)??r)+1;r++}A.push({start:k,end:d,names:p})}}let v=f?new Set:void 0,S=(s)=>{if(!b(s))return;v?.add(o[s].start);let n=e(s);if(!D.some((i)=>s>=i.start&&s<i.end&&i.names.has(n)))u.add(n)},T=(s,n)=>{for(let i=s;i<n;i++){if(e(i)==="<"&&a.has(i)){i=a.get(i);continue}if(!b(i)||e(i-1)==="."||e(i+1)===":")continue;if(["true","false","null","undefined","new","this","super","as","satisfies","typeof","void","keyof"].includes(e(i)))continue;S(i)}};for(let s=0;s<o.length;s++){if(e(s)==="typeof")S(s+1);if(e(s)==="export"){let n=s+1;if(e(n)==="default"){if(!["function","class","abstract"].includes(e(n+1))){if(T(n+1,o.length),b(n+1)&&f?.candidates.has(e(n+1))&&(e(n+2)===";"||n+2===o.length))f.references.add(e(n+1))}continue}let i=e(n)==="type";if(i)n++;if(e(n)==="{"){let h=a.get(n);if(h===void 0||e(h+1)==="from")continue;for(let d=n+1;d<h;){let k=e(d)==="type"&&b(d+1)&&e(d+1)!=="as";if(k)d++;let p=f?.candidates.has(e(d));if(p)f.references.add(e(d));if(!p||!i&&!k)S(d);else v?.add(o[d].start);while(d<h&&e(d)!==",")d++;d++}}}if(e(s)==="["){let n=a.get(s);if(n!==void 0&&[":","?","("].includes(e(n+1))&&e(s+2)!==":"&&e(s+2)!=="in")T(s+1,n)}}if(l.kind==="class"){let s=-1;for(let n=0;n<o.length&&e(n)!=="{";n++)if(e(n)==="<"&&a.has(n))n=a.get(n);else if(e(n)==="extends"){s=n;break}if(s!==-1){let n=s+1;while(n<o.length&&e(n)!=="{"&&e(n)!=="implements"){let i=a.get(n);if(i!==void 0)n=i+1;else n++}T(s+1,n)}}if(f){let s=new Set,n=t(l.generics??""),i=0,h=!1;for(let r of n){let c=(l.generics??"").slice(r.start,r.end);if(["<","(","[","{"].includes(c)){if(i++,c==="<"&&i===1)h=!0}else if([">",")","]","}"].includes(c)&&!(c===">"&&(l.generics??"").slice(r.start-1,r.start)==="="))i--;else if(c===","&&i===1)h=!0;else if(h&&i===1&&r.kind==="word"&&!["const","in","out"].includes(c))s.add(c),h=!1}let d=A.flatMap((r)=>[...r.names].flatMap((c)=>[{index:r.start,name:c,delta:1},{index:r.end,name:c,delta:-1}])).sort((r,c)=>r.index-c.index),k=new Map,p=0;for(let r=0;r<o.length;r++){while(p<d.length&&d[p].index<=r){let M=d[p++];k.set(M.name,(k.get(M.name)??0)+M.delta)}if(!b(r)||v?.has(o[r].start)||!f.candidates.has(e(r))||s.has(e(r))||(k.get(e(r))??0)>0)continue;let c=e(r-1),x=e(r+1);if(c==="."||c==="as"&&l.kind==="export"||["const","let","var","function","class","interface","type","enum","namespace","module"].includes(c))continue;if(x===":"&&c!=="?"||x==="?"&&[":","("].includes(e(r+2))||x==="("||x==="<"&&e((a.get(r+1)??o.length)+1)==="(")continue;f.references.add(e(r))}}}
4
+ export{ft,Gt,V,er,tr,nr};