@dtsx/dtsx 0.11.44 → 0.11.45

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 (210) hide show
  1. package/dist/bin/cli.js +1 -1
  2. package/dist/{chunk-jbxb317g.js → chunk-05cbfytc.js} +6 -6
  3. package/dist/{chunk-6mryvpxj.js → chunk-1gy2z5an.js} +5 -5
  4. package/dist/{chunk-ns44qxdd.js → chunk-2cjs4r5v.js} +4 -4
  5. package/dist/chunk-3nmjt94q.js +10 -0
  6. package/dist/{chunk-q45jkpya.js → chunk-3x19egjd.js} +2 -2
  7. package/dist/chunk-41d5ehn0.js +3 -0
  8. package/dist/{chunk-9qv34ymq.js → chunk-48jvmndg.js} +2 -2
  9. package/dist/{chunk-vz4fc70e.js → chunk-4fspqk22.js} +3 -3
  10. package/dist/chunk-4t1we2h5.js +3 -0
  11. package/dist/chunk-4vtfqwpq.js +8 -0
  12. package/dist/{chunk-7krb9b1s.js → chunk-51vf9de8.js} +2 -2
  13. package/dist/{chunk-8v43ne8p.js → chunk-55yw66ha.js} +3 -3
  14. package/dist/{chunk-s7k223zx.js → chunk-57xvwm7c.js} +2 -2
  15. package/dist/{chunk-th9tcxga.js → chunk-587w6ktw.js} +2 -2
  16. package/dist/{chunk-sqnhxtbk.js → chunk-6gvctv0q.js} +3 -3
  17. package/dist/{chunk-mjzee617.js → chunk-755bntty.js} +17 -17
  18. package/dist/{chunk-hnckev96.js → chunk-783erq83.js} +4 -4
  19. package/dist/{chunk-7ez7gynw.js → chunk-7x4eqjfw.js} +2 -2
  20. package/dist/chunk-83w2qbmb.js +3 -0
  21. package/dist/{chunk-gma09qy6.js → chunk-870p7sky.js} +2 -2
  22. package/dist/{chunk-mhyqvwcg.js → chunk-8c5dzvwk.js} +3 -3
  23. package/dist/{chunk-3eb0gc0y.js → chunk-8c8pgvxv.js} +1 -1
  24. package/dist/{chunk-an5ra7tr.js → chunk-8xpkce3g.js} +4 -4
  25. package/dist/chunk-8zr7m1pk.js +3 -0
  26. package/dist/{chunk-cgaw8fsn.js → chunk-9knxvphg.js} +3 -3
  27. package/dist/{chunk-3shq1bjr.js → chunk-a4791583.js} +2 -2
  28. package/dist/chunk-b3979d26.js +3 -0
  29. package/dist/{chunk-yqvn592m.js → chunk-b7azvfdn.js} +2 -2
  30. package/dist/{chunk-4hkf7dda.js → chunk-bv1q1w42.js} +4 -4
  31. package/dist/{chunk-5aqwt0a0.js → chunk-c94sk67h.js} +4 -4
  32. package/dist/chunk-cd27mg71.js +3 -0
  33. package/dist/{chunk-932kxt70.js → chunk-d5q4qfys.js} +4 -4
  34. package/dist/{chunk-2y5b6hdw.js → chunk-e9x8ywhv.js} +6 -6
  35. package/dist/{chunk-m3y5knzq.js → chunk-exf6bsbe.js} +5 -5
  36. package/dist/{chunk-waan03ga.js → chunk-f191378r.js} +11 -11
  37. package/dist/{chunk-ka22zwye.js → chunk-f3avgz4y.js} +8 -8
  38. package/dist/chunk-fkdq1x5f.js +31 -0
  39. package/dist/{chunk-xgf6djk3.js → chunk-g9emajpc.js} +2 -2
  40. package/dist/{chunk-g4rmn34j.js → chunk-gns23mhj.js} +2 -2
  41. package/dist/{chunk-mfp35a3b.js → chunk-grpmcw9x.js} +15 -15
  42. package/dist/{chunk-vgyjw95e.js → chunk-gwsjj23d.js} +4 -4
  43. package/dist/{chunk-3rwbf45t.js → chunk-hgg4aqvf.js} +2 -2
  44. package/dist/{chunk-nek63555.js → chunk-hvt855ms.js} +2 -2
  45. package/dist/chunk-hzy5z7x2.js +5 -0
  46. package/dist/chunk-j51p30sb.js +7 -0
  47. package/dist/{chunk-vv8e8pa3.js → chunk-jy5h728q.js} +2 -2
  48. package/dist/chunk-k0vthrqs.js +4 -0
  49. package/dist/{chunk-9etacmfx.js → chunk-kthga8ar.js} +3 -3
  50. package/dist/{chunk-h1xwd278.js → chunk-m14550z9.js} +2 -2
  51. package/dist/{chunk-2d3nbfth.js → chunk-m29ph3cg.js} +2 -2
  52. package/dist/{chunk-eptz3q7r.js → chunk-m8rvd58d.js} +4 -4
  53. package/dist/{chunk-zp93zcn5.js → chunk-mc9kwthm.js} +2 -2
  54. package/dist/chunk-mvxcxnff.js +3 -0
  55. package/dist/chunk-nfd9v8ba.js +3 -0
  56. package/dist/{chunk-6pr23q72.js → chunk-pydpyx8x.js} +2 -2
  57. package/dist/{chunk-c8s4d7qk.js → chunk-qab5rsk8.js} +6 -6
  58. package/dist/{chunk-dzdwc2fh.js → chunk-qj2yvdjn.js} +2 -2
  59. package/dist/{chunk-cjhmmqxd.js → chunk-qkesb95f.js} +2 -2
  60. package/dist/{chunk-der2ssgq.js → chunk-r2e0r0pd.js} +2 -2
  61. package/dist/chunk-s013113f.js +3 -0
  62. package/dist/chunk-s6t0ff96.js +3 -0
  63. package/dist/chunk-sqa3ke1a.js +3 -0
  64. package/dist/{chunk-k5wz43yh.js → chunk-srfpcjtn.js} +2 -2
  65. package/dist/{chunk-59jw51gg.js → chunk-t1js8enq.js} +5 -5
  66. package/dist/{chunk-rka9z03a.js → chunk-t73v233w.js} +4 -4
  67. package/dist/chunk-t76htvct.js +3 -0
  68. package/dist/{chunk-g19c3m7s.js → chunk-t88j01sz.js} +2 -2
  69. package/dist/chunk-vher6t7j.js +14 -0
  70. package/dist/{chunk-7x9tawkf.js → chunk-vrfp12ts.js} +2 -2
  71. package/dist/{chunk-qevb6d6j.js → chunk-vye45h9n.js} +2 -2
  72. package/dist/{chunk-cynfv4dt.js → chunk-wwjt0p6m.js} +3 -3
  73. package/dist/{chunk-9hjd6p38.js → chunk-x5z8vprh.js} +2 -2
  74. package/dist/{chunk-ehgnwdn9.js → chunk-x6ddycvm.js} +2 -2
  75. package/dist/chunk-x9vpsya2.js +40 -0
  76. package/dist/chunk-xhgs3gx2.js +4 -0
  77. package/dist/chunk-xtckj8w1.js +3 -0
  78. package/dist/{chunk-0cynxv6w.js → chunk-xvk9v148.js} +2 -2
  79. package/dist/chunk-y9bxeq10.js +3 -0
  80. package/dist/{chunk-vxghzchm.js → chunk-ybdp7k49.js} +3 -3
  81. package/dist/{chunk-d0aqaj02.js → chunk-yh04e0n4.js} +2 -2
  82. package/dist/{chunk-65d3dga1.js → chunk-z82jsz2r.js} +3 -3
  83. package/dist/{chunk-ptbd3dac.js → chunk-zb48dx6a.js} +2 -2
  84. package/dist/chunk-zmnb3yg1.js +37 -0
  85. package/dist/{chunk-njqzhkzy.js → chunk-zwcvtbt4.js} +10 -10
  86. package/dist/src/augmentation-graph.js +1 -1
  87. package/dist/src/binding-patterns.js +1 -1
  88. package/dist/src/branded-types.js +1 -1
  89. package/dist/src/bundle-linker.js +1 -1
  90. package/dist/src/bundler.js +1 -1
  91. package/dist/src/cache.js +1 -1
  92. package/dist/src/call-signatures.js +1 -1
  93. package/dist/src/circular.js +1 -1
  94. package/dist/src/compat.js +1 -1
  95. package/dist/src/computed-keys.js +1 -1
  96. package/dist/src/concurrency.js +1 -1
  97. package/dist/src/config.js +1 -1
  98. package/dist/src/dangling-refs.js +1 -1
  99. package/dist/src/declaration-project.js +1 -1
  100. package/dist/src/declaration-publication.js +1 -1
  101. package/dist/src/declaration-references.js +1 -1
  102. package/dist/src/diff.js +1 -1
  103. package/dist/src/docs.js +1 -1
  104. package/dist/src/enum-declarations.js +1 -1
  105. package/dist/src/errors.js +1 -1
  106. package/dist/src/extractor/directives.js +1 -1
  107. package/dist/src/extractor/extract.d.ts +1 -1
  108. package/dist/src/extractor/extract.js +1 -1
  109. package/dist/src/extractor/scanner.d.ts +4 -4
  110. package/dist/src/extractor/scanner.js +1 -1
  111. package/dist/src/extractor.js +1 -1
  112. package/dist/src/formats.js +1 -1
  113. package/dist/src/formatter.js +1 -1
  114. package/dist/src/function-properties.js +1 -1
  115. package/dist/src/generator.js +1 -1
  116. package/dist/src/global-types.js +1 -1
  117. package/dist/src/import-sorter.js +1 -1
  118. package/dist/src/incremental.js +1 -1
  119. package/dist/src/index.js +1 -1
  120. package/dist/src/inferred-imports.js +1 -1
  121. package/dist/src/initializer-type-spans.d.ts +7 -0
  122. package/dist/src/initializer-type-spans.js +2 -0
  123. package/dist/src/json-config.js +1 -1
  124. package/dist/src/lexical.d.ts +8 -1
  125. package/dist/src/lexical.js +1 -1
  126. package/dist/src/logger.js +1 -1
  127. package/dist/src/lsp.js +1 -1
  128. package/dist/src/memory.js +1 -1
  129. package/dist/src/merger.js +1 -1
  130. package/dist/src/module-graph.js +1 -1
  131. package/dist/src/module-references.js +1 -1
  132. package/dist/src/native-checker.js +1 -1
  133. package/dist/src/native-engine.js +1 -1
  134. package/dist/src/native-extractor.js +1 -1
  135. package/dist/src/native-generation.js +1 -1
  136. package/dist/src/native-project.js +1 -1
  137. package/dist/src/numeric-literals.d.ts +9 -0
  138. package/dist/src/numeric-literals.js +2 -0
  139. package/dist/src/optimizer.js +1 -1
  140. package/dist/src/output-normalizer.js +1 -1
  141. package/dist/src/parallel-processor.js +1 -1
  142. package/dist/src/parameters.js +1 -1
  143. package/dist/src/parser.js +1 -1
  144. package/dist/src/plugins/bun.js +1 -1
  145. package/dist/src/plugins/esbuild.js +1 -1
  146. package/dist/src/plugins/index.js +1 -1
  147. package/dist/src/plugins/tsdown.js +1 -1
  148. package/dist/src/plugins/tsup.js +1 -1
  149. package/dist/src/plugins/vite.js +1 -1
  150. package/dist/src/plugins/webpack.js +1 -1
  151. package/dist/src/plugins.js +1 -1
  152. package/dist/src/process-source.d.ts +1 -1
  153. package/dist/src/process-source.js +1 -1
  154. package/dist/src/processor/cache.js +1 -1
  155. package/dist/src/processor/comments.js +1 -1
  156. package/dist/src/processor/declarations.js +1 -1
  157. package/dist/src/processor/import-usage.js +1 -1
  158. package/dist/src/processor/imports.js +1 -1
  159. package/dist/src/processor/index.js +1 -1
  160. package/dist/src/processor/type-inference.d.ts +2 -9
  161. package/dist/src/processor/type-inference.js +1 -1
  162. package/dist/src/processor.js +1 -1
  163. package/dist/src/profiling.js +1 -1
  164. package/dist/src/return-type-scope.js +1 -1
  165. package/dist/src/security.js +1 -1
  166. package/dist/src/source-cache.js +1 -1
  167. package/dist/src/sourcemap.js +1 -1
  168. package/dist/src/stx.js +1 -1
  169. package/dist/src/syntax-validator.js +1 -1
  170. package/dist/src/tracking.js +1 -1
  171. package/dist/src/transformers.js +1 -1
  172. package/dist/src/tree-shaker.js +1 -1
  173. package/dist/src/tsconfig.js +1 -1
  174. package/dist/src/type-mappings.js +1 -1
  175. package/dist/src/utils.js +1 -1
  176. package/dist/src/value-inference.js +1 -1
  177. package/dist/src/vue.js +1 -1
  178. package/dist/src/watcher.js +1 -1
  179. package/dist/src/worker-thread.js +1 -1
  180. package/dist/src/worker.js +1 -1
  181. package/dist/src/workspace.js +1 -1
  182. package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
  183. package/native/darwin-x64/libzig-dtsx.dylib +0 -0
  184. package/native/freebsd-x64/libzig-dtsx.so +0 -0
  185. package/native/linux-arm64/libzig-dtsx.so +0 -0
  186. package/native/linux-x64/libzig-dtsx.so +0 -0
  187. package/native/windows-x64/zig-dtsx.dll +0 -0
  188. package/package.json +1 -1
  189. package/dist/chunk-1hz6j7bq.js +0 -37
  190. package/dist/chunk-3v0yh5dk.js +0 -3
  191. package/dist/chunk-4ece5g8t.js +0 -3
  192. package/dist/chunk-86xvq8km.js +0 -4
  193. package/dist/chunk-90f37xen.js +0 -3
  194. package/dist/chunk-976r899s.js +0 -10
  195. package/dist/chunk-anvhqbw8.js +0 -3
  196. package/dist/chunk-btmc3e8d.js +0 -3
  197. package/dist/chunk-d68r83t9.js +0 -3
  198. package/dist/chunk-erymqkk3.js +0 -14
  199. package/dist/chunk-hwgxwgsh.js +0 -4
  200. package/dist/chunk-hyszyzq2.js +0 -3
  201. package/dist/chunk-m2kzh519.js +0 -3
  202. package/dist/chunk-madfh88z.js +0 -3
  203. package/dist/chunk-mhz6xe61.js +0 -7
  204. package/dist/chunk-nxk4h5hy.js +0 -3
  205. package/dist/chunk-q4ebd4qe.js +0 -8
  206. package/dist/chunk-v3n9zzhm.js +0 -5
  207. package/dist/chunk-x1j88x37.js +0 -38
  208. package/dist/chunk-xa9vcbjj.js +0 -3
  209. package/dist/chunk-xb2nr89a.js +0 -3
  210. package/dist/chunk-ykrdzatr.js +0 -31
@@ -1,21 +1,21 @@
1
1
  // @bun
2
- function R(n){return n.endsWith(".vue")}function ha(n){let i={script:null,scriptSetup:null},e=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,s;while((s=e.exec(n))!==null){let t=s[1]||"",r=/lang\s*=\s*["']([^"']+)["']/i.exec(t)?.[1]?.toLowerCase()??"js",l={content:s[2]??"",attrs:t,setup:/\bsetup\b/.test(t),lang:r};if(l.setup)i.scriptSetup=l;else i.script=l}return i}function h(n,i){let e=n[i];i++;while(i<n.length){let s=n[i];if(s==="\\"){i+=2;continue}if(s===e)return i+1;i++}return i}function d(n,i){i++;let e=0;while(i<n.length){let s=n[i];if(s==="\\"){i+=2;continue}if(s==="`"&&e===0)return i+1;if(s==="$"&&n[i+1]==="{"){e++,i+=2;continue}if(s==="}"){if(e>0)e--;i++;continue}i++}return i}function b(n,i){if(n[i+1]==="/"){let e=n.indexOf(`
3
- `,i+2);return e===-1?n.length:e+1}if(n[i+1]==="*"){let e=n.indexOf("*/",i+2);return e===-1?n.length:e+2}return i+1}function Dt(n,i){let e=n[i];if(e==='"'||e==="'")return h(n,i);if(e==="`")return d(n,i);if(e==="/"&&(n[i+1]==="/"||n[i+1]==="*"))return b(n,i);return i}function Pt(n){let i=n.split(""),e=0;while(e<n.length){let s=Dt(n,e);if(s>e){for(let t=e;t<s;t++)if(i[t]!==`
4
- `&&i[t]!=="\r")i[t]=" ";e=s;continue}e++}return i.join("")}function a(n,i,e,s){let t=0,r=i;while(r<n.length){let l=n[r];if(l==='"'||l==="'"){r=h(n,r);continue}if(l==="`"){r=d(n,r);continue}if(l==="/"&&(n[r+1]==="/"||n[r+1]==="*")){r=b(n,r);continue}if(l===e)t++;else if(l===s){if(t--,t===0)return r}r++}return-1}function W(n,i){let e=0,s=i;while(s<n.length){let t=n[s];if(t==='"'||t==="'"){s=h(n,s);continue}if(t==="`"){s=d(n,s);continue}if(t==="/"&&(n[s+1]==="/"||n[s+1]==="*")){s=b(n,s);continue}if(t==="="&&n[s+1]===">"){s+=2;continue}if(t==="<")e++;else if(t===">"){if(e--,e===0)return s}s++}return-1}function S(n,i=","){let e=[],s=0,t="",r=0;while(r<n.length){let l=n[r];if(l==='"'||l==="'"){let u=h(n,r);t+=n.slice(r,u),r=u;continue}if(l==="`"){let u=d(n,r);t+=n.slice(r,u),r=u;continue}if(l==="/"&&(n[r+1]==="/"||n[r+1]==="*")){r=b(n,r);continue}if(l==="{"||l==="["||l==="("||l==="<")s++;else if(l==="}"||l==="]"||l===")"||l===">")s--;if(l===i&&s===0){e.push(t),t="",r++;continue}t+=l,r++}if(t.trim()!=="")e.push(t);return e}function O(n){let i=n.trim();if(!i.startsWith("{"))return[];let e=a(i,0,"{","}");if(e===-1)return[];let s=i.slice(1,e),t=[];for(let r of S(s)){let l=-1,u=0;for(let p=0;p<r.length;p++){let c=r[p];if(c==='"'||c==="'"){p=h(r,p)-1;continue}if(c==="`"){p=d(r,p)-1;continue}if(c==="{"||c==="["||c==="("||c==="<")u++;else if(c==="}"||c==="]"||c===")"||c===">")u--;else if(c===":"&&u===0){l=p;break}}if(l!==-1){t.push({key:E(r.slice(0,l).trim()),value:r.slice(l+1).trim(),isMethod:!1});continue}let o=/^([A-Za-z_$][\w$]*|['"][^'"]+['"])\s*\(/.exec(r.trim());if(o){t.push({key:E(o[1]),value:r.trim(),isMethod:!0});continue}let f=r.trim();if(f)t.push({key:E(f),value:"",isMethod:!1})}return t}function E(n){if(n.startsWith("'")&&n.endsWith("'")||n.startsWith('"')&&n.endsWith('"'))return n.slice(1,-1);return n}function k(n){return/^[A-Za-z_$][\w$]*$/.test(n)?n:JSON.stringify(n)}function Pe(n,i){let e=new RegExp(`\\b${i}\\b`,"g"),s;while((s=e.exec(n))!==null){let t=s.index+s[0].length;while(t<n.length&&/\s/.test(n[t]))t++;let r=null;if(n[t]==="<"){let o=W(n,t);if(o===-1)return null;r=n.slice(t+1,o).trim(),t=o+1;while(t<n.length&&/\s/.test(n[t]))t++}if(n[t]!=="(")continue;let l=a(n,t,"(",")");if(l===-1)return null;let u=S(n.slice(t+1,l));return{generic:r,arg:u.length>0?u[0].trim():null}}return null}function x(n,i){let e=L(n,i);if(!e)return null;return e.kind==="interface"?n.slice(e.bodyStart,e.end):n.slice(e.bodyStart,e.end).trim()}function L(n,i){let s=new RegExp(`\\binterface\\s+${i}\\b[^{]*\\{`,"m").exec(n);if(s){let l=s.index+s[0].length-1,u=a(n,l,"{","}");if(u!==-1)return{kind:"interface",start:s.index,end:u+1,bodyStart:l}}let r=new RegExp(`\\btype\\s+${i}\\b[^=]*=`,"m").exec(n);if(r){let l=r.index+r[0].length,u=0,o=l;while(l<n.length){let f=n[l];if(f==='"'||f==="'"){l=h(n,l);continue}if(f==="`"){l=d(n,l);continue}if(f==="{"||f==="["||f==="("||f==="<")u++;else if(f==="}"||f==="]"||f===")"||f===">")u--;else if((f===";"||f===`
5
- `)&&u===0)break;l++}return{kind:"type",start:r.index,end:l,bodyStart:o}}return null}var C={String:"string",Number:"number",Boolean:"boolean",Array:"unknown[]",Object:"Record<string, unknown>",Function:"(...args: any[]) => any",Symbol:"symbol",Promise:"Promise<unknown>",Date:"Date",BigInt:"bigint"};function V(n){let i=n.search(/\bas\s+PropType\s*</);if(i===-1)return null;let e=n.indexOf("<",i),s=W(n,e);if(s===-1)return null;if(n.slice(s+1).trim()!=="")return null;return n.slice(e+1,s).trim()}function T(n){let i=n.trim(),e=V(i);if(e!==null)return{type:e,optional:!0};if(i==="null")return{type:"unknown",optional:!0};if(i.startsWith("[")){let s=a(i,0,"[","]");if(s!==-1){let t=S(i.slice(1,s)).map((r)=>T(r).type).filter((r)=>r!=="unknown");return{type:t.length>0?[...new Set(t)].join(" | "):"unknown",optional:!0}}}if(i.startsWith("{")){let s=O(i),t=s.find((o)=>o.key==="type"),r=s.find((o)=>o.key==="required"),l=t?T(t.value).type:"unknown",u=!(r&&r.value.trim()==="true");return{type:l,optional:u}}if(C[i])return{type:C[i],optional:!0};if(/^[A-Za-z_$][\w$.]*$/.test(i))return{type:i,optional:!0};return{type:"unknown",optional:!0}}function tt(n){let i=n.trim();if(i.startsWith("{")){let e=O(i);if(e.length===0)return"{}";return`{ ${e.map((t)=>{if(t.isMethod||t.value==="")return`${k(t.key)}?: unknown`;let r=T(t.value);return`${k(t.key)}${r.optional?"?":""}: ${r.type}`}).join(", ")} }`}if(i.startsWith("[")){let e=a(i,0,"[","]");if(e===-1)return null;let s=S(i.slice(1,e)).map((t)=>E(t.trim())).filter((t)=>t!=="");if(s.length===0)return"{}";return`{ ${s.map((t)=>`${k(t)}?: unknown`).join(", ")} }`}return null}function A(n){let i=n.trim();if(!i.startsWith("["))return null;let e=a(i,0,"[","]");if(e===-1)return null;let s=S(i.slice(1,e)).map((t)=>t.trim());if(s.length===0)return"{}";if(!s.every((t)=>t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')))return"string[]";return`[${s.map((t)=>JSON.stringify(E(t))).join(", ")}]`}function D(n){let i=n.trim();if(!i.startsWith("{"))return null;let e=O(i);if(e.length===0)return"{}";return`{ ${e.map((t)=>`${JSON.stringify(t.key)}: (...args: any[]) => void`).join(", ")} }`}function P(n){return A(n)??D(n)}function I(n){let i=[],e=0,s="",t=0;while(t<n.length){let r=n[t];if(r==='"'||r==="'"){let l=h(n,t);s+=n.slice(t,l),t=l;continue}if(r==="`"){let l=d(n,t);s+=n.slice(t,l),t=l;continue}if(r==="/"&&(n[t+1]==="/"||n[t+1]==="*")){let l=b(n,t);s+=n.slice(t,l),t=l;continue}if(r==="="&&n[t+1]===">"){s+="=>",t+=2;continue}if(r==="{"||r==="["||r==="("||r==="<")e++;else if(r==="}"||r==="]"||r===")"||r===">")e--;if((r===";"||r===","||r===`
6
- `)&&e===0){if(s.trim()!=="")i.push(s.trim());s="",t++;continue}s+=r,t++}if(s.trim()!=="")i.push(s.trim());return i}function N(n){let i=n.trim();if(!i.startsWith("{"))return null;let e=a(i,0,"{","}");if(e===-1||i.slice(e+1).trim()!=="")return null;let s=I(i.slice(1,e));if(s.length===0)return"{}";let t=[];for(let r of s){let l=/^\(\s*\w+\s*:\s*/.exec(r);if(!l)return null;let u=l[0].length,o=r[u];if(o!=="'"&&o!=='"'&&o!=="`")return null;let f=h(r,u),p=r.slice(u+1,f-1),c=a(r,r.indexOf("(",0),"(",")");if(c===-1)return null;let m=r.slice(u,c),w=S(m).slice(1),g=r.slice(c+1).trim();if(g.startsWith(":"))g=g.slice(1).trim();if(g==="")g="void";t.push(`${JSON.stringify(p)}: (${w.map((v)=>v.trim()).join(", ")}) => ${g}`)}return`{ ${t.join(", ")} }`}function Rt(n){let i=n;for(let e of["defineProps","defineEmits","defineExpose","defineSlots","defineOptions"])i=z(i,e);return i}function z(n,i){let e=new RegExp(`\\b${i}\\b`,"g"),s=[],t=n,r;while((r=e.exec(n))!==null){let l=n.lastIndexOf(`
7
- `,r.index)+1,u=n.slice(l,r.index),o=/^\s*(?:(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*(?::[^=]+)?=\s*)?(withDefaults\s*\(\s*)?$/.exec(u);if(!o)continue;let f=r.index+r[0].length;while(f<n.length&&/\s/.test(n[f]))f++;if(n[f]==="<"){let m=W(n,f);if(m===-1)continue;f=m+1;while(f<n.length&&/\s/.test(n[f]))f++}if(n[f]!=="(")continue;let p=a(n,f,"(",")");if(p===-1)continue;if(o[1]){let m=l+u.length-o[1].length,w=n.indexOf("(",m);if(w!==-1){let g=a(n,w,"(",")");if(g!==-1)p=g}}let c=p+1;while(c<n.length&&n[c]!==`
8
- `&&/\s|;/.test(n[c]))c++;if(n[c]===`
9
- `)c++;s.push([l,c])}for(let l=s.length-1;l>=0;l--)t=t.slice(0,s[l][0])+t.slice(s[l][1]);return t}function Mt(n){let i=Z(n);if(i!==-1){let e=/^export\s+default\b/.exec(n.slice(i))?.[0];if(!e)return{options:null,script:n,passthrough:!1};let s=i+e.length;while(s<n.length&&/\s/.test(n[s]))s++;let t=-1,r=-1,l=-1;if(n[s]==="{")t=s,r=a(n,s,"{","}"),l=r;else if(n.startsWith("defineComponent",s)){let f=n.indexOf("(",s);if(f!==-1){let p=f+1;while(p<n.length&&/\s/.test(n[p]))p++;if(n[p]==="{")t=p,r=a(n,p,"{","}"),l=a(n,f,"(",")")}}if(t===-1||r===-1||l===-1)return{options:null,script:n,passthrough:!0};let u=l+1;if(n[u]===";")u++;let o=(n.slice(0,i)+n.slice(u)).trim();return{options:n.slice(t,r+1),script:o,passthrough:!1}}return{options:null,script:n,passthrough:!1}}function Z(n){let i=0,e=0;while(e<n.length){let s=n[e];if(s==='"'||s==="'"){e=h(n,e);continue}if(s==="`"){e=d(n,e);continue}if(s==="/"&&(n[e+1]==="/"||n[e+1]==="*")){e=b(n,e);continue}if(s==="{"||s==="["||s==="(")i++;else if(s==="}"||s==="]"||s===")")i=Math.max(0,i-1);else if(i===0&&n.startsWith("export",e)){let t=e===0?"":n[e-1],r=n[e+6]??"";if(!/[\w$]/.test(t)&&!/[\w$]/.test(r)){if(/^export\s+default\b/.exec(n.slice(e)))return e}}e++}return-1}function nt(n,i){let e=O(n).find((s)=>s.key===i);return e&&e.value!==""?e.value:null}function rt(n,i){let e=q(n),s=n;for(let t=e.length-1;t>=0;t--){let r=e[t],l=s.slice(0,r.start)+s.slice(r.end);if(B(l,r.name))continue;if(new RegExp(`\\btypeof\\s+${r.name}\\b`).test(i))continue;s=l}return s}function B(n,i){let e=0;while(e<n.length){let s=n[e];if(s==='"'||s==="'"){e=h(n,e);continue}if(s==="`"){e=d(n,e);continue}if(s==="/"&&(n[e+1]==="/"||n[e+1]==="*")){e=b(n,e);continue}if(/[A-Za-z_$]/.test(s)){let t=e+1;while(t<n.length&&/[\w$]/.test(n[t]))t++;if(n.slice(e,t)===i)return!0;e=t;continue}e++}return!1}function q(n){let i=[],e=J(n),s=/^[ \t]*(const|let|var|(?:async[ \t]+)?function)[ \t]+([A-Za-z_$][\w$]*)[ \t]*(?::[^=\n]+)?=?/gm,t;while((t=s.exec(n))!==null){let r=n.lastIndexOf(`
10
- `,t.index)+1;if(!e.has(r))continue;if(/\bexport\b/.test(n.slice(r,t.index)))continue;let l=t[1],u=t[2],o=t.index+t[0].length,f=-1;if(l.endsWith("function")){let p=n.indexOf("(",o);if(p===-1)continue;let c=a(n,p,"(",")");if(c===-1)continue;o=c+1;while(o<n.length&&/\s/.test(n[o]))o++;if(n[o]===":")while(o<n.length&&n[o]!=="{"&&n[o]!==`
2
+ function L(n){return n.endsWith(".vue")}function wa(n){let i={script:null,scriptSetup:null},e=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,s;while((s=e.exec(n))!==null){let t=s[1]||"",r=/lang\s*=\s*["']([^"']+)["']/i.exec(t)?.[1]?.toLowerCase()??"js",l={content:s[2]??"",attrs:t,setup:/\bsetup\b/.test(t),lang:r};if(l.setup)i.scriptSetup=l;else i.script=l}return i}function h(n,i){let e=n[i];i++;while(i<n.length){let s=n[i];if(s==="\\"){i+=2;continue}if(s===e)return i+1;i++}return i}function d(n,i){i++;let e=0;while(i<n.length){let s=n[i];if(s==="\\"){i+=2;continue}if(s==="`"&&e===0)return i+1;if(s==="$"&&n[i+1]==="{"){e++,i+=2;continue}if(s==="}"){if(e>0)e--;i++;continue}i++}return i}function b(n,i){if(n[i+1]==="/"){let e=n.indexOf(`
3
+ `,i+2);return e===-1?n.length:e+1}if(n[i+1]==="*"){let e=n.indexOf("*/",i+2);return e===-1?n.length:e+2}return i+1}function Ot(n,i){let e=n[i];if(e==='"'||e==="'")return h(n,i);if(e==="`")return d(n,i);if(e==="/"&&(n[i+1]==="/"||n[i+1]==="*"))return b(n,i);return i}function It(n){let i=n.split(""),e=0;while(e<n.length){let s=Ot(n,e);if(s>e){for(let t=e;t<s;t++)if(i[t]!==`
4
+ `&&i[t]!=="\r")i[t]=" ";e=s;continue}e++}return i.join("")}function c(n,i,e,s){let t=0,r=i;while(r<n.length){let l=n[r];if(l==='"'||l==="'"){r=h(n,r);continue}if(l==="`"){r=d(n,r);continue}if(l==="/"&&(n[r+1]==="/"||n[r+1]==="*")){r=b(n,r);continue}if(l===e)t++;else if(l===s){if(t--,t===0)return r}r++}return-1}function W(n,i){let e=0,s=i;while(s<n.length){let t=n[s];if(t==='"'||t==="'"){s=h(n,s);continue}if(t==="`"){s=d(n,s);continue}if(t==="/"&&(n[s+1]==="/"||n[s+1]==="*")){s=b(n,s);continue}if(t==="="&&n[s+1]===">"){s+=2;continue}if(t==="<")e++;else if(t===">"){if(e--,e===0)return s}s++}return-1}function S(n,i=","){let e=[],s=0,t="",r=0;while(r<n.length){let l=n[r];if(l==='"'||l==="'"){let u=h(n,r);t+=n.slice(r,u),r=u;continue}if(l==="`"){let u=d(n,r);t+=n.slice(r,u),r=u;continue}if(l==="/"&&(n[r+1]==="/"||n[r+1]==="*")){r=b(n,r);continue}if(l==="{"||l==="["||l==="("||l==="<")s++;else if(l==="}"||l==="]"||l===")"||l===">")s--;if(l===i&&s===0){e.push(t),t="",r++;continue}t+=l,r++}if(t.trim()!=="")e.push(t);return e}function O(n){let i=n.trim();if(!i.startsWith("{"))return[];let e=c(i,0,"{","}");if(e===-1)return[];let s=i.slice(1,e),t=[];for(let r of S(s)){let l=-1,u=0;for(let p=0;p<r.length;p++){let f=r[p];if(f==='"'||f==="'"){p=h(r,p)-1;continue}if(f==="`"){p=d(r,p)-1;continue}if(f==="{"||f==="["||f==="("||f==="<")u++;else if(f==="}"||f==="]"||f===")"||f===">")u--;else if(f===":"&&u===0){l=p;break}}if(l!==-1){t.push({key:E(r.slice(0,l).trim()),value:r.slice(l+1).trim(),isMethod:!1});continue}let o=/^([A-Za-z_$][\w$]*|['"][^'"]+['"])\s*\(/.exec(r.trim());if(o){t.push({key:E(o[1]),value:r.trim(),isMethod:!0});continue}let a=r.trim();if(a)t.push({key:E(a),value:"",isMethod:!1})}return t}function E(n){if(n.startsWith("'")&&n.endsWith("'")||n.startsWith('"')&&n.endsWith('"'))return n.slice(1,-1);return n}function k(n){return/^[A-Za-z_$][\w$]*$/.test(n)?n:JSON.stringify(n)}function Ne(n,i){let e=new RegExp(`\\b${i}\\b`,"g"),s;while((s=e.exec(n))!==null){let t=s.index+s[0].length;while(t<n.length&&/\s/.test(n[t]))t++;let r=null;if(n[t]==="<"){let o=W(n,t);if(o===-1)return null;r=n.slice(t+1,o).trim(),t=o+1;while(t<n.length&&/\s/.test(n[t]))t++}if(n[t]!=="(")continue;let l=c(n,t,"(",")");if(l===-1)return null;let u=S(n.slice(t+1,l));return{generic:r,arg:u.length>0?u[0].trim():null}}return null}function P(n,i){let e=M(n,i);if(!e)return null;return e.kind==="interface"?n.slice(e.bodyStart,e.end):n.slice(e.bodyStart,e.end).trim()}function M(n,i){let s=new RegExp(`\\binterface\\s+${i}\\b[^{]*\\{`,"m").exec(n);if(s){let l=s.index+s[0].length-1,u=c(n,l,"{","}");if(u!==-1)return{kind:"interface",start:s.index,end:u+1,bodyStart:l}}let r=new RegExp(`\\btype\\s+${i}\\b[^=]*=`,"m").exec(n);if(r){let l=r.index+r[0].length,u=0,o=l;while(l<n.length){let a=n[l];if(a==='"'||a==="'"){l=h(n,l);continue}if(a==="`"){l=d(n,l);continue}if(a==="{"||a==="["||a==="("||a==="<")u++;else if(a==="}"||a==="]"||a===")"||a===">")u--;else if((a===";"||a===`
5
+ `)&&u===0)break;l++}return{kind:"type",start:r.index,end:l,bodyStart:o}}return null}var C={String:"string",Number:"number",Boolean:"boolean",Array:"unknown[]",Object:"Record<string, unknown>",Function:"(...args: any[]) => any",Symbol:"symbol",Promise:"Promise<unknown>",Date:"Date",BigInt:"bigint"};function x(n){let i=n.search(/\bas\s+PropType\s*</);if(i===-1)return null;let e=n.indexOf("<",i),s=W(n,e);if(s===-1)return null;if(n.slice(s+1).trim()!=="")return null;return n.slice(e+1,s).trim()}function T(n){let i=n.trim(),e=x(i);if(e!==null)return{type:e,optional:!0};if(i==="null")return{type:"unknown",optional:!0};if(i.startsWith("[")){let s=c(i,0,"[","]");if(s!==-1){let t=S(i.slice(1,s)).map((r)=>T(r).type).filter((r)=>r!=="unknown");return{type:t.length>0?[...new Set(t)].join(" | "):"unknown",optional:!0}}}if(i.startsWith("{")){let s=O(i),t=s.find((o)=>o.key==="type"),r=s.find((o)=>o.key==="required"),l=t?T(t.value).type:"unknown",u=!(r&&r.value.trim()==="true");return{type:l,optional:u}}if(C[i])return{type:C[i],optional:!0};if(/^[A-Za-z_$][\w$.]*$/.test(i))return{type:i,optional:!0};return{type:"unknown",optional:!0}}function ot(n){let i=n.trim();if(i.startsWith("{")){let e=O(i);if(e.length===0)return"{}";return`{ ${e.map((t)=>{if(t.isMethod||t.value==="")return`${k(t.key)}?: unknown`;let r=T(t.value);return`${k(t.key)}${r.optional?"?":""}: ${r.type}`}).join(", ")} }`}if(i.startsWith("[")){let e=c(i,0,"[","]");if(e===-1)return null;let s=S(i.slice(1,e)).map((t)=>E(t.trim())).filter((t)=>t!=="");if(s.length===0)return"{}";return`{ ${s.map((t)=>`${k(t)}?: unknown`).join(", ")} }`}return null}function V(n){let i=n.trim();if(!i.startsWith("["))return null;let e=c(i,0,"[","]");if(e===-1)return null;let s=S(i.slice(1,e)).map((t)=>t.trim());if(s.length===0)return"{}";if(!s.every((t)=>t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')))return"string[]";return`[${s.map((t)=>JSON.stringify(E(t))).join(", ")}]`}function A(n){let i=n.trim();if(!i.startsWith("{"))return null;let e=O(i);if(e.length===0)return"{}";return`{ ${e.map((t)=>`${JSON.stringify(t.key)}: (...args: any[]) => void`).join(", ")} }`}function R(n){return V(n)??A(n)}function D(n){let i=[],e=0,s="",t=0;while(t<n.length){let r=n[t];if(r==='"'||r==="'"){let l=h(n,t);s+=n.slice(t,l),t=l;continue}if(r==="`"){let l=d(n,t);s+=n.slice(t,l),t=l;continue}if(r==="/"&&(n[t+1]==="/"||n[t+1]==="*")){let l=b(n,t);s+=n.slice(t,l),t=l;continue}if(r==="="&&n[t+1]===">"){s+="=>",t+=2;continue}if(r==="{"||r==="["||r==="("||r==="<")e++;else if(r==="}"||r==="]"||r===")"||r===">")e--;if((r===";"||r===","||r===`
6
+ `)&&e===0){if(s.trim()!=="")i.push(s.trim());s="",t++;continue}s+=r,t++}if(s.trim()!=="")i.push(s.trim());return i}function I(n){let i=n.trim();if(!i.startsWith("{"))return null;let e=c(i,0,"{","}");if(e===-1||i.slice(e+1).trim()!=="")return null;let s=D(i.slice(1,e));if(s.length===0)return"{}";let t=[];for(let r of s){let l=/^\(\s*\w+\s*:\s*/.exec(r);if(!l)return null;let u=l[0].length,o=r[u];if(o!=="'"&&o!=='"'&&o!=="`")return null;let a=h(r,u),p=r.slice(u+1,a-1),f=c(r,r.indexOf("(",0),"(",")");if(f===-1)return null;let m=r.slice(u,f),w=S(m).slice(1),g=r.slice(f+1).trim();if(g.startsWith(":"))g=g.slice(1).trim();if(g==="")g="void";t.push(`${JSON.stringify(p)}: (${w.map((v)=>v.trim()).join(", ")}) => ${g}`)}return`{ ${t.join(", ")} }`}function Lt(n){let i=n;for(let e of["defineProps","defineEmits","defineExpose","defineSlots","defineOptions"])i=z(i,e);return i}function z(n,i){let e=new RegExp(`\\b${i}\\b`,"g"),s=[],t=n,r;while((r=e.exec(n))!==null){let l=n.lastIndexOf(`
7
+ `,r.index)+1,u=n.slice(l,r.index),o=/^\s*(?:(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*(?::[^=]+)?=\s*)?(withDefaults\s*\(\s*)?$/.exec(u);if(!o)continue;let a=r.index+r[0].length;while(a<n.length&&/\s/.test(n[a]))a++;if(n[a]==="<"){let m=W(n,a);if(m===-1)continue;a=m+1;while(a<n.length&&/\s/.test(n[a]))a++}if(n[a]!=="(")continue;let p=c(n,a,"(",")");if(p===-1)continue;if(o[1]){let m=l+u.length-o[1].length,w=n.indexOf("(",m);if(w!==-1){let g=c(n,w,"(",")");if(g!==-1)p=g}}let f=p+1;while(f<n.length&&n[f]!==`
8
+ `&&/\s|;/.test(n[f]))f++;if(n[f]===`
9
+ `)f++;s.push([l,f])}for(let l=s.length-1;l>=0;l--)t=t.slice(0,s[l][0])+t.slice(s[l][1]);return t}function Nt(n){let i=Z(n);if(i!==-1){let e=/^export\s+default\b/.exec(n.slice(i))?.[0];if(!e)return{options:null,script:n,passthrough:!1};let s=i+e.length;while(s<n.length&&/\s/.test(n[s]))s++;let t=-1,r=-1,l=-1;if(n[s]==="{")t=s,r=c(n,s,"{","}"),l=r;else if(n.startsWith("defineComponent",s)){let a=n.indexOf("(",s);if(a!==-1){let p=a+1;while(p<n.length&&/\s/.test(n[p]))p++;if(n[p]==="{")t=p,r=c(n,p,"{","}"),l=c(n,a,"(",")")}}if(t===-1||r===-1||l===-1)return{options:null,script:n,passthrough:!0};let u=l+1;if(n[u]===";")u++;let o=(n.slice(0,i)+n.slice(u)).trim();return{options:n.slice(t,r+1),script:o,passthrough:!1}}return{options:null,script:n,passthrough:!1}}function Z(n){let i=0,e=0;while(e<n.length){let s=n[e];if(s==='"'||s==="'"){e=h(n,e);continue}if(s==="`"){e=d(n,e);continue}if(s==="/"&&(n[e+1]==="/"||n[e+1]==="*")){e=b(n,e);continue}if(s==="{"||s==="["||s==="(")i++;else if(s==="}"||s==="]"||s===")")i=Math.max(0,i-1);else if(i===0&&n.startsWith("export",e)){let t=e===0?"":n[e-1],r=n[e+6]??"";if(!/[\w$]/.test(t)&&!/[\w$]/.test(r)){if(/^export\s+default\b/.exec(n.slice(e)))return e}}e++}return-1}function at(n,i){let e=O(n).find((s)=>s.key===i);return e&&e.value!==""?e.value:null}function ct(n,i){let e=q(n),s=n;for(let t=e.length-1;t>=0;t--){let r=e[t],l=s.slice(0,r.start)+s.slice(r.end);if(B(l,r.name))continue;if(new RegExp(`\\btypeof\\s+${r.name}\\b`).test(i))continue;s=l}return s}function B(n,i){let e=0;while(e<n.length){let s=n[e];if(s==='"'||s==="'"){e=h(n,e);continue}if(s==="`"){e=d(n,e);continue}if(s==="/"&&(n[e+1]==="/"||n[e+1]==="*")){e=b(n,e);continue}if(/[A-Za-z_$]/.test(s)){let t=e+1;while(t<n.length&&/[\w$]/.test(n[t]))t++;if(n.slice(e,t)===i)return!0;e=t;continue}e++}return!1}function q(n){let i=[],e=J(n),s=/^[ \t]*(const|let|var|(?:async[ \t]+)?function)[ \t]+([A-Za-z_$][\w$]*)[ \t]*(?::[^=\n]+)?=?/gm,t;while((t=s.exec(n))!==null){let r=n.lastIndexOf(`
10
+ `,t.index)+1;if(!e.has(r))continue;if(/\bexport\b/.test(n.slice(r,t.index)))continue;let l=t[1],u=t[2],o=t.index+t[0].length,a=-1;if(l.endsWith("function")){let p=n.indexOf("(",o);if(p===-1)continue;let f=c(n,p,"(",")");if(f===-1)continue;o=f+1;while(o<n.length&&/\s/.test(n[o]))o++;if(n[o]===":")while(o<n.length&&n[o]!=="{"&&n[o]!==`
11
11
  `)o++;while(o<n.length&&/\s/.test(n[o])&&n[o]!==`
12
- `)o++;if(n[o]!=="{")continue;let m=a(n,o,"{","}");if(m===-1)continue;f=m+1}else{let p=0;while(o<n.length){let c=n[o];if(c==='"'||c==="'"){o=h(n,o);continue}if(c==="`"){o=d(n,o);continue}if(c==="/"&&(n[o+1]==="/"||n[o+1]==="*")){o=b(n,o);continue}if(c==="{"||c==="["||c==="(")p++;else if(c==="}"||c==="]"||c===")")p--;else if(c===";"&&p===0){f=o+1;break}else if(c===`
13
- `&&p===0){f=o;break}o++}if(f===-1)f=n.length}if(n[f]===`
14
- `)f++;i.push({name:u,start:t.index,end:f})}return i}function J(n){let i=new Set([0]),e=0,s=0;while(s<n.length){let t=n[s];if(t==='"'||t==="'"){s=h(n,s);continue}if(t==="`"){s=d(n,s);continue}if(t==="/"&&(n[s+1]==="/"||n[s+1]==="*")){s=b(n,s);continue}if(t==="{"||t==="["||t==="(")e++;else if(t==="}"||t==="]"||t===")")e=Math.max(0,e-1);if(t===`
15
- `&&e===0)i.add(s+1);s++}return i}function it(n,i,e){let s=n.indexOf(e);if(s===-1)return n;let t=n.lastIndexOf(`
16
- `,s)+1;if(/\bexport\b/.test(n.slice(t,s)))return n;let r=n.slice(0,s)+n.slice(s+e.length);if(new RegExp(`\\b${i}\\b`).test(r))return n;return r}function Ot(n){let i="",e=0,s=()=>{for(let r=i.length-1;r>=0;r--)if(!/\s/.test(i[r]))return i[r];return""},t=(r)=>{for(let l=r;l<n.length;l++)if(!/\s/.test(n[l]))return n[l];return""};while(e<n.length){let r=n[e];if(r==='"'||r==="'"){let l=h(n,e);i+=n.slice(e,l),e=l;continue}if(r==="`"){let l=d(n,e);i+=n.slice(e,l),e=l;continue}if(r==="/"&&n[e+1]==="*"){let l=b(n,e);i+=n.slice(e,l).replace(/\s*\n\s*/g," "),e=l;continue}if(r==="/"&&n[e+1]==="/"){let l=e+2;while(l<n.length&&n[l]!==`
12
+ `)o++;if(n[o]!=="{")continue;let m=c(n,o,"{","}");if(m===-1)continue;a=m+1}else{let p=0;while(o<n.length){let f=n[o];if(f==='"'||f==="'"){o=h(n,o);continue}if(f==="`"){o=d(n,o);continue}if(f==="/"&&(n[o+1]==="/"||n[o+1]==="*")){o=b(n,o);continue}if(f==="{"||f==="["||f==="(")p++;else if(f==="}"||f==="]"||f===")")p--;else if(f===";"&&p===0){a=o+1;break}else if(f===`
13
+ `&&p===0){a=o;break}o++}if(a===-1)a=n.length}if(n[a]===`
14
+ `)a++;i.push({name:u,start:t.index,end:a})}return i}function J(n){let i=new Set([0]),e=0,s=0;while(s<n.length){let t=n[s];if(t==='"'||t==="'"){s=h(n,s);continue}if(t==="`"){s=d(n,s);continue}if(t==="/"&&(n[s+1]==="/"||n[s+1]==="*")){s=b(n,s);continue}if(t==="{"||t==="["||t==="(")e++;else if(t==="}"||t==="]"||t===")")e=Math.max(0,e-1);if(t===`
15
+ `&&e===0)i.add(s+1);s++}return i}function lt(n,i,e){let s=n.indexOf(e);if(s===-1)return n;let t=n.lastIndexOf(`
16
+ `,s)+1;if(/\bexport\b/.test(n.slice(t,s)))return n;let r=n.slice(0,s)+n.slice(s+e.length);if(new RegExp(`\\b${i}\\b`).test(r))return n;return r}function Ft(n){let i="",e=0,s=()=>{for(let r=i.length-1;r>=0;r--)if(!/\s/.test(i[r]))return i[r];return""},t=(r)=>{for(let l=r;l<n.length;l++)if(!/\s/.test(n[l]))return n[l];return""};while(e<n.length){let r=n[e];if(r==='"'||r==="'"){let l=h(n,e);i+=n.slice(e,l),e=l;continue}if(r==="`"){let l=d(n,e);i+=n.slice(e,l),e=l;continue}if(r==="/"&&n[e+1]==="*"){let l=b(n,e);i+=n.slice(e,l).replace(/\s*\n\s*/g," "),e=l;continue}if(r==="/"&&n[e+1]==="/"){let l=e+2;while(l<n.length&&n[l]!==`
17
17
  `)l++;let u=n.slice(e+2,l).trim();if(u!==""&&!u.includes("*/"))i+=`/* ${u} */`;e=l;continue}if(r===`
18
- `){let l=s(),u=t(e+1);if(l===""||u===""){e++;continue}let o=F(i);if(!o&&("{;,(<:=[".includes(l)||"}),]>;|&".includes(u))){if(!i.endsWith(" ")&&!i.endsWith(";"))i+=" "}else if(o){if(!i.endsWith(" "))i+=" "}else{if(i.endsWith(" "))i=i.slice(0,-1);i+="; "}e++;while(e<n.length&&(n[e]===" "||n[e]==="\t"))e++;continue}i+=r,e++}return i}function F(n){let i=n.length-1;while(i>=0&&/\s/.test(n[i]))i--;if(i<1||n[i]!=="/"||n[i-1]!=="*")return!1;let e=n.lastIndexOf("/*",i);if(e===-1)return!1;for(let s=e-1;s>=0;s--){let t=n[s];if(/\s/.test(t))continue;return"{;,(<:".includes(t)}return!0}function st(n,i){let e=[n,i].filter((s)=>s!==null);for(let s of e){let t=Pe(s,"defineProps");if(!t)continue;if(t.generic){let r=t.generic;if(r.startsWith("{"))return{type:r};if(/^[A-Za-z_$][\w$]*$/.test(r)){for(let l of e){let u=L(l,r);if(!u)continue;let o=x(l,r);if(o===null)continue;return{type:o,inlinedLocal:{name:r,declText:l.slice(u.start,u.end)}}}return{type:r}}return{type:r}}if(t.arg){let r=tt(t.arg);if(r!==null)return{type:r}}}return null}function It(n,i){let e=[n,i].filter((s)=>s!==null);for(let s of e){let t=Pe(s,"defineEmits");if(!t)continue;if(t.generic)return N(t.generic)??t.generic;if(t.arg){let r=P(t.arg);if(r!==null)return r}}return null}function Lt(n,i){let e=[n,i].filter((s)=>s!==null);for(let s of e){let t=Pe(s,"defineExpose");if(!t||!t.arg||!t.arg.startsWith("{"))continue;let r=O(t.arg);if(r.length===0)return null;return`{ ${r.map((u)=>{if(u.value===""&&/^[A-Za-z_$][\w$]*$/.test(u.key))return`${k(u.key)}: typeof ${u.key}`;let o=u.isMethod||/=>|^\s*function\b/.test(u.value);return`${k(u.key)}: ${o?"(...args: any[]) => any":"unknown"}`}).join(", ")} }`}return null}function M(n){let i=ha(n),e="",s=null,t=null;if(i.script){let y=Mt(i.script.content);if(y.passthrough)return i.scriptSetup?`${i.script.content}
19
- ${i.scriptSetup.content}`:i.script.content;if(e=y.script,y.options){let _=nt(y.options,"props");if(_)s=tt(_);let j=nt(y.options,"emits");if(j)t=P(j)}}let r=i.scriptSetup?.content??null,l=r!==null?Rt(r):null,u=st(r,r!==null?null:e),o=u?.type??s??"{}",f=It(r,null)??t,p=Lt(r,null),c=u?.inlinedLocal;if(c){if(e=it(e,c.name,c.declText),l!==null)l=it(l,c.name,c.declText)}let m=[o,p??"{}"];if(f)m.push("{}","{}","{}","{}","{}",f);let w=Ot(`DefineComponent<${m.join(", ")}>`),g=[],v=rt(e,w);if(v.trim()!=="")g.push(v);if(l&&l.trim()!==""){let y=rt(l,w);if(y.trim()!=="")g.push(y)}return g.push("import type { DefineComponent } from 'vue'"),g.push(`type __DtsxComponentType = ${w}`),g.push("const __dtsx_component__: __DtsxComponentType = null as unknown as __DtsxComponentType"),g.push("export default __dtsx_component__"),g.join(`
18
+ `){let l=s(),u=t(e+1);if(l===""||u===""){e++;continue}let o=F(i);if(!o&&("{;,(<:=[".includes(l)||"}),]>;|&".includes(u))){if(!i.endsWith(" ")&&!i.endsWith(";"))i+=" "}else if(o){if(!i.endsWith(" "))i+=" "}else{if(i.endsWith(" "))i=i.slice(0,-1);i+="; "}e++;while(e<n.length&&(n[e]===" "||n[e]==="\t"))e++;continue}i+=r,e++}return i}function F(n){let i=n.length-1;while(i>=0&&/\s/.test(n[i]))i--;if(i<1||n[i]!=="/"||n[i-1]!=="*")return!1;let e=n.lastIndexOf("/*",i);if(e===-1)return!1;for(let s=e-1;s>=0;s--){let t=n[s];if(/\s/.test(t))continue;return"{;,(<:".includes(t)}return!0}function ut(n,i){let e=[n,i].filter((s)=>s!==null);for(let s of e){let t=Ne(s,"defineProps");if(!t)continue;if(t.generic){let r=t.generic;if(r.startsWith("{"))return{type:r};if(/^[A-Za-z_$][\w$]*$/.test(r)){for(let l of e){let u=M(l,r);if(!u)continue;let o=P(l,r);if(o===null)continue;return{type:o,inlinedLocal:{name:r,declText:l.slice(u.start,u.end)}}}return{type:r}}return{type:r}}if(t.arg){let r=ot(t.arg);if(r!==null)return{type:r}}}return null}function Bt(n,i){let e=[n,i].filter((s)=>s!==null);for(let s of e){let t=Ne(s,"defineEmits");if(!t)continue;if(t.generic)return I(t.generic)??t.generic;if(t.arg){let r=R(t.arg);if(r!==null)return r}}return null}function Wt(n,i){let e=[n,i].filter((s)=>s!==null);for(let s of e){let t=Ne(s,"defineExpose");if(!t||!t.arg||!t.arg.startsWith("{"))continue;let r=O(t.arg);if(r.length===0)return null;return`{ ${r.map((u)=>{if(u.value===""&&/^[A-Za-z_$][\w$]*$/.test(u.key))return`${k(u.key)}: typeof ${u.key}`;let o=u.isMethod||/=>|^\s*function\b/.test(u.value);return`${k(u.key)}: ${o?"(...args: any[]) => any":"unknown"}`}).join(", ")} }`}return null}function N(n){let i=wa(n),e="",s=null,t=null;if(i.script){let y=Nt(i.script.content);if(y.passthrough)return i.scriptSetup?`${i.script.content}
19
+ ${i.scriptSetup.content}`:i.script.content;if(e=y.script,y.options){let _=at(y.options,"props");if(_)s=ot(_);let j=at(y.options,"emits");if(j)t=R(j)}}let r=i.scriptSetup?.content??null,l=r!==null?Lt(r):null,u=ut(r,r!==null?null:e),o=u?.type??s??"{}",a=Bt(r,null)??t,p=Wt(r,null),f=u?.inlinedLocal;if(f){if(e=lt(e,f.name,f.declText),l!==null)l=lt(l,f.name,f.declText)}let m=[o,p??"{}"];if(a)m.push("{}","{}","{}","{}","{}",a);let w=Ft(`DefineComponent<${m.join(", ")}>`),g=[],v=ct(e,w);if(v.trim()!=="")g.push(v);if(l&&l.trim()!==""){let y=ct(l,w);if(y.trim()!=="")g.push(y)}return g.push("import type { DefineComponent } from 'vue'"),g.push(`type __DtsxComponentType = ${w}`),g.push("const __dtsx_component__: __DtsxComponentType = null as unknown as __DtsxComponentType"),g.push("export default __dtsx_component__"),g.join(`
20
20
  `)}
21
- export{R,ha,Dt,Pt,a,Pe,tt,Rt,Mt,nt,rt,it,Ot,st,It,Lt,M};
21
+ export{L,wa,Ot,It,c,Ne,ot,Lt,Nt,at,ct,lt,Ft,ut,Bt,Wt,N};
@@ -1,10 +1,10 @@
1
1
  // @bun
2
- import{r}from"./chunk-90f37xen.js";import{existsSync as j,mkdirSync as N,readFileSync as z,writeFileSync as G}from"fs";import{dirname as K,relative as L,resolve as _}from"path";async function ds(t,e,n){let u=new Map,f=[],x=new Set,D=0,w=0,S=0,C=[];for(let i of t){let o=e.get(i);if(!o)continue;C.push({file:i,decls:r(o,i,n.keepComments)})}for(let{file:i,decls:o}of C){D+=o.length;for(let s of o)if(s.kind==="import"){w++;let c=s.source||"";if(c.startsWith("."))continue;if(!u.has(c))u.set(c,{source:c,specifiers:new Map,isTypeOnly:s.isTypeOnly||!1,isSideEffect:s.isSideEffect||!1});let l=u.get(c);if(s.specifiers)for(let h of s.specifiers){let W=h.alias||h.name;if(!l.specifiers.has(W))l.specifiers.set(W,{name:h.name,alias:h.alias,isType:h.isType||!1})}if(!s.isTypeOnly)l.isTypeOnly=!1}else if(s.isExported||s.kind==="export"){if(S++,s.kind==="export"&&s.source&&(s.source.startsWith(".")||s.source.startsWith("/")))continue;if(s.name&&x.has(s.name))continue;if(s.name)x.add(s.name);f.push({declaration:s,file:i})}}let a=[];a.push("/**"),a.push(" * Bundled TypeScript declarations"),a.push(` * Generated from ${t.length} source files`),a.push(" */"),a.push("");let T=n.importOrder||["bun"],y=Array.from(u.values()),p=Array(y.length);for(let i=0;i<y.length;i++){let o=y[i].source,s=T.length;for(let c=0;c<T.length;c++)if(o.startsWith(T[c])){s=c;break}p[i]=s}let g=y.map((i,o)=>o);g.sort((i,o)=>{let s=p[i],c=p[o];if(s!==c)return s-c;return y[i].source.localeCompare(y[o].source)});let b=g.map((i)=>y[i]);for(let i of b)if(i.isSideEffect)a.push(`import '${i.source}';`);else if(i.specifiers.size>0){let s=Array.from(i.specifiers.values()).map((l)=>{let h=l.isType?"type ":"";return l.alias?`${h}${l.name} as ${l.alias}`:`${h}${l.name}`}),c=i.isTypeOnly?"type ":"";a.push(`import ${c}{ ${s.join(", ")} } from '${i.source}';`)}if(b.length>0)a.push("");let m=new Map;for(let{declaration:i,file:o}of f){if(!m.has(o))m.set(o,[]);m.get(o).push(i)}for(let[i,o]of m){let s=L(n.cwd,i);a.push(`// From: ${s}`);for(let c of o){if(n.keepComments&&c.leadingComments)for(let l of c.leadingComments)a.push(l);a.push(F(c))}a.push("")}let d=a.join(`
2
+ import{r}from"./chunk-sqa3ke1a.js";import{existsSync as j,mkdirSync as N,readFileSync as z,writeFileSync as G}from"fs";import{dirname as K,relative as L,resolve as _}from"path";async function hs(t,e,n){let u=new Map,f=[],x=new Set,D=0,w=0,S=0,C=[];for(let i of t){let o=e.get(i);if(!o)continue;C.push({file:i,decls:r(o,i,n.keepComments)})}for(let{file:i,decls:o}of C){D+=o.length;for(let s of o)if(s.kind==="import"){w++;let c=s.source||"";if(c.startsWith("."))continue;if(!u.has(c))u.set(c,{source:c,specifiers:new Map,isTypeOnly:s.isTypeOnly||!1,isSideEffect:s.isSideEffect||!1});let l=u.get(c);if(s.specifiers)for(let h of s.specifiers){let W=h.alias||h.name;if(!l.specifiers.has(W))l.specifiers.set(W,{name:h.name,alias:h.alias,isType:h.isType||!1})}if(!s.isTypeOnly)l.isTypeOnly=!1}else if(s.isExported||s.kind==="export"){if(S++,s.kind==="export"&&s.source&&(s.source.startsWith(".")||s.source.startsWith("/")))continue;if(s.name&&x.has(s.name))continue;if(s.name)x.add(s.name);f.push({declaration:s,file:i})}}let a=[];a.push("/**"),a.push(" * Bundled TypeScript declarations"),a.push(` * Generated from ${t.length} source files`),a.push(" */"),a.push("");let T=n.importOrder||["bun"],y=Array.from(u.values()),p=Array(y.length);for(let i=0;i<y.length;i++){let o=y[i].source,s=T.length;for(let c=0;c<T.length;c++)if(o.startsWith(T[c])){s=c;break}p[i]=s}let g=y.map((i,o)=>o);g.sort((i,o)=>{let s=p[i],c=p[o];if(s!==c)return s-c;return y[i].source.localeCompare(y[o].source)});let b=g.map((i)=>y[i]);for(let i of b)if(i.isSideEffect)a.push(`import '${i.source}';`);else if(i.specifiers.size>0){let s=Array.from(i.specifiers.values()).map((l)=>{let h=l.isType?"type ":"";return l.alias?`${h}${l.name} as ${l.alias}`:`${h}${l.name}`}),c=i.isTypeOnly?"type ":"";a.push(`import ${c}{ ${s.join(", ")} } from '${i.source}';`)}if(b.length>0)a.push("");let m=new Map;for(let{declaration:i,file:o}of f){if(!m.has(o))m.set(o,[]);m.get(o).push(i)}for(let[i,o]of m){let s=L(n.cwd,i);a.push(`// From: ${s}`);for(let c of o){if(n.keepComments&&c.leadingComments)for(let l of c.leadingComments)a.push(l);a.push(F(c))}a.push("")}let d=a.join(`
3
3
  `);return{content:d,files:t,declarationCount:D,importCount:w,exportCount:S,size:Buffer.byteLength(d,"utf8"),warnings:[]}}function F(t){if(t.text){let n=t.text.trim();if(t.isExported&&!n.startsWith("export"))n=`export ${n}`;if(!n.endsWith(";")&&!n.endsWith("}"))n+=";";return n}let e=[];if(t.isExported)e.push("export");if(t.isDefault)e.push("default");switch(t.kind){case"function":if(e.push("declare function"),e.push(t.name),t.generics)e.push(t.generics);if(e.push(`(${V(t.parameters)})`),t.returnType)e.push(`: ${t.returnType}`);break;case"variable":if(e.push("declare const"),e.push(t.name),t.typeAnnotation)e.push(`: ${t.typeAnnotation}`);break;case"interface":if(e.push("interface"),e.push(t.name),t.generics)e.push(t.generics);if(t.extends)e.push(`extends ${t.extends}`);if(e.push("{"),t.members)for(let n of t.members)e.push(` ${n.name}${n.typeAnnotation?`: ${n.typeAnnotation}`:""};`);e.push("}");break;case"type":if(e.push("type"),e.push(t.name),t.generics)e.push(t.generics);e.push("="),e.push(t.typeAnnotation||"unknown");break;case"class":if(e.push("declare class"),e.push(t.name),t.generics)e.push(t.generics);if(t.extends)e.push(`extends ${t.extends}`);if(t.implements&&t.implements.length>0)e.push(`implements ${t.implements.join(", ")}`);if(e.push("{"),t.members)for(let n of t.members)e.push(` ${F(n)}`);e.push("}");break;case"enum":if(e.push("declare enum"),e.push(t.name),e.push("{"),t.members){let n=t.members.map((u)=>u.value!==void 0?`${u.name} = ${u.value}`:u.name);e.push(` ${n.join(`,
4
- `)}`)}e.push("}");break;default:return t.text||""}return e.join(" ")}function V(t){if(!t||t.length===0)return"";return t.map((e)=>{let n="";if(e.rest)n+="...";if(n+=e.name,e.optional)n+="?";if(e.type)n+=`: ${e.type}`;if(e.defaultValue)n+=` = ${e.defaultValue}`;return n}).join(", ")}async function Yt(t,e={}){let n=[],u=new Map,f=[],x=[],D=new Set,w=0,S=0,C=0;for(let p of t){if(!j(p)){n.push(`File not found: ${p}`);continue}let g=z(p,"utf-8");x.push(p);let b=g.split(`
4
+ `)}`)}e.push("}");break;default:return t.text||""}return e.join(" ")}function V(t){if(!t||t.length===0)return"";return t.map((e)=>{let n="";if(e.rest)n+="...";if(n+=e.name,e.optional)n+="?";if(e.type)n+=`: ${e.type}`;if(e.defaultValue)n+=` = ${e.defaultValue}`;return n}).join(", ")}async function en(t,e={}){let n=[],u=new Map,f=[],x=[],D=new Set,w=0,S=0,C=0;for(let p of t){if(!j(p)){n.push(`File not found: ${p}`);continue}let g=z(p,"utf-8");x.push(p);let b=g.split(`
5
5
  `),m=[],d=0,i=!1;for(let o of b){let s=o.trim();if(!s&&!i)continue;if(s.startsWith("import ")){S++;let l=s.match(/import\s+(type\s+)?(?:\{([^}]+)\}|(\w+)|\*\s+as\s+(\w+))\s+from\s+['"]([^'"]+)['"]/);if(l){let[,h,W,q,H,A]=l;if(e.externals?.some((P)=>A.startsWith(P))){f.push(s);continue}if(A.startsWith("."))continue;if(!u.has(A))u.set(A,{source:A,specifiers:new Map,isTypeOnly:!!h,isSideEffect:!1});let E=u.get(A);if(W){let P=W.split(",").map((k)=>k.trim());for(let k of P){let[I,v]=k.split(/\s+as\s+/).map((M)=>M.trim()),R=I.startsWith("type "),O=R?I.replace("type ",""):I;E.specifiers.set(v||O,{name:O,alias:v!==O?v:void 0,isType:R})}}if(!h)E.isTypeOnly=!1}continue}if(/^(export\s+)?(declare\s+)?(interface|type|class|function|const|let|var|enum|namespace|module)\s/.test(s)){if(i=!0,m=[o],d=(o.match(/\{/g)||[]).length-(o.match(/\}/g)||[]).length,d===0&&(s.endsWith(";")||!s.includes("{"))){let l=B(s);if(!D.has(l)||!e.mergeDuplicates){if(D.add(l),f.push(o),w++,s.startsWith("export"))C++}i=!1,m=[]}}else if(i){if(m.push(o),d+=(o.match(/\{/g)||[]).length-(o.match(/\}/g)||[]).length,d<=0){let l=m.join(`
6
6
  `),h=B(m[0]);if(!D.has(h)||!e.mergeDuplicates){if(D.add(h),f.push(l),w++,m[0].trim().startsWith("export"))C++}i=!1,m=[]}}else if(s.startsWith("export ")&&!s.includes("declare"))f.push(o),C++}}let a=[];if(e.banner)a.push(e.banner),a.push("");if(e.includeReferences&&e.references){for(let p of e.references)a.push(`/// <reference types="${p}" />`);a.push("")}let T=Array.from(u.values()).sort((p,g)=>p.source.localeCompare(g.source));for(let p of T)if(p.specifiers.size>0){let b=Array.from(p.specifiers.values()).map((d)=>{let i=d.isType?"type ":"";return d.alias?`${i}${d.name} as ${d.alias}`:`${i}${d.name}`}),m=p.isTypeOnly?"type ":"";a.push(`import ${m}{ ${b.join(", ")} } from '${p.source}';`)}if(T.length>0)a.push("");if(e.ambient&&e.moduleName){a.push(`declare module '${e.moduleName}' {`);for(let p of f){let g=p.split(`
7
7
  `).map((b)=>` ${b.replace(/^(\s*)(export\s+)?declare\s+/,"$1$2")}`).join(`
8
8
  `);a.push(g)}a.push("}")}else{if(e.sortDeclarations)f.sort((p,g)=>{let b=B(p),m=B(g);return b.localeCompare(m)});for(let p of f)a.push(p)}if(e.footer)a.push(""),a.push(e.footer);let y=a.join(`
9
- `);return{content:y,files:x,declarationCount:w,importCount:S,exportCount:C,size:Buffer.byteLength(y,"utf-8"),warnings:n}}function B(t){let e=t.match(/(interface|type|class|function|const|let|var|enum|namespace|module)\s+(\w+)/);return e?`${e[1]}:${e[2]}`:t.trim()}async function vr(t,e,n={}){let u=await Yt(t,n),f=K(e);if(!j(f))N(f,{recursive:!0});return G(e,u.content),u}function ps(t={}){return{bundle:(e)=>Yt(e,t),bundleAndWrite:(e,n)=>vr(e,n,{...t,output:n})}}async function ms(t,e=process.cwd()){let n=Array.isArray(t)?t:[t],u=[];for(let f of n){if(f.includes("*"))continue;let x=_(e,f);if(j(x))u.push(x)}return u}
10
- export{ds,Yt,vr,ps,ms};
9
+ `);return{content:y,files:x,declarationCount:w,importCount:S,exportCount:C,size:Buffer.byteLength(y,"utf-8"),warnings:n}}function B(t){let e=t.match(/(interface|type|class|function|const|let|var|enum|namespace|module)\s+(\w+)/);return e?`${e[1]}:${e[2]}`:t.trim()}async function kr(t,e,n={}){let u=await en(t,n),f=K(e);if(!j(f))N(f,{recursive:!0});return G(e,u.content),u}function ys(t={}){return{bundle:(e)=>en(e,t),bundleAndWrite:(e,n)=>kr(e,n,{...t,output:n})}}async function bs(t,e=process.cwd()){let n=Array.isArray(t)?t:[t],u=[];for(let f of n){if(f.includes("*"))continue;let x=_(e,f);if(j(x))u.push(x)}return u}
10
+ export{hs,en,kr,ys,bs};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{B}from"./chunk-waan03ga.js";import{k}from"./chunk-m2kzh519.js";import{Se,$e}from"./chunk-59jw51gg.js";import{createHash as x}from"crypto";import{readFile as d}from"fs/promises";import{resolve as m}from"path";async function Rn(g){let e={...B,...g},n=e.moduleSpecifierMode??"preserve";if(n!=="node"&&n!=="preserve")throw Error("moduleSpecifierMode must be preserve or node");if(e.plugins?.length)throw Error("Native project planning does not support generation plugins");let o=await Se(e),l=[];for(let r of o.files){let s=await d(r),a=s.toString("utf8");if(!Buffer.from(a,"utf8").equals(s))throw Error(`Native declaration source must be valid UTF-8: ${r}`);let u=o.outputBySource.get(r),v=$e(r,e,o.resolver),i=[],S=new Set(k(a,{includeImports:!0}).map((t)=>t.specifier));for(let t of S){let p=v(t);if(p.kind!=="local")continue;let{resolvedSource:h,declarationOutput:w,emittedSpecifier:y}=p;i.push({specifier:t,resolvedSource:h,declarationOutput:w,emittedSpecifier:y})}let c={version:1,moduleSpecifierMode:n,sourceFile:r,outputFile:u,sourceHash:x("sha256").update(s).digest("hex"),rewrites:i};if(!e.isolatedDeclarations&&i.length)c.inferenceSources=await Promise.all(i.map(async(t)=>({specifier:t.specifier,source:await d(t.resolvedSource,"utf8")})));let f=o.augmentationImports.get(r);if(f?.size)c.augmentationImports=[...f];l.push(Object.freeze({sourceFile:r,outputFile:u,source:a,context:c}))}return Object.freeze({version:1,rootPath:m(e.cwd,e.root),outdirPath:m(e.cwd,e.outdir),files:Object.freeze(l)})}
3
- export{Rn};
2
+ import{j}from"./chunk-f191378r.js";import{D}from"./chunk-s6t0ff96.js";import{De,Pe}from"./chunk-t1js8enq.js";import{createHash as x}from"crypto";import{readFile as d}from"fs/promises";import{resolve as m}from"path";async function Ln(g){let e={...j,...g},n=e.moduleSpecifierMode??"preserve";if(n!=="node"&&n!=="preserve")throw Error("moduleSpecifierMode must be preserve or node");if(e.plugins?.length)throw Error("Native project planning does not support generation plugins");let o=await De(e),l=[];for(let r of o.files){let s=await d(r),a=s.toString("utf8");if(!Buffer.from(a,"utf8").equals(s))throw Error(`Native declaration source must be valid UTF-8: ${r}`);let u=o.outputBySource.get(r),v=Pe(r,e,o.resolver),i=[],S=new Set(D(a,{includeImports:!0}).map((t)=>t.specifier));for(let t of S){let p=v(t);if(p.kind!=="local")continue;let{resolvedSource:h,declarationOutput:w,emittedSpecifier:y}=p;i.push({specifier:t,resolvedSource:h,declarationOutput:w,emittedSpecifier:y})}let c={version:1,moduleSpecifierMode:n,sourceFile:r,outputFile:u,sourceHash:x("sha256").update(s).digest("hex"),rewrites:i};if(!e.isolatedDeclarations&&i.length)c.inferenceSources=await Promise.all(i.map(async(t)=>({specifier:t.specifier,source:await d(t.resolvedSource,"utf8")})));let f=o.augmentationImports.get(r);if(f?.size)c.augmentationImports=[...f];l.push(Object.freeze({sourceFile:r,outputFile:u,source:a,context:c}))}return Object.freeze({version:1,rootPath:m(e.cwd,e.root),outdirPath:m(e.cwd,e.outdir),files:Object.freeze(l)})}
3
+ export{Ln};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{L,N}from"./chunk-755bntty.js";import{O,I}from"./chunk-exf6bsbe.js";import{p}from"./chunk-v6fwy63g.js";import{P,F}from"./chunk-zmnb3yg1.js";import{Le}from"./chunk-4t1we2h5.js";import{l}from"./chunk-3nmjt94q.js";import{q,Ee}from"./chunk-b3979d26.js";function Ze(t,n,r,s,e,i){if(s.length!==1||s[0]!=="bun")return null;if(q(i)==="typescript")return null;let a=L(n??"")?N(t):O(n??"")?I(t):t;return Ee(a,{keepComments:r,isolatedDeclarations:e,engine:i,sourceFile:n})}var y=100,x=0,c=new Map;function $t(t,n,r=!0,s=["bun"],e=!1,i){let a=p(t),b=JSON.stringify([n,r,e,s,q(i)]),g=c.get(b);if(g&&g.contentHash===a)return g.lastAccess=++x,g.result;let h=Ze(t,n,r,s,e,i)??E(t,n,r,s,e);if(c.set(b,{result:h,contentHash:a,lastAccess:++x}),c.size>y){let S=Math.max(1,Math.ceil(c.size*0.1)),u=[];for(let[o,f]of c)u.push([o,f.lastAccess]);u.sort((o,f)=>o[1]-f[1]);for(let o=0;o<S&&o<u.length;o++)c.delete(u[o][0])}return h}function oi(t,n,r=!0,s=["bun"]){return $t(t,n,r,s,!0)}function ai(t,n,r=!0,s=["bun"]){return $t(t,n,r,s,!1)}function E(t,n,r,s,e){let i=Le(t,n,r,e);return l(i,{filePath:n??"stdin.ts",sourceCode:t,declarations:i},r,s)}function ci(){c.clear()}function Na(t,n,r=!0,s=["bun"],e=!1,i){return Ze(t,n,r,s,e,i)??$n(t,n,r,s,e)}function $n(t,n,r=!0,s=["bun"],e=!1){if(L(n??""))t=N(t);else if(O(n??""))t=I(t);let i=e?P(t,n,r):F(t,n,r);return l(i,{filePath:n??"stdin.ts",sourceCode:t,declarations:i},r,s)}
3
+ export{Ze,$t,oi,ai,ci,Na,$n};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{basename as e,dirname as n,isAbsolute as i,join as o,relative as a,resolve as s}from"path";function Ii(t){if(!t||typeof t!=="string")throw Error("Invalid file path: must be a non-empty string");return t}function Li(t){if(!t||typeof t!=="string")throw Error("Invalid directory path: must be a non-empty string");return t}function Fi(t){if(!t||typeof t!=="string")throw Error("Invalid glob pattern: must be a non-empty string");return t}function Ni(t){if(typeof t!=="string")throw TypeError("Invalid source code: must be a string");return t}function Bi(t){if(typeof t!=="string")throw TypeError("Invalid DTS content: must be a string");return t}function Wi(t){if(!t||typeof t!=="string")throw Error("Invalid module specifier: must be a non-empty string");return t}function _i(t){if(!t||typeof t!=="string")throw Error("Invalid type name: must be a non-empty string");if(!["string","number","boolean","symbol","bigint","undefined","null","void","never","any","unknown","object"].includes(t)&&!/^[A-Z_$]/.test(t));return t}function ji(t){if(!t||typeof t!=="string")throw Error("Invalid declaration name: must be a non-empty string");return t}function Gi(t){if(!t||typeof t!=="string")throw Error("Invalid absolute path: must be a non-empty string");if(!t.startsWith("/")&&!/^[A-Z]:/i.test(t))throw Error("Invalid absolute path: must start with / or drive letter");return t}function Vi(t){if(!t||typeof t!=="string")throw Error("Invalid relative path: must be a non-empty string");if(t.startsWith("/")||/^[A-Z]:/i.test(t))throw Error("Invalid relative path: must not be absolute");return t}function Ui(t){if(typeof t!=="string")throw TypeError("Invalid JSON string: must be a string");try{JSON.parse(t)}catch{throw Error("Invalid JSON string: must be valid JSON")}return t}function zi(t,r){return typeof t==="string"||typeof t==="number"}function Hi(t){return t}var Ki={join(t,...r){return o(t,...r)},dirname(t){return n(t)},basename(t){return e(t)},resolve(...t){return s(...t)},isAbsolute(t){return i(t)},relative(t,r){return a(t,r)}};
3
- export{Ii,Li,Fi,Ni,Bi,Wi,_i,ji,Gi,Vi,Ui,zi,Hi,Ki};
2
+ import{basename as e,dirname as n,isAbsolute as i,join as o,relative as a,resolve as s}from"path";function Vi(t){if(!t||typeof t!=="string")throw Error("Invalid file path: must be a non-empty string");return t}function Ui(t){if(!t||typeof t!=="string")throw Error("Invalid directory path: must be a non-empty string");return t}function zi(t){if(!t||typeof t!=="string")throw Error("Invalid glob pattern: must be a non-empty string");return t}function Hi(t){if(typeof t!=="string")throw TypeError("Invalid source code: must be a string");return t}function Ki(t){if(typeof t!=="string")throw TypeError("Invalid DTS content: must be a string");return t}function qi(t){if(!t||typeof t!=="string")throw Error("Invalid module specifier: must be a non-empty string");return t}function Ji(t){if(!t||typeof t!=="string")throw Error("Invalid type name: must be a non-empty string");if(!["string","number","boolean","symbol","bigint","undefined","null","void","never","any","unknown","object"].includes(t)&&!/^[A-Z_$]/.test(t));return t}function Yi(t){if(!t||typeof t!=="string")throw Error("Invalid declaration name: must be a non-empty string");return t}function Xi(t){if(!t||typeof t!=="string")throw Error("Invalid absolute path: must be a non-empty string");if(!t.startsWith("/")&&!/^[A-Z]:/i.test(t))throw Error("Invalid absolute path: must start with / or drive letter");return t}function Zi(t){if(!t||typeof t!=="string")throw Error("Invalid relative path: must be a non-empty string");if(t.startsWith("/")||/^[A-Z]:/i.test(t))throw Error("Invalid relative path: must not be absolute");return t}function Qi(t){if(typeof t!=="string")throw TypeError("Invalid JSON string: must be a string");try{JSON.parse(t)}catch{throw Error("Invalid JSON string: must be valid JSON")}return t}function es(t,r){return typeof t==="string"||typeof t==="number"}function ts(t){return t}var ns={join(t,...r){return o(t,...r)},dirname(t){return n(t)},basename(t){return e(t)},resolve(...t){return s(...t)},isAbsolute(t){return i(t)},relative(t,r){return a(t,r)}};
3
+ export{Vi,Ui,zi,Hi,Ki,qi,Ji,Yi,Xi,Zi,Qi,es,ts,ns};
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- class ve{plugins=[];config=null;register(t){if(this.plugins.some((n)=>n.name===t.name))throw Error(`Plugin "${t.name}" is already registered`);this.plugins.push(t)}hasDeclarationHooks(){return this.plugins.some((t)=>t.onDeclarations!==void 0)}unregister(t){let n=this.plugins.findIndex((r)=>r.name===t);if(n>=0)return this.plugins.splice(n,1),!0;return!1}getPlugins(){return this.plugins}createLogger(t){return{debug:(n)=>console.debug(`[${t}] ${n}`),info:(n)=>console.info(`[${t}] ${n}`),warn:(n)=>console.warn(`[${t}] ${n}`),error:(n)=>console.error(`[${t}] ${n}`)}}async runOnStart(t){let n=t;for(let r of this.plugins)if(r.onStart){let e=await r.onStart(n);if(e)n=e}return this.config=n,n}async runOnBeforeFile(t,n){let r=n;for(let e of this.plugins)if(e.onBeforeFile){let i={filePath:t,sourceCode:n,content:r,config:this.config,log:this.createLogger(e.name)},o=await e.onBeforeFile(i);if(typeof o==="string")r=o}return r}async runOnDeclarations(t,n,r){let e=r;for(let i of this.plugins)if(i.onDeclarations){let o={filePath:t,sourceCode:n,declarations:e,config:this.config,log:this.createLogger(i.name)},s=await i.onDeclarations(o);if(s)e=s}return e}async runOnAfterFile(t,n,r){let e=r;for(let i of this.plugins)if(i.onAfterFile){let o={filePath:t,sourceCode:n,content:e,config:this.config,log:this.createLogger(i.name)},s=await i.onAfterFile(o);if(typeof s==="string")e=s}return e}async runOnEnd(t){for(let n of this.plugins)if(n.onEnd)await n.onEnd(t)}async runOnError(t,n,r){for(let e of this.plugins)if(e.onError){let i={filePath:n,sourceCode:r,config:this.config,log:this.createLogger(e.name)};await e.onError(t,i)}}}var Jo=new ve;function Q(t){return t}var Yo=Q({name:"strip-internal",version:"1.0.0",description:"Removes declarations marked with @internal",onDeclarations:(t)=>t.declarations.filter((n)=>{if(n.leadingComments){if(n.leadingComments.some((e)=>e.includes("@internal")))return t.log.debug(`Stripping internal declaration: ${n.name}`),!1}return!0})});function Xo(t){return Q({name:"banner",version:"1.0.0",description:"Adds a banner comment to generated files",onAfterFile:(n)=>`/**
2
+ class Ae{plugins=[];config=null;register(t){if(this.plugins.some((n)=>n.name===t.name))throw Error(`Plugin "${t.name}" is already registered`);this.plugins.push(t)}hasDeclarationHooks(){return this.plugins.some((t)=>t.onDeclarations!==void 0)}unregister(t){let n=this.plugins.findIndex((r)=>r.name===t);if(n>=0)return this.plugins.splice(n,1),!0;return!1}getPlugins(){return this.plugins}createLogger(t){return{debug:(n)=>console.debug(`[${t}] ${n}`),info:(n)=>console.info(`[${t}] ${n}`),warn:(n)=>console.warn(`[${t}] ${n}`),error:(n)=>console.error(`[${t}] ${n}`)}}async runOnStart(t){let n=t;for(let r of this.plugins)if(r.onStart){let e=await r.onStart(n);if(e)n=e}return this.config=n,n}async runOnBeforeFile(t,n){let r=n;for(let e of this.plugins)if(e.onBeforeFile){let i={filePath:t,sourceCode:n,content:r,config:this.config,log:this.createLogger(e.name)},o=await e.onBeforeFile(i);if(typeof o==="string")r=o}return r}async runOnDeclarations(t,n,r){let e=r;for(let i of this.plugins)if(i.onDeclarations){let o={filePath:t,sourceCode:n,declarations:e,config:this.config,log:this.createLogger(i.name)},s=await i.onDeclarations(o);if(s)e=s}return e}async runOnAfterFile(t,n,r){let e=r;for(let i of this.plugins)if(i.onAfterFile){let o={filePath:t,sourceCode:n,content:e,config:this.config,log:this.createLogger(i.name)},s=await i.onAfterFile(o);if(typeof s==="string")e=s}return e}async runOnEnd(t){for(let n of this.plugins)if(n.onEnd)await n.onEnd(t)}async runOnError(t,n,r){for(let e of this.plugins)if(e.onError){let i={filePath:n,sourceCode:r,config:this.config,log:this.createLogger(e.name)};await e.onError(t,i)}}}var Qo=new Ae;function se(t){return t}var ea=se({name:"strip-internal",version:"1.0.0",description:"Removes declarations marked with @internal",onDeclarations:(t)=>t.declarations.filter((n)=>{if(n.leadingComments){if(n.leadingComments.some((e)=>e.includes("@internal")))return t.log.debug(`Stripping internal declaration: ${n.name}`),!1}return!0})});function ta(t){return se({name:"banner",version:"1.0.0",description:"Adds a banner comment to generated files",onAfterFile:(n)=>`/**
3
3
  * ${t.split(`
4
4
  `).join(`
5
5
  * `)}
6
6
  */
7
7
 
8
- `+n.content})}function Zo(t){return Q({name:"filter",version:"1.0.0",description:"Filters declarations by name",onDeclarations:(n)=>n.declarations.filter((r)=>{if(r.kind==="import")return!0;return t(r.name)})})}
9
- export{ve,Jo,Q,Yo,Xo,Zo};
8
+ `+n.content})}function na(t){return se({name:"filter",version:"1.0.0",description:"Filters declarations by name",onDeclarations:(n)=>n.declarations.filter((r)=>{if(r.kind==="import")return!0;return t(r.name)})})}
9
+ export{Ae,Qo,se,ea,ta,na};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- var e="@dtsx/dtsx",i="module",n="0.11.44",r=!0,c="A modern, fast .d.ts generation tool, powered by Bun.",u="Chris Breuer <chris@stacksjs.org>",a="MIT",b="https://github.com/stacksjs/dtsx#readme",o={type:"git",url:"git+https://github.com/stacksjs/dtsx.git"},p={url:"https://github.com/stacksjs/dtsx/issues"},d=["dts","generation","isolated declarations","development","bun","stacks","typescript","javascript"],m={".":{import:"./dist/index.js"},"./*":{import:"./dist/*"}},k="./dist/index.js",l="./dist/index.d.ts",x={dtsx:"./dist/cli.js"},g=["dist"],h={benchmark:"bun benchmark/index.ts","benchmark:prepare":"cd packages/zig-dtsx && zig build -Doptimize=ReleaseFast && cd ../.. && bun build benchmark/oxc-emit.ts --compile --splitting --bytecode --minify --format=esm --outfile benchmark/oxc-emit","benchmark:publish":"bun benchmark/index.ts --json benchmark/results.json --runs 3 && bun benchmark/render.ts","benchmark:tsdown":"bun benchmark/tsdown.ts",build:"bun --filter './packages/dtsx' build",test:"find packages -name '*.test.ts' -print | xargs bun test","test:public-sdk":"bun scripts/verify-public-sdk.ts","test:standalone":"bun scripts/verify-standalone.ts","typecheck:public-sdk":"bun x tsc --project tsconfig.public-sdk.json",lint:"bun x --bun pickier .","lint:fix":"bun x --bun pickier . --fix",format:"bun x --bun pickier . --format","format:fix":"bun x --bun pickier . --format --write",changelog:"bun x @stacksjs/logsmith --verbose","changelog:generate":"bun x @stacksjs/logsmith --output CHANGELOG.md",release:"bun x --bun @stacksjs/bumpx prompt --recursive","release:patch":"bun x --bun @stacksjs/bumpx patch --recursive --commit --tag --push --yes","release:minor":"bun x --bun @stacksjs/bumpx minor --recursive --commit --tag --push --yes",typecheck:"bun x tsc --noEmit","dev:docs":"bun --bun bunpress dev docs","build:docs":"bun --bun bunpress build docs","preview:docs":"bun --bun bunpress preview docs"},j={"@stacksjs/bumpx":"^0.2.32","@stacksjs/bunpress":"^0.2.31","@stacksjs/clapp":"^0.2.16",pickier:"^0.1.88","@stacksjs/gitlint":"^0.1.8","@stacksjs/logsmith":"^0.2.14","@types/bun":"^1.4.4","buddy-bot":"^0.10.5","bun-git-hooks":"^0.3.3","@dtsx/bun":"workspace:*",mitata:"^1.0.34","oxc-transform":"^0.157.0","oxc-parser":"^0.157.0",tsdown:"^0.23.7",typescript:"^7.0.2"},y=["packages/*"],f={typescript:"^7.0.2"},v={name:e,type:i,version:n,private:r,description:c,author:u,license:a,homepage:b,repository:o,bugs:p,keywords:d,exports:m,module:k,types:l,bin:x,files:g,scripts:h,devDependencies:j,workspaces:y,overrides:f,"git-hooks":{"pre-commit":{"staged-lint":{"*.{js,ts,json,yaml,yml,md}":"bun x --bun pickier lint --fix"}},"commit-msg":"bun x gitlint --edit .git/COMMIT_EDITMSG"}};export{u as author,x as bin,p as bugs,v as default,c as description,j as devDependencies,m as exports,g as files,b as homepage,d as keywords,a as license,k as module,e as name,f as overrides,r as private,o as repository,h as scripts,i as type,l as types,n as version,y as workspaces};
2
+ var e="@dtsx/dtsx",i="module",n="0.11.45",r=!0,c="A modern, fast .d.ts generation tool, powered by Bun.",u="Chris Breuer <chris@stacksjs.org>",a="MIT",b="https://github.com/stacksjs/dtsx#readme",o={type:"git",url:"git+https://github.com/stacksjs/dtsx.git"},p={url:"https://github.com/stacksjs/dtsx/issues"},d=["dts","generation","isolated declarations","development","bun","stacks","typescript","javascript"],m={".":{import:"./dist/index.js"},"./*":{import:"./dist/*"}},k="./dist/index.js",l="./dist/index.d.ts",x={dtsx:"./dist/cli.js"},g=["dist"],h={benchmark:"bun benchmark/index.ts","benchmark:prepare":"cd packages/zig-dtsx && zig build -Doptimize=ReleaseFast && cd ../.. && bun build benchmark/oxc-emit.ts --compile --splitting --bytecode --minify --format=esm --outfile benchmark/oxc-emit","benchmark:publish":"bun benchmark/index.ts --json benchmark/results.json --runs 3 && bun benchmark/render.ts","benchmark:tsdown":"bun benchmark/tsdown.ts",build:"bun --filter './packages/dtsx' build",test:"find packages -name '*.test.ts' -print | xargs bun test","test:public-sdk":"bun scripts/verify-public-sdk.ts","test:standalone":"bun scripts/verify-standalone.ts","typecheck:public-sdk":"bun x tsc --project tsconfig.public-sdk.json",lint:"bun x --bun pickier .","lint:fix":"bun x --bun pickier . --fix",format:"bun x --bun pickier . --format","format:fix":"bun x --bun pickier . --format --write",changelog:"bun x @stacksjs/logsmith --verbose","changelog:generate":"bun x @stacksjs/logsmith --output CHANGELOG.md",release:"bun x --bun @stacksjs/bumpx prompt --recursive","release:patch":"bun x --bun @stacksjs/bumpx patch --recursive --commit --tag --push --yes","release:minor":"bun x --bun @stacksjs/bumpx minor --recursive --commit --tag --push --yes",typecheck:"bun x tsc --noEmit","dev:docs":"bun --bun bunpress dev docs","build:docs":"bun --bun bunpress build docs","preview:docs":"bun --bun bunpress preview docs"},j={"@stacksjs/bumpx":"^0.2.32","@stacksjs/bunpress":"^0.2.31","@stacksjs/clapp":"^0.2.16",pickier:"^0.1.88","@stacksjs/gitlint":"^0.1.8","@stacksjs/logsmith":"^0.2.14","@types/bun":"^1.4.4","buddy-bot":"^0.10.5","bun-git-hooks":"^0.3.3","@dtsx/bun":"workspace:*",mitata:"^1.0.34","oxc-transform":"^0.157.0","oxc-parser":"^0.157.0",tsdown:"^0.23.7",typescript:"^7.0.2"},y=["packages/*"],f={typescript:"^7.0.2"},v={name:e,type:i,version:n,private:r,description:c,author:u,license:a,homepage:b,repository:o,bugs:p,keywords:d,exports:m,module:k,types:l,bin:x,files:g,scripts:h,devDependencies:j,workspaces:y,overrides:f,"git-hooks":{"pre-commit":{"staged-lint":{"*.{js,ts,json,yaml,yml,md}":"bun x --bun pickier lint --fix"}},"commit-msg":"bun x gitlint --edit .git/COMMIT_EDITMSG"}};export{u as author,x as bin,p as bugs,v as default,c as description,j as devDependencies,m as exports,g as files,b as homepage,d as keywords,a as license,k as module,e as name,f as overrides,r as private,o as repository,h as scripts,i as type,l as types,n as version,y as workspaces};
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{r}from"./chunk-90f37xen.js";import{we}from"./chunk-3rwbf45t.js";import{readFileSync as u}from"fs";import{readFile as p}from"fs/promises";import{resolve as g}from"path";function m(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/^\s*\/\/.*$/gm,"").replace(/,\s*([}\]])/g,"$1")}function ks(t,e){try{return{...JSON.parse(m(u(t,"utf8"))).compilerOptions,...e}}catch(s){throw Error(`Error reading tsconfig.json: ${s instanceof Error?s.message:String(s)}`)}}function f(t,e){let s=e.declarationsOnly?t.filter((o)=>o.endsWith(".d.ts")):t;if(e.include?.length){let o=e.include.map((n)=>new RegExp(n.replace(/\*/g,".*")));s=s.filter((n)=>o.some((i)=>i.test(n)))}if(e.exclude?.length){let o=e.exclude.map((n)=>new RegExp(n.replace(/\*/g,".*")));s=s.filter((n)=>!o.some((i)=>i.test(n)))}return s}async function gt(t,e={}){let s=performance.now(),o=f(t,e),n=[];for(let a of o)try{let c=await p(a,"utf8");for(let l of we(c))n.push({file:a,line:l.line,column:l.column,message:l.message,code:Number(l.code.slice(4)),severity:"error",category:"Error"})}catch(c){n.push({file:a,line:0,column:0,message:c instanceof Error?c.message:String(c),code:1000,severity:"error",category:"Error"})}let i=e.maxErrors?n.slice(0,e.maxErrors):n;return{success:i.length===0,diagnostics:i,errorCount:i.length,warningCount:0,infoCount:0,filesChecked:o,durationMs:performance.now()-s}}function Dr(t,e={}){return gt(t,{...e,declarationsOnly:!0})}async function Ts(t){let e=new Map;for(let s of t){let o=await p(s,"utf8").catch(()=>""),n=[];for(let i of r(o,s,!1,!0))if(i.isExported&&i.kind==="function"&&!i.returnType)n.push({line:1,column:1,message:"Exported function requires an explicit return type",declarationName:i.name,missingAnnotation:"return"});e.set(s,{compatible:n.length===0,issues:n})}return e}function d(t,e,s){let o=t.split(`
3
- `);if(e<1||e>o.length||s<1||s>o[e-1].length+1)return null;let n=s-1;for(let i=0;i<e-1;i++)n+=o[i].length+1;return n}function Pr(t,e,s){try{let o=u(t,"utf8"),n=d(o,e,s);if(n===null)return null;let i=r(o,t,!1).find((a)=>n>=(a.start??0)&&n<=(a.end??o.length));return i?.typeAnnotation??i?.returnType??i?.text??null}catch{return null}}function As(t,e,s){let o=Pr(t,e,s);return o?{type:o}:null}function Ds(t){if(t.success)return`\u2713 Type check passed (${t.filesChecked.length} files checked in ${t.durationMs}ms)`;return["\u2717 Type check failed",` ${t.errorCount} error(s), ${t.warningCount} warning(s)`,...t.diagnostics.map((e)=>`\u2717 ${e.file}:${e.line}:${e.column}
2
+ import{r}from"./chunk-sqa3ke1a.js";import{ke}from"./chunk-hgg4aqvf.js";import{readFileSync as u}from"fs";import{readFile as p}from"fs/promises";import{resolve as g}from"path";function m(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/^\s*\/\/.*$/gm,"").replace(/,\s*([}\]])/g,"$1")}function Ps(t,e){try{return{...JSON.parse(m(u(t,"utf8"))).compilerOptions,...e}}catch(s){throw Error(`Error reading tsconfig.json: ${s instanceof Error?s.message:String(s)}`)}}function f(t,e){let s=e.declarationsOnly?t.filter((o)=>o.endsWith(".d.ts")):t;if(e.include?.length){let o=e.include.map((n)=>new RegExp(n.replace(/\*/g,".*")));s=s.filter((n)=>o.some((i)=>i.test(n)))}if(e.exclude?.length){let o=e.exclude.map((n)=>new RegExp(n.replace(/\*/g,".*")));s=s.filter((n)=>!o.some((i)=>i.test(n)))}return s}async function xt(t,e={}){let s=performance.now(),o=f(t,e),n=[];for(let a of o)try{let c=await p(a,"utf8");for(let l of ke(c))n.push({file:a,line:l.line,column:l.column,message:l.message,code:Number(l.code.slice(4)),severity:"error",category:"Error"})}catch(c){n.push({file:a,line:0,column:0,message:c instanceof Error?c.message:String(c),code:1000,severity:"error",category:"Error"})}let i=e.maxErrors?n.slice(0,e.maxErrors):n;return{success:i.length===0,diagnostics:i,errorCount:i.length,warningCount:0,infoCount:0,filesChecked:o,durationMs:performance.now()-s}}function Or(t,e={}){return xt(t,{...e,declarationsOnly:!0})}async function Rs(t){let e=new Map;for(let s of t){let o=await p(s,"utf8").catch(()=>""),n=[];for(let i of r(o,s,!1,!0))if(i.isExported&&i.kind==="function"&&!i.returnType)n.push({line:1,column:1,message:"Exported function requires an explicit return type",declarationName:i.name,missingAnnotation:"return"});e.set(s,{compatible:n.length===0,issues:n})}return e}function d(t,e,s){let o=t.split(`
3
+ `);if(e<1||e>o.length||s<1||s>o[e-1].length+1)return null;let n=s-1;for(let i=0;i<e-1;i++)n+=o[i].length+1;return n}function Ir(t,e,s){try{let o=u(t,"utf8"),n=d(o,e,s);if(n===null)return null;let i=r(o,t,!1).find((a)=>n>=(a.start??0)&&n<=(a.end??o.length));return i?.typeAnnotation??i?.returnType??i?.text??null}catch{return null}}function Ms(t,e,s){let o=Ir(t,e,s);return o?{type:o}:null}function Os(t){if(t.success)return`\u2713 Type check passed (${t.filesChecked.length} files checked in ${t.durationMs}ms)`;return["\u2717 Type check failed",` ${t.errorCount} error(s), ${t.warningCount} warning(s)`,...t.diagnostics.map((e)=>`\u2717 ${e.file}:${e.line}:${e.column}
4
4
  ${e.message}`)].join(`
5
- `)}function Ps(t){return gt(t.entrypoints.map((e)=>g(t.cwd,e)),{tsconfigPath:t.tsconfigPath,rootDir:t.root})}async function Rs(t,e){let o=(await Promise.all([gt(t),Dr(e)])).flatMap((n)=>n.diagnostics).map((n)=>({sourceName:n.file,sourceType:n.message,dtsType:"<invalid>"}));return{valid:o.length===0,mismatches:o}}
6
- export{ks,gt,Dr,Ts,Pr,As,Ds,Ps,Rs};
5
+ `)}function Is(t){return xt(t.entrypoints.map((e)=>g(t.cwd,e)),{tsconfigPath:t.tsconfigPath,rootDir:t.root})}async function Ls(t,e){let o=(await Promise.all([xt(t),Or(e)])).flatMap((n)=>n.diagnostics).map((n)=>({sourceName:n.file,sourceType:n.message,dtsType:"<invalid>"}));return{valid:o.length===0,mismatches:o}}
6
+ export{Ps,xt,Or,Rs,Ir,Ms,Os,Is,Ls};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{A}from"./chunk-f191378r.js";import{re}from"./chunk-vher6t7j.js";import{ne,$e}from"./chunk-41d5ehn0.js";import{Ln}from"./chunk-7x4eqjfw.js";import{spawn as j}from"child_process";var N=new Set(["cwd","root","outdir","entrypoints","include","exclude","autoIncludeReExports","outputStructure","tsconfigPath","moduleSpecifierMode","keepComments","isolatedDeclarations","clean","lineEnding"]);function x(l,f,d,n,u){let s=u.signal;s?.throwIfAborted();let c=u.timeoutMs??30000;if(!Number.isSafeInteger(c)||c<=0||c>2147483647)throw RangeError("Native project timeoutMs must be an integer between 1 and 2147483647");return new Promise((g,r)=>{let o=j(l,f,{cwd:n,stdio:["pipe","pipe","pipe"],windowsHide:!0}),i=[],a=[],e,h,v=!1,p=(t)=>{e??=t,o.kill()},m=()=>p(s?.reason instanceof Error?s.reason:Error("Native declaration project aborted",{cause:s?.reason})),b=setTimeout(()=>p(Error(`Native declaration project exceeded ${c}ms`)),c),E=(t,w)=>{if(v)return;if(v=!0,clearTimeout(b),s?.removeEventListener("abort",m),t)r(t);else g(w)};if(o.once("error",(t)=>E(t)),o.stdout.on("data",(t)=>i.push(Buffer.from(t))),o.stderr.on("data",(t)=>a.push(Buffer.from(t))),o.stdout.once("error",p),o.stderr.once("error",p),o.stdin.once("error",(t)=>{h??=t}),o.once("close",(t,w)=>{if(t!==0&&!e)e=Error(`Native declaration project failed (${w??t}): ${Buffer.concat(a).toString("utf8")}`);E(e??h,Buffer.concat(i).toString("utf8"))}),s?.addEventListener("abort",m,{once:!0}),s?.aborted)m();o.stdin.end(Buffer.from(d,"utf8"))})}async function Gi(l,f={},d={}){if(!l||l.includes("\x00"))throw Error("A native zig-dtsx executable is required");for(let i of Object.keys(f))if(!N.has(i))throw Error(`Native declaration project does not support option: ${i}`);d.signal?.throwIfAborted();let n={...A,...f};if(await ne(n),n.isolatedDeclarations===void 0)n.isolatedDeclarations=await re(n);let u=await Ln(n),s=["--batch"];if(!n.keepComments)s.push("--no-comments");if(n.isolatedDeclarations)s.push("--isolated-declarations");let c=JSON.stringify({protocol:"zig-dtsx-project",version:1,files:u.files.map((i)=>({source:i.source,context:i.context}))}),g=await x(l,s,c,n.cwd,d),r;try{r=JSON.parse(g)}catch(i){throw Error("Native executable did not return a valid zig-dtsx project protocol response",{cause:i})}if(!r||typeof r!=="object"||!("protocol"in r)||r.protocol!=="zig-dtsx-project"||!("version"in r)||r.version!==1||!("files"in r)||!Array.isArray(r.files)||r.files.length!==u.files.length)throw Error("Native executable returned an unsupported or incomplete project response");let o=new Map;for(let[i,a]of u.files.entries()){let e=r.files[i];if(!e||typeof e!=="object"||!("sourceFile"in e)||e.sourceFile!==a.sourceFile||!("outputFile"in e)||e.outputFile!==a.outputFile||!("sourceHash"in e)||e.sourceHash!==a.context.sourceHash||!("content"in e)||typeof e.content!=="string")throw Error(`Native executable returned a mismatched project result for ${a.sourceFile}`);o.set(a.outputFile,{content:e.content,lineEnding:n.lineEnding})}return d.signal?.throwIfAborted(),await $e(n,o),Object.freeze({filesGenerated:o.size,outputFiles:Object.freeze([...o.keys()])})}
3
+ export{Gi};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{r}from"./chunk-90f37xen.js";import{existsSync as g,readFileSync as h,writeFileSync as b}from"fs";function d(t){let e=[],s=/\b([A-Z][a-zA-Z0-9]*)\b/g,o;while((o=s.exec(t))!==null){let i=o[1];if(!D(i))e.push(i)}return[...new Set(e)]}function D(t){return new Set(["Array","Object","String","Number","Boolean","Symbol","BigInt","Function","Promise","Map","Set","WeakMap","WeakSet","Date","RegExp","Error","TypeError","RangeError","SyntaxError","Partial","Required","Readonly","Pick","Omit","Record","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","NoInfer","Generator","AsyncGenerator","IterableIterator","AsyncIterableIterator","PropertyKey","Iterable","AsyncIterable","ArrayLike","PromiseLike","ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Uint8Array","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"]).has(t)}function x(t){if(t.kind!=="type")return!1;let e=t.typeAnnotation||"";if(t.generics)return!1;if(e.includes("{")||e.includes("(")||e.includes("<"))return!1;return/^[\w\s|&]+$/.test(e)}function v(t){if(t.kind!=="interface")return!1;if(!t.members||t.members.length===0){if(!t.extends)return!0}return!1}function I(t,e){let s={...t,members:[...t.members||[],...e.members||[]],leadingComments:[...t.leadingComments||[],...e.leadingComments||[]]};if(t.extends&&e.extends){let o=t.extends.split(",").map((n)=>n.trim()),i=e.extends.split(",").map((n)=>n.trim());s.extends=[...new Set([...o,...i])].join(", ")}else s.extends=t.extends||e.extends;return s}function A(t){let e={import:0,interface:1,type:2,class:3,enum:4,function:5,variable:6,export:7};return[...t].sort((s,o)=>{let i=e[s.kind]??99,n=e[o.kind]??99;if(i!==n)return i-n;return s.name.localeCompare(o.name)})}function T(t){let e=[],s=[];for(let i=0;i<t.length;i++){let n=t[i];if(n.kind==="import")e.push(n);else s.push(n)}return[...[...e].sort((i,n)=>{let a=i.source||"",c=n.source||"",p=a.startsWith("node:")||a==="bun",m=c.startsWith("node:")||c==="bun";if(p&&!m)return-1;if(!p&&m)return 1;let l=!a.startsWith("."),u=!c.startsWith(".");if(l&&!u)return-1;if(!l&&u)return 1;return a.localeCompare(c)}),...s]}function S(t){let e=new Set;for(let i of t){if(i.kind==="import")continue;let n=i.text||"",a=i.typeAnnotation||"",c=i.returnType||"",p=i.extends||"",m=i.implements?.join(" ")||"",l=`${n} ${a} ${c} ${p} ${m}`;for(let u of d(l))e.add(u);if(i.members)for(let u of i.members){let f=`${u.typeAnnotation||""} ${u.returnType||""}`;for(let y of d(f))e.add(y)}if(i.parameters){for(let u of i.parameters)if(u.type)for(let f of d(u.type))e.add(f)}}let s=0;return{declarations:t.map((i)=>{if(i.kind!=="import"||!i.specifiers)return i;let n=i.specifiers.filter((a)=>{let c=a.alias||a.name;return e.has(c)});if(n.length===0){if(!i.isSideEffect)return s++,null}if(n.length<(i.specifiers?.length||0))return s+=(i.specifiers?.length||0)-n.length,{...i,specifiers:n};return i}).filter((i)=>i!==null),removed:s}}function k(t){let e=new Map,s=0;for(let o of t){if(o.kind==="import"){let n=`import:${o.source}`;if(e.has(n)){let a=e.get(n),c=[...a.specifiers||[],...o.specifiers||[]],p=Array.from(new Map(c.map((m)=>[m.alias||m.name,m])).values());e.set(n,{...a,specifiers:p}),s++}else e.set(n,o);continue}let i=`${o.kind}:${o.name}`;if(e.has(i))s++;else e.set(i,o)}return{declarations:Array.from(e.values()),removed:s}}function z(t){let e=new Map,s=[];for(let n of t)if(n.kind==="interface"){let a=n.name;if(!e.has(a))e.set(a,[]);e.get(a).push(n)}else s.push(n);let o=0,i=[];for(let[n,a]of e)if(a.length>1){let c=a[0];for(let p=1;p<a.length;p++)c=I(c,a[p]),o++;i.push(c)}else i.push(a[0]);return{declarations:[...s,...i],merged:o}}function w(t){let e=new Map,s=new Set;for(let n of t)if(x(n))e.set(n.name,n.typeAnnotation||""),s.add(n.name);if(e.size===0)return{declarations:t,inlined:0};function o(n){let a=n;for(let[c,p]of e){let m=new RegExp(`\\b${c}\\b`,"g");a=a.replace(m,p)}return a}return{declarations:t.filter((n)=>n.kind!=="type"||!s.has(n.name)).map((n)=>{if(n.typeAnnotation)n={...n,typeAnnotation:o(n.typeAnnotation)};if(n.returnType)n={...n,returnType:o(n.returnType)};if(n.extends)n={...n,extends:o(n.extends)};return n}),inlined:e.size}}function R(t){let e=t.length,s=t.filter((o)=>!v(o));return{declarations:s,removed:e-s.length}}function cr(t,e={}){let s=[...t],o={originalSize:0,optimizedSize:0,savings:0,savingsPercent:0,removedImports:0,removedDeclarations:0,mergedInterfaces:0,inlinedTypes:0};if(e.removeUnusedImports){let{declarations:i,removed:n}=S(s);s=i,o.removedImports=n}if(e.deduplicateDeclarations){let{declarations:i,removed:n}=k(s);s=i,o.removedDeclarations+=n}if(e.mergeInterfaces){let{declarations:i,merged:n}=z(s);s=i,o.mergedInterfaces=n}if(e.removeEmptyInterfaces){let{declarations:i,removed:n}=R(s);s=i,o.removedDeclarations+=n}if(e.inlineSimpleTypes){let{declarations:i,inlined:n}=w(s);s=i,o.inlinedTypes=n}if(e.sortImports)s=T(s);if(e.sortDeclarations)s=A(s);return{declarations:s,result:o}}async function Mi(t,e={}){if(!g(t))throw Error(`File not found: ${t}`);let s=h(t,"utf-8"),o=Buffer.byteLength(s,"utf-8"),i=r(s,t,!e.removeComments),{declarations:n,result:a}=cr(i,e),c=C(n,e);if(e.minify)c=lr(c);let p=Buffer.byteLength(c,"utf-8");return a.originalSize=o,a.optimizedSize=p,a.savings=o-p,a.savingsPercent=Math.round(a.savings/o*100),b(t,c),a}function C(t,e){let s=[];for(let o of t){if(!e.removeComments&&o.leadingComments)for(let i of o.leadingComments)s.push(i);if(o.text)s.push(o.text);else s.push(E(o));s.push("")}return s.join(`
3
- `)}function E(t){let e=[];if(t.isExported)e.push("export");if(t.isDefault)e.push("default");switch(t.kind){case"import":if(t.isTypeOnly)e.push("import type");else e.push("import");if(t.specifiers&&t.specifiers.length>0){let s=t.specifiers.map((o)=>{let i=o.isType?"type ":"";return o.alias?`${i}${o.name} as ${o.alias}`:`${i}${o.name}`}).join(", ");e.push(`{ ${s} }`)}e.push("from"),e.push(`'${t.source}'`);break;case"function":if(e.push("declare function"),e.push(t.name),t.generics)e.push(t.generics);if(e.push(`(${B(t.parameters)})`),t.returnType)e.push(`: ${t.returnType}`);break;case"variable":if(e.push("declare const"),e.push(t.name),t.typeAnnotation)e.push(`: ${t.typeAnnotation}`);break;case"interface":if(e.push("interface"),e.push(t.name),t.generics)e.push(t.generics);if(t.extends)e.push(`extends ${t.extends}`);if(e.push("{"),t.members)for(let s of t.members)e.push(` ${s.name}${s.typeAnnotation?`: ${s.typeAnnotation}`:""}`);e.push("}");break;case"type":if(e.push("type"),e.push(t.name),t.generics)e.push(t.generics);e.push("="),e.push(t.typeAnnotation||"unknown");break;case"class":if(e.push("declare class"),e.push(t.name),t.generics)e.push(t.generics);if(t.extends)e.push(`extends ${t.extends}`);if(t.implements?.length)e.push(`implements ${t.implements.join(", ")}`);e.push("{ }");break;case"enum":e.push("declare enum"),e.push(t.name),e.push("{ }");break;default:return t.text||""}return e.join(" ")}function B(t){if(!t)return"";return t.map((e)=>{let s="";if(e.rest)s+="...";if(s+=e.name,e.optional)s+="?";if(e.type)s+=`: ${e.type}`;return s}).join(", ")}function lr(t){return t.replace(/(?<!\/\*\*)\/\/[^\n]*/g,"").replace(/^\s*[\r\n]/gm,"").replace(/ {2,}/g," ").replace(/\s*([{}[\]();,:])\s*/g,"$1").replace(/(\w)(\{)/g,"$1 $2").replace(/(\})([a-z])/gi,"$1 $2").replace(/(export|import|type|interface|class|function|const|let|var|extends|implements|declare)\s*/g,"$1 ").trim()}
4
- export{cr,Mi,lr};
2
+ import{r}from"./chunk-sqa3ke1a.js";import{existsSync as g,readFileSync as h,writeFileSync as b}from"fs";function d(t){let e=[],s=/\b([A-Z][a-zA-Z0-9]*)\b/g,o;while((o=s.exec(t))!==null){let i=o[1];if(!D(i))e.push(i)}return[...new Set(e)]}function D(t){return new Set(["Array","Object","String","Number","Boolean","Symbol","BigInt","Function","Promise","Map","Set","WeakMap","WeakSet","Date","RegExp","Error","TypeError","RangeError","SyntaxError","Partial","Required","Readonly","Pick","Omit","Record","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","NoInfer","Generator","AsyncGenerator","IterableIterator","AsyncIterableIterator","PropertyKey","Iterable","AsyncIterable","ArrayLike","PromiseLike","ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Uint8Array","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"]).has(t)}function x(t){if(t.kind!=="type")return!1;let e=t.typeAnnotation||"";if(t.generics)return!1;if(e.includes("{")||e.includes("(")||e.includes("<"))return!1;return/^[\w\s|&]+$/.test(e)}function v(t){if(t.kind!=="interface")return!1;if(!t.members||t.members.length===0){if(!t.extends)return!0}return!1}function I(t,e){let s={...t,members:[...t.members||[],...e.members||[]],leadingComments:[...t.leadingComments||[],...e.leadingComments||[]]};if(t.extends&&e.extends){let o=t.extends.split(",").map((n)=>n.trim()),i=e.extends.split(",").map((n)=>n.trim());s.extends=[...new Set([...o,...i])].join(", ")}else s.extends=t.extends||e.extends;return s}function A(t){let e={import:0,interface:1,type:2,class:3,enum:4,function:5,variable:6,export:7};return[...t].sort((s,o)=>{let i=e[s.kind]??99,n=e[o.kind]??99;if(i!==n)return i-n;return s.name.localeCompare(o.name)})}function T(t){let e=[],s=[];for(let i=0;i<t.length;i++){let n=t[i];if(n.kind==="import")e.push(n);else s.push(n)}return[...[...e].sort((i,n)=>{let a=i.source||"",c=n.source||"",p=a.startsWith("node:")||a==="bun",m=c.startsWith("node:")||c==="bun";if(p&&!m)return-1;if(!p&&m)return 1;let l=!a.startsWith("."),u=!c.startsWith(".");if(l&&!u)return-1;if(!l&&u)return 1;return a.localeCompare(c)}),...s]}function S(t){let e=new Set;for(let i of t){if(i.kind==="import")continue;let n=i.text||"",a=i.typeAnnotation||"",c=i.returnType||"",p=i.extends||"",m=i.implements?.join(" ")||"",l=`${n} ${a} ${c} ${p} ${m}`;for(let u of d(l))e.add(u);if(i.members)for(let u of i.members){let f=`${u.typeAnnotation||""} ${u.returnType||""}`;for(let y of d(f))e.add(y)}if(i.parameters){for(let u of i.parameters)if(u.type)for(let f of d(u.type))e.add(f)}}let s=0;return{declarations:t.map((i)=>{if(i.kind!=="import"||!i.specifiers)return i;let n=i.specifiers.filter((a)=>{let c=a.alias||a.name;return e.has(c)});if(n.length===0){if(!i.isSideEffect)return s++,null}if(n.length<(i.specifiers?.length||0))return s+=(i.specifiers?.length||0)-n.length,{...i,specifiers:n};return i}).filter((i)=>i!==null),removed:s}}function k(t){let e=new Map,s=0;for(let o of t){if(o.kind==="import"){let n=`import:${o.source}`;if(e.has(n)){let a=e.get(n),c=[...a.specifiers||[],...o.specifiers||[]],p=Array.from(new Map(c.map((m)=>[m.alias||m.name,m])).values());e.set(n,{...a,specifiers:p}),s++}else e.set(n,o);continue}let i=`${o.kind}:${o.name}`;if(e.has(i))s++;else e.set(i,o)}return{declarations:Array.from(e.values()),removed:s}}function z(t){let e=new Map,s=[];for(let n of t)if(n.kind==="interface"){let a=n.name;if(!e.has(a))e.set(a,[]);e.get(a).push(n)}else s.push(n);let o=0,i=[];for(let[n,a]of e)if(a.length>1){let c=a[0];for(let p=1;p<a.length;p++)c=I(c,a[p]),o++;i.push(c)}else i.push(a[0]);return{declarations:[...s,...i],merged:o}}function w(t){let e=new Map,s=new Set;for(let n of t)if(x(n))e.set(n.name,n.typeAnnotation||""),s.add(n.name);if(e.size===0)return{declarations:t,inlined:0};function o(n){let a=n;for(let[c,p]of e){let m=new RegExp(`\\b${c}\\b`,"g");a=a.replace(m,p)}return a}return{declarations:t.filter((n)=>n.kind!=="type"||!s.has(n.name)).map((n)=>{if(n.typeAnnotation)n={...n,typeAnnotation:o(n.typeAnnotation)};if(n.returnType)n={...n,returnType:o(n.returnType)};if(n.extends)n={...n,extends:o(n.extends)};return n}),inlined:e.size}}function R(t){let e=t.length,s=t.filter((o)=>!v(o));return{declarations:s,removed:e-s.length}}function pr(t,e={}){let s=[...t],o={originalSize:0,optimizedSize:0,savings:0,savingsPercent:0,removedImports:0,removedDeclarations:0,mergedInterfaces:0,inlinedTypes:0};if(e.removeUnusedImports){let{declarations:i,removed:n}=S(s);s=i,o.removedImports=n}if(e.deduplicateDeclarations){let{declarations:i,removed:n}=k(s);s=i,o.removedDeclarations+=n}if(e.mergeInterfaces){let{declarations:i,merged:n}=z(s);s=i,o.mergedInterfaces=n}if(e.removeEmptyInterfaces){let{declarations:i,removed:n}=R(s);s=i,o.removedDeclarations+=n}if(e.inlineSimpleTypes){let{declarations:i,inlined:n}=w(s);s=i,o.inlinedTypes=n}if(e.sortImports)s=T(s);if(e.sortDeclarations)s=A(s);return{declarations:s,result:o}}async function ji(t,e={}){if(!g(t))throw Error(`File not found: ${t}`);let s=h(t,"utf-8"),o=Buffer.byteLength(s,"utf-8"),i=r(s,t,!e.removeComments),{declarations:n,result:a}=pr(i,e),c=C(n,e);if(e.minify)c=mr(c);let p=Buffer.byteLength(c,"utf-8");return a.originalSize=o,a.optimizedSize=p,a.savings=o-p,a.savingsPercent=Math.round(a.savings/o*100),b(t,c),a}function C(t,e){let s=[];for(let o of t){if(!e.removeComments&&o.leadingComments)for(let i of o.leadingComments)s.push(i);if(o.text)s.push(o.text);else s.push(E(o));s.push("")}return s.join(`
3
+ `)}function E(t){let e=[];if(t.isExported)e.push("export");if(t.isDefault)e.push("default");switch(t.kind){case"import":if(t.isTypeOnly)e.push("import type");else e.push("import");if(t.specifiers&&t.specifiers.length>0){let s=t.specifiers.map((o)=>{let i=o.isType?"type ":"";return o.alias?`${i}${o.name} as ${o.alias}`:`${i}${o.name}`}).join(", ");e.push(`{ ${s} }`)}e.push("from"),e.push(`'${t.source}'`);break;case"function":if(e.push("declare function"),e.push(t.name),t.generics)e.push(t.generics);if(e.push(`(${B(t.parameters)})`),t.returnType)e.push(`: ${t.returnType}`);break;case"variable":if(e.push("declare const"),e.push(t.name),t.typeAnnotation)e.push(`: ${t.typeAnnotation}`);break;case"interface":if(e.push("interface"),e.push(t.name),t.generics)e.push(t.generics);if(t.extends)e.push(`extends ${t.extends}`);if(e.push("{"),t.members)for(let s of t.members)e.push(` ${s.name}${s.typeAnnotation?`: ${s.typeAnnotation}`:""}`);e.push("}");break;case"type":if(e.push("type"),e.push(t.name),t.generics)e.push(t.generics);e.push("="),e.push(t.typeAnnotation||"unknown");break;case"class":if(e.push("declare class"),e.push(t.name),t.generics)e.push(t.generics);if(t.extends)e.push(`extends ${t.extends}`);if(t.implements?.length)e.push(`implements ${t.implements.join(", ")}`);e.push("{ }");break;case"enum":e.push("declare enum"),e.push(t.name),e.push("{ }");break;default:return t.text||""}return e.join(" ")}function B(t){if(!t)return"";return t.map((e)=>{let s="";if(e.rest)s+="...";if(s+=e.name,e.optional)s+="?";if(e.type)s+=`: ${e.type}`;return s}).join(", ")}function mr(t){return t.replace(/(?<!\/\*\*)\/\/[^\n]*/g,"").replace(/^\s*[\r\n]/gm,"").replace(/ {2,}/g," ").replace(/\s*([{}[\]();,:])\s*/g,"$1").replace(/(\w)(\{)/g,"$1 $2").replace(/(\})([a-z])/gi,"$1 $2").replace(/(export|import|type|interface|class|function|const|let|var|extends|implements|declare)\s*/g,"$1 ").trim()}
4
+ export{pr,ji,mr};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- var r=/^\/\/\/\s*<reference\s+(?:path|types|lib|no-default-lib)\s*=\s*["'][^"']+["']\s*\/>/,E=/^\/\/\/\s*<amd-module\s+name\s*=\s*["'][^"']+["']\s*\/>/,f=/^\/\/\/\s*<amd-dependency\s+path\s*=\s*["'][^"']+["']/;function Cn(t){let l=[],a=0;for(let e=0;e<=t.length;e++)if(e===t.length||t[e]===`
2
+ var r=/^\/\/\/\s*<reference\s+(?:path|types|lib|no-default-lib)\s*=\s*["'][^"']+["']\s*\/>/,E=/^\/\/\/\s*<amd-module\s+name\s*=\s*["'][^"']+["']\s*\/>/,f=/^\/\/\/\s*<amd-dependency\s+path\s*=\s*["'][^"']+["']/;function En(t){let l=[],a=0;for(let e=0;e<=t.length;e++)if(e===t.length||t[e]===`
3
3
  `){let n=a,i=e;while(n<i&&(t[n]===" "||t[n]==="\t"||t[n]==="\r"))n++;while(i>n&&(t[i-1]===" "||t[i-1]==="\t"||t[i-1]==="\r"))i--;let s=t.slice(n,i);if(a=e+1,s.startsWith("///")){if(s.indexOf("<")===-1)continue;if(r.test(s)||E.test(s)||f.test(s))l.push(s)}else if(s===""||s.startsWith("//"))continue;else break}return l}
4
- export{Cn};
4
+ export{En};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import _ from"process";import{existsSync as U}from"fs";import{arch as I,platform as E}from"os";import{fileURLToPath as L}from"url";var T=["native","typescript"];function K(n,t="engine"){if(n===void 0||n===null||n==="")return;if(typeof n==="string"&&T.includes(n))return n;throw Error(`Invalid ${t} ${JSON.stringify(n)}: expected "native" or "typescript"`)}var S;function mi(n){S=K(n)}function q(n){return K(n)??S??K(_.env.DTSX_ENGINE,"DTSX_ENGINE")??"native"}var b;function w(){return`${E()==="win32"?"windows":E()}-${I()}`}function z(n){let t=[],e=_.env.DTSX_NATIVE_LIBRARY;if(e)t.push(e);for(let r of[`../native/${w()}/${n}`,`../../native/${w()}/${n}`,`../../zig-dtsx/zig-out/lib/${n}`,`../../zig-dtsx/zig-out/bin/${n}`])try{t.push(L(new URL(r,import.meta.url)))}catch{}return t}function B(){if(typeof globalThis.Bun>"u")return null;let n;try{n=import.meta.require("bun:ffi")}catch{return null}let{dlopen:t,FFIType:e,ptr:r,suffix:c,toArrayBuffer:a}=n,g=c==="dll"?`zig-dtsx.${c}`:`libzig-dtsx.${c}`;for(let u of z(g)){if(!U(u))continue;try{let p=t(u,{process_source_checked_v1:{args:[e.ptr,e.u64,e.bool,e.bool,e.ptr,e.ptr],returns:e.ptr},process_source_with_context_v1:{args:[e.ptr,e.u64,e.bool,e.bool,e.ptr,e.u64,e.ptr,e.ptr],returns:e.ptr},free_result:{args:[e.ptr,e.u64],returns:e.void}}),{symbols:l}=p,f=new TextDecoder;return{checked:(i,o,d,m,y,h)=>l.process_source_checked_v1(r(i),o,d,m,r(y),r(h)),contextual:(i,o,d,m,y,h,A,N)=>l.process_source_with_context_v1(r(i),o,d,m,r(y),h,r(A),r(N)),read:(i,o)=>{if(!i)return"";let d=o?f.decode(a(i,0,o)):"";return l.free_result(i,o),d}}}catch{continue}}return null}function k(){if(b===void 0)b=B();return b}function gi(n){return q(n)==="native"&&k()!==null}var D=new TextEncoder,s=new Uint8Array(65536),x=new BigUint64Array(1),v=new Uint32Array(1);function Ee(n,t){if(q(t.engine)==="typescript")return null;let e=k();if(!e)return null;if(n.length*3>s.length)s=new Uint8Array(n.length*3);let{written:r}=D.encodeInto(n,s),c=t.sourceFile!==void 0||(t.inferenceSources?.size??0)>0||(t.augmentationImports?.size??0)>0,a;if(c){let u=t.sourceFile??"source.ts",p=D.encode(JSON.stringify({version:1,moduleSpecifierMode:"preserve",sourceFile:u,outputFile:u.replace(/\.(?:[cm]?[jt]sx?|vue|stx)$/,".d.ts"),sourceHash:new Bun.CryptoHasher("sha256").update(s.subarray(0,r)).digest("hex"),rewrites:[],augmentationImports:[...t.augmentationImports??[]],inferenceSources:[...t.inferenceSources??[]].map(([l,f])=>({specifier:l,source:f}))}));a=e.contextual(s,r,t.keepComments,t.isolatedDeclarations,p,p.length,x,v)}else a=e.checked(s,r,t.keepComments,t.isolatedDeclarations,x,v);let g=Number(x[0]);if(v[0]!==0)return e.read(a,g),null;return e.read(a,g)}
3
+ export{K,mi,q,gi,Ee};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{s}from"./chunk-ykrdzatr.js";function je(d={}){let{buildStart:l=!0,buildEnd:u=!1,writeBundle:c=!1,modes:t,onGenerated:f,onError:o,...p}=d,i="production",r=async()=>{try{let e=await s(p);f?.(e)}catch(e){let a=e instanceof Error?e:Error(String(e));if(o?.(a),!o)console.error("[dtsx] Generation failed:",a.message)}},n=()=>{if(!t||t.length===0)return!0;return t.includes(i)};return{name:"dtsx",apply(e){return i=e.mode,!0},async buildStart(){if(l&&n())await r()},async buildEnd(){if(u&&n())await r()},async writeBundle(){if(c&&n())await r()}}}var Sa=je,$a=je;
3
- export{je,Sa,$a};
2
+ import{s}from"./chunk-fkdq1x5f.js";function Ke(d={}){let{buildStart:l=!0,buildEnd:u=!1,writeBundle:c=!1,modes:t,onGenerated:f,onError:o,...p}=d,i="production",r=async()=>{try{let e=await s(p);f?.(e)}catch(e){let a=e instanceof Error?e:Error(String(e));if(o?.(a),!o)console.error("[dtsx] Generation failed:",a.message)}},n=()=>{if(!t||t.length===0)return!0;return t.includes(i)};return{name:"dtsx",apply(e){return i=e.mode,!0},async buildStart(){if(l&&n())await r()},async buildEnd(){if(u&&n())await r()},async writeBundle(){if(c&&n())await r()}}}var Da=Ke,Pa=Ke;
3
+ export{Ke,Da,Pa};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var Zt=["builtin","external","internal","parent","sibling","index","type","unknown"];function Qt(e){let i=e.match(/^(import\s+)(type\s+)?(.+?)\s+from\s+['"]([^'"]+)['"]/);if(!i){let p=e.match(/^import\s+['"]([^'"]+)['"]/);if(p)return{statement:e,source:p[1],isTypeOnly:!1,group:ht(p[1]),specifiers:[]};return null}let[,,u,l,c]=i,g=!!u,m,h,f=[],n=l.trim(),a=n.match(/^\*\s+as\s+(\w+)$/);if(a)h=a[1];else if(n.includes("{")){let p=n.match(/^(\w+)\s*,/);if(p)m=p[1];let d=n.match(/\{([^}]+)\}/);if(d){let I=d[1].split(",").map((y)=>y.trim()).filter(Boolean);f.push(...I)}}else if(/^\w+$/.test(n))m=n;else{let p=n.match(/\{([^}]+)\}/);if(p){let d=p[1].split(",").map((I)=>I.trim()).filter(Boolean);f.push(...d)}}return{statement:e,source:c,isTypeOnly:g,group:ht(c,g),specifiers:f,defaultImport:m,namespaceImport:h}}function ht(e,i=!1){if(i)return"type";if(e.startsWith("node:")||O(e))return"builtin";if(e.startsWith("./"))return"sibling";if(e.startsWith("../"))return"parent";if(e==="."||e==="./index")return"index";if(e.startsWith("@/")||e.startsWith("~/")||e.startsWith("#"))return"internal";if(e.startsWith("@")||/^[a-z]/.test(e))return"external";return"unknown"}var b=new Set(["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","perf_hooks","process","punycode","querystring","readline","repl","stream","string_decoder","sys","timers","tls","tty","url","util","v8","vm","wasi","worker_threads","zlib"]);function O(e){return b.has(e)}function en(e,i={}){let{order:u=[],groupByType:l=!0,groups:c=Zt,alphabetize:g=!0,caseInsensitive:m=!0,typeImportsLast:h=!1,separateTypeImports:f=!1}=i,n=[];for(let t of e){let r=Qt(t);if(r)n.push(r);else n.push({statement:t,source:"",isTypeOnly:!1,group:"unknown",specifiers:[]})}let a=u.length>0?u.map((t)=>{if(t.startsWith("^"))try{return{regex:new RegExp(t),prefix:t.slice(1)}}catch{return{prefix:t.slice(1)}}return{prefix:t}}):[],p=(t)=>{for(let r=0;r<a.length;r++){let s=a[r];if(s.regex){if(s.regex.test(t))return r}else if(t.startsWith(s.prefix)||t.includes(`/${s.prefix}`))return r}return a.length},d=new Map,I=(t)=>{let r=d.get(t);if(r!==void 0)return r;let s=c.indexOf(t),o=s>=0?s:c.length;return d.set(t,o),o},y=(t,r)=>{if(a.length>0){let s=p(t.source),o=p(r.source);if(s!==o)return s-o}if(l){let s=I(t.group),o=I(r.group);if(s!==o)return s-o}if(h&&t.isTypeOnly!==r.isTypeOnly)return t.isTypeOnly?1:-1;if(g){let s=m?t.source.toLowerCase():t.source,o=m?r.source.toLowerCase():r.source;return s.localeCompare(o)}return 0};if(n.sort(y),l){let t=[],r=null;for(let s of n){if(r!==null&&s.group!==r){let o=c.indexOf(r),x=c.indexOf(s.group);if(o>=0&&x>=0&&o!==x)t.push("")}t.push(s.statement),r=s.group}return t}return n.map((t)=>t.statement)}function Rr(e,i={}){let u=e.split(`
3
- `),l=[],c=[],g=-1;for(let n=0;n<u.length;n++){let a=u[n].trim();if(a.startsWith("import "))l.push(u[n]),c.push(n),g=n;else if(l.length>0&&a==="")continue;else if(l.length>0&&!a.startsWith("import "))break}if(l.length===0)return e;let m=en(l,i),h=u.slice(0,c[0]),f=u.slice(g+1);while(f.length>0&&f[0].trim()==="")f.shift();return[...h,...m,"",...f].join(`
4
- `)}function Ms(e={}){return{sort:(i)=>en(i,e),sortContent:(i)=>Rr(i,e),parse:Qt,detectGroup:ht}}var Os={default:{groupByType:!0,groups:Zt,alphabetize:!0,caseInsensitive:!0},node:{order:["node:"],groupByType:!0,groups:["builtin","external","internal","parent","sibling","index"],alphabetize:!0},bun:{order:["bun","node:"],groupByType:!0,groups:["builtin","external","internal","parent","sibling","index"],alphabetize:!0},typeSeparated:{groupByType:!0,groups:["builtin","external","internal","parent","sibling","index","type"],separateTypeImports:!0,alphabetize:!0},alphabetical:{groupByType:!1,alphabetize:!0,caseInsensitive:!0},none:{groupByType:!1,alphabetize:!1}};
5
- export{Zt,Qt,ht,en,Rr,Ms,Os};
2
+ var nn=["builtin","external","internal","parent","sibling","index","type","unknown"];function rn(e){let i=e.match(/^(import\s+)(type\s+)?(.+?)\s+from\s+['"]([^'"]+)['"]/);if(!i){let p=e.match(/^import\s+['"]([^'"]+)['"]/);if(p)return{statement:e,source:p[1],isTypeOnly:!1,group:wt(p[1]),specifiers:[]};return null}let[,,u,l,c]=i,g=!!u,m,h,f=[],n=l.trim(),a=n.match(/^\*\s+as\s+(\w+)$/);if(a)h=a[1];else if(n.includes("{")){let p=n.match(/^(\w+)\s*,/);if(p)m=p[1];let d=n.match(/\{([^}]+)\}/);if(d){let I=d[1].split(",").map((y)=>y.trim()).filter(Boolean);f.push(...I)}}else if(/^\w+$/.test(n))m=n;else{let p=n.match(/\{([^}]+)\}/);if(p){let d=p[1].split(",").map((I)=>I.trim()).filter(Boolean);f.push(...d)}}return{statement:e,source:c,isTypeOnly:g,group:wt(c,g),specifiers:f,defaultImport:m,namespaceImport:h}}function wt(e,i=!1){if(i)return"type";if(e.startsWith("node:")||O(e))return"builtin";if(e.startsWith("./"))return"sibling";if(e.startsWith("../"))return"parent";if(e==="."||e==="./index")return"index";if(e.startsWith("@/")||e.startsWith("~/")||e.startsWith("#"))return"internal";if(e.startsWith("@")||/^[a-z]/.test(e))return"external";return"unknown"}var b=new Set(["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","perf_hooks","process","punycode","querystring","readline","repl","stream","string_decoder","sys","timers","tls","tty","url","util","v8","vm","wasi","worker_threads","zlib"]);function O(e){return b.has(e)}function sn(e,i={}){let{order:u=[],groupByType:l=!0,groups:c=nn,alphabetize:g=!0,caseInsensitive:m=!0,typeImportsLast:h=!1,separateTypeImports:f=!1}=i,n=[];for(let t of e){let r=rn(t);if(r)n.push(r);else n.push({statement:t,source:"",isTypeOnly:!1,group:"unknown",specifiers:[]})}let a=u.length>0?u.map((t)=>{if(t.startsWith("^"))try{return{regex:new RegExp(t),prefix:t.slice(1)}}catch{return{prefix:t.slice(1)}}return{prefix:t}}):[],p=(t)=>{for(let r=0;r<a.length;r++){let s=a[r];if(s.regex){if(s.regex.test(t))return r}else if(t.startsWith(s.prefix)||t.includes(`/${s.prefix}`))return r}return a.length},d=new Map,I=(t)=>{let r=d.get(t);if(r!==void 0)return r;let s=c.indexOf(t),o=s>=0?s:c.length;return d.set(t,o),o},y=(t,r)=>{if(a.length>0){let s=p(t.source),o=p(r.source);if(s!==o)return s-o}if(l){let s=I(t.group),o=I(r.group);if(s!==o)return s-o}if(h&&t.isTypeOnly!==r.isTypeOnly)return t.isTypeOnly?1:-1;if(g){let s=m?t.source.toLowerCase():t.source,o=m?r.source.toLowerCase():r.source;return s.localeCompare(o)}return 0};if(n.sort(y),l){let t=[],r=null;for(let s of n){if(r!==null&&s.group!==r){let o=c.indexOf(r),x=c.indexOf(s.group);if(o>=0&&x>=0&&o!==x)t.push("")}t.push(s.statement),r=s.group}return t}return n.map((t)=>t.statement)}function Lr(e,i={}){let u=e.split(`
3
+ `),l=[],c=[],g=-1;for(let n=0;n<u.length;n++){let a=u[n].trim();if(a.startsWith("import "))l.push(u[n]),c.push(n),g=n;else if(l.length>0&&a==="")continue;else if(l.length>0&&!a.startsWith("import "))break}if(l.length===0)return e;let m=sn(l,i),h=u.slice(0,c[0]),f=u.slice(g+1);while(f.length>0&&f[0].trim()==="")f.shift();return[...h,...m,"",...f].join(`
4
+ `)}function Ns(e={}){return{sort:(i)=>sn(i,e),sortContent:(i)=>Lr(i,e),parse:rn,detectGroup:wt}}var Fs={default:{groupByType:!0,groups:nn,alphabetize:!0,caseInsensitive:!0},node:{order:["node:"],groupByType:!0,groups:["builtin","external","internal","parent","sibling","index"],alphabetize:!0},bun:{order:["bun","node:"],groupByType:!0,groups:["builtin","external","internal","parent","sibling","index"],alphabetize:!0},typeSeparated:{groupByType:!0,groups:["builtin","external","internal","parent","sibling","index","type"],separateTypeImports:!0,alphabetize:!0},alphabetical:{groupByType:!1,alphabetize:!0,caseInsensitive:!0},none:{groupByType:!1,alphabetize:!1}};
5
+ export{nn,rn,wt,sn,Lr,Ns,Fs};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- function Hs(e,i){return e.getText?.()??i.slice(e.pos??0,e.end??i.length)}function Ks(e){return e.getFullText?.().match(/\/\*[\s\S]*?\*\/|\/\/[^\n]*/g)??[]}function cn(e){let i=e,s=!0;while(s){s=!1;let n=i.trimStart();if(n.startsWith("/*")){let r=n.indexOf("*/",2);if(r!==-1){i=n.slice(r+2),s=!0;continue}}if(n.startsWith("//")){let r=n.indexOf(`
3
- `);if(r!==-1)i=n.slice(r+1),s=!0;else i="",s=!0}}return i.trim()}function qs(e,i){let n=e.substring(0,i).split(`
4
- `),r=[],t=n.length-1,u=!1,a=[];while(t>=0){let l=n[t].trim();if(l.endsWith("*/")&&!u)u=!0,a.unshift(l);else if(l.startsWith("/*")&&u)a.unshift(l),r.unshift(...a),a=[],u=!1;else if(u)a.unshift(l);else if(l.startsWith("//"))r.unshift(l);else if(l.startsWith("*")&&(t>0&&n[t-1].trim().startsWith("/*")))r.unshift(l);else if(l===""&&r.length>0);else if(l!=="")break;t--}return r}function Js(e){let i=!1,s="",n=!1;for(let r=0;r<e.length;r++){let t=e[r];if(!n&&!i&&(t==='"'||t==="'"||t==="`"))i=!0,s=t;else if(!n&&i&&t===s)i=!1;else if(t==="\\"&&!n){n=!0;continue}else if(!i&&t==="/"&&r<e.length-1){if(e[r+1]==="/")return e.substring(r)}n=!1}return null}function ln(e,i,s){let n=0,r=!1,t="",u=!1;if(!e.startsWith(i))return null;for(let a=0;a<e.length;a++){let l=e[a];if(!u&&(l==='"'||l==="'"||l==="`")){if(!r)r=!0,t=l;else if(l===t)r=!1}if(l==="\\"&&!u){u=!0;continue}if(u=!1,!r){if(e.substring(a,a+i.length)===i)n++;else if(e.substring(a,a+s.length)===s){if(n--,n===0)return{content:e.substring(0,a+s.length),rest:e.substring(a+s.length)}}}}return null}function Ys(e){let i=cn(e).trim(),s=i.match(/^(export\s+)?(async\s+)?function\s*(\*?)([a-zA-Z_$][\w$]*)/);if(!s)return null;let n=[];if(s[1])n.push("export");if(s[2])n.push("async");if(s[3])n.push("generator");let r=s[4],t=i.substring(s[0].length).trim(),u="";if(t.startsWith("<")){let o=ln(t,"<",">");if(o)u=o.content,t=o.rest.trim()}let a="";if(t.startsWith("(")){let o=ln(t,"(",")");if(o)a=o.content.slice(1,-1).trim(),t=o.rest.trim()}let l="void";if(t.startsWith(":")){let o=t.match(/^:\s*([^{;]+)/);if(o)l=o[1].trim()}return{name:r,generics:u,parameters:a,returnType:l,modifiers:n}}function Xs(e){return/^\s*export\s+/.test(e)}function Zs(e){return/^\s*export\s+type\s+/.test(e)}function Qs(e){let i=cn(e).trim(),s=i.match(/^(export\s+)?(const|let|var)\s+([a-zA-Z_$][\w$]*)/);if(!s)return null;let n=s[2],r=s[3],t=i.substring(s[0].length).trim(),u;if(t.startsWith(":")){let l=t.indexOf("=");if(l!==-1)u=t.substring(1,l).trim(),t=t.substring(l).trim();else u=t.substring(1).replace(/;?\s*$/,"").trim(),t=""}let a;if(t.startsWith("="))a=t.substring(1).replace(/;?\s*$/,"").trim();return{kind:n,name:r,typeAnnotation:u,value:a}}
5
- export{Hs,Ks,cn,qs,Js,ln,Ys,Xs,Zs,Qs};
2
+ function Ys(e,i){return e.getText?.()??i.slice(e.pos??0,e.end??i.length)}function Xs(e){return e.getFullText?.().match(/\/\*[\s\S]*?\*\/|\/\/[^\n]*/g)??[]}function dn(e){let i=e,s=!0;while(s){s=!1;let n=i.trimStart();if(n.startsWith("/*")){let r=n.indexOf("*/",2);if(r!==-1){i=n.slice(r+2),s=!0;continue}}if(n.startsWith("//")){let r=n.indexOf(`
3
+ `);if(r!==-1)i=n.slice(r+1),s=!0;else i="",s=!0}}return i.trim()}function Zs(e,i){let n=e.substring(0,i).split(`
4
+ `),r=[],t=n.length-1,u=!1,a=[];while(t>=0){let l=n[t].trim();if(l.endsWith("*/")&&!u)u=!0,a.unshift(l);else if(l.startsWith("/*")&&u)a.unshift(l),r.unshift(...a),a=[],u=!1;else if(u)a.unshift(l);else if(l.startsWith("//"))r.unshift(l);else if(l.startsWith("*")&&(t>0&&n[t-1].trim().startsWith("/*")))r.unshift(l);else if(l===""&&r.length>0);else if(l!=="")break;t--}return r}function Qs(e){let i=!1,s="",n=!1;for(let r=0;r<e.length;r++){let t=e[r];if(!n&&!i&&(t==='"'||t==="'"||t==="`"))i=!0,s=t;else if(!n&&i&&t===s)i=!1;else if(t==="\\"&&!n){n=!0;continue}else if(!i&&t==="/"&&r<e.length-1){if(e[r+1]==="/")return e.substring(r)}n=!1}return null}function pn(e,i,s){let n=0,r=!1,t="",u=!1;if(!e.startsWith(i))return null;for(let a=0;a<e.length;a++){let l=e[a];if(!u&&(l==='"'||l==="'"||l==="`")){if(!r)r=!0,t=l;else if(l===t)r=!1}if(l==="\\"&&!u){u=!0;continue}if(u=!1,!r){if(e.substring(a,a+i.length)===i)n++;else if(e.substring(a,a+s.length)===s){if(n--,n===0)return{content:e.substring(0,a+s.length),rest:e.substring(a+s.length)}}}}return null}function eo(e){let i=dn(e).trim(),s=i.match(/^(export\s+)?(async\s+)?function\s*(\*?)([a-zA-Z_$][\w$]*)/);if(!s)return null;let n=[];if(s[1])n.push("export");if(s[2])n.push("async");if(s[3])n.push("generator");let r=s[4],t=i.substring(s[0].length).trim(),u="";if(t.startsWith("<")){let o=pn(t,"<",">");if(o)u=o.content,t=o.rest.trim()}let a="";if(t.startsWith("(")){let o=pn(t,"(",")");if(o)a=o.content.slice(1,-1).trim(),t=o.rest.trim()}let l="void";if(t.startsWith(":")){let o=t.match(/^:\s*([^{;]+)/);if(o)l=o[1].trim()}return{name:r,generics:u,parameters:a,returnType:l,modifiers:n}}function to(e){return/^\s*export\s+/.test(e)}function no(e){return/^\s*export\s+type\s+/.test(e)}function ro(e){let i=dn(e).trim(),s=i.match(/^(export\s+)?(const|let|var)\s+([a-zA-Z_$][\w$]*)/);if(!s)return null;let n=s[2],r=s[3],t=i.substring(s[0].length).trim(),u;if(t.startsWith(":")){let l=t.indexOf("=");if(l!==-1)u=t.substring(1,l).trim(),t=t.substring(l).trim();else u=t.substring(1).replace(/;?\s*$/,"").trim(),t=""}let a;if(t.startsWith("="))a=t.substring(1).replace(/;?\s*$/,"").trim();return{kind:n,name:r,typeAnnotation:u,value:a}}
5
+ export{Ys,Xs,dn,Zs,Qs,pn,eo,to,no,ro};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{lstat as d,realpath as f,stat as T}from"fs/promises";import{isAbsolute as l,normalize as g,relative as p,resolve as u}from"path";var _={rootDir:process.cwd(),maxFileSize:10485760,maxTotalSize:104857600,timeout:30000,followSymlinks:!1,maxFiles:1e4,blockedPatterns:["**/.git/**","**/node_modules/**","**/.env*","**/secrets/**","**/*.key","**/*.pem"]};class E extends Error{code;path;constructor(t,r,e){super(t);this.code=r;this.path=e;this.name="SecurityError"}}function Ye(t,r={}){let{rootDir:e=process.cwd()}=r,i=g(t),n=l(i)?i:u(e,i),o=u(n),s=p(e,o);if(s.startsWith("..")||l(s))throw new E(`Path traversal detected: "${t}" resolves outside root directory`,"PATH_TRAVERSAL",t);return o}function qr(t,r={}){return t.map((e)=>Ye(e,r))}function mn(t,r={}){let e=r.blockedPatterns||_.blockedPatterns;for(let i of e)if(h(t,i))return!0;return!1}var m=new Map;function P(t){let r=m.get(t);if(r)return r;let e=t.replace(/\*\*/g,"<<GLOBSTAR>>").replace(/\*/g,"<<STAR>>").replace(/\?/g,"<<QUESTION>>");e=e.replace(/[.+^${}()|[\]\\]/g,"\\$&"),e=e.replace(/^<<GLOBSTAR>>\//,"(.*\\/)?"),e=e.replace(/\/<<GLOBSTAR>>$/,"(\\/.*)?"),e=e.replace(/\/<<GLOBSTAR>>\//g,"(\\/.*)?\\/"),e=e.replace(/<<GLOBSTAR>>/g,".*"),e=e.replace(/<<STAR>>/g,"[^/]*"),e=e.replace(/<<QUESTION>>/g,"[^/]");let i=new RegExp(`^${e}$`);return m.set(t,i),i}function h(t,r){let e=t.indexOf("\\")===-1?t:t.replace(/\\/g,"/");return P(r).test(e)}async function Jr(t,r={}){let e=r.maxFileSize??_.maxFileSize;try{let i=await T(t);if(i.size>e)throw new E(`File too large: "${t}" is ${a(i.size)}, max is ${a(e)}`,"FILE_TOO_LARGE",t);return i.size}catch(i){if(i instanceof E)throw i;throw new E(`Failed to check file size: ${t}`,"INVALID_PATH",t)}}async function Yr(t){try{return(await d(t)).isSymbolicLink()}catch{return!1}}async function Xr(t,r={}){let e=r.followSymlinks??_.followSymlinks;if(await Yr(t)){if(!e)throw new E(`Symbolic links not allowed: "${t}"`,"SYMLINK_NOT_ALLOWED",t);let i=await f(t);return Ye(i,r)}return t}async function vt(t,r={}){let e=Ye(t,r);if(mn(e,r))throw new E(`Path matches blocked pattern: "${t}"`,"BLOCKED_PATTERN",t);let i=await Xr(e,r),n=await Jr(i,r);return{path:i,size:n}}async function gn(t,r={}){let e=r.maxFiles??_.maxFiles,i=r.maxTotalSize??_.maxTotalSize;if(t.length>e)throw new E(`Too many files: ${t.length} exceeds maximum of ${e}`,"MAX_FILES_EXCEEDED");let n=[],o=0;for(let s of t){let c=await vt(s,r);if(n.push(c.path),o+=c.size,o>i)throw new E(`Total size exceeded: ${a(o)} exceeds maximum of ${a(i)}`,"TOTAL_SIZE_EXCEEDED")}return{paths:n,totalSize:o}}function St(t,r,e="Operation"){return new Promise((i,n)=>{let o=setTimeout(()=>{n(new E(`${e} timed out after ${r}ms`,"TIMEOUT"))},r);t.then((s)=>{clearTimeout(o),i(s)}).catch((s)=>{clearTimeout(o),n(s)})})}function Zr(t,r={}){let e=r.timeout??_.timeout;return async(i)=>{let{path:n}=await vt(i,r);return St(t(n),e,`Processing ${i}`)}}function io(t,r={}){let e=r.timeout??_.timeout;return async(i)=>{let{paths:n}=await gn(i,r);return St(t(n),e,`Processing ${i.length} files`)}}function so(t){let r=t.replace(/\\/g,"/").replace(/\0/g,"").replace(/^\/+/,"").replace(/^[A-Z]:/i,""),e="";while(e!==r)e=r,r=r.replace(/\.\.\/|\.\.$/g,"").replace(/\/+/g,"/");return r.replace(/^\/+|\/+$/g,"")}function oo(t){if(t.includes("\x00"))return!1;if(g(t).includes(".."))return!1;if(l(t)&&!t.startsWith(process.cwd()))return!1;return!0}function a(t){if(t===0)return"0 B";let r=["B","KB","MB","GB"],e=1024,i=Math.floor(Math.log(t)/Math.log(e));return`${Number.parseFloat((t/e**i).toFixed(2))} ${r[i]}`}function ao(t={}){let r={..._,...t};return{validatePath:(e)=>Ye(e,r),validatePaths:(e)=>qr(e,r),validateFile:(e)=>vt(e,r),validateBatch:(e)=>gn(e,r),withTimeout:(e,i)=>St(e,r.timeout,i),secureProcessor:(e)=>Zr(e,r),isBlocked:(e)=>mn(e,r),getConfig:()=>r}}
3
+ export{_,E,Ye,qr,mn,Jr,Yr,Xr,vt,gn,St,Zr,io,so,oo,ao};
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{watch as z}from"fs";import{readdir as O,stat as U}from"fs/promises";import{join as S,relative as E}from"path";function Pi(e,i){let{root:s,include:u=["**/*.ts","**/*.tsx","**/*.vue","**/*.stx"],exclude:v=["**/node_modules/**","**/*.d.ts","**/dist/**"],debounce:f=100,initialBuild:a=!0,clearScreen:D=!1,onChange:T,onBuildStart:w,onBuildComplete:B,onError:W}=e,P=[],g=new Set,h=!1,d=new Map,c=null,y=!1;function A(o){let r=E(s,o);for(let n of v)if(p(r,n))return!1;for(let n of u)if(p(r,n))return!0;return!1}function p(o,r){let n=r.replace(/\./g,"\\.").replace(/\*\*/g,"{{DOUBLESTAR}}").replace(/\*/g,"[^/]*").replace(/\{\{DOUBLESTAR\}\}/g,".*").replace(/\?/g,".");return new RegExp(`^${n}$`).test(o.replace(/\\/g,"/"))}async function F(){if(y||d.size===0)return;y=!0;let o=Array.from(d.values());d.clear();try{for(let t of o)await T?.(t);if(D)console.clear();await w?.();let r=o.filter((t)=>t.type!=="unlink").map((t)=>t.path),n=await i(r.length>0?r:void 0);await B?.(n)}catch(r){await W?.(r)}finally{if(y=!1,d.size>0)C()}}function C(){if(c)clearTimeout(c);c=setTimeout(()=>{c=null,F()},f)}function k(o,r,n){if(!r||!h)return;let t=S(n,r);if(!A(t))return;let l={type:o==="rename"?"add":"change",path:t,relativePath:E(s,t)};U(t).then(()=>{g.add(t)}).catch(()=>{l.type="unlink",g.delete(t)}).finally(()=>{d.set(t,l),C()})}async function b(o){let r=[o];try{let n=await O(o,{withFileTypes:!0});for(let t of n)if(t.isDirectory()){let l=S(o,t.name),x=E(s,l),R=!1;for(let m of v)if(p(x,m)||p(`${x}/`,m)){R=!0;break}if(!R){let m=await b(l);r.push(...m)}}}catch{}return r}async function G(){if(h)return;h=!0;let o=await b(s);for(let r of o)try{let n=z(r,{persistent:!0},(t,l)=>{k(t,l,r)});n.on("error",(t)=>{W?.(t)}),P.push(n)}catch(n){await W?.(n)}if(a){await w?.();let r=await i();await B?.(r)}}function L(){if(h=!1,c)clearTimeout(c),c=null;for(let o of P)o.close();P.length=0,g.clear(),d.clear()}async function j(){await w?.();let o=await i();return await B?.(o),o}return{start:G,stop:L,rebuild:j,isWatching:()=>h,getWatchedFiles:()=>Array.from(g)}}async function Ca(e,i){let s=async(v)=>{let f=Date.now();try{let a=await i(e);return{success:a.errors.length===0,duration:Date.now()-f,filesProcessed:a.filesProcessed,errors:a.errors}}catch(a){return{success:!1,duration:Date.now()-f,filesProcessed:0,errors:[a.message]}}},u=Pi({root:e.root||e.cwd||process.cwd(),include:e.include,exclude:e.exclude,debounce:e.debounce,initialBuild:e.initialBuild,clearScreen:e.clearScreen,onChange:e.onChange,onBuildStart:e.onBuildStart,onBuildComplete:e.onBuildComplete,onError:e.onError},s);return await u.start(),u}function Ri(e){let i=e.success?"\u2713":"\u2717",s=`${e.duration}ms`;if(e.success)return`${i} Built ${e.filesProcessed} file(s) in ${s}`;else return`${i} Build failed in ${s}
2
+ import{watch as z}from"fs";import{readdir as O,stat as U}from"fs/promises";import{join as S,relative as E}from"path";function Ii(e,i){let{root:s,include:u=["**/*.ts","**/*.tsx","**/*.vue","**/*.stx"],exclude:v=["**/node_modules/**","**/*.d.ts","**/dist/**"],debounce:f=100,initialBuild:a=!0,clearScreen:D=!1,onChange:T,onBuildStart:w,onBuildComplete:B,onError:W}=e,P=[],g=new Set,h=!1,d=new Map,c=null,y=!1;function A(o){let r=E(s,o);for(let n of v)if(p(r,n))return!1;for(let n of u)if(p(r,n))return!0;return!1}function p(o,r){let n=r.replace(/\./g,"\\.").replace(/\*\*/g,"{{DOUBLESTAR}}").replace(/\*/g,"[^/]*").replace(/\{\{DOUBLESTAR\}\}/g,".*").replace(/\?/g,".");return new RegExp(`^${n}$`).test(o.replace(/\\/g,"/"))}async function F(){if(y||d.size===0)return;y=!0;let o=Array.from(d.values());d.clear();try{for(let t of o)await T?.(t);if(D)console.clear();await w?.();let r=o.filter((t)=>t.type!=="unlink").map((t)=>t.path),n=await i(r.length>0?r:void 0);await B?.(n)}catch(r){await W?.(r)}finally{if(y=!1,d.size>0)C()}}function C(){if(c)clearTimeout(c);c=setTimeout(()=>{c=null,F()},f)}function k(o,r,n){if(!r||!h)return;let t=S(n,r);if(!A(t))return;let l={type:o==="rename"?"add":"change",path:t,relativePath:E(s,t)};U(t).then(()=>{g.add(t)}).catch(()=>{l.type="unlink",g.delete(t)}).finally(()=>{d.set(t,l),C()})}async function b(o){let r=[o];try{let n=await O(o,{withFileTypes:!0});for(let t of n)if(t.isDirectory()){let l=S(o,t.name),x=E(s,l),R=!1;for(let m of v)if(p(x,m)||p(`${x}/`,m)){R=!0;break}if(!R){let m=await b(l);r.push(...m)}}}catch{}return r}async function G(){if(h)return;h=!0;let o=await b(s);for(let r of o)try{let n=z(r,{persistent:!0},(t,l)=>{k(t,l,r)});n.on("error",(t)=>{W?.(t)}),P.push(n)}catch(n){await W?.(n)}if(a){await w?.();let r=await i();await B?.(r)}}function L(){if(h=!1,c)clearTimeout(c),c=null;for(let o of P)o.close();P.length=0,g.clear(),d.clear()}async function j(){await w?.();let o=await i();return await B?.(o),o}return{start:G,stop:L,rebuild:j,isWatching:()=>h,getWatchedFiles:()=>Array.from(g)}}async function $a(e,i){let s=async(v)=>{let f=Date.now();try{let a=await i(e);return{success:a.errors.length===0,duration:Date.now()-f,filesProcessed:a.filesProcessed,errors:a.errors}}catch(a){return{success:!1,duration:Date.now()-f,filesProcessed:0,errors:[a.message]}}},u=Ii({root:e.root||e.cwd||process.cwd(),include:e.include,exclude:e.exclude,debounce:e.debounce,initialBuild:e.initialBuild,clearScreen:e.clearScreen,onChange:e.onChange,onBuildStart:e.onBuildStart,onBuildComplete:e.onBuildComplete,onError:e.onError},s);return await u.start(),u}function Li(e){let i=e.success?"\u2713":"\u2717",s=`${e.duration}ms`;if(e.success)return`${i} Built ${e.filesProcessed} file(s) in ${s}`;else return`${i} Build failed in ${s}
3
3
  ${e.errors.map((u)=>` - ${u}`).join(`
4
- `)}`}function va(){return{onChange:(e)=>{let i=e.type==="add"?"+":e.type==="unlink"?"-":"~";console.log(`[${i}] ${e.relativePath}`)},onBuildStart:()=>{console.log(`
5
- Rebuilding...`)},onBuildComplete:(e)=>{console.log(Ri(e))},onError:(e)=>{console.error(`Error: ${e.message}`)}}}
6
- export{Pi,Ca,Ri,va};
4
+ `)}`}function Ea(){return{onChange:(e)=>{let i=e.type==="add"?"+":e.type==="unlink"?"-":"~";console.log(`[${i}] ${e.relativePath}`)},onBuildStart:()=>{console.log(`
5
+ Rebuilding...`)},onBuildComplete:(e)=>{console.log(Li(e))},onError:(e)=>{console.error(`Error: ${e.message}`)}}}
6
+ export{Ii,$a,Li,Ea};
@@ -1,10 +1,10 @@
1
1
  // @bun
2
- var ye={PARSE_ERROR:"PARSE_ERROR",SYNTAX_ERROR:"SYNTAX_ERROR",FILE_NOT_FOUND:"FILE_NOT_FOUND",FILE_READ_ERROR:"FILE_READ_ERROR",FILE_WRITE_ERROR:"FILE_WRITE_ERROR",TYPE_INFERENCE_ERROR:"TYPE_INFERENCE_ERROR",UNRESOLVED_TYPE:"UNRESOLVED_TYPE",EXTRACTION_ERROR:"EXTRACTION_ERROR",PROCESSING_ERROR:"PROCESSING_ERROR",VALIDATION_ERROR:"VALIDATION_ERROR",INVALID_DECLARATION:"INVALID_DECLARATION",CONFIG_ERROR:"CONFIG_ERROR",INVALID_ENTRYPOINT:"INVALID_ENTRYPOINT",CIRCULAR_DEPENDENCY:"CIRCULAR_DEPENDENCY",TIMEOUT_ERROR:"TIMEOUT_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",UNKNOWN_ERROR:"UNKNOWN_ERROR"};class v extends Error{code;context;constructor(n,e="UNKNOWN_ERROR",t){super(n);if(this.name="DtsxError",this.code=e,this.context=t,Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}toString(){let n=`${this.name} [${this.code}]: ${this.message}`;if(this.context)n+=`
3
- Context: ${JSON.stringify(this.context,null,2)}`;return n}toJSON(){return{name:this.name,code:this.code,message:this.message,context:this.context,stack:this.stack}}}class vn extends v{filePath;line;column;constructor(n,e,t){super(n,"PARSE_ERROR",{filePath:e,line:t?.line,column:t?.column});if(this.name="ParseError",this.filePath=e,this.line=t?.line,this.column=t?.column,t?.cause)this.cause=t.cause}get locationString(){if(this.line!==void 0&&this.column!==void 0)return`${this.filePath}:${this.line}:${this.column}`;return this.line!==void 0?`${this.filePath}:${this.line}`:this.filePath}}class si extends v{filePath;declarationKind;constructor(n,e,t,s){super(n,"EXTRACTION_ERROR",{filePath:e,declarationKind:t});if(this.name="ExtractionError",this.filePath=e,this.declarationKind=t,s)this.cause=s}}class oi extends v{declarationName;constructor(n,e,t){super(n,"PROCESSING_ERROR",{declarationName:e});if(this.name="ProcessingError",this.declarationName=e,t)this.cause=t}}class Sn extends v{filePath;operation;constructor(n,e,t,s){super(n,t==="read"?"FILE_READ_ERROR":"FILE_WRITE_ERROR",{filePath:e,operation:t});if(this.name="FileError",this.filePath=e,this.operation=t,s)this.cause=s}}class $n extends v{configPath;invalidKey;constructor(n,e){super(n,"CONFIG_ERROR",{configPath:e?.configPath,invalidKey:e?.invalidKey});if(this.name="ConfigError",this.configPath=e?.configPath,this.invalidKey=e?.invalidKey,e?.cause)this.cause=e.cause}}class ai extends v{cycle;constructor(n){super(`Circular dependency detected: ${n.join(" -> ")}`,"CIRCULAR_DEPENDENCY",{cycle:n});this.name="CircularDependencyError",this.cycle=n}}function go(n){return n instanceof v}function ho(n){return n instanceof vn}function yo(n){return n instanceof Sn}function bo(n){return n instanceof $n}function xo(n,e="UNKNOWN_ERROR",t){if(n instanceof v)return n;let s=t||(n instanceof Error?n.message:String(n)),r=new v(s,e);if(n instanceof Error)r.cause=n;return r}function wo(n,e){let t=1,s=1,r=0;for(let i of n){if(r>=e)break;if(i===`
4
- `)t++,s=1;else s++;r++}return{line:t,column:s,offset:e}}function Co(n,e,t,s){let r=n.split(`
2
+ var Se={PARSE_ERROR:"PARSE_ERROR",SYNTAX_ERROR:"SYNTAX_ERROR",FILE_NOT_FOUND:"FILE_NOT_FOUND",FILE_READ_ERROR:"FILE_READ_ERROR",FILE_WRITE_ERROR:"FILE_WRITE_ERROR",TYPE_INFERENCE_ERROR:"TYPE_INFERENCE_ERROR",UNRESOLVED_TYPE:"UNRESOLVED_TYPE",EXTRACTION_ERROR:"EXTRACTION_ERROR",PROCESSING_ERROR:"PROCESSING_ERROR",VALIDATION_ERROR:"VALIDATION_ERROR",INVALID_DECLARATION:"INVALID_DECLARATION",CONFIG_ERROR:"CONFIG_ERROR",INVALID_ENTRYPOINT:"INVALID_ENTRYPOINT",CIRCULAR_DEPENDENCY:"CIRCULAR_DEPENDENCY",TIMEOUT_ERROR:"TIMEOUT_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",UNKNOWN_ERROR:"UNKNOWN_ERROR"};class k extends Error{code;context;constructor(n,e="UNKNOWN_ERROR",t){super(n);if(this.name="DtsxError",this.code=e,this.context=t,Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}toString(){let n=`${this.name} [${this.code}]: ${this.message}`;if(this.context)n+=`
3
+ Context: ${JSON.stringify(this.context,null,2)}`;return n}toJSON(){return{name:this.name,code:this.code,message:this.message,context:this.context,stack:this.stack}}}class kn extends k{filePath;line;column;constructor(n,e,t){super(n,"PARSE_ERROR",{filePath:e,line:t?.line,column:t?.column});if(this.name="ParseError",this.filePath=e,this.line=t?.line,this.column=t?.column,t?.cause)this.cause=t.cause}get locationString(){if(this.line!==void 0&&this.column!==void 0)return`${this.filePath}:${this.line}:${this.column}`;return this.line!==void 0?`${this.filePath}:${this.line}`:this.filePath}}class li extends k{filePath;declarationKind;constructor(n,e,t,s){super(n,"EXTRACTION_ERROR",{filePath:e,declarationKind:t});if(this.name="ExtractionError",this.filePath=e,this.declarationKind=t,s)this.cause=s}}class ui extends k{declarationName;constructor(n,e,t){super(n,"PROCESSING_ERROR",{declarationName:e});if(this.name="ProcessingError",this.declarationName=e,t)this.cause=t}}class Tn extends k{filePath;operation;constructor(n,e,t,s){super(n,t==="read"?"FILE_READ_ERROR":"FILE_WRITE_ERROR",{filePath:e,operation:t});if(this.name="FileError",this.filePath=e,this.operation=t,s)this.cause=s}}class An extends k{configPath;invalidKey;constructor(n,e){super(n,"CONFIG_ERROR",{configPath:e?.configPath,invalidKey:e?.invalidKey});if(this.name="ConfigError",this.configPath=e?.configPath,this.invalidKey=e?.invalidKey,e?.cause)this.cause=e.cause}}class fi extends k{cycle;constructor(n){super(`Circular dependency detected: ${n.join(" -> ")}`,"CIRCULAR_DEPENDENCY",{cycle:n});this.name="CircularDependencyError",this.cycle=n}}function xo(n){return n instanceof k}function wo(n){return n instanceof kn}function Co(n){return n instanceof Tn}function vo(n){return n instanceof An}function So(n,e="UNKNOWN_ERROR",t){if(n instanceof k)return n;let s=t||(n instanceof Error?n.message:String(n)),r=new k(s,e);if(n instanceof Error)r.cause=n;return r}function $o(n,e){let t=1,s=1,r=0;for(let i of n){if(r>=e)break;if(i===`
4
+ `)t++,s=1;else s++;r++}return{line:t,column:s,offset:e}}function Eo(n,e,t,s){let r=n.split(`
5
5
  `),i=e.line-1,o=[];if(s)o.push(`${s}:${e.line}:${e.column}`);else o.push(`Line ${e.line}, Column ${e.column}`);o.push(`Error: ${t}`),o.push("");let E=Math.max(0,i-1),c=Math.min(r.length-1,i+1);for(let a=E;a<=c;a++){let R=(a+1).toString().padStart(4," "),u=a===i?">":" ";if(o.push(`${u} ${R} | ${r[a]}`),a===i){let l=" ".repeat(8+e.column-1);o.push(`${l}^`)}}return o.join(`
6
- `)}function qe(n,e,t){let s={file:e,message:"Unknown error",code:ye.UNKNOWN_ERROR};if(n instanceof Error){s.message=n.message,s.stack=n.stack;let r=n.message.match(/\((\d+),(\d+)\)/);if(r)s.location={line:Number.parseInt(r[1],10),column:Number.parseInt(r[2],10)};if(n.message.includes("Cannot find")||n.message.includes("not found"))s.code=ye.FILE_NOT_FOUND,s.suggestion="Check that the file path is correct and the file exists.";else if(n.message.includes("syntax")||n.message.includes("Unexpected token"))s.code=ye.SYNTAX_ERROR,s.suggestion="Check for syntax errors in your TypeScript code.";else if(n.message.includes("type")&&n.message.includes("cannot"))s.code=ye.TYPE_INFERENCE_ERROR,s.suggestion="Add explicit type annotations to help with type inference.";else if(n.message.includes("parse")||n.message.includes("Parse"))s.code=ye.PARSE_ERROR,s.suggestion="The file contains invalid TypeScript syntax."}else if(typeof n==="string")s.message=n;return s}function Ct(n,e){let t=[],s=n.file;if(n.location)s+=`:${n.location.line}:${n.location.column}`;if(n.code)s+=` [${n.code}]`;if(t.push(s),t.push(` Error: ${n.message}`),e&&n.location){t.push("");let r=e.split(`
6
+ `)}function Qe(n,e,t){let s={file:e,message:"Unknown error",code:Se.UNKNOWN_ERROR};if(n instanceof Error){s.message=n.message,s.stack=n.stack;let r=n.message.match(/\((\d+),(\d+)\)/);if(r)s.location={line:Number.parseInt(r[1],10),column:Number.parseInt(r[2],10)};if(n.message.includes("Cannot find")||n.message.includes("not found"))s.code=Se.FILE_NOT_FOUND,s.suggestion="Check that the file path is correct and the file exists.";else if(n.message.includes("syntax")||n.message.includes("Unexpected token"))s.code=Se.SYNTAX_ERROR,s.suggestion="Check for syntax errors in your TypeScript code.";else if(n.message.includes("type")&&n.message.includes("cannot"))s.code=Se.TYPE_INFERENCE_ERROR,s.suggestion="Add explicit type annotations to help with type inference.";else if(n.message.includes("parse")||n.message.includes("Parse"))s.code=Se.PARSE_ERROR,s.suggestion="The file contains invalid TypeScript syntax."}else if(typeof n==="string")s.message=n;return s}function Et(n,e){let t=[],s=n.file;if(n.location)s+=`:${n.location.line}:${n.location.column}`;if(n.code)s+=` [${n.code}]`;if(t.push(s),t.push(` Error: ${n.message}`),e&&n.location){t.push("");let r=e.split(`
7
7
  `),i=n.location.line-1;if(i>=0&&i<r.length){let o=Math.max(0,i-1),E=Math.min(r.length-1,i+1);for(let c=o;c<=E;c++){let a=(c+1).toString().padStart(4," "),R=c===i?">":" ";if(t.push(` ${R} ${a} | ${r[c]}`),c===i&&n.location.column>0){let u=" ".repeat(10+n.location.column-1);t.push(` ${u}^`)}}}}if(n.suggestion)t.push(""),t.push(` Suggestion: ${n.suggestion}`);return t.join(`
8
- `)}function vo(n){if(n.length===0)return"No errors";let e=new Map;for(let s of n){let r=s.code||"UNKNOWN";e.set(r,(e.get(r)||0)+1)}let t=[`${n.length} error(s) found:`];for(let[s,r]of e.entries())t.push(` - ${s}: ${r}`);return t.join(`
8
+ `)}function ko(n){if(n.length===0)return"No errors";let e=new Map;for(let s of n){let r=s.code||"UNKNOWN";e.set(r,(e.get(r)||0)+1)}let t=[`${n.length} error(s) found:`];for(let[s,r]of e.entries())t.push(` - ${s}: ${r}`);return t.join(`
9
9
  `)}
10
- export{ye,v,vn,si,oi,Sn,$n,ai,go,ho,yo,bo,xo,wo,Co,qe,Ct,vo};
10
+ export{Se,k,kn,li,ui,Tn,An,fi,xo,wo,Co,vo,So,$o,Eo,Qe,Et,ko};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{Dt,Pt,a,Pe,tt,Rt,Mt,nt,rt,it,Ot,st,It,Lt}from"./chunk-mjzee617.js";function D(t){return t.endsWith(".stx")}function h(t){let n=[],s=/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,o;while((o=s.exec(t))!==null){let r=o[1]??"",i=/\blang\s*=\s*["']([^"']+)["']/i.exec(r)?.[1]?.toLowerCase()??(/\b(?:type\s*=\s*["'](?:text\/)?typescript["']|typescript)\b/i.test(r)?"ts":"js"),e=/\bserver\b/i.test(r)?"server":/\bclient\b/i.test(r)?"client":"universal";n.push({content:o[2]??"",kind:"script",attrs:r,context:e,lang:i,start:o.index})}return n}function y(t){let n=[],s=/^[ \t]*@ts[ \t]*(?:\r?\n|$)/gm,o;while((o=s.exec(t))!==null){let r=s.lastIndex,i=/^[ \t]*@endts[ \t]*(?:\r?\n|$)/gm;i.lastIndex=r;let e=i.exec(t),l=e?.index??t.length;if(n.push({content:t.slice(r,l),kind:"ts",attrs:"",context:"universal",lang:"ts",start:o.index}),!e)break;s.lastIndex=i.lastIndex}return n}function ga(t){return[...h(t),...y(t)].sort((n,s)=>n.start-s.start)}function k(t){if(t.kind==="ts"||t.context!=="universal"||t.lang==="ts")return!0;return/\b(?:defineProps|defineEmits|defineExpose|defineSlots)\b|\bexport\s|\b(?:interface|type)\s+[A-Za-z_$]/.test(t.content)}function _(t){let n=/(?:\$?props)\s+as\s+/g,s;while((s=n.exec(t))!==null){let o=n.lastIndex;while(o<t.length&&/\s/.test(t[o]))o++;if(t[o]==="{"){let e=a(t,o,"{","}");if(e!==-1)return t.slice(o,e+1).trim();continue}let r=/^[A-Za-z_$][\w$]*/.exec(t.slice(o))?.[0];if(!r)continue;let i=o+r.length;while(i<t.length&&/\s/.test(t[i]))i++;if(t[i]==="<"){let e=a(t,i,"<",">");if(e!==-1)i=e+1}return t.slice(o,i).trim()}return null}function w(t){return/\b(?:const|let|var)\s+\$?props\s*:\s*([^=;\n]+)/.exec(t)?.[1]?.trim()??null}function T(t){let n=/^\s*(?:\|\||\?\?)\s*([^;\n]+)/.exec(t)?.[1]?.trim();if(/^['"`]/.test(n??""))return"string";if(/^(?:true|false)\b/.test(n??""))return"boolean";if(/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)\b/.test(n??""))return"number";if(/^\[/.test(n??""))return"unknown[]";if(/^\{/.test(n??""))return"Record<string, unknown>";if(/^\s*(?:===?|!==?)\s*(?:true|false)\b/.test(t))return"boolean";return"unknown"}function E(t,n){if(!t||t==="unknown")return n;if(n==="unknown"||t===n)return t;return[...new Set([...t.split(" | "),...n.split(" | ")])].join(" | ")}function v(t){let n=Pt(t),s=new Map,o=/\$props(?:\.([A-Za-z_$][\w$]*)|\[\s*(['"])([^'"\n]+)\2\s*\])/g,r;while((r=o.exec(t))!==null){if(n.slice(r.index,r.index+6)!=="$props")continue;let e=r[1]??r[3],l=T(t.slice(o.lastIndex));s.set(e,E(s.get(e),l))}if(s.size===0)return null;return{type:`{ ${[...s].map(([e,l])=>`${/^[A-Za-z_$][\w$]*$/.test(e)?e:JSON.stringify(e)}?: ${l}`).join(", ")} }`}}function A(t){let n=st(t,null);if(n)return n;let s=_(t)??w(t);if(!s)return v(t);if(/^[A-Za-z_$][\w$]*$/.test(s)){let o=s.replace(/[$]/g,"\\$&");if(new RegExp(`\\bexport\\s+(?:declare\\s+)?(?:interface|type)\\s+${o}\\b`).test(t))return{type:s}}return st(`${t}
3
- defineProps<${s}>()`,null)}function C(t){return Rt(t)}function S(t){let n=Pt(t).trimStart();if(n==="")return!0;return/^(?:import\b|export\b|declare\b|interface\b|type\b|(?:export\s+)?namespace\b|(?:export\s+)?module\b|(?:abstract\s+)?class\b|const\b|let\b|var\b|(?:async\s+)?function\b)/.test(n)}function R(t){let n=[],s=0,o=0,r=0;while(r<t.length){let e=t[r],l=Dt(t,r);if(l>r){r=l;continue}if(e==="{"||e==="["||e==="(")o++;else if(e==="}"||e==="]"||e===")")o=Math.max(0,o-1);if((e===";"||e===`
4
- `)&&o===0){let c=r+1;if(!S(t.slice(s,c)))n.push([s,c]);s=c}r++}if(s<t.length&&!S(t.slice(s)))n.push([s,t.length]);let i=t;for(let e=n.length-1;e>=0;e--)i=i.slice(0,n[e][0])+i.slice(n[e][1]);return i}function P(t){let s=ga(t).filter(k).map((f)=>f.content).join(`
5
- `),o=null,r=Mt(s);if(r.passthrough)return s;if(s=r.script,r.options){let f=nt(r.options,"props");if(f)o=tt(f)}let i=s,e=C(s),l=A(i),c=l?.type??o??"{}",m=It(i,null),d=Lt(i,null),g=Pe(i,"defineSlots")?.generic??null,x=l?.inlinedLocal;if(x)e=it(e,x.name,x.declText);let p=`DefineComponent<${c}>`,u=[];if(m)u.push(`readonly __stxEmits?: ${m}`);if(g)u.push(`readonly __stxSlots?: ${g}`);if(d)u.push(`readonly __stxExposed?: ${d}`);if(u.length>0)p+=` & { ${u.join(", ")} }`;p=Ot(p),e=R(rt(e,p));let b=["import type { DefineComponent } from '@stacksjs/stx'",`type __DtsxStxComponentType = ${p}`,"const __dtsx_component__: __DtsxStxComponentType = null as unknown as __DtsxStxComponentType","export default __dtsx_component__"];if(e.trim()!=="")b.push(e);return b.join(`
2
+ import{Ot,It,c,Ne,ot,Lt,Nt,at,ct,lt,Ft,ut,Bt,Wt}from"./chunk-755bntty.js";function O(t){return t.endsWith(".stx")}function h(t){let n=[],s=/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,o;while((o=s.exec(t))!==null){let r=o[1]??"",i=/\blang\s*=\s*["']([^"']+)["']/i.exec(r)?.[1]?.toLowerCase()??(/\b(?:type\s*=\s*["'](?:text\/)?typescript["']|typescript)\b/i.test(r)?"ts":"js"),e=/\bserver\b/i.test(r)?"server":/\bclient\b/i.test(r)?"client":"universal";n.push({content:o[2]??"",kind:"script",attrs:r,context:e,lang:i,start:o.index})}return n}function y(t){let n=[],s=/^[ \t]*@ts[ \t]*(?:\r?\n|$)/gm,o;while((o=s.exec(t))!==null){let r=s.lastIndex,i=/^[ \t]*@endts[ \t]*(?:\r?\n|$)/gm;i.lastIndex=r;let e=i.exec(t),l=e?.index??t.length;if(n.push({content:t.slice(r,l),kind:"ts",attrs:"",context:"universal",lang:"ts",start:o.index}),!e)break;s.lastIndex=i.lastIndex}return n}function xa(t){return[...h(t),...y(t)].sort((n,s)=>n.start-s.start)}function k(t){if(t.kind==="ts"||t.context!=="universal"||t.lang==="ts")return!0;return/\b(?:defineProps|defineEmits|defineExpose|defineSlots)\b|\bexport\s|\b(?:interface|type)\s+[A-Za-z_$]/.test(t.content)}function _(t){let n=/(?:\$?props)\s+as\s+/g,s;while((s=n.exec(t))!==null){let o=n.lastIndex;while(o<t.length&&/\s/.test(t[o]))o++;if(t[o]==="{"){let e=c(t,o,"{","}");if(e!==-1)return t.slice(o,e+1).trim();continue}let r=/^[A-Za-z_$][\w$]*/.exec(t.slice(o))?.[0];if(!r)continue;let i=o+r.length;while(i<t.length&&/\s/.test(t[i]))i++;if(t[i]==="<"){let e=c(t,i,"<",">");if(e!==-1)i=e+1}return t.slice(o,i).trim()}return null}function w(t){return/\b(?:const|let|var)\s+\$?props\s*:\s*([^=;\n]+)/.exec(t)?.[1]?.trim()??null}function T(t){let n=/^\s*(?:\|\||\?\?)\s*([^;\n]+)/.exec(t)?.[1]?.trim();if(/^['"`]/.test(n??""))return"string";if(/^(?:true|false)\b/.test(n??""))return"boolean";if(/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)\b/.test(n??""))return"number";if(/^\[/.test(n??""))return"unknown[]";if(/^\{/.test(n??""))return"Record<string, unknown>";if(/^\s*(?:===?|!==?)\s*(?:true|false)\b/.test(t))return"boolean";return"unknown"}function E(t,n){if(!t||t==="unknown")return n;if(n==="unknown"||t===n)return t;return[...new Set([...t.split(" | "),...n.split(" | ")])].join(" | ")}function P(t){let n=It(t),s=new Map,o=/\$props(?:\.([A-Za-z_$][\w$]*)|\[\s*(['"])([^'"\n]+)\2\s*\])/g,r;while((r=o.exec(t))!==null){if(n.slice(r.index,r.index+6)!=="$props")continue;let e=r[1]??r[3],l=T(t.slice(o.lastIndex));s.set(e,E(s.get(e),l))}if(s.size===0)return null;return{type:`{ ${[...s].map(([e,l])=>`${/^[A-Za-z_$][\w$]*$/.test(e)?e:JSON.stringify(e)}?: ${l}`).join(", ")} }`}}function v(t){let n=ut(t,null);if(n)return n;let s=_(t)??w(t);if(!s)return P(t);if(/^[A-Za-z_$][\w$]*$/.test(s)){let o=s.replace(/[$]/g,"\\$&");if(new RegExp(`\\bexport\\s+(?:declare\\s+)?(?:interface|type)\\s+${o}\\b`).test(t))return{type:s}}return ut(`${t}
3
+ defineProps<${s}>()`,null)}function A(t){return Lt(t)}function S(t){let n=It(t).trimStart();if(n==="")return!0;return/^(?:import\b|export\b|declare\b|interface\b|type\b|(?:export\s+)?namespace\b|(?:export\s+)?module\b|(?:abstract\s+)?class\b|const\b|let\b|var\b|(?:async\s+)?function\b)/.test(n)}function C(t){let n=[],s=0,o=0,r=0;while(r<t.length){let e=t[r],l=Ot(t,r);if(l>r){r=l;continue}if(e==="{"||e==="["||e==="(")o++;else if(e==="}"||e==="]"||e===")")o=Math.max(0,o-1);if((e===";"||e===`
4
+ `)&&o===0){let a=r+1;if(!S(t.slice(s,a)))n.push([s,a]);s=a}r++}if(s<t.length&&!S(t.slice(s)))n.push([s,t.length]);let i=t;for(let e=n.length-1;e>=0;e--)i=i.slice(0,n[e][0])+i.slice(n[e][1]);return i}function I(t){let s=xa(t).filter(k).map((f)=>f.content).join(`
5
+ `),o=null,r=Nt(s);if(r.passthrough)return s;if(s=r.script,r.options){let f=at(r.options,"props");if(f)o=ot(f)}let i=s,e=A(s),l=v(i),a=l?.type??o??"{}",m=Bt(i,null),d=Wt(i,null),g=Ne(i,"defineSlots")?.generic??null,x=l?.inlinedLocal;if(x)e=lt(e,x.name,x.declText);let p=`DefineComponent<${a}>`,u=[];if(m)u.push(`readonly __stxEmits?: ${m}`);if(g)u.push(`readonly __stxSlots?: ${g}`);if(d)u.push(`readonly __stxExposed?: ${d}`);if(u.length>0)p+=` & { ${u.join(", ")} }`;p=Ft(p),e=C(ct(e,p));let b=["import type { DefineComponent } from '@stacksjs/stx'",`type __DtsxStxComponentType = ${p}`,"const __dtsx_component__: __DtsxStxComponentType = null as unknown as __DtsxStxComponentType","export default __dtsx_component__"];if(e.trim()!=="")b.push(e);return b.join(`
6
6
  `)}
7
- export{D,ga,P};
7
+ export{O,xa,I};