@dtsx/dtsx 0.11.56 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/dist/bin/cli.js +1 -1
  2. package/dist/{chunk-62428w6e.js → chunk-07c41ffx.js} +7 -7
  3. package/dist/{chunk-j7rpp55s.js → chunk-0mj07j66.js} +3 -3
  4. package/dist/chunk-0zwa1tag.js +31 -0
  5. package/dist/chunk-16rpzfwq.js +10 -0
  6. package/dist/chunk-253e6nb4.js +3 -0
  7. package/dist/chunk-27hrxxsh.js +9 -0
  8. package/dist/{chunk-tgaear7n.js → chunk-27rxm6hh.js} +6 -6
  9. package/dist/chunk-30ffarqm.js +4 -0
  10. package/dist/{chunk-kkshxyex.js → chunk-37jcvx0v.js} +3 -3
  11. package/dist/chunk-44a6zpxs.js +3 -0
  12. package/dist/{chunk-g9emajpc.js → chunk-4ce9a877.js} +2 -2
  13. package/dist/{chunk-587w6ktw.js → chunk-4th0w19y.js} +3 -3
  14. package/dist/{chunk-mew3f4wh.js → chunk-50r5qs7t.js} +2 -2
  15. package/dist/chunk-5fgakmq9.js +3 -0
  16. package/dist/chunk-5tcpge5e.js +56 -0
  17. package/dist/{chunk-h6ddkhyq.js → chunk-5vk2x8ee.js} +2 -2
  18. package/dist/{chunk-k8tnz2qd.js → chunk-7116bytq.js} +8 -8
  19. package/dist/{chunk-6j6dvj8a.js → chunk-78ft65vf.js} +2 -2
  20. package/dist/{chunk-v22xpr7j.js → chunk-795w1bb2.js} +2 -2
  21. package/dist/chunk-7vjbc4z7.js +6 -0
  22. package/dist/chunk-85r70e8z.js +3 -0
  23. package/dist/chunk-8t9qp0mq.js +5 -0
  24. package/dist/chunk-9axwjcna.js +21 -0
  25. package/dist/{chunk-qt9gjs57.js → chunk-9wgk5qp1.js} +2 -2
  26. package/dist/{chunk-hbmnkmzb.js → chunk-am4b9zt0.js} +3 -3
  27. package/dist/chunk-b5wcbnb8.js +9 -0
  28. package/dist/{chunk-8vvryt8p.js → chunk-bd048mjd.js} +2 -2
  29. package/dist/chunk-be7f8t6b.js +3 -0
  30. package/dist/chunk-bwb12r8r.js +3 -0
  31. package/dist/chunk-cb5dj4qy.js +3 -0
  32. package/dist/chunk-chj3hn6f.js +3 -0
  33. package/dist/chunk-cnb2rfmv.js +21 -0
  34. package/dist/{chunk-vk5r6pgx.js → chunk-cs6538bw.js} +2 -2
  35. package/dist/chunk-d99qykzn.js +6 -0
  36. package/dist/{chunk-2qbj76ap.js → chunk-e12f4mpd.js} +8 -8
  37. package/dist/chunk-e21ap86b.js +3 -0
  38. package/dist/{chunk-f5jc2v3k.js → chunk-ezhvnzja.js} +2 -2
  39. package/dist/chunk-fnd5bvfd.js +3 -0
  40. package/dist/chunk-fwqdc8fd.js +3 -0
  41. package/dist/{chunk-6r01zgys.js → chunk-gkfchhnr.js} +2 -2
  42. package/dist/chunk-h9gwg4kt.js +9 -0
  43. package/dist/chunk-hd2bq1j5.js +6 -0
  44. package/dist/{chunk-g25sbqbw.js → chunk-hpdmtzhk.js} +3 -3
  45. package/dist/{chunk-v6fwy63g.js → chunk-j2bapmng.js} +2 -2
  46. package/dist/{chunk-pnfjhm01.js → chunk-j41nnny5.js} +2 -2
  47. package/dist/{chunk-btcj8fgc.js → chunk-j60x598n.js} +3 -3
  48. package/dist/{chunk-gwa4hmfa.js → chunk-javyer70.js} +2 -2
  49. package/dist/chunk-ke1h5m7f.js +5 -0
  50. package/dist/chunk-kp395d2p.js +44 -0
  51. package/dist/{chunk-4rsk49xj.js → chunk-mzw42cv7.js} +2 -2
  52. package/dist/chunk-n2fm08w5.js +2 -0
  53. package/dist/chunk-n73yp5s4.js +6 -0
  54. package/dist/{chunk-6ekemc3h.js → chunk-ne7q6jf2.js} +2 -2
  55. package/dist/{chunk-5bdwrsqt.js → chunk-ngb87w7x.js} +7 -7
  56. package/dist/chunk-p15wwraa.js +3 -0
  57. package/dist/{chunk-1mzxq1rg.js → chunk-pb7p64tn.js} +2 -2
  58. package/dist/chunk-peg2exva.js +3 -0
  59. package/dist/chunk-pjrnfmwm.js +3 -0
  60. package/dist/{chunk-mph001z4.js → chunk-pkmjprad.js} +4 -4
  61. package/dist/{chunk-fpa2ea8k.js → chunk-pq6j9bkd.js} +5 -5
  62. package/dist/chunk-r1t34d75.js +3 -0
  63. package/dist/chunk-r48h4anw.js +3 -0
  64. package/dist/chunk-r6bagvr6.js +18 -0
  65. package/dist/chunk-rnm8937h.js +3 -0
  66. package/dist/chunk-rv597vq5.js +3 -0
  67. package/dist/chunk-s7d3d1wx.js +3 -0
  68. package/dist/{chunk-b6994asf.js → chunk-sqhmhd08.js} +2 -2
  69. package/dist/{chunk-8r7rmcz7.js → chunk-t5x9cy8y.js} +5 -5
  70. package/dist/chunk-t9w6e58q.js +22 -0
  71. package/dist/chunk-v0gpmwh9.js +8 -0
  72. package/dist/{chunk-heqx5083.js → chunk-ves5kf6r.js} +4 -4
  73. package/dist/{chunk-6c8nk9rm.js → chunk-veys7ggd.js} +4 -4
  74. package/dist/chunk-vjmwxye4.js +3 -0
  75. package/dist/chunk-war78wdt.js +22 -0
  76. package/dist/chunk-wfkkp4tx.js +29 -0
  77. package/dist/{chunk-mqv5m22t.js → chunk-x4pxkg7c.js} +4 -4
  78. package/dist/chunk-xrtfb38p.js +14 -0
  79. package/dist/chunk-xz57d151.js +3 -0
  80. package/dist/chunk-y7bcjjqd.js +3 -0
  81. package/dist/{chunk-hgg4aqvf.js → chunk-yfgm2ccr.js} +2 -2
  82. package/dist/{chunk-nmht3krt.js → chunk-yje9ebc0.js} +4 -4
  83. package/dist/chunk-yjkhep5n.js +3 -0
  84. package/dist/{chunk-7dmn623d.js → chunk-ykxeeekb.js} +3 -3
  85. package/dist/{chunk-9bj73ygx.js → chunk-ypbjr2b6.js} +3 -3
  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.d.ts +4 -2
  90. package/dist/src/bundle-linker.js +1 -1
  91. package/dist/src/bundler.js +1 -1
  92. package/dist/src/cache.js +1 -1
  93. package/dist/src/call-signatures.d.ts +2 -0
  94. package/dist/src/call-signatures.js +1 -1
  95. package/dist/src/circular.js +1 -1
  96. package/dist/src/compat.js +1 -1
  97. package/dist/src/computed-keys.js +1 -1
  98. package/dist/src/concurrency.js +1 -1
  99. package/dist/src/config.js +1 -1
  100. package/dist/src/dangling-refs.js +1 -1
  101. package/dist/src/declaration-project.d.ts +4 -2
  102. package/dist/src/declaration-project.js +1 -1
  103. package/dist/src/declaration-publication.d.ts +1 -1
  104. package/dist/src/declaration-publication.js +1 -1
  105. package/dist/src/declaration-references.js +1 -1
  106. package/dist/src/diff.js +1 -1
  107. package/dist/src/docs.js +1 -1
  108. package/dist/src/enum-declarations.js +1 -1
  109. package/dist/src/errors.js +1 -1
  110. package/dist/src/extractor/directives.js +1 -1
  111. package/dist/src/extractor/extract.js +1 -1
  112. package/dist/src/extractor/hash.js +1 -1
  113. package/dist/src/extractor/scanner.d.ts +2 -0
  114. package/dist/src/extractor/scanner.js +1 -1
  115. package/dist/src/extractor.js +1 -1
  116. package/dist/src/formats.js +1 -1
  117. package/dist/src/formatter.js +1 -1
  118. package/dist/src/function-properties.js +1 -1
  119. package/dist/src/generator.js +1 -1
  120. package/dist/src/import-sorter.d.ts +6 -6
  121. package/dist/src/import-sorter.js +1 -1
  122. package/dist/src/incremental.js +1 -1
  123. package/dist/src/index.js +1 -1
  124. package/dist/src/inferred-imports.d.ts +5 -1
  125. package/dist/src/inferred-imports.js +1 -1
  126. package/dist/src/initializer-type-spans.js +1 -1
  127. package/dist/src/json-config.js +1 -1
  128. package/dist/src/lexical.d.ts +3 -0
  129. package/dist/src/lexical.js +1 -1
  130. package/dist/src/logger.js +1 -1
  131. package/dist/src/lsp.js +1 -1
  132. package/dist/src/memory.js +1 -1
  133. package/dist/src/merger.js +1 -1
  134. package/dist/src/module-graph.d.ts +9 -3
  135. package/dist/src/module-graph.js +1 -1
  136. package/dist/src/module-references.d.ts +2 -0
  137. package/dist/src/module-references.js +1 -1
  138. package/dist/src/native-checker.js +1 -1
  139. package/dist/src/native-engine.d.ts +24 -0
  140. package/dist/src/native-engine.js +1 -1
  141. package/dist/src/native-extractor.js +1 -1
  142. package/dist/src/native-generation.js +1 -1
  143. package/dist/src/native-project.js +1 -1
  144. package/dist/src/numeric-literals.js +1 -1
  145. package/dist/src/optimizer.js +1 -1
  146. package/dist/src/output-normalizer.d.ts +5 -5
  147. package/dist/src/output-normalizer.js +1 -1
  148. package/dist/src/parallel-processor.js +1 -1
  149. package/dist/src/parameters.js +1 -1
  150. package/dist/src/parser.js +1 -1
  151. package/dist/src/plugins/bun.js +1 -1
  152. package/dist/src/plugins/esbuild.js +1 -1
  153. package/dist/src/plugins/index.js +1 -1
  154. package/dist/src/plugins/tsdown.js +1 -1
  155. package/dist/src/plugins/tsup.js +1 -1
  156. package/dist/src/plugins/vite.js +1 -1
  157. package/dist/src/plugins/webpack.js +1 -1
  158. package/dist/src/plugins.d.ts +2 -0
  159. package/dist/src/plugins.js +1 -1
  160. package/dist/src/process-source.js +1 -1
  161. package/dist/src/processor/cache.js +1 -1
  162. package/dist/src/processor/comments.js +1 -1
  163. package/dist/src/processor/declarations.js +1 -1
  164. package/dist/src/processor/import-usage.js +1 -1
  165. package/dist/src/processor/imports.d.ts +3 -1
  166. package/dist/src/processor/imports.js +1 -1
  167. package/dist/src/processor/index.js +1 -1
  168. package/dist/src/processor/type-inference.d.ts +27 -7
  169. package/dist/src/processor/type-inference.js +1 -1
  170. package/dist/src/processor.js +1 -1
  171. package/dist/src/profiling.js +1 -1
  172. package/dist/src/return-type-scope.js +1 -1
  173. package/dist/src/security.js +1 -1
  174. package/dist/src/source-cache.js +1 -1
  175. package/dist/src/sourcemap.js +1 -1
  176. package/dist/src/stx.js +1 -1
  177. package/dist/src/syntax-validator.js +1 -1
  178. package/dist/src/tracking.js +1 -1
  179. package/dist/src/transformers.js +1 -1
  180. package/dist/src/tree-shaker.js +1 -1
  181. package/dist/src/tsconfig.js +1 -1
  182. package/dist/src/type-mappings.js +1 -1
  183. package/dist/src/utils.js +1 -1
  184. package/dist/src/value-inference.js +1 -1
  185. package/dist/src/vue.js +1 -1
  186. package/dist/src/watcher.js +1 -1
  187. package/dist/src/worker-thread.js +1 -1
  188. package/dist/src/worker.js +1 -1
  189. package/dist/src/workspace.js +1 -1
  190. package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
  191. package/native/darwin-x64/libzig-dtsx.dylib +0 -0
  192. package/native/freebsd-x64/libzig-dtsx.so +0 -0
  193. package/native/linux-arm64/libzig-dtsx.so +0 -0
  194. package/native/linux-x64/libzig-dtsx.so +0 -0
  195. package/native/windows-x64/zig-dtsx.dll +0 -0
  196. package/package.json +1 -1
  197. package/dist/chunk-0a1xppye.js +0 -3
  198. package/dist/chunk-0d5nemtn.js +0 -3
  199. package/dist/chunk-1t77gtcx.js +0 -3
  200. package/dist/chunk-20jq5v1p.js +0 -14
  201. package/dist/chunk-38r6thfe.js +0 -3
  202. package/dist/chunk-4cr1q0yf.js +0 -4
  203. package/dist/chunk-555w3kcr.js +0 -8
  204. package/dist/chunk-5tn8854w.js +0 -31
  205. package/dist/chunk-5yx2x4v4.js +0 -3
  206. package/dist/chunk-6b6rt0yh.js +0 -3
  207. package/dist/chunk-7pw9ayve.js +0 -9
  208. package/dist/chunk-7rdazac9.js +0 -40
  209. package/dist/chunk-81jrzxr6.js +0 -10
  210. package/dist/chunk-9h17ws4c.js +0 -2
  211. package/dist/chunk-9mdgtq38.js +0 -3
  212. package/dist/chunk-9wwsqemm.js +0 -3
  213. package/dist/chunk-bt2n0b75.js +0 -4
  214. package/dist/chunk-c726s7aj.js +0 -6
  215. package/dist/chunk-cfjd81h8.js +0 -3
  216. package/dist/chunk-cgqg1br8.js +0 -5
  217. package/dist/chunk-daasy0pw.js +0 -3
  218. package/dist/chunk-dak0dhnx.js +0 -3
  219. package/dist/chunk-djbck65n.js +0 -3
  220. package/dist/chunk-ekf33t9z.js +0 -6
  221. package/dist/chunk-eskywkxz.js +0 -22
  222. package/dist/chunk-ewgs91y1.js +0 -3
  223. package/dist/chunk-h28vzayq.js +0 -3
  224. package/dist/chunk-h7ebvy8j.js +0 -3
  225. package/dist/chunk-hj7gs32r.js +0 -3
  226. package/dist/chunk-hkcqbex1.js +0 -3
  227. package/dist/chunk-msa98cgm.js +0 -19
  228. package/dist/chunk-mzxxgnp8.js +0 -3
  229. package/dist/chunk-njknd1pt.js +0 -6
  230. package/dist/chunk-qbk49jz5.js +0 -21
  231. package/dist/chunk-qhkxctek.js +0 -3
  232. package/dist/chunk-r46rw8gr.js +0 -29
  233. package/dist/chunk-rzcnab8j.js +0 -3
  234. package/dist/chunk-sjbm1trn.js +0 -3
  235. package/dist/chunk-spdw3tc0.js +0 -18
  236. package/dist/chunk-srm0ddsk.js +0 -27
  237. package/dist/chunk-t5nmnzy6.js +0 -7
  238. package/dist/chunk-tw99ftp1.js +0 -3
  239. package/dist/chunk-vt5hr8vs.js +0 -3
  240. package/dist/chunk-wq5r1ms9.js +0 -38
  241. package/dist/chunk-x6ddycvm.js +0 -3
  242. package/dist/chunk-yxcyqezk.js +0 -8
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{t,d,E}from"./chunk-t5nmnzy6.js";var K={kind:"symbol"},k=/^(?:0[xX][\da-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|(?:[\d_]+(?:\.[\d_]*)?|\.[\d_]+)(?:[eE][+-]?[\d_]+)?)/,v={"|":1,"^":2,"&":3,"<<":4,">>":4,">>>":4,"+":5,"-":5,"*":6,"/":6,"%":6,"**":7},C=[">>>","<<",">>","**","+","-","*","/","%","|","^","&"];function S(l,c,o=0){if(o>=64)return;let n=l.trim(),r=t(n);if(!r.length)return;if(r[0].start!==0||r[r.length-1].end!==n.length)return S(n.slice(r[0].start,r[r.length-1].end),c,o+1);if(r.length===1&&r[0].kind==="quoted")return d(n);if(r.length===1&&r[0].kind==="word"){let e=c.get(n);return typeof e==="object"?void 0:e}if(k.exec(n)?.[0].length===n.length){let e=Number(n.replaceAll("_",""));return Number.isFinite(e)?e:void 0}let i=0,a;for(let e=0;e<r.length;e++){let s=r[e],u=n.slice(s.start,s.end);if(s.kind!=="punctuation")continue;if(["(","[","{"].includes(u)){i++;continue}if([")","]","}"].includes(u)){i--;continue}let m=k.exec(n.slice(s.start));if(m){while(r[e+1]?.start<s.start+m[0].length)e++;continue}if(i)continue;let f=C.find((w)=>n.startsWith(w,s.start));if(!f)continue;let p=r[e-1],h=p?n.slice(p.start,p.end):"";if(!(!p||p.kind==="punctuation"&&![")","]"].includes(h)&&!/\d/.test(h))&&(!a||v[f]<a.priority||v[f]===a.priority&&f!=="**"))a={start:s.start,operator:f,priority:v[f]};while(r[e+1]?.start<s.start+f.length)e++}if(a){let e=S(n.slice(0,a.start),c,o+1),s=S(n.slice(a.start+a.operator.length),c,o+1);if(e===void 0||s===void 0)return;if(a.operator==="+"&&(typeof e==="string"||typeof s==="string"))return String(e)+String(s);if(typeof e!=="number"||typeof s!=="number")return;let u;switch(a.operator){case"+":u=e+s;break;case"-":u=e-s;break;case"*":u=e*s;break;case"/":u=e/s;break;case"%":u=e%s;break;case"**":u=e**s;break;case"<<":u=e<<s;break;case">>":u=e>>s;break;case">>>":u=e>>>s;break;case"|":u=e|s;break;case"^":u=e^s;break;case"&":u=e&s;break;default:return}return Number.isFinite(u)?u:void 0}if(n.startsWith("(")&&n.endsWith(")")){let e=0;if(r.every((u,m)=>{let f=n.slice(u.start,u.end);if(f==="(")e++;if(f===")")e--;return e!==0||m===r.length-1}))return S(n.slice(1,-1),c,o+1)}if(["+","-","~"].includes(n[0])){let e=S(n.slice(1),c,o+1);if(typeof e!=="number")return;return n[0]==="-"?-e:n[0]==="~"?~e:e}if(!n.startsWith("`")||!n.endsWith("`"))return;let y="",b=1;for(let e=1;e<n.length-1;e++){if(n[e]==="\\"){e++;continue}if(n[e]!=="$"||n[e+1]!=="{")continue;let s=d(`\`${n.slice(b,e)}\``);if(s===void 0)return;y+=s;let u=0,m=r.find((p)=>{if(p.start<e+2||p.kind!=="punctuation")return!1;let h=n.slice(p.start,p.end);if(h==="{")u++;if(h!=="}")return!1;if(u===0)return!0;return u--,!1});if(!m)return;let f=S(n.slice(e+2,m.start),c,o+1);if(f===void 0)return;y+=String(f),e=m.start,b=e+1}let g=d(`\`${n.slice(b,-1)}\``);return g===void 0?void 0:y+g}function sr(l,c){let o=[...new Set([...l,...c.values()])];if(!o.some((i)=>i.kind==="variable"&&typeof i.value==="string"&&/[\[{]/.test(i.value)))return;o.sort((i,a)=>(i.start??0)-(a.start??0));let n=new Map,r=new Map,x=o.some((i)=>i.name==="Symbol");for(let i of o){if(i.kind!=="variable"||typeof i.value!=="string")continue;if(i.value.includes("{")||i.value.includes("[")){let g=new Map(n);g.mutableBindingTypes=new Map(r),i.computedKeyConstants=g}let a=t(i.value),y=a.length===1&&a[0].kind==="word"?n.get(i.value.slice(a[0].start,a[0].end)):void 0;if(i.typeAnnotation==="unique symbol"||i.typeAnnotation==="symbol"||typeof y==="object"||!x&&a[0]?.kind==="word"&&i.value.slice(a[0].start,a[0].end)==="Symbol"&&["(","."].includes(i.value.slice(a[1]?.start,a[1]?.end))){n.set(i.name,K);continue}if(i.modifiers?.[0]!=="const"||i.typeAnnotation||i.modifiers.includes("const assertion"))continue;let b=S(i.value,n);if(b!==void 0){if(n.set(i.name,b),!(a.length===1&&a[0].kind==="word")||r.has(i.value.trim()))r.set(i.name,typeof b)}else if(i.value.trim()==="true"||i.value.trim()==="false")r.set(i.name,"boolean");else if(a.length===1&&a[0].kind==="word"){let g=r.get(i.value.trim());if(g)r.set(i.name,g)}}}function or(l,c){if(!l.trimStart().startsWith("[")||!l.includes("`"))return;let o=t(l);if(l[o[0]?.start]!=="["||l[o[1]?.start]!=="`"||l[o.at(-1)?.start??-1]!=="]")return;let n=l.slice(o[0].end,o.at(-1).start).trim(),r=S(n,c??new Map);return typeof r==="string"?{name:E(r,"'")}:{index:!0}}function ar(l,c){if(!c||!l.trimStart().startsWith("["))return!1;let o=t(l);return o.length===3&&l[o[0].start]==="["&&o[1].kind==="word"&&l[o[2].start]==="]"&&typeof c.get(l.slice(o[1].start,o[1].end))==="object"}function cr(l){if(!l.trimStart().startsWith("[")||!l.includes("`"))return!1;let c=t(l);return l[c[1]?.start]==="`"&&c.some((o)=>o.kind==="punctuation"&&l[o.start]==="{")}
3
- export{S,sr,or,ar,cr};
@@ -1,19 +0,0 @@
1
- // @bun
2
- var wn=["import","type","interface","enum","class","function","variable","export","module","namespace","unknown"],oi=["builtin","external","scoped","internal","parent","sibling","index","type"];function Xe(e,n={}){let{lineEnding:t="lf",trailingNewline:i=!0,maxBlankLines:u=1,trimTrailingWhitespace:a=!0,normalizeIndentation:l=!0,indent:x={style:"spaces",size:2},declarationOrder:f,importGrouping:p,preserveComments:d=!0,insertFinalNewline:b=!0}=n,r=e;if(r=xn(r,t),p?.enabled!==!1)r=$n(r,p||{});if(f)r=En(r,f);if(a)r=Cn(r);if(r=vn(r,u),l)r=ai(r,x);if(i||b)r=Sn(r);return r}function xn(e,n){let t=e;if(e.indexOf("\r")!==-1){if(e.indexOf(`\r
3
- `)!==-1)t=t.replace(/\r\n/g,`
4
- `);if(t.indexOf("\r")!==-1)t=t.replace(/\r/g,`
5
- `)}if(n==="crlf")t=t.replace(/\n/g,`\r
6
- `);return t}function yo(e){let n=(e.match(/\r\n/g)||[]).length,t=(e.match(/(?<!\r)\n/g)||[]).length;if(n>t)return"crlf";return"lf"}function Cn(e){return e.split(`
7
- `).map((n)=>n.replace(/[\t ]+$/,"")).join(`
8
- `)}function vn(e,n){let t=new RegExp(`\\n{${n+2},}`,"g");return e.replace(t,`
9
- `.repeat(n+1))}function Sn(e){return`${e.replace(/\s+$/,"")}
10
- `}function ai(e,n){let{style:t="spaces",size:i=2}=n,u=t==="tabs"?"\t":" ".repeat(i),a=e.split(`
11
- `),l=[];for(let x of a){let f=x.match(/^([\t ]*)(.*)$/);if(!f){l.push(x);continue}let[,p,d]=f;if(!d){l.push("");continue}let b=p.replace(/\t/g," "),r=Math.floor(b.length/2);l.push(u.repeat(r)+d)}return l.join(`
12
- `)}function $n(e,n){let{groups:t=oi,separateGroups:i=!0,alphabetize:u=!0}=n,a=e.split(`
13
- `),l=[],x=[],f=-1;for(let s=0;s<a.length;s++){let c=a[s],o=E(c);if(o)l.push({line:c,source:o.source,group:o.group,isType:o.isType}),f=s;else if(l.length>0&&c.trim()==="")continue;else if(l.length>0||c.trim()!==""){if(l.length===0||s>f+1)x.push(c)}}if(l.length===0)return e;let p=new Map;for(let s of t)p.set(s,[]);for(let s of l)(p.get(s.group)||p.get("external")||[]).push(s);if(u)for(let[,s]of p)s.sort((c,o)=>{if(c.isType!==o.isType)return c.isType?1:-1;return c.source.localeCompare(o.source)});let d=[],b=null;for(let s of t){let c=p.get(s)||[];if(c.length===0)continue;if(i&&b!==null)d.push("");for(let o of c)d.push(o.line);b=s}let r=a.slice(0,a.findIndex((s)=>E(s)!==null)),m=x;while(m.length>0&&m[0].trim()==="")m.shift();return[...r,...d,"",...m].join(`
14
- `)}function E(e){let n=e.trim(),t=n.match(/^import\s+(type\s+)?.*from\s+['"]([^'"]+)['"]/);if(!t){let a=n.match(/^import\s+['"]([^'"]+)['"]/);if(a)return{source:a[1],group:k(a[1]),isType:!1};return null}let i=!!t[1],u=t[2];return{source:u,group:i?"type":k(u),isType:i}}function k(e){if(e.startsWith("node:"))return"builtin";let n=["assert","buffer","child_process","cluster","crypto","dgram","dns","events","fs","http","https","net","os","path","querystring","readline","stream","url","util","zlib"];if(n.includes(e)||n.includes(e.split("/")[0]))return"builtin";if(e==="."||e==="./index"||e==="./index.js"||e==="./index.ts")return"index";if(e.startsWith("./"))return"sibling";if(e.startsWith("../"))return"parent";if(e.startsWith("@/")||e.startsWith("~/")||e.startsWith("#"))return"internal";if(e.startsWith("@"))return"scoped";return"external"}function En(e,n){let{kinds:t=wn,alphabetize:i=!1,groupExports:u=!0}=n,a=e.split(`
15
- `),l=[],x=[],f=[],p=null,d=0,b=!0,r=!1,m=[];for(let o=0;o<a.length;o++){let g=a[o],h=g.trim(),y=d,z=h.startsWith("///"),I=y===0&&!z&&(h.startsWith("//")||h.startsWith("/*"));if(r||I){if(m.push(g),!r&&h.startsWith("/*")&&!h.includes("*/"))r=!0;else if(r&&h.includes("*/"))r=!1;continue}if(y===0&&m.length>0&&h===""){m.push(g);continue}d+=(g.match(/\{/g)||[]).length,d-=(g.match(/\}/g)||[]).length;let W=T(h);if(b&&W&&W.kind!=="import"&&!h.startsWith("//")&&!h.startsWith("/*"))b=!1;if(b){if(m.length>0){if(W?.kind==="import"||!W)x.push(...m),m.length=0}x.push(g);continue}if(W&&d<=1){if(p)l.push(p);p={lines:m.length>0?[...m,g]:[g],kind:W.kind,name:W.name,isExport:W.isExport},m.length=0}else if(p)p.lines.push(g);else{if(h==="")continue;f.push(g)}}if(p)l.push(p);if(m.length>0)f.push(...m);l.sort((o,g)=>{if(u&&o.isExport!==g.isExport)return o.isExport?-1:1;let h=t.indexOf(o.kind),y=t.indexOf(g.kind),z=h>=0?h:t.length,I=y>=0?y:t.length;if(z!==I)return z-I;if(i)return o.name.localeCompare(g.name);return 0});let s=[...x],c=null;for(let o of l){if(c!==null&&o.kind!==c)s.push("");s.push(...o.lines),c=o.kind}if(f.length>0)s.push(""),s.push(...f);return s.join(`
16
- `)}function T(e){let n=e.startsWith("export "),t=n?e.slice(7):e;if(e.startsWith("import "))return{kind:"import",name:e.match(/from\s+['"]([^'"]+)['"]/)?.[1]||"",isExport:!1};if(t.startsWith("type ")||t.startsWith("declare type "))return{kind:"type",name:t.match(/type\s+(\w+)/)?.[1]||"",isExport:n};if(t.startsWith("interface ")||t.startsWith("declare interface "))return{kind:"interface",name:t.match(/interface\s+(\w+)/)?.[1]||"",isExport:n};if(t.startsWith("class ")||t.startsWith("abstract class ")||t.startsWith("declare class ")||t.startsWith("declare abstract class "))return{kind:"class",name:t.match(/class\s+(\w+)/)?.[1]||"",isExport:n};if(t.startsWith("enum ")||t.startsWith("const enum ")||t.startsWith("declare enum ")||t.startsWith("declare const enum "))return{kind:"enum",name:t.match(/enum\s+(\w+)/)?.[1]||"",isExport:n};if(t.startsWith("function ")||t.startsWith("async function ")||t.startsWith("declare function ")||t.startsWith("declare async function "))return{kind:"function",name:t.match(/function\s+(\w+)/)?.[1]||"",isExport:n};if(t.startsWith("const ")||t.startsWith("let ")||t.startsWith("var ")||t.startsWith("declare const ")||t.startsWith("declare let ")||t.startsWith("declare var "))return{kind:"variable",name:t.match(/(?:const|let|var)\s+(\w+)/)?.[1]||"",isExport:n};if(t.startsWith("namespace ")||t.startsWith("declare namespace "))return{kind:"namespace",name:t.match(/namespace\s+(\w+)/)?.[1]||"",isExport:n};if(t.startsWith("module ")||t.startsWith("declare module "))return{kind:"module",name:t.match(/module\s+['"]?(\w+)['"]?/)?.[1]||"",isExport:n};if(e.startsWith("export {")||e.startsWith("export *")||e.startsWith("export type {"))return{kind:"export",name:"",isExport:!0};return null}function bo(e){let n=e.split(`
17
- `),t=[];for(let i=0;i<n.length;i++){let u=n[i],a=u.trim();if(a.startsWith("/**")||a.startsWith("*")||a.startsWith("*/")){t.push(u);continue}if(a.startsWith("//")){t.push(u);continue}if(a.startsWith("/*")||a.endsWith("*/")){t.push(u);continue}t.push(u)}return t.join(`
18
- `)}function wo(e={}){return{normalize:(n)=>Xe(n,e),normalizeLineEndings:(n)=>xn(n,e.lineEnding||"lf"),removeTrailingWhitespace:Cn,normalizeBlankLines:(n)=>vn(n,e.maxBlankLines||1),ensureTrailingNewline:Sn,processImports:(n)=>$n(n,e.importGrouping||{}),orderDeclarations:(n)=>En(n,e.declarationOrder||{})}}var xo={default:{lineEnding:"lf",trailingNewline:!0,maxBlankLines:1,trimTrailingWhitespace:!0,normalizeIndentation:!0,indent:{style:"spaces",size:2},importGrouping:{enabled:!0,separateGroups:!0,alphabetize:!0}},minimal:{lineEnding:"lf",trailingNewline:!0,maxBlankLines:2,trimTrailingWhitespace:!0,normalizeIndentation:!1,importGrouping:{enabled:!1}},strict:{lineEnding:"lf",trailingNewline:!0,maxBlankLines:1,trimTrailingWhitespace:!0,normalizeIndentation:!0,indent:{style:"spaces",size:2},importGrouping:{enabled:!0,separateGroups:!0,alphabetize:!0},declarationOrder:{kinds:wn,alphabetize:!0,groupExports:!0}},windows:{lineEnding:"crlf",trailingNewline:!0,maxBlankLines:1,trimTrailingWhitespace:!0,normalizeIndentation:!0,indent:{style:"spaces",size:2},importGrouping:{enabled:!0,separateGroups:!0,alphabetize:!0}},tabs:{lineEnding:"lf",trailingNewline:!0,maxBlankLines:1,trimTrailingWhitespace:!0,normalizeIndentation:!0,indent:{style:"tabs",size:1},importGrouping:{enabled:!0,separateGroups:!0,alphabetize:!0}}};
19
- export{wn,oi,Xe,xn,yo,Cn,vn,Sn,ai,$n,En,bo,wo,xo};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{t}from"./chunk-t5nmnzy6.js";function Ve(e,d){let i=t(e),o=0,r=0;for(let n=0;n<i.length;n++){let l=i[n],s=e.slice(l.start,l.end),c=i[n+1];if(o===0&&s==="function"&&c?.kind==="word"&&e.slice(c.start,c.end)===d)r++;if(["{","(","["].includes(s))o++;else if(["}",")","]"].includes(s))o--}return r}
3
- export{Ve};
@@ -1,6 +0,0 @@
1
- // @bun
2
- import{r}from"./chunk-0a1xppye.js";import{readFile as D}from"fs/promises";import{dirname as x,relative as g,resolve as C}from"path";async function Dr(s,i={}){let e=new Map,n=i.rootDir||process.cwd(),t=[];for(let o of s){if(i.ignore?.some((p)=>M(o,p)))continue;if(!i.includeNodeModules&&o.includes("node_modules"))continue;t.push(o)}let c=await Promise.all(t.map((o)=>b(o,n)));for(let o=0;o<t.length;o++){let p=c[o];if(p)e.set(t[o],p)}for(let[o,p]of e)for(let a of p.dependencies){let d=e.get(a);if(d)d.dependents.add(o)}return e}async function b(s,i){try{let e=await D(s,"utf-8"),n={path:s,exports:new Set,imports:new Map,dependencies:new Set,dependents:new Set};for(let t of r(e,s,!1)){if(t.isExported&&t.name)n.exports.add(t.isTypeOnly||t.kind==="type"||t.kind==="interface"?"type":t.name);if(!t.source)continue;let c=w(t.source,s,i);if(!c)continue;if(n.dependencies.add(c),t.kind==="import")for(let o of t.specifiers??[])n.imports.set(t.isTypeOnly||o.isType?`type ${o.alias??o.name}`:o.alias??o.name,c)}return n}catch{return null}}function w(s,i,e){if(!s.startsWith(".")&&!s.startsWith("/"))return null;let n=x(i),t=C(n,s);if(t.includes("node_modules"))return null;if(t.endsWith(".ts")||t.endsWith(".tsx"))return t.replace(/\.tsx?$/,".ts");return`${t}.ts`}function M(s,i){let e=i.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp(e).test(s)}function Pr(s,i={}){let e=[],n=new Set,t=new Set,c=[],o=new Map,p=i.maxDepth||100;function a(d,y){if(y>p)return;if(t.has(d)){let u=o.get(d)??c.indexOf(d),l=c.slice(u);l.push(d);let h=S(l,s),f=z(l,s);if(!i.typesOnly||f)e.push({chain:l,symbols:h,severity:f?"error":"warning",reason:f?"Type-level circular dependency can cause compilation issues":"Value-level circular dependency may cause runtime issues"});return}if(n.has(d))return;let m=s.get(d);if(!m)return;t.add(d),o.set(d,c.length),c.push(d);for(let u of m.dependencies)a(u,y+1);t.delete(d),c.pop(),o.delete(d),n.add(d)}for(let d of s.keys())if(!n.has(d))a(d,0);return N(e)}function S(s,i){let e=[];for(let n=0;n<s.length-1;n++){let t=i.get(s[n]),c=s[n+1];if(t){for(let[o,p]of t.imports)if(p===c)e.push(o)}}return[...new Set(e)]}function z(s,i){return s.some((e)=>e.endsWith(".d.ts")||i.get(e)?.exports.has("type")||[...i.get(e)?.imports.keys()||[]].some((n)=>n.startsWith("type ")||n==="type"))}function N(s){let i=new Set,e=[];for(let n of s){let t=v(n.chain),c=t.join(" -> ");if(!i.has(c))i.add(c),e.push({...n,chain:t})}return e}function v(s){if(s.length<=1)return s;let i=s.slice(0,-1),e=i;for(let n=1;n<i.length;n++){let t=[...i.slice(n),...i.slice(0,n)];if(t.join("")<e.join(""))e=t}return[...e,e[0]]}async function Cs(s,i={}){let e=Date.now(),n=await Dr(s,i),t=Pr(n,i);return{hasCircular:t.length>0,cycles:t,graph:n,filesAnalyzed:s,durationMs:Date.now()-e}}function vs(s,i){let e=[];if(!s.hasCircular)return e.push(`\u2713 No circular dependencies found (${s.filesAnalyzed.length} files analyzed in ${s.durationMs}ms)`),e.join(`
3
- `);e.push(`\u2717 Found ${s.cycles.length} circular dependency chain(s)`),e.push("");for(let n of s.cycles){let t=n.severity==="error"?"\uD83D\uDD34":"\uD83D\uDFE1";e.push(`${t} ${n.severity.toUpperCase()}: Circular dependency`);let c=n.chain.map((o)=>i?g(i,o):o);if(e.push(` ${c.join(" \u2192 ")}`),n.symbols.length>0)e.push(` Symbols: ${n.symbols.join(", ")}`);e.push(` ${n.reason}`),e.push("")}return e.push(`Analyzed ${s.filesAnalyzed.length} files in ${s.durationMs}ms`),e.join(`
4
- `)}function Ss(s){let i=0,e={file:"",count:0},n={file:"",count:0},t=[];for(let[c,o]of s){let p=o.dependencies.size;if(i+=p,p>e.count)e={file:c,count:p};if(p===0&&o.dependents.size===0)t.push(c);if(o.dependents.size>n.count)n={file:c,count:o.dependents.size}}return{totalFiles:s.size,totalDependencies:i,avgDependencies:s.size>0?i/s.size:0,maxDependencies:e,isolatedFiles:t,mostDepended:n}}function $s(s,i){let e=new Set,n=[s];while(n.length>0){let t=n.shift(),c=i.get(t);if(c){for(let o of c.dependents)if(!e.has(o))e.add(o),n.push(o)}}return e}function Es(s,i){let e=new Set,n=[s];while(n.length>0){let t=n.shift(),c=i.get(t);if(c){for(let o of c.dependencies)if(!e.has(o))e.add(o),n.push(o)}}return e}function ks(s,i){let e=["digraph dependencies {"," rankdir=LR;"," node [shape=box];",""];for(let[n,t]of s){let c=i?g(i,n):n,o=n.replace(/[^a-z0-9]/gi,"_");e.push(` ${o} [label="${c}"];`);for(let p of t.dependencies){let a=p.replace(/[^a-z0-9]/gi,"_");e.push(` ${o} -> ${a};`)}}return e.push("}"),e.join(`
5
- `)}function Ts(s,i){let e=[];for(let[n,t]of s){let c=i?g(i,n):n;e.push({id:n,path:c,exports:[...t.exports],imports:Object.fromEntries(t.imports),dependencies:[...t.dependencies],dependents:[...t.dependents]})}return JSON.stringify({nodes:e},null,2)}
6
- export{Dr,Pr,Cs,vs,Ss,$s,Es,ks,Ts};
@@ -1,21 +0,0 @@
1
- // @bun
2
- function L(n){return n.endsWith(".vue")}function va(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
- `)o++;while(o<n.length&&/\s/.test(n[o])&&n[o]!==`
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
- `)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 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=va(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
- `)}
21
- export{L,va,Ot,It,c,Ne,ot,Lt,Nt,at,ct,lt,Ft,ut,Bt,Wt,N};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{s}from"./chunk-5tn8854w.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 Ra=Ke,Ma=Ke;
3
- export{Ke,Ra,Ma};
@@ -1,29 +0,0 @@
1
- // @bun
2
- import{f,be}from"./chunk-587w6ktw.js";import{zt,Ut,n,We,H}from"./chunk-7rdazac9.js";function h(t){if(t.includes(`
3
- `))return`/**
4
- * ${t}
5
- */
6
- `;return`/** ${t} */
7
- `}function D(t){let o=t.indexOf("{");if(o===-1)return-1;let s=t.indexOf("<");if(s===-1||s>o)return o;let e=0,r=!1,a="";for(let i=0;i<t.length;i++){let l=t[i],u=i>0?t[i-1]:"";if(!r&&(l==='"'||l==="'"||l==="`"))r=!0,a=l;else if(r&&l===a&&u!=="\\")r=!1;if(!r){if(l==="<")e++;else if(l===">")e--;else if(l==="{"&&e===0)return i}}return-1}function fe(t,o=!0){return f(t.leadingComments,o)+t.text}function x(t,o=!0){if(t.inferenceError)throw Object.assign(Error(`Cannot infer alias '${t.name}': unsupported source value flow`),{code:t.inferenceError});let s=f(t.leadingComments,o);if(!t.typeAnnotation&&t.inferredType)return s+t.text;if(t.typeAnnotation&&!t.value)return s+t.text;let e="";if(t.isExported)e+="export ";e+="declare ";let r=t.modifiers?.[0]||"const";e+=`${r} `,e+=t.name;let{typeAnnotation:a,value:i}=t,l=!a&&i?H(i):null;if(l)a=l;else if(!a&&i&&i.trim().endsWith("as const"))a=n(i,!0,!1,0,t.computedKeyConstants);else if(!a&&i&&r==="const"){let c=i.trim(),m=c.startsWith("{")||c.startsWith("[");if(m)zt();a=n(i,!m,!1,0,t.computedKeyConstants)}else if(!a&&i)a=n(i,r==="const",!1,0,t.computedKeyConstants);if(!a)a="unknown";let u="";if(o&&i&&!t.typeAnnotation&&!i.trim().endsWith("as const")){let c=i.trim();if(r!=="const"){if((a==="string"||a==="number"||a==="boolean")&&c.length>0)u=`@defaultValue ${c}`}else if(c.startsWith("{")||c.startsWith("[")){let m=Ut();if(m)if(m.includes(`
8
- `))u=`@defaultValue
9
- * \`\`\`ts
10
- ${m.split(`
11
- `).map((p)=>` * ${p}`).join(`
12
- `)}
13
- * \`\`\``;else u=`@defaultValue \`${m}\``}}else if(o&&i&&t.typeAnnotation&&We(t.typeAnnotation)){zt();let c=i.trim(),m=c.endsWith("as const")?c.slice(0,-8).trim():c;n(m,!1,!1,0,t.computedKeyConstants);let d=Ut();if(d)if(d.includes(`
14
- `))u=`@defaultValue
15
- * \`\`\`ts
16
- ${d.split(`
17
- `).map((g)=>` * ${g}`).join(`
18
- `)}
19
- * \`\`\``;else u=`@defaultValue \`${d}\``}if(u=be(u),e+=`: ${a};`,u&&s&&s.includes("@defaultValue"))u="";if(u&&s){let c=s.trimEnd(),m=c.lastIndexOf("*/");if(m!==-1){let p=c.slice(0,m).trimEnd();if(p.startsWith("/** ")&&!p.includes(`
20
- `))p=`/**
21
- * ${p.slice(4)}`;return`${p}
22
- * ${u}
23
- */
24
- `+e}return`/**
25
- * ${c.replace(/^\/\/\s*/,"")}
26
- * ${u}
27
- */
28
- ${e}`}if(u)return`${h(u)}${e}`;return s+e}function de(t,o=!0){let s=f(t.leadingComments,o),e=t.text;if(e.startsWith("export declare interface")||e.startsWith("declare interface"))return s+e;let r="";if(t.isExported)r+="export ";if(r+="declare interface ",r+=t.name,t.generics)r+=t.generics;if(t.extends)r+=` extends ${t.extends}`;let a=D(t.text);if(a!==-1)r+=` ${t.text.slice(a)}`;else r+=" {}";return s+r}function pe(t,o=!0){let s=f(t.leadingComments,o);if(t.text.includes("{")&&t.text.includes("}")&&t.text.includes("from"))return s+t.text;let e="";if(t.isExported)e+="export ";if(!t.isExported&&!t.text.includes(" from "))e+="declare ";let r=t.text.indexOf("type ");if(r!==-1){let i=t.text.slice(r),l=i.length;while(l>0&&(i.charCodeAt(l-1)===59||i.charCodeAt(l-1)===32||i.charCodeAt(l-1)===10||i.charCodeAt(l-1)===13))l--;if(l<i.length)i=i.slice(0,l);e+=i}else{if(e+=`type ${t.name}`,t.generics)e+=t.generics;e+=" = any"}let a=e.trimEnd();if(!a.endsWith(";")&&!a.endsWith("}"))e+=";";return s+e}function me(t,o=!0){return f(t.leadingComments,o)+t.text}function ge(t,o=!0){let s=f(t.leadingComments,o),e="";if(t.isExported)e+="export ";if(e+="declare ",t.modifiers?.includes("const"))e+="const ";e+="enum ",e+=t.name;let r=t.text.indexOf("{");if(r!==-1)e+=` ${t.text.slice(r)}`;else e+=" {}";return s+e}function qn(t){let o=t.text.trim(),s=o.length;while(s>0&&o.charCodeAt(s-1)===59)s--;if(s<o.length)o=o.slice(0,s);return o+=";",o}function Jn(t,o=!0){return f(t.leadingComments,o)+t.text.trim()}function he(t,o=!0){let s=f(t.leadingComments,o);if(t.text.startsWith("declare global"))return s+t.text;if(t.source||(t.name.startsWith('"')||t.name.startsWith("'")||t.name.startsWith("`"))){let i="declare module ";i+=t.name;let l=t.text.indexOf("{");if(l!==-1)i+=` ${t.text.slice(l)}`;else i+=" {}";return s+i}let r="";if(t.isExported)r+="export ";if(!t.modifiers?.includes("declare"))r+="declare ";r+="namespace ",r+=t.name;let a=t.text.indexOf("{");if(a!==-1)r+=` ${t.text.slice(a)}`;else r+=" {}";return s+r}
29
- export{fe,x,de,pe,me,ge,qn,Jn,he};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{s}from"./chunk-5tn8854w.js";import w from"process";import{dirname as x,relative as y,resolve as B,sep as l}from"path";function qe(p={}){let{preBuild:c=!1,postBuild:r=!0,onGenerated:n,onError:o,failOnError:E=!0,...e}=p,v=async(i)=>{try{let t=await s(i);n?.(t)}catch(t){let d=t instanceof Error?t:Error(String(t));if(o?.(d),!o)console.error("[dtsx] Generation failed:",d.message);if(E)throw d}};return{name:"dtsx",async setup(i){if(!c&&!r)return;let t=e.cwd||w.cwd(),u=(i.config.entrypoints||[]).map((a)=>B(t,a)),g=e.root||i.config.root||(u.length>0?y(t,G(u))||".":"./src"),f=B(t,g),m=e.entrypoints||u.filter((a)=>a===f||a.startsWith(`${f}${l}`)).map((a)=>y(f,a));await v({...e,cwd:t,root:g,entrypoints:m.length>0?m:["index.ts"],outdir:e.outdir||i.config.outdir||"./dist",moduleSpecifierMode:e.moduleSpecifierMode??(i.config.target==="node"?"node":"preserve")})}}}function G(p){let c=p.map((n)=>x(n).split(l)),r=c[0];for(let n of c.slice(1)){let o=0;while(o<r.length&&o<n.length&&r[o]===n[o])o++;r=r.slice(0,o)}return r.join(l)||l}var Oa=qe,Ia=qe;
3
- export{qe,Oa,Ia};
@@ -1,3 +0,0 @@
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 j={rootDir:process.cwd(),maxFileSize:10485760,maxTotalSize:104857600,timeout:30000,followSymlinks:!1,maxFiles:1e4,blockedPatterns:["**/.git/**","**/node_modules/**","**/.env*","**/secrets/**","**/*.key","**/*.pem"]};class k 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 k(`Path traversal detected: "${t}" resolves outside root directory`,"PATH_TRAVERSAL",t);return o}function Yr(t,r={}){return t.map((e)=>Ye(e,r))}function hn(t,r={}){let e=r.blockedPatterns||j.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 Xr(t,r={}){let e=r.maxFileSize??j.maxFileSize;try{let i=await T(t);if(i.size>e)throw new k(`File too large: "${t}" is ${a(i.size)}, max is ${a(e)}`,"FILE_TOO_LARGE",t);return i.size}catch(i){if(i instanceof k)throw i;throw new k(`Failed to check file size: ${t}`,"INVALID_PATH",t)}}async function Zr(t){try{return(await d(t)).isSymbolicLink()}catch{return!1}}async function Qr(t,r={}){let e=r.followSymlinks??j.followSymlinks;if(await Zr(t)){if(!e)throw new k(`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(hn(e,r))throw new k(`Path matches blocked pattern: "${t}"`,"BLOCKED_PATTERN",t);let i=await Qr(e,r),n=await Xr(i,r);return{path:i,size:n}}async function yn(t,r={}){let e=r.maxFiles??j.maxFiles,i=r.maxTotalSize??j.maxTotalSize;if(t.length>e)throw new k(`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 k(`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 k(`${e} timed out after ${r}ms`,"TIMEOUT"))},r);t.then((s)=>{clearTimeout(o),i(s)}).catch((s)=>{clearTimeout(o),n(s)})})}function ei(t,r={}){let e=r.timeout??j.timeout;return async(i)=>{let{path:n}=await vt(i,r);return St(t(n),e,`Processing ${i}`)}}function oo(t,r={}){let e=r.timeout??j.timeout;return async(i)=>{let{paths:n}=await yn(i,r);return St(t(n),e,`Processing ${i.length} files`)}}function ao(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 co(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 lo(t={}){let r={...j,...t};return{validatePath:(e)=>Ye(e,r),validatePaths:(e)=>Yr(e,r),validateFile:(e)=>vt(e,r),validateBatch:(e)=>yn(e,r),withTimeout:(e,i)=>St(e,r.timeout,i),secureProcessor:(e)=>ei(e,r),isBlocked:(e)=>hn(e,r),getConfig:()=>r}}
3
- export{j,k,Ye,Yr,hn,Xr,Zr,Qr,vt,yn,St,ei,oo,ao,co,lo};
@@ -1,18 +0,0 @@
1
- // @bun
2
- var d=null,m=null;async function P(){if(d!==null)return d;try{return m=await import("prettier"),d=!0,!0}catch{return d=!1,!1}}async function y(r,e){if(!m)return null;try{if(e&&m.resolveConfig){let n=await m.resolveConfig(e);if(n)return n}if(r&&m.resolveConfig){let n=await m.resolveConfig(r);if(n)return n}return null}catch{return null}}async function w(r,e){if(!m)throw Error("Prettier is not available");let n={...e,parser:e.parser||"typescript"};return m.format(r,n)}function C(r,e={}){let{indentSize:n=2,useTabs:s=!1,maxLineWidth:a=100,trailingNewline:i=!0,normalizeWhitespace:u=!0,sortImports:l=!0,groupImports:o=!0}=e,t=r,p=s?"\t":" ".repeat(n);if(t.indexOf(`\r
3
- `)!==-1)t=t.replace(/\r\n/g,`
4
- `);if(u){if(/[ \t]\n/.test(t)||/[ \t]$/.test(t))t=t.replace(/[ \t]+$/gm,"");if(t.indexOf(`
5
-
6
-
7
- `)!==-1)t=t.replace(/\n{3,}/g,`
8
-
9
- `);t=I(t,p)}if(l||o)t=x(t,{sort:l,group:o});if(a>0)t=W(t,a,p);if(i&&!t.endsWith(`
10
- `))t+=`
11
- `;return t}function I(r,e){let n=r.split(`
12
- `),s=[];for(let a of n){let i=a.match(/^(\s*)(.*)$/);if(!i){s.push(a);continue}let[,u,l]=i;if(!l){s.push("");continue}let o=u.replace(/\t/g," ").length,t=Math.floor(o/2);s.push(e.repeat(t)+l)}return s.join(`
13
- `)}function x(r,e){let n=r.split(`
14
- `),s=[],a=[],i=!1,u=0;for(let o=0;o<n.length;o++){let t=n[o],p=t.match(/^(import\s+(?:type\s+)?.*from\s+['"])([^'"]+)(['"].*)$/);if(p){i=!0,u=o;let c=p[1];s.push({line:t,source:p[2],isType:c.startsWith("import type ")||c.startsWith("import type\t")})}else if(i&&t.trim()==="")continue;else{if(i)i=!1;a.push(t)}}if(s.length===0)return r;if(e.sort)s.sort((o,t)=>{if(o.isType!==t.isType)return o.isType?1:-1;return M(o.source,t.source)});let l;if(e.group){let o=[],t=[],p=[],c=[],b=[];for(let f=0;f<s.length;f++){let g=s[f],h=g.source;if(h.charCodeAt(0)===46)b.push(g);else if(h.startsWith("node:"))o.push(g);else if(h.charCodeAt(0)===64)c.push(g);else if(h.includes("/"))p.push(g);else t.push(g)}l=[...o.map((f)=>f.line),...o.length>0&&t.length>0?[""]:[],...t.map((f)=>f.line),...(o.length>0||t.length>0)&&p.length>0?[""]:[],...p.map((f)=>f.line),...c.length>0&&(o.length>0||t.length>0||p.length>0)?[""]:[],...c.map((f)=>f.line),...b.length>0?[""]:[],...b.map((f)=>f.line)]}else l=s.map((o)=>o.line);return[...l,"",...a].join(`
15
- `)}function M(r,e){let n=r.startsWith("node:"),s=e.startsWith("node:");if(n!==s)return n?-1:1;let a=r.startsWith("."),i=e.startsWith(".");if(a!==i)return a?1:-1;return r.localeCompare(e)}function W(r,e,n){let s=r.split(`
16
- `),a=[];for(let i of s){if(i.length<=e){a.push(i);continue}if(i.trimStart().startsWith("import ")){a.push(i);continue}let u=i.match(/^(\s*)/)?.[1]||"",l=u+n,o=O(i,u,l);if(o){a.push(...o);continue}if(i.includes("{")&&i.includes("}")){let t=v(i,e,u,l);a.push(...t);continue}if(i.includes(" | ")){let t=R(i,e,u,l);a.push(...t);continue}a.push(i)}return a.join(`
17
- `)}var F=/^\s*(export|import)(\s+type)?\s*\{([^{}]*)\}\s*(from\s*(?:'[^']*'|"[^"]*")(?:\s*(?:with|assert)\s*\{[^{}]*\})?)?\s*;?\s*$/;function O(r,e,n){let s=r.match(F);if(!s)return null;let[,a,i,u,l]=s,o=u.split(",").map((c)=>c.trim()).filter(Boolean);if(o.length<=1)return[r];let t=`${e}${a}${i??""} {`,p=l?`${e}} ${l};`:`${e}};`;return[t,...o.map((c)=>`${n}${c},`),p]}function v(r,e,n,s){let a=r.match(/^(\s*)(.*?)(\{)(.+)(\}.*)$/);if(!a)return[r];let[,,i,u,l,o]=a,t=l.split(/;\s*|,\s*/).filter((c)=>c.trim());if(t.length<=1)return[r];return[`${n}${i}${u}`,...t.map((c)=>`${s}${c.trim()};`),`${n}${o.trim()}`]}function R(r,e,n,s){let a=r.match(/^(\s*)(.*?=\s*)(.+)$/);if(!a)return[r];let[,,i,u]=a,l=u.split(/\s*\|\s*/).filter((t)=>t.trim());if(l.length<=2)return[r];return[`${n}${i}`,...l.map((t,p)=>`${s}${p>0?"| ":" "}${t.trim()}`)]}async function te(r,e={},n){let s=[];if(e.usePrettier!==!1){if(await P())try{let l={...await y(e.prettierConfigPath,n),...e.prettierOptions,parser:"typescript"};return{content:await w(r,l),usedPrettier:!0}}catch(u){s.push(`Prettier formatting failed: ${u}. Using built-in formatter.`)}else if(e.usePrettier===!0)s.push("Prettier requested but not available. Using built-in formatter.")}return{content:C(r,e.builtIn),usedPrettier:!1,warnings:s.length>0?s:void 0}}async function si(r,e={}){let n=new Map;for(let[s,a]of r){let i=await te(a,e,s);n.set(s,i)}return n}function go(r={}){return{format:(e,n)=>te(e,r,n),formatMany:(e)=>si(e,r)}}async function ho(r){return(await te(r,{usePrettier:!0,builtIn:{indentSize:2,normalizeWhitespace:!0,sortImports:!0,trailingNewline:!0}})).content}
18
- export{te,si,go,ho};
@@ -1,27 +0,0 @@
1
- // @bun
2
- import{t,d}from"./chunk-t5nmnzy6.js";import{z}from"./chunk-4cr1q0yf.js";import{jt}from"./chunk-wq5r1ms9.js";import{v}from"./chunk-9mdgtq38.js";import{ae}from"./chunk-1t77gtcx.js";import{relative as O}from"path";function J(n){let k=t(n),c=(l)=>k[l]?n.slice(k[l].start,k[l].end):"",i=c(0)==="export"?1:0;if(c(i++)!=="declare")return;let f;if(c(i)==="module"&&k[i+1]?.kind==="quoted"){if(f=d(c(i+1)),f===void 0)return;i+=2}else if(c(i++)!=="global")return;if(c(i)!=="{")return;let h=k[i].end,M=1;for(i++;i<k.length;i++)if(c(i)==="{")M++;else if(c(i)==="}"&&--M===0)return{specifier:f,body:n.slice(h,k[i].start),start:h,end:k[i].start};return}var te=/^[A-Z_$][\w$]*$/i;function Io(n){let k=[],c=[],i=0,f=0,h=[],M=!1,l=0,y=n.length,R=(a)=>{let b=n.slice(i,a).trim();if(i=a,!b)return;if(ne(b)){c.push(b);return}k.push({text:b,comments:c}),c=[]};while(l<y){let a=n[l];if(M){if(a==="\\"){l+=2;continue}if(a==="`"){M=!1,l++;continue}if(a==="$"&&n[l+1]==="{"){h.push(f),f++,M=!1,l+=2;continue}l++;continue}if(a==="/"&&n[l+1]==="*"){let b=n.indexOf("*/",l+2);l=b===-1?y:b+2;continue}if(a==="/"&&n[l+1]==="/"){let b=n.indexOf(`
3
- `,l);l=b===-1?y:b;continue}if(a==="'"||a==='"'){l++;while(l<y&&n[l]!==a&&n[l]!==`
4
- `){if(n[l]==="\\")l++;l++}l++;continue}if(a==="`"){M=!0,l++;continue}if(a==="("||a==="["||a==="{"){f++,l++;continue}if(a===")"||a==="]"||a==="}"){if(f--,h.length>0&&a==="}"&&f===h[h.length-1])h.pop(),M=!0;l++;continue}if(f===0&&a===";"){R(l+1),l++;continue}if(f===0&&a===`
5
- `){let b=n[l+1];if(b!==void 0&&/[\w$@/]/.test(b))R(l+1);l++;continue}l++}return R(y),k}function ne(n){let k=0;while(k<n.length){while(k<n.length&&/\s/.test(n[k]))k++;if(k>=n.length)return!0;if(n.startsWith("//",k)){let c=n.indexOf(`
6
- `,k);k=c===-1?n.length:c;continue}if(n.startsWith("/*",k)){let c=n.indexOf("*/",k+2);if(c===-1)return!0;k=c+2;continue}return!1}return!0}function X(n){let k=[];for(let c of n.split(",")){let i=c.replace(/\/\*[\s\S]*?\*\//g,"").trim().replace(/^type\s+/,"");if(!i)continue;let f=i.match(/^([\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!f)continue;k.push({local:f[1],exported:f[2]??f[1]})}return k}var se=/^(?:export\s+)?(default\s+)?(?:declare\s+)?(abstract\s+)?(class|interface|type|function\s*\*?|enum|const\s+enum|namespace|module|const|let|var|async\s+function)\b\s*([\w$]+)?/;function ie(n,k){let c=n.replace(/^export\s+/,""),i=/^default\s+/.test(c);if(c=c.replace(/^default\s+/,""),i)c=c.replace(/^((?:declare\s+)?(?:abstract\s+)?(?:class|function\s*\*?|async\s+function\s*\*?))\s*(?=[(<{])/,(f,h)=>`${h.trimEnd()} ${k}`);if(/^(?:interface|type)\b/.test(c)||/^declare\b/.test(c))return c;return`declare ${c}`}function F(n,k,c=!1){let i={file:n,declarations:[],declared:new Set,imports:new Map,localExports:new Map,namedReExports:[],starReExports:[],namespaceReExports:[],verbatim:[],augmentations:[],directives:[]},f=c?jt(k,n).map((h)=>({text:h.text,comments:[...h.leadingComments??[]]})):Io(k);for(let h of f){h.comments=h.comments.filter((b)=>{if(/^\/\/\/\s*</.test(b))return i.directives.push(...b.split(`
7
- `).map((S)=>S.trim()).filter((S)=>S.startsWith("///"))),!1;return!0});let M=h.text.replace(/;\s*$/,"").trim(),l=M.startsWith("import")?v(M):null;if(l&&!l.isImportEquals){let b=l.source;if(l.defaultName)i.imports.set(l.defaultName,{specifier:b,imported:"default"});if(l.namespaceName)i.imports.set(l.namespaceName,{specifier:b,imported:"*"});for(let S of l.namedItems)i.imports.set(S.name,{specifier:b,imported:/^['"]/.test(S.originalName)?d(S.originalName):S.originalName});continue}if(/^import\s+['"]/.test(M)){i.verbatim.push(h);continue}let y=M.match(/^export\s+(?:type\s+)?\*\s+as\s+([\w$]+)\s+from\s+(['"])([^'"]+)\2/);if(y){i.namespaceReExports.push({specifier:y[3],exported:y[1]});continue}if(y=M.match(/^export\s+(?:type\s+)?\*\s+from\s+(['"])([^'"]+)\1/),y){i.starReExports.push(y[2]);continue}if(y=M.match(/^export\s+(?:type\s+)?\{([\s\S]*)\}\s+from\s+(['"])([^'"]+)\2/),y){for(let b of X(y[1]))i.namedReExports.push({specifier:y[3],imported:b.local,exported:b.exported});continue}if(y=M.match(/^export\s+(?:type\s+)?\{([\s\S]*)\}$/),y){for(let b of X(y[1]))i.localExports.set(b.exported,b.local);continue}if(y=M.match(/^export\s+default\s+([\w$]+)$/),y&&te.test(y[1])){i.localExports.set("default",y[1]);continue}let R=J(M);if(R?.specifier!==void 0&&z(k)){i.augmentations.push({statement:h,specifier:R.specifier,body:R.body});continue}if(/^export\s+as\s+namespace\b/.test(M)||R){i.verbatim.push(h);continue}let a=M.match(se);if(a){let b=!!a[1],S=a[4]??(b?"_default":null);if(S){if(i.declared.add(S),/^export\s/.test(M))i.localExports.set(b?"default":S,S);i.declarations.push({statement:h,name:S,emit:ie(h.text,S)});continue}}i.declarations.push({statement:h,name:null,emit:h.text})}return i}function nt(n,k){if(k.size===0)return n;let c=t(n),i=new Map(c.filter((m)=>m.kind==="literal").map((m)=>[m.start,m.end])),f=(m)=>c[m]?n.slice(c[m].start,c[m].end):"",h=new Map,M=[];for(let m=0;m<c.length;m++){let x=f(m);if(["(","[","{","<"].includes(x))M.push(m);else if([")","]","}",">"].includes(x)&&!(x===">"&&f(m-1)==="=")){let w=M.at(-1);if(w!==void 0&&["()","[]","{}","<>"].includes(f(w)+x))M.pop(),h.set(w,m)}}let l=(m)=>{for(let x=m;x<c.length;x++){if([";",",",")","]","}"].includes(f(x))||f(x)===">"&&f(x-1)!=="=")return x;let w=h.get(x);if(w!==void 0)x=w}return c.length},y=new Set;for(let m=0;m<c.length;m++){let x=h.get(m);if(f(m)!=="<"||x===void 0)continue;let w=["class","interface","type"].includes(f(m-2));if(!w&&f(x+1)!=="(")continue;let N=new Set;for(let u=m+1;u<x;u++){if(u===m+1||f(u-1)===","){while(["const","in","out"].includes(f(u)))u++;if(c[u]?.kind==="word")N.add(f(u))}let D=h.get(u);if(D!==void 0)u=D}let I=l(x+1);if(w&&f(m-2)!=="type")for(let u=x+1;u<c.length;u++){if(f(u)==="{"){I=h.get(u)??I;break}let D=h.get(u);if(D!==void 0)u=D}for(let u=m+1;u<I;u++){let D=f(m-2)==="class"&&u>x&&f(u-1)==="extends";if(N.has(f(u))&&f(u-1)!=="typeof"&&!D)y.add(c[u].start)}}for(let m=0;m<c.length;m++){if(!["namespace","module"].includes(f(m))||c[m+1]?.kind!=="word"||f(m+2)!=="{")continue;let x=h.get(m+2);if(x===void 0)continue;let w=jt(n.slice(c[m+2].end,c[x].start),"bundle-namespace.ts"),N=new Set(w.filter((u)=>["class","interface","type","enum","module","namespace"].includes(u.kind)).map((u)=>u.name)),I=new Set(w.filter((u)=>["class","variable","function","enum","module","namespace"].includes(u.kind)).map((u)=>u.name));for(let u=m+3;u<x;u++)if((f(u-1)==="typeof"?I:N).has(f(u)))y.add(c[u].start)}let R="",a=0,b=n.length,S=`
8
- `;while(a<b){let m=i.get(a);if(m!==void 0){R+=n.slice(a,m),a=m,S="`";continue}let x=n[a];if(x==="/"&&n[a+1]==="*"){let w=n.indexOf("*/",a+2),N=w===-1?b:w+2;R+=n.slice(a,N),a=N;continue}if(x==="/"&&n[a+1]==="/"){let w=n.indexOf(`
9
- `,a),N=w===-1?b:w;R+=n.slice(a,N),a=N;continue}if(x==="'"||x==='"'){let w=a+1;while(w<b&&n[w]!==x&&n[w]!==`
10
- `){if(n[w]==="\\")w++;w++}R+=n.slice(a,w+1),a=w+1,S=x;continue}if(/[A-Z_$]/i.test(x)){let w=a+1;while(w<b&&/[\w$]/.test(n[w]))w++;let N=n.slice(a,w),I=k.get(N);if(I!==void 0&&S!=="."&&!y.has(a)){let u=w;while(u<b&&(n[u]===" "||n[u]==="\t"))u++;let D=(n[u]===":"||n[u]==="?"&&n[u+1]===":")&&/[{;,(\n]/.test(S);R+=D?N:I}else R+=N;S="a",a=w;continue}if(R+=x,x===`
11
- `||!/\s/.test(x))S=x;a++}return R}function Rn(n,k,c,i){let f=[],h=new Map,M=[n,...k.filter((e)=>e!==n)];for(let e of M){let s=c.get(e);if(s===void 0){f.push(`No declarations were generated for ${O(i.cwd,e)}; it is left out of the bundle`);continue}h.set(e,F(e,s))}let l=(e,s)=>{if(!e.startsWith(".")&&!e.startsWith("/"))return null;let o=ae(e,s).resolved;return o&&h.has(o)?o:null},y=(e)=>e.startsWith(".")||e.startsWith("/"),R=new Set,a=(e)=>{let s=e;for(let o=1;R.has(s);o++)s=`${e}_${o}`;return R.add(s),s},b=new Map;for(let[e,s]of h){let o=new Map;for(let g of s.declared)o.set(g,a(g));b.set(e,o)}let S=new Map,m=(e,s,o)=>{let g=`${e}\x00${s}`,r=S.get(g);if(!r)r=a(o),S.set(g,r);return r},x=new Map,w=new Map,N=new Set,I=new Map,u=!0,D=(e,s,o)=>{let g=l(s,e.file);if(g){if(o==="*")return{kind:"namespace",file:g};let r=L(g).get(o);if(!r&&!u)f.push(`${O(i.cwd,e.file)}: '${o}' is not exported by '${s}'`);return r??null}if(y(s))return f.push(`${O(i.cwd,e.file)}: '${s}' is not part of the bundle`),null;return o==="*"?{kind:"external-namespace",source:s}:{kind:"external",source:s,imported:o}},Y=(e,s)=>{if(e.declared.has(s))return{kind:"local",name:b.get(e.file).get(s)};let o=e.imports.get(s);if(o)return D(e,o.specifier,o.imported);return f.push(`${O(i.cwd,e.file)}: cannot resolve exported name '${s}'`),null};function L(e){let s=x.get(e);if(s)return s;let o=new Map,g=h.get(e);if(!g||N.has(e))return o;N.add(e);let r=new Set;for(let[p,E]of g.localExports){let B=Y(g,E);if(B)o.set(p,B)}for(let p of g.namedReExports){let E=D(g,p.specifier,p.imported);if(E)o.set(p.exported,E)}for(let p of g.namespaceReExports){let E=D(g,p.specifier,"*");if(E)o.set(p.exported,E)}for(let p of g.starReExports){let E=l(p,e);if(E){for(let[B,C]of L(E))if(B!=="default"&&!o.has(B))o.set(B,C);for(let B of w.get(E)??[])r.add(B)}else if(y(p))f.push(`${O(i.cwd,e)}: '${p}' is not part of the bundle`);else r.add(p)}for(let[p,E]of I.get(e)??[])o.set(p,E);return N.delete(e),x.set(e,o),w.set(e,r),o}for(let[e,s]of h)for(let o of s.augmentations){let g=l(o.specifier,e);if(!g)continue;for(let r of F(e,o.body,!0).declared){if(L(g).has(r))continue;let p=I.get(g);if(!p)p=new Map,I.set(g,p);p.set(r,{kind:"local",name:a(r)}),x.clear()}}u=!1,x.clear(),w.clear();let Q=new Map,H=[],T=(e,s)=>{switch(e.kind){case"local":return e.name;case"external":return m(e.source,e.imported,e.imported==="default"?s:e.imported);case"external-namespace":return m(e.source,"*",s);case"namespace":return ee(e.file,s)}};function ee(e,s){let o=Q.get(e);if(o)return o;let g=a(s);Q.set(e,g);let r=[];for(let[p,E]of L(e)){if(p==="default")continue;let B=T(E,p);r.push(B===p?p:`${B} as ${p}`)}if(w.get(e)?.size)f.push(`${O(i.cwd,e)}: 'export * from' an external module cannot be expressed inside namespace '${g}'`);return H.push(`declare namespace ${g} {
12
- export { ${r.join(", ")} };
13
- }`),g}let U=[],A=[],Z=new Set;for(let[e,s]of h){for(let r of s.directives)Z.add(r);let o=new Map;for(let[r,p]of b.get(e))if(r!==p)o.set(r,p);for(let[r,p]of s.imports){if(s.declared.has(r))continue;let E=D(s,p.specifier,p.imported);if(!E)continue;let B=T(E,r);if(B!==r)o.set(r,B)}let g=[];for(let r of s.declarations){if(i.keepComments)g.push(...r.statement.comments);let p=nt(r.emit,o);if(!/[;}]$/.test(p))p+=";";g.push(p)}for(let r of s.verbatim){if(i.keepComments)A.push(...r.comments);let p=J(r.text);if(p){let E=new Map(o);for(let B of F(e,p.body,!0).declared)E.delete(B);A.push(r.text.slice(0,p.start)+nt(p.body,E)+r.text.slice(p.end))}else{let E=t(r.text),B=E[1]?.kind==="quoted"?d(r.text.slice(E[1].start,E[1].end)):void 0;if(B===void 0||!l(B,e))A.push(nt(r.text,o))}}for(let r of s.augmentations){let p=l(r.specifier,e),E=F(e,r.body,!0),B=new Map(o);if(!p){for(let P of E.declared)B.delete(P);let C=J(r.statement.text);if(i.keepComments)A.push(...r.statement.comments);A.push(r.statement.text.slice(0,C.start)+nt(C.body,B)+r.statement.text.slice(C.end));continue}for(let[C,P]of L(p))B.set(C,T(P,C));if(i.keepComments)g.push(...r.statement.comments);for(let C of E.declarations){if(!C.name||!L(p).has(C.name))throw Error(`Cannot link augmentation '${r.specifier}' member '${C.name??C.emit}'`);if(i.keepComments)g.push(...C.statement.comments);g.push(nt(C.emit,B))}}if(g.length>0)U.push(`// From: ${O(i.cwd,e)}
14
- ${g.join(`
15
- `)}`)}let V=L(n),G=[],q=[];for(let[e,s]of V){if(s.kind==="external"){q.push(`export { ${s.imported===e?e:`${s.imported} as ${e}`} } from '${s.source}';`);continue}if(s.kind==="external-namespace"){q.push(`export * as ${e} from '${s.source}';`);continue}let o=T(s,e==="default"?"_default":e);G.push(o===e?e:`${o} as ${e}`)}for(let e of w.get(n)??[])q.push(`export * from '${e}';`);let K=new Map;for(let[e,s]of S){let[o,g]=e.split("\x00"),r=K.get(o)??{named:[],defaults:[],namespaces:[]};if(K.set(o,r),g==="*")r.namespaces.push(s);else if(g==="default")r.defaults.push(s);else r.named.push(g===s?s:`${g} as ${s}`)}let W=[];for(let[e,s]of[...K].sort(([o],[g])=>o.localeCompare(g))){for(let o of s.defaults)W.push(`import ${o} from '${e}';`);for(let o of s.namespaces)W.push(`import * as ${o} from '${e}';`);if(s.named.length>0)W.push(`import { ${s.named.join(", ")} } from '${e}';`)}let j=[];if(Z.size>0)j.push([...Z].join(`
16
- `));if(j.push(`/**
17
- * Bundled TypeScript declarations
18
- * Generated from ${h.size} source files
19
- */`),W.length>0)j.push(W.join(`
20
- `));if(j.push(...U),H.length>0)j.push(H.join(`
21
- `));if(A.length>0)j.push(A.join(`
22
- `));let _=[];if(G.length>0)_.push(`export { ${G.join(", ")} };`);if(_.push(...q),_.length===0)_.push("export {};");return j.push(_.join(`
23
- `)),{content:`${j.join(`
24
-
25
- `)}
26
- `,files:[...h.keys()],exportCount:V.size,warnings:f}}
27
- export{Io,nt,Rn};
@@ -1,7 +0,0 @@
1
- // @bun
2
- import{a,i,h,g,xe,Ue}from"./chunk-cgqg1br8.js";function t(f){let o=[],c=f.length,l=new Set,e=Ue(f,l),r=0;function k(){let S=r++;while(r<c){let y=f.charCodeAt(r);if(y===92)r+=2;else if(y===96){o.push({start:S,end:++r,kind:"literal"});return}else if(y===36&&f.charCodeAt(r+1)===123)o.push({start:S,end:r+1,kind:"literal"}),o.push({start:r+1,end:r+2,kind:"punctuation"}),r+=2,p(!0),S=r;else r++}o.push({start:S,end:r,kind:"literal"})}function p(S=!1){let y=0,M=0;while(r<c){let w=r,n=f.charCodeAt(r);if(n===60&&(M>0||f[r+1]!=="/"&&xe(f,r,o.at(-1)?.end??0))){let u=e(r);if(u){if(M=Math.max(0,M+u.delta),u.delta<0){r=u.end+1,o.push({start:w,end:r,kind:"literal"});continue}}}if(n===32||n>=9&&n<=13||n>127&&/\s/.test(f[r])){r++;continue}if(n===47){let u=f.charCodeAt(r+1);if(u===47){let s=f.indexOf(`
3
- `,r+2);r=s===-1?c:s+1;continue}if(u===42){let s=f.indexOf("*/",r+2);r=s===-1?c:s+2;continue}if(!l.has(r)&&h(f,r,o.at(-1)?.end??0)){r=g(f,r),o.push({start:w,end:r,kind:"literal"});continue}}else if(n===96){k();continue}else if(n===34||n===39){r++;let u=!1;while(r<c){let s=f.charCodeAt(r++);if(s===92)r++;else if(s===n){u=!0;break}}o.push({start:w,end:Math.min(r,c),kind:u?"quoted":"literal"});continue}else if(a(n)){while(i(f.charCodeAt(++r)));o.push({start:w,end:r,kind:"word"});continue}if(o.push({start:w,end:++r,kind:"punctuation"}),S){if(n===123)y++;else if(n===125){if(y===0)return;y--}}}}return p(),o}var R,q=[];function m(f){if(f!==R)q=t(f),R=f;return q}function ur(){R=void 0,q=[]}function d(f){let o="",c=f.length-1;for(let l=1;l<c;l++){if(f[l]!=="\\"){o+=f[l];continue}let e=f[++l];if(l>=c)return;switch(e){case`
4
- `:break;case"\r":if(f[l+1]===`
5
- `)l++;break;case"n":o+=`
6
- `;break;case"r":o+="\r";break;case"t":o+="\t";break;case"b":o+="\b";break;case"f":o+="\f";break;case"v":o+="\v";break;case"0":if(/\d/.test(f[l+1]??""))return;o+="\x00";break;case"x":case"u":{let r=e==="u"&&f[l+1]==="{",k=l+(r?2:1),p=r?f.indexOf("}",k):k+(e==="x"?2:4),S=f.slice(k,p);if(p<k||p>c||!/^[\da-f]+$/i.test(S)||r&&S.length>6)return;let y=Number.parseInt(S,16);if(y>1114111)return;o+=String.fromCodePoint(y),l=r?p:p-1;break}default:if(/\d/.test(e))return;o+=e}}return o}function E(f,o){let c=o;for(let l of f){let e=l.charCodeAt(0);if(l===o||l==="\\")c+=`\\${l}`;else if(e<32||e===8232||e===8233||l.length===1&&e>=55296&&e<=57343)c+=`\\u${e.toString(16).padStart(4,"0")}`;else c+=l}return c+o}function ze(f){let o=t(f),c=(p)=>o[p]?f.slice(o[p].start,o[p].end):"";if(c(0)!=="import")return;let l=c(1)==="type"&&c(2)!=="=",e=l?2:1;if(o[e]?.kind!=="word"||c(e+1)!=="="||c(e+2)!=="require"||c(e+3)!=="("||o[e+4]?.kind!=="quoted"||c(e+5)!==")")return;let r=e+6;if(o.length!==r&&!(o.length===r+1&&c(r)===";"))return;let k=d(c(e+4));if(k===void 0)return;return{name:c(e),source:k,isTypeOnly:l,end:o[o.length-1].end}}function b(f){let o=t(f),c=[],l=new Set,e=(n)=>n>=0&&n<o.length?f.slice(o[n].start,o[n].end):"",r=(n)=>o[n]?.kind==="quoted",k=(n)=>o[n]?.kind==="word",p=[],S=!1,y=0;if(f.includes("declare")&&f.includes("module"))for(let n=0;n<o.length;n++){let u=e(n);if(y===0&&k(n)&&e(n-1)!=="."&&e(n-1)!=="#"){if(u==="export"||u==="import"&&e(n+1)!=="("&&e(n+1)!==".")S=!0;if(u==="declare"&&e(n+1)==="module"&&r(n+2)&&e(n+3)==="{")p.push(n+2)}if(u==="{"||u==="("||u==="[")y++;else if(u==="}"||u===")"||u==="]")y--}function M(n,u=!1){if(e(n)==="*"){if(e(n+1)==="as")return k(n+2)||u&&r(n+2)?n+3:-1;return u?n+1:-1}if(e(n)!=="{")return-1;let s=1;for(let x=n+1;x<o.length;x++)if(e(x)==="{")s++;else if(e(x)==="}"&&--s===0)return x+1;else if(o[x].kind==="literal"||e(x)===";")return-1;return-1}function w(n,u,s,x){let T=o[n];if(!T||T.kind!=="quoted"||l.has(T.start))return;let C=d(f.slice(T.start,T.end));if(C===void 0)return;l.add(T.start),c.push({specifier:C,kind:u,isTypeOnly:s,category:x,start:T.start,end:T.end})}for(let n=0;n<o.length;n++){if(!k(n)||e(n-1)==="."||e(n-1)==="#")continue;let u=e(n),s=n+1;if(u==="export"){let x=e(s)==="type";if(x)s++;let T=e(s)==="*"?e(s+1)==="as"?"export-star-as":"export-star":"export-named",C=M(s,!0);if(C>=0&&e(C)==="from")w(C+1,T,x,"export")}else if(u==="import"){if(r(s)){w(s,"import",!1,"static-import");continue}if(e(s)==="("){if(e(s+2)===")"||e(s+2)===",")w(s+1,"import",!1,"import-type");continue}let x=e(s)==="type"&&e(s+1)!=="from"&&e(s+1)!=="="&&e(s+1)!==",";if(x)s++;if(k(s)){if(s++,e(s)==="="){if(e(s+1)==="require"&&e(s+2)==="("&&e(s+4)===")")w(s+3,"import",x,"static-import");continue}if(e(s)===",")s=M(s+1)}else s=M(s);if(s>=0&&e(s)==="from")w(s+1,"import",x,"static-import")}}if(S&&p.length){for(let n of p)w(n,"import",!0,"augmentation");c.sort((n,u)=>n.start-u.start)}return c}
7
- export{t,m,ur,d,E,ze,b};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{V}from"./chunk-mew3f4wh.js";import{p}from"./chunk-v6fwy63g.js";var f=100,c=new Map,a=new Map,u=new Map,g=0;function d(e,n,t){let r={fileName:e,text:n};c.delete(e),c.set(e,{file:r,hash:t});while(c.size>f){let s=c.keys().next().value;if(s===void 0)break;c.delete(s)}return r}function b(e,n,t){return u.set(e,(u.get(e)??0)+1),d(e,n,t)}function _t(e,n,t=p(n)){let r=c.get(e);if(r?.hash===t)return c.delete(e),c.set(e,r),r.file;return b(e,n,t)}async function ue(e,n,t={}){let r=p(n);if(c.get(e)?.hash===r)return _t(e,n,r);let o=`${e}\x00${String(r)}`,i=a.get(o);if(i)return i;let h=(u.get(e)??0)+1;u.set(e,h);let m=g,l;return l=Promise.resolve().then(async()=>{try{if(n.length>=(t.asyncThreshold??1e5))await new Promise((y)=>setTimeout(y,Math.max(0,t.yieldInterval??0)));if(m===g&&u.get(e)===h)return d(e,n,r);return{fileName:e,text:n}}finally{if(a.get(o)===l)a.delete(o)}}),a.set(o,l),l}async function jn(e,n={}){let t=new Map,r=V(n.concurrency,4);for(let s=0;s<e.length;s+=r){let o=await Promise.all(e.slice(s,s+r).map(async(i)=>({path:i.filePath,file:await ue(i.filePath,i.sourceCode,n)})));for(let i of o)t.set(i.path,i.file)}return t}function Gn(){g++,c.clear(),a.clear(),u.clear()}function Vn(){return c.size}function zn(){return a.size}function Un(e,n={}){return e.length>=(n.asyncThreshold??1e5)}
3
- export{_t,ue,jn,Gn,Vn,zn,Un};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{ur}from"./chunk-t5nmnzy6.js";import{L,N}from"./chunk-qbk49jz5.js";import{O,I}from"./chunk-fpa2ea8k.js";import{p}from"./chunk-v6fwy63g.js";import{R,F}from"./chunk-wq5r1ms9.js";var y=100,h=0,e=new Map;function Le(n,s,c=!0,i=!1,l){if(L(s??""))n=N(n);else if(O(s??""))n=I(n);let f=p(n),m=JSON.stringify([s,c,i,[...l??[]].sort()]),a=e.get(m);if(a&&a.contentHash===f)return a.lastAccess=++h,a.declarations;let g=i?R(n,s,c):F(n,s,c,l);if(e.set(m,{declarations:g,contentHash:f,lastAccess:++h}),e.size>y){let S=Math.max(1,Math.ceil(e.size*0.1)),r=[];for(let[t,o]of e)r.push([t,o.lastAccess]);r.sort((t,o)=>t[1]-o[1]);for(let t=0;t<S&&t<r.length;t++)e.delete(r[t][0])}return g}function _n(){e.clear(),ur()}
3
- export{Le,_n};
@@ -1,38 +0,0 @@
1
- // @bun
2
- import{a,i,h,g,xe,Ue}from"./chunk-cgqg1br8.js";import{t,m,d,ze,b}from"./chunk-t5nmnzy6.js";import{lr}from"./chunk-gwa4hmfa.js";import{Ve}from"./chunk-mzxxgnp8.js";import{sr}from"./chunk-hkcqbex1.js";import{z,rr}from"./chunk-4cr1q0yf.js";import{Kn}from"./chunk-h28vzayq.js";import{y,K}from"./chunk-vk5r6pgx.js";import{_}from"./chunk-daasy0pw.js";import{_e,we,je}from"./chunk-6r01zgys.js";import{n,B,W,Kt,ir,qt,U,H}from"./chunk-7rdazac9.js";import{Hn}from"./chunk-555w3kcr.js";import{x}from"./chunk-r46rw8gr.js";import{Gt,Yn}from"./chunk-h7ebvy8j.js";function Ii(M,ie,J,Y,ue=""){let le=new Map,f={start:0,end:M.length,header:0,name:"",children:[],results:new Map},ee=t(M),ge=[],S=[],Ze=[],Ye=new Map;for(let Z=0;Z<ee.length;Z++){let he=ee[Z];if(he.kind!=="punctuation")continue;let Ce=M.slice(he.start,he.end);if(Ce==="(")Ze.push(Z);else if(Ce===")"){let e=Ze.pop();if(e!==void 0)Ye.set(Z,e)}else if(Ce==="{")S.push(Z);else if(Ce==="}"){let e=S.pop();if(e===void 0)continue;let Q=ee[e].start,re=e-1,L=re>=0?M.slice(ee[re].start,ee[re].end):"";if(L===")"){let ce=Ye.get(re);if(ce!==void 0&&ce>0&&["if","for","while","switch","catch","with"].includes(M.slice(ee[ce-1].start,ee[ce-1].end)))Q=ee[ce-1].start}else if(["else","try","finally","do"].includes(L))Q=ee[re].start;ge.push({open:ee[e].start,close:he.start,header:Q})}}let j=0,me=(Z,he=new Set)=>{let Ce=new Set(he),e=t(M.slice(Z.start,Z.end)),Q=0;for(let de=0;de+1<e.length;de++){let Qe=M.slice(Z.start+e[de].start,Z.start+e[de].end);if(Qe==="{")Q++;else if(Qe==="}")Q--;else if(!Q&&["type","interface"].includes(Qe))Ce.add(M.slice(Z.start+e[de+1].start,Z.start+e[de+1].end))}let re="",L=Z.start,ce=[...Z.results].map(([de,Qe])=>({type:de,name:Qe}));for(let de of Z.children.sort((Qe,ot)=>Qe.header-ot.header)){let Qe=me(de,Ce);re+=M.slice(L,de.header)+`
3
- declare namespace ${de.name} {
4
- ${Qe.text}
5
- }
6
- `,L=de.end+1;for(let ot of Qe.exports)ce.push({type:`${de.name}.${ot.name}`,name:ot.name})}re+=`${M.slice(L,Z.end)}
7
- ;
8
- ${ce.map((de)=>`export type ${de.name} = ${de.type};`).join(`
9
- `)}`;let Ee=F(re,ie,!1);for(let de of ce)Ce.add(de.name);let pe=ue?Ut(ue).map((de,Qe)=>[de,`${Le}_capture_${Qe}`]):[],Ke=Ee.map((de)=>ue&&["type","interface"].includes(de.kind)?zn(de,ue,pe,Ce):(de.kind==="variable"?x(de,!1):de.text).replace(/^export\s+/,"").replace(/^declare\s+/,"")).join(`
10
- `);return{declarations:Ee,text:Ke,exports:ce}},Le;return{resolve(Z,he){Le??=J();let Ce=f;for(let Q of ge.filter((re)=>re.open<he&&he<re.close).sort((re,L)=>re.open-L.open)){let re=Ce.children.find((L)=>L.start===Q.open+1);if(!re)re={start:Q.open+1,end:Q.close,header:Q.header,name:`${Le}_scope_${j++}`,children:[],results:new Map},Ce.children.push(re);Ce=re}let e=Ce.results.get(Z);if(!e)e=`${Le}_result_${le.size}`,Ce.results.set(Z,e),le.set(e,Z);return`${Le}.${e}`},finish(Z){if(!Le)return Z;let he=me(f),Ce=he.declarations,e=new Set(le.keys());if(Ce.every((re)=>e.has(re.name))){let re=new Map(le),L=t(Z),ce="",Ee=0;for(let pe=0;pe+2<L.length;pe++){if(Z.slice(L[pe].start,L[pe].end)!==Le||Z.slice(L[pe+1].start,L[pe+1].end)!==".")continue;let Ke=re.get(Z.slice(L[pe+2].start,L[pe+2].end));if(!Ke)continue;ce+=Z.slice(Ee,L[pe].start)+`(${Ke})`,Ee=L[pe+2].end,pe+=2}return ce+Z.slice(Ee)}if(ue){let re=Ut(ue).join(", "),L=t(Z),ce="",Ee=0;for(let pe=0;pe+2<L.length;pe++){if(Z.slice(L[pe].start,L[pe].end)!==Le||Z.slice(L[pe+1].start,L[pe+1].end)!=="."||!e.has(Z.slice(L[pe+2].start,L[pe+2].end)))continue;ce+=`${Z.slice(Ee,L[pe+2].end)}<${re}>`,Ee=L[pe+2].end,pe+=2}Z=ce+Z.slice(Ee)}let Q=he.text;return Y({kind:"module",name:Le,text:`declare namespace ${Le} {
11
- ${Q}
12
- }`,moduleForm:"namespace",isExported:!1}),Z}}}function Ut(M){let ie=t(M),J=[],Y=0,ue=0,le=!1;for(let f of ie){let ee=M.slice(f.start,f.end);if(ee==="<"){if(Y++,Y===1)le=!0}else if(ee===">"&&M[f.start-1]!=="=")Y--;else if(["(","[","{"].includes(ee))ue++;else if([")","]","}"].includes(ee))ue--;else if(ee===","&&Y===1&&!ue)le=!0;else if(le&&f.kind==="word"&&!["const","in","out"].includes(ee))J.push(ee),le=!1}return J}function zn(M,ie,J,Y){let ue=new Set(Ut(M.generics||"")),le=(me,Le,Z)=>{let he=t(me),Ce="",e=0;for(let Q=0;Q<he.length;Q++){let re=he[Q],L=me.slice(re.start,re.end),ce=he[Q+1]&&me.slice(he[Q+1].start,he[Q+1].end),Ee=he[Q+2]&&me.slice(he[Q+2].start,he[Q+2].end),pe=he[Q-1]&&me.slice(he[Q-1].start,he[Q-1].end);if(re.kind!=="word"||ce===":"||ce==="?"&&Ee===":")continue;let Ke=!Z.has(L)&&pe!=="."&&J.find(([de])=>de===L)?.[1];if(Ke)Ce+=me.slice(e,re.start)+Ke,e=re.end;else if(Le&&Y.has(L)&&!Z.has(L)){let de=J.map(([,Qe])=>Qe).join(", ");Ce+=`${me.slice(e,re.end)}<${de}${ce==="<"?", ":">"}`,e=ce==="<"?he[++Q].end:re.end}}return Ce+me.slice(e)},f=t(M.text),ee=f.findIndex((me)=>["type","interface"].includes(M.text.slice(me.start,me.end))),ge=f[ee+1],S=M.generics||"",Ze=S?M.text.indexOf(S,ge.end)+S.length:ge.end,Ye=le(qn(ie),!1,new Set),j=S?`, ${le(S.slice(1,-1),!0,ue)}`:"";return`${M.text.slice(0,ge.end)}<${Ye}${j}>${le(M.text.slice(Ze),!0,ue)}`.replace(/^export\s+/,"").replace(/^declare\s+/,"")}function qn(M){let ie=M.slice(1,-1),J=t(ie),Y=0,ue=0,le=!1,f="";for(let ee=0;ee<J.length;ee++){let ge=J[ee],S=ie.slice(ge.start,ge.end);if(["(","[","{","<"].includes(S))Y++;else if([")","]","}"].includes(S)||S===">"&&ie[ge.start-1]!=="=")Y--;else if(!Y&&S==="const")f+=ie.slice(ue,ge.start),ue=ge.end;else if(!Y&&S==="="&&ie.slice(J[ee+1]?.start,J[ee+1]?.end)!==">")f+=ie.slice(ue,ge.start),le=!0;else if(!Y&&S===","&&le)ue=ge.start,le=!1}return f+(le?"":ie.slice(ue))}var Fe=32,Ge=9,ve=10,Oe=13,te=47,$e=42,be=39,ye=34,Pe=96,tt=92,q=123,ne=125,ae=40,Ae=41,De=91,Me=93,ke=60,Te=62,oe=59,nt=58,Ie=61,it=44,Ct=46,Ot=63,Cn=35,jn=64,Fn=36;function He(M){return M===Fe||M===Ge||M===ve||M===Oe}function An(M){let ie=!0;for(let J=0;J<M.length;J++){let Y=M.charCodeAt(J);if(Y===Ct){if(ie)return!1;ie=!0}else if(ie){if(!a(Y))return!1;ie=!1}else if(!i(Y))return!1}return M.length>0&&!ie}function $t(M,ie,J){let Y=ie+1;while(Y<M.length){let ue=M.charCodeAt(Y);if(ue===tt){Y+=2;continue}if(Y++,ue===J)break}return Y}function Gn(M){if(M==="any"||M==="object"||M==="unknown")return!0;if(M.startsWith("Record<")||M.startsWith("Array<"))return!0;return M.charCodeAt(0)===q&&M.includes("[")&&M.includes("]:")}var Qt=["public","protected","private","readonly","override"];function Wa(M,ie,J=!0,Y=!1){return Y?R(M,ie,J):F(M,ie,J)}function R(M,ie,J=!0){return Jt(M,ie,J,!0)}function F(M,ie,J=!0,Y){return Jt(M,ie,J,!1,!1,Y)}function jt(M,ie,J=!0){return Jt(M,ie,J,!0,!0)}function Jt(M,ie,J,Y,ue=!1,le){let f=M,ee=J,ge=Y,S=f.length,Ze=Ue(f),Ye=z(f),j=[],me=new Map,Le=new Map;function Z(s,o){let r=o.kind==="interface"||o.kind==="type";if(r){let l=Le.get(s);if(l)l.push(o);else Le.set(s,[o])}let c=me.get(s);if(!r||!c||c.kind!=="variable"&&c.kind!=="function")me.set(s,o)}let he=new Map,Ce=new Set,e=0,Q,re=0,L=[],ce=[],Ee=[],pe=[],Ke;function de(s,o=!1){let r=`__dtsx_constructor_field_${pe.length}__`;Ke??=new Set(m(f).filter((c)=>c.kind==="word").map((c)=>f.slice(c.start,c.end)).filter((c)=>c.startsWith("__dtsx_constructor_field_")));while(Ke.has(r))r+="_";return pe.push({marker:r,initializer:s,classes:L.map((c)=>c.name),namespaces:[...Ee],binding:o}),r}function Qe(s){let o=/^this\.([\w$]+)$/.exec(s);if(o){let w=L.at(-1);return w?.fields.get(`${w.isStatic?"static:":""}${o[1]}`)}let r=/^([\w$]+)\s*\(/.exec(s);if(!r||!s.endsWith(")"))return;let c=t(s),l=0;for(let w=1;w<c.length;w++){let C=s.slice(c[w].start,c[w].end);if(C==="(")l++;else if(C===")"&&--l===0&&w!==c.length-1)return}let u=[...j,...me.values()].filter((w)=>w.kind==="function"&&w.name===r[1]);if(u.length!==1||u[0].generics||Ve(f,r[1])!==1)return;return u[0].returnType}function ot(s){let o=s.trim(),r=Qe(o);if(r)return r;if(!o.startsWith("class"))return;let c=t(o);if(c[0]?.kind!=="word"||o.slice(c[0].start,c[0].end)!=="class")return;let l;do l=`__dtsx_class_${re++}`;while(f.includes(l));let u=c[1],w=u?o.slice(u.start,u.end):"",C=u?.kind==="word"&&!["extends","implements"].includes(w),A=C?w:`${l}_value`,p=C?`export ${o}`:`export class ${A} ${o.slice(5)}`,k=F(p,ie,ee),E=k.find((v)=>v.kind==="class");if(!E)throw Error("Cannot extract the class expression declaration");if(t(p.slice(E.end??p.length)).some((v)=>p.slice((E.end??0)+v.start,(E.end??0)+v.end)!==";"))return;let P=k.map((v)=>v.text.replace(/^export\s+/,"").replace(/^declare\s+/,"")).join(`
13
- `);return Z(l,{kind:"module",name:l,text:`declare namespace ${l} {
14
- ${P}
15
- }`,moduleForm:"namespace",isExported:!1,start:e,end:e}),`typeof ${l}.${A}`}function xt(s,o){let r=/^this\.([\w$]+)$/.exec(s);if(r)return L.at(-1)?.fields.get(`${o?"static:":""}${r[1]}`);return ot(s)}function Zt(s){let o=he.get(s.name);if(o)o.push(s);else he.set(s.name,[s]);Z(s.name,s)}if(e<S&&f.charCodeAt(e)===65279)e++;function Se(s,o){if(s<o){let r=f.charCodeAt(s),c=f.charCodeAt(o-1);if(r!==Fe&&r!==Ge&&r!==ve&&r!==Oe&&c!==Fe&&c!==Ge&&c!==ve&&c!==Oe)return f.slice(s,o)}while(s<o&&He(f.charCodeAt(s)))s++;while(o>s&&He(f.charCodeAt(o-1)))o--;return f.slice(s,o)}let Xt=/[\r\n]/g;function ft(s){return Xt.lastIndex=s,Xt.exec(f)?.index??S}function I(){if(e>=S)return;let s=f.charCodeAt(e);if(s!==Fe&&s!==Ge&&s!==ve&&s!==Oe&&s!==te)return;while(e<S){let o=f.charCodeAt(e);if(o===Fe||o===Ge||o===ve||o===Oe){e++;continue}if(o===te&&e+1<S){let r=f.charCodeAt(e+1);if(r===te){e=ft(e+2);continue}if(r===$e){let c=f.indexOf("*/",e+2);e=c===-1?S:c+2;continue}}break}}function wn(s){if(s.indexOf("//")===-1&&s.indexOf("/*")===-1)return s;let o=0,r=0;while(r<s.length){let c=s.charCodeAt(r);if(c===be||c===ye||c===Pe){r=$t(s,r,c),o=r;continue}if(c===tt){r+=2,o=Math.min(r,s.length);continue}if(c===te&&s.charCodeAt(r+1)===te){while(r<s.length&&s.charCodeAt(r)!==ve&&s.charCodeAt(r)!==Oe)r++;continue}if(c===te&&s.charCodeAt(r+1)===$e){let l=s.indexOf("*/",r+2);r=l===-1?s.length:l+2;continue}if(r++,c>32)o=r}return o<s.length?s.slice(0,o).trimEnd():s}function $n(s){let o=s.length,r=0,c=o;for(let l=0;l<o;l++){let u=s.charCodeAt(l);if(r){if(u===tt){l++;continue}if(u===r)r=0;continue}if(u===be||u===ye||u===Pe){r=u;continue}if(u===te&&l+1<o){let w=s.charCodeAt(l+1);if(w===te){c=l;while(c>0&&(s.charCodeAt(c-1)===Fe||s.charCodeAt(c-1)===Ge))c--;return s.slice(0,c)}if(w===$e){let C=s.indexOf("*/",l+2);if(C!==-1){s=`${s.slice(0,l)} ${s.slice(C+2)}`,l--;continue}}}}c=o;while(c>0&&(s.charCodeAt(c-1)===Fe||s.charCodeAt(c-1)===Ge||s.charCodeAt(c-1)===Oe))c--;return c<o?s.slice(0,c):s}function st(s){e++;let o=s===be?"'":'"';while(e<S){let r=f.indexOf(o,e);if(r===-1){e=S;return}let c=0,l=r-1;while(l>=0&&f.charCodeAt(l)===tt)c++,l--;if(c%2===0){e=r+1;return}e=r+1}}function At(){e++;let s=[];while(e<S){let o=f.charCodeAt(e);if(s.length===0){if(o===tt){e+=2;continue}if(o===Pe){e++;return}if(o===Fn&&e+1<S&&f.charCodeAt(e+1)===q){e+=2,s.push(0);continue}e++;continue}if(o===be||o===ye){st(o);continue}if(o===Pe){At();continue}if(o===te&&e+1<S){let r=f.charCodeAt(e+1);if(r===te){e=ft(e+2);continue}if(r===$e){let c=f.indexOf("*/",e+2);e=c===-1?S:c+2;continue}if(Yt()){en();continue}e++;continue}if(o===q){s[s.length-1]++,e++;continue}if(o===ne){let r=s[s.length-1];if(r===0){s.pop(),e++;continue}s[s.length-1]=r-1,e++;continue}e++}}let Et=!1;function qe(){Et=!1;let s=f.charCodeAt(e);if(s===be||s===ye)return st(s),!0;if(s===Pe)return At(),!0;if(s===te&&e+1<S){let o=f.charCodeAt(e+1);if(o===te)return e=ft(e+2),!0;if(o===$e){let r=f.indexOf("*/",e+2);return Et=ft(e+2)<(r===-1?S:r),e=r===-1?S:r+2,!0}if(Yt())return en(),!0}return!1}function Yt(){return h(f,e)}function en(){e=g(f,e)}function Re(){let s=e;while(e<S&&i(f.charCodeAt(e)))e++;return f.slice(s,e)}function D(s){if(e+s.length>S)return!1;for(let o=0;o<s.length;o++)if(f.charCodeAt(e+o)!==s.charCodeAt(o))return!1;if(e+s.length<S&&i(f.charCodeAt(e+s.length)))return!1;return!0}function yt(s){let o=e+s;while(o<S){let r=f.charCodeAt(o);if(r===Fe||r===Ge||r===ve||r===Oe){o++;continue}return r!==Ct&&r!==Ie}return!1}function tn(){if(!Et)return!1;let s=e;I();let o=e>=S||Rt()||f.charCodeAt(e)===ne;return e=s,o}function Rt(){if(e>=S)return!1;switch(f.charCodeAt(e)){case 101:return D("export")||D("enum");case 105:return D("import")||D("interface");case 102:return D("function");case 99:return D("class")||D("const");case 116:return D("type");case 108:return D("let");case 118:return D("var");case 100:return D("declare")||D("default");case 109:return D("module");case 110:return D("namespace");case 97:return D("abstract")||D("async");default:return!1}}function ht(){let s=f.charCodeAt(e);if(s!==ve&&s!==Oe)return!1;let o=e;if(e++,s===Oe&&e<S&&f.charCodeAt(e)===ve)e++;while(e<S){let c=f.charCodeAt(e);if(c===Fe||c===Ge||c===Oe||c===ve){e++;continue}if(c===te&&e+1<S){let l=f.charCodeAt(e+1);if(l===te){e=ft(e+2);continue}if(l===$e){let u=f.indexOf("*/",e+2);e=u===-1?S:u+2;continue}}break}let r=e>=S||Rt()||f.charCodeAt(e)===ne;return e=o,r}function xn(s){let o=s-1;while(o>=0){let A=f.charCodeAt(o);if(A===Fe||A===Ge||A===Oe||A===ve){o--;continue}break}if(o<0)return!0;let r=f[o];if("+-*/%=<>&|^!~?:,.([{".includes(r))return!0;let c=o;while(c>0&&f.charCodeAt(c-1)!==ve)c--;let l=f.slice(c,o+1),u=l.lastIndexOf("<");if(u!==-1&&/^<[A-Za-z]/.test(l.slice(u))&&!l.slice(u).includes(">"))return!0;let w=o;while(w>=0&&/[a-z]/i.test(f[w]))w--;let C=f.slice(w+1,o+1);return["as","in","of","new","typeof","keyof","extends","instanceof","satisfies","await","return","yield","void"].includes(C)}function yn(s,o){let r=f.charCodeAt(e);if(r!==ve&&r!==Oe&&!(r===te&&(f[e+1]==="/"||f[e+1]==="*")))return!1;let c=m(f),l=0,u=c.length;while(l<u){let k=l+u>>>1;if(c[k].start<e)l=k+1;else u=k}let w=c[l-1],C=c[l];if(!w||w.start<s||!/[\r\n]/.test(f.slice(e,C?.start??S)))return!1;let A=f.slice(w.start,w.end);if(w.end!==o&&w.kind==="punctuation"&&"+-*/%=<>&|^!~?:,.([{".includes(A))return!1;if(w.kind==="word"&&["as","in","of","new","typeof","keyof","extends","instanceof","satisfies","await","return","yield","void"].includes(A))return!1;if(!C)return!0;let p=f.slice(C.start,C.end);return!(".?:)]},+-*/%<>=&|^`([".includes(p)||C.kind==="literal"&&f.charCodeAt(C.start)===Pe||["as","satisfies","instanceof","in"].includes(p))}function nn(){let s=f.charCodeAt(e);if(s!==ve&&s!==Oe)return!1;if(xn(e))return!1;let o=e;e++;while(e<S){let l=f.charCodeAt(e);if(l===Fe||l===Ge||l===Oe||l===ve){e++;continue}if(l===te&&e+1<S){let u=f.charCodeAt(e+1);if(u===te){e=ft(e+2);continue}if(u===$e){let w=f.indexOf("*/",e+2);e=w===-1?S:w+2;continue}}break}let r=e<S?f[e]:"",c=r==="|"||r==="&"||r==="["||r==="."||r==="?"||r===":"||r===">"||r===")"||r===","||D("extends");return e=o,!c}function bt(){let s=f.charCodeAt(e);if(s!==ve&&s!==Oe)return!1;let o=e;if(e++,s===Oe&&e<S&&f.charCodeAt(e)===ve)e++;while(e<S){let c=f.charCodeAt(e);if(c===Fe||c===Ge||c===Oe||c===ve){e++;continue}if(c===te&&e+1<S&&f.charCodeAt(e+1)===te){e=ft(e+2);continue}break}if(e>=S)return e=o,!0;let r=f.charCodeAt(e);if(r===124||r===38||r===Ct||r===Ot||r===nt)return e=o,!1;if(D("extends")||D("keyof")||D("typeof")||D("infer")||D("is")||D("as")||D("in"))return e=o,!1;return e=o,!0}let vn=/[{}'"`\/]/g,Sn=/[()'"`\/]/g,_n=/[[\]'"`\/]/g,Dn=/[<>'"`\/]/g;function Be(s,o){let r=1;e++;let c=s===q?vn:s===ae?Sn:s===De?_n:Dn;c.lastIndex=e;let l;while((l=c.exec(f))!==null){let u=l.index,w=f.charCodeAt(u);if(w===be||w===ye){e=u,st(w),c.lastIndex=e;continue}if(w===Pe){e=u,At(),c.lastIndex=e;continue}if(w===te){if(e=u,qe()){c.lastIndex=e;continue}c.lastIndex=u+1;continue}if(w===s)r++;else if(w===o){if(o===Te&&u>0&&f.charCodeAt(u-1)===Ie){c.lastIndex=u+1;continue}if(r--,r===0)return e=u+1,e}c.lastIndex=u+1}return e=S,e}function et(){return e>0&&f.charCodeAt(e-1)===Ie}function Mt(){return e+1<S&&f.charCodeAt(e+1)===Te}let Je=/[<{};'"`\/\n\r()[\]]/g;function Ne(s=!1){let o=0,r=0,c=0,l=0,u=f.charCodeAt(e)===q;Je.lastIndex=e;let w;while((w=Je.exec(f))!==null){let C=w.index,A=f.charCodeAt(C);if(A===be||A===ye){e=C,st(A),Je.lastIndex=e;continue}if(A===Pe){e=C,At(),Je.lastIndex=e;continue}if(A===te){if(C>0&&f.charCodeAt(C-1)===ke){Je.lastIndex=C+1;continue}if(e=C,qe()){if(o===0&&r===0&&c===0&&l===0&&tn())return;Je.lastIndex=e;continue}Je.lastIndex=C+1;continue}if(A===ke){let p=Ze(C)?.delta??null;if(p!==null)l=Math.max(0,l+p);Je.lastIndex=C+1;continue}if(A===ae){r++,Je.lastIndex=C+1;continue}if(A===Ae){r--,Je.lastIndex=C+1;continue}if(A===De){c++,Je.lastIndex=C+1;continue}if(A===Me){c--,Je.lastIndex=C+1;continue}if(A===q){o++,Je.lastIndex=C+1;continue}if(A===ne){let p=o>0;if(!p&&s&&r===0&&c===0&&l===0){e=C;return}if(p)o--;if((!p||u)&&o===0&&r===0&&c===0&&l===0){e=C+1;return}if(p&&o===0&&r===0&&c===0&&l===0){e=C+1;let k=e;I();let E=Rt();if(e=k,E)return}Je.lastIndex=C+1;continue}if(A===oe&&o===0&&r===0&&c===0&&l===0){e=C+1;return}if((A===ve||A===Oe)&&o===0&&r===0&&c===0&&l===0){if(e=C,ht())return}Je.lastIndex=C+1}e=S}function Tn(){e++;while(e<S&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;let s=f.indexOf(`
16
- `,e),o=s===-1?S:s,r=f.indexOf(";",e);if(r!==-1&&r<o){let c=r-1;while(c>=e&&(f.charCodeAt(c)===Fe||f.charCodeAt(c)===Ge))c--;let l=f.charCodeAt(e),u=f.charCodeAt(c);if(l===q&&u===ne||l===De&&u===Me||l===be&&u===be||l===ye&&u===ye||l===Pe&&u===Pe){e=r+1;return}}Ne()}function sn(){Be(q,ne);while(e<S&&He(f.charCodeAt(e)))e++;if(D("from")){e+=4;while(e<S&&He(f.charCodeAt(e)))e++;if(e<S){let s=f.charCodeAt(e);if(s===be||s===ye)st(s)}}while(e<S&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;if(e<S&&f.charCodeAt(e)===oe)e++}function rn(){e++;while(e<S&&He(f.charCodeAt(e)))e++;if(D("as")){e+=2;while(e<S&&He(f.charCodeAt(e)))e++;Re();while(e<S&&He(f.charCodeAt(e)))e++}if(D("from")){e+=4;while(e<S&&He(f.charCodeAt(e)))e++;if(e<S){let s=f.charCodeAt(e);if(s===be||s===ye)st(s)}}while(e<S&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;if(e<S&&f.charCodeAt(e)===oe)e++}function vt(s){let o=s.indexOf("from ");if(o===-1)return;let r=o+5;while(r<s.length&&(s.charCodeAt(r)===32||s.charCodeAt(r)===9))r++;if(r>=s.length)return;let c=s.charCodeAt(r);if(c!==39&&c!==34)return;let l=s.indexOf(s[r],r+1);if(l===-1)return;return s.slice(r+1,l)}function Xe(s){if(!ee)return;let o=s-1;while(o>=0&&He(f.charCodeAt(o)))o--;if(o<0)return;let r=[],c=!1;while(o>=0){if(o>=1&&f.charCodeAt(o)===te&&f.charCodeAt(o-1)===$e){let w=f.lastIndexOf("/*",o-2);if(w>=0){r.push(f.slice(w,o+1)),c=!0,o=w-1;while(o>=0&&He(f.charCodeAt(o)))o--;continue}break}let l=o;while(l>0&&f.charCodeAt(l-1)!==ve)l--;let u=Se(l,o+1);if(u.startsWith("//")){if(c)break;let w=[u];o=l-1;while(o>=0&&(f.charCodeAt(o)===ve||f.charCodeAt(o)===Oe))o--;while(o>=0){let C=o;while(C>0&&f.charCodeAt(C-1)!==ve)C--;let A=Se(C,o+1);if(A.startsWith("//")){w.push(A),o=C-1;while(o>=0&&(f.charCodeAt(o)===ve||f.charCodeAt(o)===Oe))o--}else if(A===""){o=C-1;while(o>=0&&(f.charCodeAt(o)===ve||f.charCodeAt(o)===Oe))o--}else break}w.reverse(),r.push(w.join(`
17
- `));continue}break}if(r.length===0)return;return r.reverse(),r}function In(s){let o=s,r=!1,c=0,l;while(e<S){let O=f.charCodeAt(e);if(O===te&&(f.charCodeAt(e+1)===te||f.charCodeAt(e+1)===$e)){I();continue}if(O===oe){e++;break}if(O===q)c++;else if(O===ne&&c>0)c--;if(O===be||O===ye){if(st(O),c>0)continue;r=!0;let P=e;if(I(),f.charCodeAt(e)===Ae){let v=e+1;l=ze(f.slice(o,v)),e=l?v:P}else e=P;while(e<S&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;if(e<S&&f.charCodeAt(e)===oe)e++;break}if(O===ve&&r)break;e++}let u=Se(o,e),w=b(u).find((O)=>O.category==="static-import"),C=t(u),A=l?.isTypeOnly??w?.isTypeOnly??!1,p=C[1]?.kind==="quoted",k=l?.source??w?.specifier??"",E=Xe(o);return{kind:"import",name:"",text:u,isExported:!1,isTypeOnly:A,isSideEffect:p,source:k,leadingComments:E,start:o,end:e}}function Wt(){let s=e;return Be(q,ne),f.slice(s,e)}function on(s){let o=s.indexOf("(");if(o===-1)return s;let r=s.slice(o);if(r.indexOf("=")===-1)return s;let c=!1;for(let A=0;A<r.length;A++)if(r.charCodeAt(A)===61){let k=A>0?r.charCodeAt(A-1):0,E=A+1<r.length?r.charCodeAt(A+1):0;if(k!==61&&k!==33&&k!==60&&k!==62&&E!==61&&E!==62){c=!0;break}}if(!c)return s;let l=0,u=-1;for(let A=o;A<s.length;A++){let p=s.charCodeAt(A);if(p===40)l++;else if(p===41){if(l--,l===0){u=A;break}}}if(u===-1)return s;let w=s.slice(o,u+1),C=pt(w);return s.slice(0,o)+C+s.slice(u+1)}function cn(s){let o=s.indexOf("//")!==-1||s.indexOf("/*")!==-1,r=s.split(`
18
- `),c=[],l=[],u=[],w=!1,C=1/0;for(let k=0;k<r.length;k++){let E=r[k];if(o){if(w){if(E.includes("*/"))w=!1;continue}let O=E.trim();if(O.length===0)continue;let P=O.charCodeAt(0);if(P===te){let X=O.charCodeAt(1);if(X===te)continue;if(X===$e){if(!O.includes("*/"))w=!0;continue}}if(P===$e)continue;let v=$n(E);if(v.charCodeAt(v.length-1)===oe)v=v.slice(0,-1);v=on(v);let T=v.trim();if(!T)continue;c.push(v),l.push(T);let V=0;while(V<v.length&&He(v.charCodeAt(V)))V++;if(T!=="{"&&T!=="}"){if(V<C)C=V}u.push(V)}else{let O=E.length;while(O>0&&(E.charCodeAt(O-1)===Fe||E.charCodeAt(O-1)===Ge||E.charCodeAt(O-1)===Oe))O--;if(O===0)continue;let P=O<E.length?E.slice(0,O):E;if(P.charCodeAt(P.length-1)===oe)P=P.slice(0,-1);P=on(P);let v=P.trim();if(!v)continue;c.push(P),l.push(v);let T=0;while(T<P.length&&He(P.charCodeAt(T)))T++;if(v!=="{"&&v!=="}"){if(T<C)C=T}u.push(T)}}if(c.length===0)return"{}";if(C===1/0||C<=2)return c.join(`
19
- `);let A=C-2,p=Array(c.length);for(let k=0;k<c.length;k++){let E=l[k];if(E==="{"){p[k]=E;continue}let O=u[k];if(O>C)p[k]=c[k];else if(O===C&&(E.charCodeAt(0)===ne||E.charCodeAt(0)===Me||E.charCodeAt(0)===Ae))p[k]=c[k];else{let P=Math.max(0,O-A);p[k]=" ".repeat(P)+E}}return p.join(`
20
- `)}function rt(){if(e>=S||f.charCodeAt(e)!==ke)return"";let s=e;Be(ke,Te);let o=f.slice(s,e);if(o.includes(`
21
- `)){let r="",c=!1;for(let l=0;l<o.length;l++){let u=o.charCodeAt(l);if(u===32||u===9||u===10||u===13){if(!c&&r.length>0)r+=" ",c=!0}else r+=o[l],c=!1}if(r.charCodeAt(1)===32)r=`<${r.slice(2)}`;if(r.charCodeAt(r.length-2)===32)r=`${r.slice(0,-2)}>`;return r}return o}function ct(){if(e>=S||f.charCodeAt(e)!==ae)return"()";let s=e;return Be(ae,Ae),f.slice(s,e)}function St(s){if(s.indexOf("/")===-1)return s;let o="",r=!1,c=0;for(let l=0;l<s.length;l++){let u=s.charCodeAt(l);if(r){if(o+=s[l],u===tt&&l+1<s.length){o+=s[++l];continue}if(u===c)r=!1;continue}if(u===be||u===ye||u===Pe){r=!0,c=u,o+=s[l];continue}if(u===te&&l+1<s.length){let w=s.charCodeAt(l+1);if(w===$e){let C=s.indexOf("*/",l+2);l=C===-1?s.length:C+1,o+=" ";continue}if(w===te){let C=s.indexOf(`
22
- `,l+2);l=C===-1?s.length:C-1;continue}if(h(s,l)){let C=g(s,l);o+=s.slice(l,C),l=C-1;continue}}o+=s[l]}return o.trim()}function pt(s){let o=s.slice(1,-1).trim();if(!o)return"()";if(s.indexOf(`
23
- `)===-1&&o.indexOf(":")!==-1&&o.indexOf("{")===-1&&o.indexOf("[")===-1&&o.indexOf("=")===-1&&o.indexOf("@")===-1&&o.indexOf("...")===-1){let A=0,p=0,k=0;for(let E=0;E<o.length;E++){let O=o.charCodeAt(E);if(O===ae||O===ke||O===q)k++;else if(O===Ae||O===Te||O===ne)k--;else if(k===0){if(O===nt)A++;else if(O===it)p++}}if(A>=p+1){let E=!1;for(let O=0;O<Qt.length;O++){let P=Qt[O],v=o.indexOf(P);if(v!==-1){let T=v+P.length;if((v===0||!i(o.charCodeAt(v-1)))&&(T>=o.length||!i(o.charCodeAt(T)))){E=!0;break}}}if(!E)return s}}let r=[],c=0,l=0,u=!1,w=0;for(let A=0;A<=o.length;A++){if(A===o.length){r.push(St(o.slice(c).trim()));break}let p=o.charCodeAt(A);if(u){if(p===tt){A++;continue}if(p===w)u=!1;continue}if(p===te&&A+1<o.length){let k=o.charCodeAt(A+1);if(k===$e){A+=2;while(A+1<o.length&&!(o.charCodeAt(A)===$e&&o.charCodeAt(A+1)===te))A++;A++;continue}if(k===te){while(A<o.length&&o.charCodeAt(A)!==10)A++;continue}if(h(o,A)){A=g(o,A)-1;continue}}if(p===be||p===ye||p===Pe){u=!0,w=p;continue}if(p===ae||p===q||p===De||p===ke)l++;else if(p===Ae||p===ne||p===Me||p===Te&&!(A>0&&o.charCodeAt(A-1)===Ie))l--;else if(p===it&&l===0)r.push(St(o.slice(c,A).trim())),c=A+1}let C=[];for(let A of r){if(!A)continue;let p=A.trim();if(p.startsWith("//")||p.startsWith("/*"))continue;let k=A;{let E=!1,O=0,P=0,v=0;for(let T=0;T<k.length-1;T++){let V=k.charCodeAt(T);if(V===ve){v=T+1;continue}if(E){if(V===tt){T++;continue}if(V===O)E=!1;continue}if(V===be||V===ye||V===Pe){E=!0,O=V;continue}if(V===q||V===De||V===ae||V===ke){P++;continue}if(V===ne||V===Me||V===Ae||V===Te){if(P>0)P--;continue}if(V===te&&h(k,T)){T=g(k,T)-1;continue}if(V===te&&k.charCodeAt(T+1)===te){if(P===0){k=k.slice(0,T).trimEnd();break}let X=k.indexOf(`
24
- `,T);if(X===-1){k=k.slice(0,v).trimEnd();break}let G=k.slice(0,v),N=k.slice(X+1);k=`${G}${N}`,T=v-1}}}if(!k.trim())continue;C.push(an(k))}return _e(`(${C.join(", ")})`)}function On(s){if(!s.startsWith("{")&&!s.startsWith("["))return s;let o="",r=0,c=0,l=!1,u=0;while(r<s.length){let w=s.charCodeAt(r);if(l){if(w===tt&&r+1<s.length){o+=s[r]+s[r+1],r+=2;continue}if(w===u)l=!1;o+=s[r],r++;continue}if(w===te&&r+1<s.length){let C=s.charCodeAt(r+1);if(C===$e){let A=r;r+=2;while(r+1<s.length&&!(s.charCodeAt(r)===$e&&s.charCodeAt(r+1)===te))r++;r=Math.min(r+2,s.length),o+=s.slice(A,r);continue}if(C===te){let A=r;while(r<s.length&&s.charCodeAt(r)!==10)r++;o+=s.slice(A,r);continue}}if(w===be||w===ye||w===Pe){l=!0,u=w,o+=s[r],r++;continue}if(w===q||w===De||w===ae)c++;else if(w===ne||w===Me||w===Ae)c--;if(c>=1&&w===Ie&&(r+1>=s.length||s.charCodeAt(r+1)!==Ie&&s.charCodeAt(r+1)!==Te)){while(o.length>0&&(o[o.length-1]===" "||o[o.length-1]==="\t"||o[o.length-1]===`
25
- `))o=o.slice(0,-1);r++;let C=0;while(r<s.length){let A=s.charCodeAt(r);if(A===te){if(s.charCodeAt(r+1)===te){let p=s.indexOf(`
26
- `,r+2);r=p===-1?s.length:p+1;continue}if(s.charCodeAt(r+1)===$e){let p=s.indexOf("*/",r+2);r=p===-1?s.length:p+2;continue}if(h(s,r)){r=g(s,r);continue}}if(A===be||A===ye||A===Pe){let p=A;r++;while(r<s.length){if(s.charCodeAt(r)===tt){r+=2;continue}if(s.charCodeAt(r)===p){r++;break}r++}continue}if(A===q||A===De||A===ae)C++;else if(A===ne||A===Me||A===Ae){if(C===0)break;C--}else if(A===it&&C===0)break;r++}continue}o+=s[r],r++}return o}function an(s){let o=s.trim(),r=o.startsWith("...");if(r)o=o.slice(3).trim();while(o.startsWith("@")){let v=1;while(v<o.length&&i(o.charCodeAt(v)))v++;if(v<o.length&&o.charCodeAt(v)===ae){let T=1;v++;while(v<o.length&&T>0){if(o.charCodeAt(v)===ae)T++;else if(o.charCodeAt(v)===Ae)T--;v++}}o=o.slice(v).trim()}let c=!0;while(c){c=!1;for(let v of Qt)if(o.startsWith(v)&&o.length>v.length&&!i(o.charCodeAt(v.length))){let T=o.slice(v.length).trim();if(T.charCodeAt(0)===nt||T.charCodeAt(0)===Ot&&T.length>1&&T.charCodeAt(1)===nt)break;o=T,c=!0;break}}let l=-1,u=-1,w=0,C=!1,A=0;for(let v=0;v<o.length;v++){let T=o.charCodeAt(v);if(C){if(T===tt){v++;continue}if(T===A)C=!1;continue}if(T===te&&v+1<o.length){let V=o.charCodeAt(v+1);if(V===$e){v+=2;while(v+1<o.length&&!(o.charCodeAt(v)===$e&&o.charCodeAt(v+1)===te))v++;v++;continue}if(V===te){while(v<o.length&&o.charCodeAt(v)!==10)v++;continue}if(h(o,v)){v=g(o,v)-1;continue}}if(T===be||T===ye||T===Pe){C=!0,A=T;continue}if(T===ae||T===q||T===De||T===ke)w++;else if(T===Ae||T===ne||T===Me||T===Te&&!(v>0&&o.charCodeAt(v-1)===Ie))w--;else if(w===0){if(T===nt&&l===-1)l=v;else if(T===Ie&&u===-1&&(v===0||o.charCodeAt(v-1)!==Ie)&&(v+1>=o.length||o.charCodeAt(v+1)!==Ie&&o.charCodeAt(v+1)!==Te))u=v}}let p,k,E=u!==-1;if(l!==-1&&(u===-1||l<u))if(p=o.slice(0,l).trim(),u!==-1)k=o.slice(l+1,u).trim();else k=o.slice(l+1).trim();else if(u!==-1){p=o.slice(0,u).trim();let v=r?null:we(p,o.slice(u+1));if(v)return je(v,kt);k=kt(o.slice(u+1).trim())}else p=o,k="unknown";if(p=On(p),(p.startsWith("{")||p.startsWith("["))&&p.includes(`
27
- `)){let v=p.replace(/\s*\n\s*/g," ").replace(/\s+/g," ");if(v.length<=40)p=v;else p=p.split(`
28
- `).map((V)=>{let X=V.trim();if(!X)return"";if(X==="{"||X==="}"||X==="["||X==="]"||X.startsWith("}")||X.startsWith("]"))return X;return` ${X}`}).join(`
29
- `)}let O=p.endsWith("?")||E;if(p.endsWith("?"))p=p.slice(0,-1).trim();let P=O&&!r?"?":"";if(r)return`...${p}: ${k}`;return`${p}${P}: ${k}`}function kt(s){let o=s.trim(),r=Qe(o);if(r)return r;if(o==="true"||o==="false")return"boolean";if(y(o))return"number";if(o.startsWith("'")&&o.endsWith("'")||o.startsWith('"')&&o.endsWith('"'))return"string";if(o.startsWith("["))return"unknown[]";if(o.startsWith("{"))return"Record<string, unknown>";return U(o)??"unknown"}function Pt(s){let o=s.trim();if(o.endsWith("as const"))o=o.slice(0,-8).trim();if(o==="true"||o==="false")return o;if(y(o))return K(o);let r=En(o);if(r!==null)return r;return U(o)??"unknown"}function En(s){if(s==="")return null;if(s.charCodeAt(0)===be||s.charCodeAt(0)===ye){if($t(s,0,s.charCodeAt(0))===s.length)return s}let o=Rn(s,"+");if(o.length>1){let r=!1,c=!0,l=[];for(let u of o){let w=u.trim(),C=w.charCodeAt(0);if((C===be||C===ye)&&$t(w,0,C)===w.length)r=!0,l.push(Mn(w));else c=!1}if(c)return Wn(l.join(""));if(r)return"string";return null}if(/^[\d\s()+*/%.\-]+$/.test(s)&&/\d/.test(s)&&/[+*/%\-\s]/.test(s))return"number";return null}function Rn(s,o){let r=[],c=0,l="",u=0;while(u<s.length){let w=s.charCodeAt(u);if(w===be||w===ye||w===Pe){let C=$t(s,u,w);l+=s.slice(u,C),u=C;continue}if(w===te&&(s.charCodeAt(u+1)===te||s.charCodeAt(u+1)===42)){if(s.charCodeAt(u+1)===te){let p=s.indexOf(`
30
- `,u+2),k=p===-1?s.length:p;l+=s.slice(u,k),u=k;continue}let C=s.indexOf("*/",u+2),A=C===-1?s.length:C+2;l+=s.slice(u,A),u=A;continue}if(w===ae||w===De||w===q)c++;else if(w===Ae||w===Me||w===ne)c--;if(s[u]===o&&c===0){r.push(l),l="",u++;continue}l+=s[u],u++}return r.push(l),r}function Mn(s){return s.slice(1,-1).replace(/\\(.)/g,(r,c)=>{if(c==="n")return`
31
- `;if(c==="t")return"\t";if(c==="r")return"\r";if(c==="0")return"\x00";return c})}function Wn(s){return`'${s.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`}function _t(s){if(s.endsWith("as const"))return null;let o=0,r=-1;for(let l=0;l<s.length;l++){let u=s.charCodeAt(l);if(u===be||u===ye||u===Pe)l=$t(s,l,u)-1;else if(u===123||u===91||u===40)o++;else if(u===125||u===93||u===41)o--;else if(o===0&&u===32&&l+4<=s.length&&s.substring(l,l+4)===" as ")r=l}if(r===-1)return null;return s.slice(r+4).trim()||null}function wt(){if(I(),e<S&&f.charCodeAt(e)===nt){let c=function(){let l=Se(s,r),u=(w)=>{let C=l.length-w.length;return C>=0&&l.endsWith(w)&&(C===0||!i(l.charCodeAt(C-1)))};return l.length===0||l.endsWith("=>")||l.endsWith("|")||l.endsWith("&")||l.endsWith("?")||l.endsWith(":")||u("is")||u("extends")||u("keyof")||u("readonly")};e++,I();let s=e,o=0,r=s;while(e<S){let l=e;if(qe()){if(f.charCodeAt(l)!==te)r=e;continue}let u=f.charCodeAt(e);if(u===ae||u===De||u===ke)o++;else if(u===Ae||u===Me||u===Te&&!et())o--;else if(u===q)if(o>0)o++;else if(c())o++;else break;else if(u===ne){if(o===0)break;o--}else if(o===0&&u===oe)break;if(o===0&&bt()&&!c())break;if(!He(u))r=e+1;e++}return Se(s,e)}return""}function at(s,o,r,c){e+=8,I();let l=e<S&&f.charCodeAt(e)===$e;if(l)e++,I();let u=Re();if(!u&&!c)return null;I();let w=rt();I();let C=ct();I();let A=wt(),p=A.length>0;if(!A)if(r&&l)A="AsyncGenerator<unknown, void, unknown>";else if(l)A="Generator<unknown, void, unknown>";else if(r)A="Promise<void>";else A="void";I();let k=!1;if(e<S&&f.charCodeAt(e)===q){k=!0;let X=e+1;if(Be(q,ne),!p&&!l){let G=f.slice(X,e-1),N=Ii(G,ie??"stdin.ts",()=>{let fe;do fe=`__dtsx_return_${re++}`;while(f.includes(fe));return fe},(fe)=>Z(fe.name,{...fe,start:e,end:e}),w);A=N.finish(B(G,r,C,ot,N.resolve))}}else if(e<S&&f.charCodeAt(e)===oe)e++;let E=pt(C),v=`${o?c?"export default function ":"export declare function ":"declare function "}${u||(c?"":"default")}${w}${E}: ${A};`,T=Xe(s),V={kind:"function",name:u||"default",text:v,isExported:o,isDefault:c,isAsync:r,isGenerator:l,returnType:A,generics:w||void 0,leadingComments:T,start:s,end:e};if(k)Ce.add(V);return V}let Bt,Pn=0;function ln(){Bt??=new Set(t(f).filter((s)=>s.kind==="word").map((s)=>f.slice(s.start,s.end)));for(;;){let s=`__dtsx_binding_${Pn++}`;if(Bt.has(s))continue;return Bt.add(s),s}}function dt(s,o,r){e+=o.length,I();let c=[];do{if(I(),e>=S)break;let l=f.charCodeAt(e),u,w=e;if(l===q||l===De)Be(l,l===q?ne:Me),u=f.slice(w,e);let C=u?ln():Re();if(!C)return Ne(),c;I();let A,p,k,E=!1;if(e<S&&f.charCodeAt(e)===nt){e++,I();let X=e,G=0;while(e<S){if(qe()){if(G===0&&tn())break;continue}let N=f.charCodeAt(e);if(N===ae||N===q||N===De||N===ke)G++;else if(N===Ae||N===ne||N===Me||N===Te&&!et())G--;else if(G===0&&(N===oe||N===it))break;else if(G===0&&N===Ie&&!Mt())break;if(G===0&&(ht()||nn()))break;e++}A=Se(X,e)}if(e<S&&f.charCodeAt(e)===Ie)if(ge&&A&&(!ee||!Gn(A)))Tn();else{e++,I();let X=e;k=X;let G=0,N=0,fe;if(f.charCodeAt(e)===ae||f.charCodeAt(e)===ke||D("function")||D("async")){Q??=_(f);let se=Q(e,X);if(se?.parameters)e=se.end}while(e<S){if(G===0&&N===0&&yn(X,fe))break;if(qe())continue;let se=f.charCodeAt(e);if(se===ae||se===q||se===De)G++;else if(se===Ae||se===ne||se===Me)G--;else if(se===ke){Q??=_(f);let We=G===0&&N===0?Q(e,X,fe):void 0;if(We?.parameters||We?.completeOperand||We&&ie!==void 0&&!/\.[jt]sx$/.test(ie)){e=We.end,fe=We.completeOperand?We.end:void 0;continue}let ut=N>0||f[e+1]!=="/"&&xe(f,e)?Ze(e):null;if(ut){if(N=Math.max(0,N+ut.delta),e=ut.end+1,N===0)fe=e;continue}else if(N===0){if(We){e=We.end,fe=We.completeOperand?We.end:void 0;continue}}}else if(G===0&&N===0&&(se===oe||se===it))break;e++}if(p=wn(Se(X,e)),p.endsWith(" as const")||p==="const"){if(E=!0,!A){let se=p.endsWith(" as const")?p.slice(0,-9).trim():p,We=Pt(se);A=We!=="unknown"?We:void 0}}else if(!A){let se=H(p)??_t(p)??ot(p);if(se)A=se}}let O=c.length===0?Xe(s):void 0,P=u?"const":o,v=u?!1:r,T=`${v?"export ":""}declare ${P} ${C}: ${A||"unknown"};`,V={kind:"variable",name:C,text:T,isExported:v,typeAnnotation:A,value:p,initializerStart:k,modifiers:E?[P,"const assertion"]:[P],leadingComments:u?void 0:O,start:s,end:e};if(u)c.push(...lr({pattern:u,patternOffset:w,root:V,kind:o,exported:r,comments:O,allocateName:ln}));else c.push(V);if(f.charCodeAt(e)===it){e++;continue}if(f.charCodeAt(e)===oe)e++;break}while(e<S);return c}function Lt(s,o){e+=9,I();let r=Re();I();let c=rt();I();let l="";if(D("extends")){e+=7,I();let p=e,k=0;while(e<S){if(qe())continue;let E=f.charCodeAt(e);if(E===ke)k++;else if(E===Te&&!et())k--;else if(E===q&&k===0)break;e++}l=Se(p,e)}I();let u=e<S&&f.charCodeAt(e)===q?Wt():"{}",w=cn(u),C=`${o?"export ":""}declare interface ${r}${c}${l?` extends ${l}`:""} ${w}`,A=Xe(s);return{kind:"interface",name:r,text:C,isExported:o,extends:l||void 0,generics:c||void 0,leadingComments:A,start:s,end:e}}function Nt(s,o){e+=4,I();let r=Re();I();let c=rt();if(I(),e<S&&f.charCodeAt(e)===Ie)e++;I();let l=e,u=0;while(e<S){if(qe())continue;let p=f.charCodeAt(e);if(p===ae||p===q||p===De||p===ke)u++;else if(p===Ae||p===ne||p===Me||p===Te&&!et())u--;else if(u===0&&p===oe)break;if(u===0&&(ht()||nn()))break;e++}let w=Se(l,e);if(e<S&&f.charCodeAt(e)===oe)e++;let C=`${o?"export ":""}type ${r}${c} = ${w}`,A=Xe(s);return{kind:"type",name:r,text:C,isExported:o,generics:c||void 0,leadingComments:A,start:s,end:e}}function gt(s,o,r){e+=4,I();let c=Re();I();let l=e;if(e<S&&f.charCodeAt(e)===q)Be(q,ne);let u=Se(s,e),w=Xe(s);return{kind:"enum",name:c,text:u,isExported:o,modifiers:r?["const"]:void 0,leadingComments:w,start:s,end:e}}function lt(s,o,r,c=!1){e+=5,I();let l=Re()||"AnonymousClass";I();let u=rt();I();let w="";if(D("extends")){e+=7,I();let O=e,P=0;while(e<S){if(qe())continue;let v=f.charCodeAt(e);if(v===ke)P++;else if(v===Te&&!et())P--;else if(P===0&&(v===q||D("implements")))break;e++}w=Se(O,e)}let C;if(D("implements")){e+=10,I();let O=e,P=0;while(e<S){if(qe())continue;let T=f.charCodeAt(e);if(T===ke)P++;else if(T===Te&&!et())P--;else if(P===0&&T===q)break;e++}let v=Se(O,e);if(v)C=v.split(",").map((T)=>T.trim())}I();let A=Ht(l),k=`${o?c?"export default ":"export declare ":"declare "}${r?"abstract ":""}class ${l}${u}${w?` extends ${w}`:""}${C&&C.length>0?` implements ${C.join(", ")}`:""} ${A}`,E=Xe(s);return{kind:"class",name:l,text:k,isExported:o,isDefault:c,extends:w||void 0,implements:C,generics:u||void 0,modifiers:r?["abstract"]:void 0,leadingComments:E,start:s,end:e}}let zt;function Ht(s){if(e>=S||f.charCodeAt(e)!==q)return"{}";e++;let o={name:s,fields:new Map,pending:[],isStatic:!1};L.push(o);let r=[],c=new Set;while(e<S){if(I(),e>=S)break;if(f.charCodeAt(e)===ne){e++;break}if(f.charCodeAt(e)===oe){e++;continue}if(zt=Xe(e),D("static")&&Tt("static")===q){e+=6,I(),Be(q,ne);continue}let l=!1,u=!1,w=!1,C=!1,A=!1,p=!1,k=!1,E=!1,O=!0;while(O){I();let G=e,N=Re();if(e=G,N){let fe=Tt(N);if(fe===ae||fe===ke||fe===Ot||fe===33||fe===nt||fe===Ie||fe===oe||fe===ne)break}if(D("private")){l=!0,e+=7;continue}if(D("protected")){u=!0,e+=9;continue}if(D("public")){e+=6;continue}if(D("static")){w=!0,e+=6;continue}if(D("abstract")){C=!0,e+=8;continue}if(D("readonly")){A=!0,e+=8;continue}if(D("override")){p=!0,e+=8;continue}if(D("accessor")){k=!0,e+=8;continue}if(D("async")){E=!0,e+=5;continue}if(D("declare")){e+=7;continue}break}if(I(),e>=S||f.charCodeAt(e)===ne)break;let P=e;if(o.isStatic=w,(D("get")||D("set"))&&Ft(Tt(f.slice(e,e+3))))e+=3,I();if(f.charCodeAt(e)===$e)e++,I();let v=Dt();e=P;let T=v.startsWith("#");if(T)l=!0;if(l&&v&&v!=="constructor"){let G=T?w?" static #private_static;":" #private;":` private ${w?"static ":""}${v};`,fe=v[0]==="'"||v[0]==='"'?d(v)??v:v,se=T?`${w?"static":"instance"}#`:`${w?"static:":"instance:"}${fe}`;if(!c.has(se))c.add(se),r.push(G)}let V=l?[]:r,X=" ";if(u)X+="protected ";if(w)X+="static ";if(C)X+="abstract ";if(A)X+="readonly ";if(D("constructor")){e+=11,I();let G=ct();if(I(),Ln(G,r),e<S&&f.charCodeAt(e)===q)Be(q,ne);else if(e<S&&f.charCodeAt(e)===oe)e++;let N=pt(G);r.push(l?" private constructor();":` ${u?"protected ":""}constructor${N};`)}else if(D("get"))if(e+=3,I(),e<S&&Ft(f.charCodeAt(e))){let G=Dt();if(G.startsWith("#")){if(I(),e<S&&f.charCodeAt(e)===ae)ct();if(I(),wt(),I(),e<S&&f.charCodeAt(e)===q)Be(q,ne);else if(e<S&&f.charCodeAt(e)===oe)e++;continue}I(),ct(),I();let N=wt(),fe;if(I(),e<S&&f.charCodeAt(e)===q){let We=e+1;if(Be(q,ne),!N&&!ge)fe=f.slice(We,e-1),N=B(fe,!1,"()",(ut)=>xt(ut,w))}else if(e<S&&f.charCodeAt(e)===oe)e++;let se=V.length;if(V.push(`${X}get ${G}(): ${fe?W(N):N||"unknown"};`),fe)o.pending.push(()=>{let We=B(fe,!1,"()",(ut)=>xt(ut,w));V[se]=`${X}get ${G}(): ${W(We)};`})}else dn("get",X,w,A,E,V);else if(D("set"))if(e+=3,I(),e<S&&Ft(f.charCodeAt(e))){let G=Dt();if(G.startsWith("#")){if(I(),e<S&&f.charCodeAt(e)===ae)ct();if(I(),e<S&&f.charCodeAt(e)===q)Be(q,ne);else if(e<S&&f.charCodeAt(e)===oe)e++;continue}I();let N=ct();if(I(),e<S&&f.charCodeAt(e)===q)Be(q,ne);else if(e<S&&f.charCodeAt(e)===oe)e++;let fe=pt(N);V.push(`${X}set ${G}${fe};`)}else dn("set",X,w,A,E,V);else{let G=f.charCodeAt(e)===$e;if(G)e++,I();let N=Dt();if(!N){fn();continue}un(N,X,w,A,G,C,E,V)}}for(let l of o.pending)l();return L.pop(),`{
32
- ${r.join(`
33
- `)}
34
- }`}function Ft(s){return a(s)||s===De||s===Cn||s===be||s===ye}function Dt(){if(e>=S)return"";let s=f.charCodeAt(e);if(s===De){let o=e;return Be(De,Me),f.slice(o,e)}if(s===Cn)return e++,`#${Re()}`;if(s===be||s===ye){let o=e;return st(s),f.slice(o,e)}return Re()}function Tt(s){let o=e;e+=s.length,I();let r=e<S?f.charCodeAt(e):0;return e=o,r}function fn(){let s=0;while(e<S){if(qe())continue;let o=f.charCodeAt(e);if(o===q||o===ae)s++;else if(o===ne||o===Ae){if(s===0)return;s--}else if(o===oe&&s===0){e++;return}if(s===0&&bt())return;e++}}function dn(s,o,r,c,l,u){un(s,o,r,c,!1,!1,l,u)}function un(s,o,r,c,l,u,w,C){let A=zt;if(zt=void 0,I(),e>=S)return;let p=f.charCodeAt(e),k=!1;if(p===Ot)k=!0,e++,I();if(e<S&&f.charCodeAt(e)===33)e++,I();let E=e<S?f.charCodeAt(e):0;if(E===ae||E===ke){let O=E===ke?rt():"";I();let P=ct();I();let v=wt(),T,V=v.length>0;if(!v)if(w&&l)v="AsyncGenerator<unknown, void, unknown>";else if(l)v="Generator<unknown, void, unknown>";else if(w)v="Promise<void>";else v="void";if(I(),e<S&&f.charCodeAt(e)===q){let fe=e+1;if(Be(q,ne),!V&&!l)T=f.slice(fe,e-1),v=B(T,w,P,(se)=>xt(se,r))}else if(e<S&&f.charCodeAt(e)===oe)e++;let X=pt(P),G=k?"?":"",N=C.length;if(C.push(`${o}${s}${G}${O}${X}: ${T?W(v):v};`),T)L.at(-1)?.pending.push(()=>{let fe=B(T,w,P,(se)=>xt(se,r));C[N]=`${o}${s}${G}${O}${X}: ${W(fe)};`})}else if(E===nt||E===Ie||E===oe||E===ne||E===ve||E===Oe){let O="";if(E===nt){e++,I();let X=e,G=0;while(e<S){if(qe())continue;let N=f.charCodeAt(e);if(N===ae||N===q||N===De||N===ke)G++;else if(N===Ae||N===ne||N===Me||N===Te&&!et()){if(G===0)break;G--}else if(G===0&&(N===oe||N===it))break;else if(G===0&&N===Ie&&!Mt())break;if(G===0&&bt())break;e++}O=Se(X,e)}let P="";if(e<S&&f.charCodeAt(e)===Ie)if(ge&&O){e++;let X=0;while(e<S){if(qe())continue;let G=f.charCodeAt(e);if(G===ae||G===q||G===De)X++;else if(G===Ae||G===ne||G===Me){if(X===0&&G===ne)break;X--}else if(X===0&&G===oe)break;if(X===0&&bt())break;e++}}else{e++,I();let X=e,G=0;while(e<S){if(qe())continue;let N=f.charCodeAt(e);if(N===ae||N===q||N===De)G++;else if(N===Ae||N===ne||N===Me){if(G===0&&N===ne)break;G--}else if(G===0&&N===oe)break;if(G===0&&bt())break;e++}P=Se(X,e)}if(e<S&&f.charCodeAt(e)===oe)e++;let v=O.length>0;if(!O)if(P){let X=_t(P);if(X)O=X;else if(P.startsWith("new "))O=de(P);else if(O=P.endsWith("as const")||r&&c?Pt(P):kt(P),O==="unknown"&&An(P)&&!P.includes("."))O=de(P,!0)}else O="unknown";let T=k?"?":"";L.at(-1)?.fields.set(`${r?"static:":""}${s}`,k?`(${O}) | undefined`:O);let V=ee&&!v&&P?qt(A,P,O):"";C.push(`${V}${o}${s}${T}: ${O};`)}else fn()}function Bn(s){let o=0;for(let r=0;r<s.length;r++){let c=s.charCodeAt(r);if(c===ae||c===q||c===De||c===ke)o++;else if(c===Ae||c===ne||c===Me||c===Te&&s.charCodeAt(r-1)!==Ie)o--;else if(c===Ie&&o===0&&s.charCodeAt(r+1)!==Te&&s.charCodeAt(r+1)!==Ie)return!0}return!1}function Ln(s,o){let r=s.slice(1,-1).trim();if(!r)return;let c=[],l=0,u=0,w=!1,C=0,A=[];for(let p=0;p<=r.length;p++){if(p===r.length){A.push(r.slice(l)),c.push(St(r.slice(l).trim()));break}let k=r.charCodeAt(p);if(w){if(k===tt){p++;continue}if(k===C)w=!1;continue}if(k===te&&p+1<r.length){let E=r.charCodeAt(p+1);if(E===$e){p+=2;while(p+1<r.length&&!(r.charCodeAt(p)===$e&&r.charCodeAt(p+1)===te))p++;p++;continue}if(E===te){while(p<r.length&&r.charCodeAt(p)!==10)p++;continue}}if(k===be||k===ye||k===Pe){w=!0,C=k;continue}if(k===ae||k===q||k===De||k===ke)u++;else if(k===Ae||k===ne||k===Me||k===Te&&!(p>0&&r.charCodeAt(p-1)===Ie))u--;else if(k===it&&u===0)A.push(r.slice(l,p)),c.push(St(r.slice(l,p).trim())),l=p+1}for(let[p,k]of c.entries()){let E=k.startsWith("public ")||k.startsWith("public\t"),O=k.startsWith("protected ")||k.startsWith("protected\t"),P=k.startsWith("private ")||k.startsWith("private\t"),v=k.includes("readonly ");if(!E&&!O&&!P&&!v)continue;let T=k,V=[];if(P){let se=7;while(se<T.length&&He(T.charCodeAt(se)))se++;T=T.slice(se),V.push("private")}if(E){let se=6;while(se<T.length&&He(T.charCodeAt(se)))se++;T=T.slice(se),V.push("public")}if(O){let se=9;while(se<T.length&&He(T.charCodeAt(se)))se++;T=T.slice(se),V.push("protected")}if(v){let se=T.indexOf("readonly ");if(se!==-1){let We=se+8;while(We<T.length&&He(T.charCodeAt(We)))We++;T=T.slice(0,se)+T.slice(We)}V.push("readonly")}let X=V.length>0?`${V.join(" ")} `:"",G=an(T),N=T.search(/[?:=]/);if(N!==-1&&T.charCodeAt(N)!==63&&Bn(T))G=G.replace(/^([\w$]+)\?:/,"$1:");let fe="";if(ee&&!P&&N!==-1&&T.charCodeAt(N)===Ie){let se=T.slice(N+1);fe=qt(ir(A[p]),se,kt(se))}o.push(P?` private ${G.split(/[?:]/,1)[0]};`:`${fe} ${X}${G};`)}}function Vt(s=" ",o="",r=!1){if(e>=S||f.charCodeAt(e)!==q)return"{}";e++;let c=Ee.at(-1)?.path,l={path:c?`${c}.${o}`:o,bindings:new Map,exports:new Set,annotatedValues:new Set,ambient:r||Ee.at(-1)?.ambient===!0};ce.push(l),Ee.push(l);let u=[];while(e<S){if(I(),e>=S)break;if(f.charCodeAt(e)===ne){e++;break}if(f.charCodeAt(e)===oe){e++;continue}let w=!1;if(D("export"))w=!0,e+=6,I();let C=!1;if(D("declare"))C=!0,e+=7,I();let A=w?"export ":"";if(D("function")||D("async")&&Nn("async","function")){let p=!1;if(D("async"))p=!0,e+=5,I();if(e+=8,I(),e<S&&f.charCodeAt(e)===$e)e++,I();let E=Re();I();let O=rt();I();let P=ct();I();let v=wt();if(!v)v=p?"Promise<void>":"void";if(I(),e<S&&f.charCodeAt(e)===q)Be(q,ne);else if(e<S&&f.charCodeAt(e)===oe)e++;let T=pt(P);u.push(`${s}${A}function ${E}${O}${T}: ${v};`)}else if(D("const")||D("let")||D("var")){let p=D("const")?"const":D("let")?"let":"var";e+=p.length,I();let k=Re();if(l.bindings.set(k,"value"),w||l.ambient)l.exports.add(k);if(!k){Ne(!0);continue}I();let E="";if(e<S&&f.charCodeAt(e)===nt){e++,I();let P=e,v=0;while(e<S){if(qe())continue;let T=f.charCodeAt(e);if(T===ae||T===q||T===De||T===ke)v++;else if(T===ne&&v===0)break;else if(T===Ae||T===ne||T===Me||T===Te&&!et())v--;else if(v===0&&(T===oe||T===it))break;else if(v===0&&T===Ie&&!Mt())break;if(v===0&&ht())break;e++}E=Se(P,e)}if(E)l.annotatedValues.add(k);let O="";if(e<S&&f.charCodeAt(e)===Ie){e++,I();let P=e,v=0;while(e<S){if(qe())continue;let T=f.charCodeAt(e);if(T===ae||T===q||T===De||T===ke)v++;else if(T===ne&&v===0)break;else if(T===Ae||T===ne||T===Me||T===Te&&!et())v--;else if(v===0&&(T===oe||T===it))break;if(v===0&&ht())break;e++}O=Se(P,e)}if(e<S&&f.charCodeAt(e)===oe)e++;if(!E&&O){let P=_t(O);if(P)E=P;else if(p==="const")E=Pt(O);else E=kt(O)}if(!E)E="unknown";u.push(`${s}${A}${p} ${k}: ${E};`)}else if(D("interface")){e+=9,I();let p=Re();I();let k=rt();I();let E="";if(D("extends")){e+=7,I();let P=e,v=0;while(e<S){if(qe())continue;let T=f.charCodeAt(e);if(T===ke)v++;else if(T===Te&&!et())v--;else if(T===q&&v===0)break;e++}E=Se(P,e)}let O=cn(Wt());u.push(`${s}${A}interface ${p}${k}${E?` extends ${E}`:""} ${O}`)}else if(D("type")){e+=4,I();let p=Re();I();let k=rt();if(I(),e<S&&f.charCodeAt(e)===Ie){e++,I();let E=e,O=0;while(e<S){if(qe())continue;let v=f.charCodeAt(e);if(v===ae||v===q||v===De||v===ke)O++;else if(v===ne&&O===0)break;else if(v===Ae||v===ne||v===Me||v===Te&&!et())O--;else if(O===0&&v===oe)break;if(O===0&&ht())break;e++}let P=Se(E,e);if(e<S&&f.charCodeAt(e)===oe)e++;u.push(`${s}${A}type ${p}${k} = ${P}`)}}else if(D("class")){e+=5,I();let p=Re();I();let k=rt();I();let E=e,O=0;while(e<S){if(qe())continue;let V=f.charCodeAt(e);if(V===ke)O++;else if(V===Te&&!et())O--;else if(V===q&&O===0)break;e++}let P=Se(E,e),v=P?` ${P}`:"";if(l.bindings.set(p,"class"),w||l.ambient)l.exports.add(p);let T=Ht(p);u.push(`${s}${A}class ${p}${k}${v} ${T}`)}else if(D("enum")){e+=4,I();let p=Re();I();let k=Wt();u.push(`${s}${A}enum ${p} ${k}`)}else if(D("namespace")||D("module")){let p=D("namespace")?"namespace":"module";e+=p.length,I();let k=Re();if(!l.bindings.has(k))l.bindings.set(k,"namespace");if(w||l.ambient)l.exports.add(k);I();let E=Vt(s,k,C);u.push(`${s}${A}${p} ${k} ${E}`)}else if(D("abstract"))if(e+=8,I(),D("class")){e+=5,I();let p=Re();I();let k=rt();I();let E=e,O=0;while(e<S){if(qe())continue;let V=f.charCodeAt(e);if(V===ke)O++;else if(V===Te&&!et())O--;else if(V===q&&O===0)break;e++}let P=Se(E,e),v=P?` ${P}`:"";if(l.bindings.set(p,"class"),w||l.ambient)l.exports.add(p);let T=Ht(p);u.push(`${s}${A}abstract class ${p}${k}${v} ${T}`)}else Ne(!0);else if(w&&D("default")){e+=7,I();let p=e;Ne(!0);let k=Se(p,e);if(k.charCodeAt(k.length-1)===oe)k=k.slice(0,-1);if(k)u.push(`${s}export default ${k};`)}else if(!w&&(f.charCodeAt(e)===be||f.charCodeAt(e)===ye||f.charCodeAt(e)===Pe))Ne(!0);else Ne(!0)}if(Ee.pop(),u.length===0)return"{}";return`{
35
- ${u.join(`
36
- `)}
37
- }`}function Nn(s,o){let r=e+s.length;while(r<S&&He(f.charCodeAt(r)))r++;for(let c=0;c<o.length;c++)if(r+c>=S||f.charCodeAt(r+c)!==o.charCodeAt(c))return!1;return r+o.length>=S||!i(f.charCodeAt(r+o.length))}function mt(s,o,r){e+=r.length,I();let c="",l=f.charCodeAt(e);if(l===be||l===ye){let O=e;st(l),c=f.slice(O,e)}else{c=Re();while(e<S&&f.charCodeAt(e)===Ct)e++,c+=`.${Re()}`}I();let u=t(f.slice(s,e)),w=u.findIndex((O)=>O.kind==="word"&&["namespace","module"].includes(f.slice(s+O.start,s+O.end))),C=u.slice(0,w).some((O)=>O.kind==="word"&&f.slice(s+O.start,s+O.end)==="declare"),A=e<S&&f.charCodeAt(e)===q?Vt(" ",c,C):"{}",p=`${o?"export ":""}declare ${r} ${c} ${A}`,k=Xe(s),E=c.startsWith("'")||c.startsWith('"');return{kind:"module",name:c,text:p,isExported:o,moduleForm:E?"quoted":r==="namespace"?"namespace":"identifier",source:E?c.slice(1,-1):void 0,leadingComments:k,start:s,end:e}}function hn(s,o){Ne();let r=Se(o,e);if(r.charCodeAt(r.length-1)===oe)r=r.slice(0,-1).trimEnd();if(!r)return;let c=a(r.charCodeAt(0));for(let k=1;c&&k<r.length;k++)c=i(r.charCodeAt(k));let l=Xe(s);if(c){j.push({kind:"export",name:"default",text:`export default ${r};`,isExported:!0,isTypeOnly:!1,leadingComments:l,start:s,end:e});return}let u="__dtsx_default_export__",w=1;while(f.includes(u))u=`__dtsx_default_export_${w++}__`;let A=_t(r)||ot(r)||n(r,!1),p=A==="unknown"&&An(r)?`typeof ${r}`:A;j.push({kind:"variable",name:u,text:`declare const ${u}: ${p};`,isExported:!1,typeAnnotation:p,modifiers:["const"],start:s,end:e}),j.push({kind:"export",name:"default",text:`export default ${u};`,isExported:!0,isTypeOnly:!1,leadingComments:l,start:s,end:e})}function pn(){if(f.charCodeAt(e)===q)return Be(q,ne),!0;let s=D("if"),o=D("do"),r=D("try"),c=D("for");if(!s&&!o&&!r&&!c&&!D("while")&&!D("switch")&&!D("with"))return!1;if(Re(),I(),c&&D("await"))e+=5,I();if(!o&&!r&&f.charCodeAt(e)===ae)Be(ae,Ae);if(It(),I(),s&&D("else"))e+=4,It();else if(o&&D("while")){if(e+=5,I(),f.charCodeAt(e)===ae)Be(ae,Ae);if(I(),f.charCodeAt(e)===oe)e++}else if(r){if(D("catch")){if(e+=5,I(),f.charCodeAt(e)===ae)Be(ae,Ae);It(),I()}if(D("finally"))e+=7,It()}return!0}function It(){if(I(),!pn())Ne()}while(e<S){if(I(),e>=S)break;if(pn())continue;let s=e,o=f.charCodeAt(e);if(o===105&&D("import"))j.push(In(s));else if(o===101&&D("export")){e+=6,I();let r=f.charCodeAt(e);if(r===100&&D("default")){e+=7,I();let c=e,l=f.charCodeAt(e);if(l===102&&D("function")){let u=at(s,!0,!1,!0);if(u)j.push(u)}else if(l===97&&D("async")&&Tt("async")!==oe)if(e+=5,I(),D("function")){let u=at(s,!0,!0,!0);if(u)j.push(u)}else hn(s,c);else if(l===99&&D("class")){let u=lt(s,!0,!1,!0);j.push(u)}else if(l===97&&D("abstract")){if(e+=8,I(),D("class")){let u=lt(s,!0,!0,!0);j.push(u)}}else hn(s,c)}else if(r===116&&D("type")){let c=e;if(e+=4,I(),e<S&&f.charCodeAt(e)===q){sn();let l=Se(s,e),u=Xe(s);j.push({kind:"export",name:"",text:l,isExported:!0,isTypeOnly:!0,source:vt(l),leadingComments:u,start:s,end:e})}else if(e<S&&f.charCodeAt(e)===$e){rn();let l=Se(s,e);j.push({kind:"export",name:"",text:l,isExported:!0,isTypeOnly:!0,source:vt(l),start:s,end:e})}else{e=c;let l=Nt(s,!0);j.push(l)}}else if(r===105&&D("interface")){let c=Lt(s,!0);j.push(c)}else if(r===102&&D("function")){let c=at(s,!0,!1,!1);if(c)j.push(c)}else if(r===97&&D("async"))if(e+=5,I(),D("function")){let c=at(s,!0,!0,!1);if(c)j.push(c)}else Ne();else if(r===99)if(D("class")){let c=lt(s,!0,!1);j.push(c)}else if(D("const")){let c=e;if(e+=5,I(),D("enum")){e=c+5,I();let l=gt(s,!0,!0);j.push(l)}else{e=c;let l=dt(s,"const",!0);for(let u=0;u<l.length;u++)j.push(l[u])}}else Ne();else if(r===97&&D("abstract")){if(e+=8,I(),D("class")){let c=lt(s,!0,!0);j.push(c)}}else if(r===108&&D("let")){let c=dt(s,"let",!0);for(let l=0;l<c.length;l++)j.push(c[l])}else if(r===118&&D("var")){let c=dt(s,"var",!0);for(let l=0;l<c.length;l++)j.push(c[l])}else if(r===101&&D("enum")){let c=gt(s,!0,!1);j.push(c)}else if(r===100&&D("declare"))e+=7,I(),mn(s,!0);else if(r===110&&D("namespace")&&yt(9)){let c=mt(s,!0,"namespace");j.push(c)}else if(r===109&&D("module")&&yt(6)){let c=mt(s,!0,"module");j.push(c)}else if(r===q){sn();let c=Se(s,e),l=c.includes("export type"),u=Xe(s);j.push({kind:"export",name:"",text:c,isExported:!0,isTypeOnly:l,source:vt(c),leadingComments:u,start:s,end:e})}else if(r===$e){rn();let c=Se(s,e),l=Xe(s);j.push({kind:"export",name:"",text:c,isExported:!0,isTypeOnly:!1,source:vt(c),leadingComments:l,start:s,end:e})}else{Ne();let c=Se(s,e);if(c)j.push({kind:"export",name:"",text:c,isExported:!0,start:s,end:e})}}else if(o===100&&D("declare"))e+=7,I(),mn(s,!1);else if(o===105&&D("interface")){let r=Lt(s,!1);Z(r.name,r)}else if(o===116&&D("type")){let r=Nt(s,!1);Z(r.name,r),j.push(r)}else if(o===102&&D("function")){let r=at(s,!1,!1,!1);if(r)Zt(r);else Ne()}else if(o===97)if(D("async")){let r=e;if(e+=5,I(),D("function")){let c=at(s,!1,!0,!1);if(c)Zt(c);else e=r,Ne()}else e=r,Ne()}else if(D("abstract"))if(e+=8,I(),D("class")){let r=lt(s,!1,!1);Z(r.name,r),j.push(r)}else Ne();else e++,Ne();else if(o===99)if(D("class")){let r=lt(s,!1,!1);Z(r.name,r),j.push(r)}else if(D("const")){let r=e;if(e+=5,I(),D("enum")){e=r+5,I();let c=gt(s,!1,!0);Z(c.name,c),j.push(c)}else{e=r;let c=dt(s,"const",!1);for(let l=0;l<c.length;l++)Z(c[l].name,c[l])}}else e++,Ne();else if(o===101&&D("enum")){let r=gt(s,!1,!1);Z(r.name,r),j.push(r)}else if(o===108&&D("let")||o===118&&D("var")){let r=D("let")?"let":"var",c=dt(s,r,!1);for(let l=0;l<c.length;l++)Z(c[l].name,c[l])}else if(o===109&&D("module")&&yt(6)){let r=mt(s,!1,"module");j.push(r)}else if(o===110&&D("namespace")&&yt(9)){let r=mt(s,!1,"namespace");j.push(r)}else{let r=f.charCodeAt(e);if(r===oe)e++;else if(r===be||r===ye){if(st(r),e<S&&f.charCodeAt(e)===oe)e++}else if(r===Pe){if(At(),e<S&&f.charCodeAt(e)===oe)e++}else if(r===jn){if(e++,Re(),I(),e<S&&f.charCodeAt(e)===Ct)e++,Re(),I();if(e<S&&f.charCodeAt(e)===ae)Be(ae,Ae)}else e++,Ne()}}if(pe.length){let s=new Set([...j,...me.values()]),o=new Set([...s].filter((C)=>C.kind==="class").map((C)=>C.name)),r=new Set([...s].filter((C)=>C.kind==="variable"&&!!C.typeAnnotation).map((C)=>C.name)),c=new Set,l=new Map;for(let C of ce)for(let[A,p]of C.bindings){let k=C.path?`${C.path}.${A}`:A;if(C.exports.has(A)&&(p!=="namespace"||!l.has(k)))l.set(k,p);if(C.exports.has(A)&&C.annotatedValues.has(A))c.add(k)}let u=new Map;for(let C of pe){if(C.binding){let A=r.has(C.initializer);for(let p=C.namespaces.length-1;p>=0;p--){let k=C.namespaces[p],E=k.path?`${k.path}.${C.initializer}`:C.initializer;if(k.bindings.has(C.initializer)||l.has(E)){A=k.bindings.has(C.initializer)?k.annotatedValues.has(C.initializer):c.has(E);break}}u.set(C.marker,A?`typeof ${C.initializer}`:"unknown");continue}u.set(C.marker,Kt(C.initializer,(A)=>{if(C.classes.includes(A))return!0;for(let p=C.namespaces.length-1;p>=0;p--){let k=C.namespaces[p],E=k.path?`${k.path}.${A}`:A,O=A.split(".")[0],P=k.bindings.get(O);if(P){if(A===O&&P!=="namespace")return P==="class";return l.get(E)==="class"}let v=k.path?`${k.path}.${O}`:O;if(l.has(v))return l.get(E)==="class"}return l.has(A)?l.get(A)==="class":o.has(A)}))}let w=(C)=>{if(!C.includes("__dtsx_constructor_field_"))return C;let A="",p=0;for(let k of t(C)){if(k.kind!=="word")continue;let E=u.get(C.slice(k.start,k.end));if(!E)continue;A+=C.slice(p,k.start)+E,p=k.end}return A+C.slice(p)};for(let C of s){C.text=w(C.text);for(let A of["typeAnnotation","inferredType","returnType"])if(C[A])C[A]=w(C[A])}}if(Ce.size>0){gn(j);for(let s of he.values())gn(s)}if(Hn(f,j,me,he),Kn(j,me),sr(j,me),ge)Gt([...j,...me.values()]);else Yn(f,j,me,le);if(ue){let s=new Set(j);for(let o of[...me.values(),...[...he.values()].flat(),...[...Le.values()].flat()])if(!s.has(o))j.push(o),s.add(o);return j.sort((o,r)=>(o.start??0)-(r.start??0))}if(me.size>0)Vn(j,me,he,Le,Ye);return j;function gn(s){let o=new Map;for(let c of s)if(c.kind==="function")o.set(c.name,(o.get(c.name)||0)+1);let r=new Set;for(let[c,l]of o)if(l>1)r.add(c);if(r.size>0){let c=new Set;for(let l of r)for(let u=s.length-1;u>=0;u--)if(s[u].kind==="function"&&s[u].name===l&&Ce.has(s[u])){c.add(u);break}if(c.size>0){let l=[...c].sort((u,w)=>w-u);for(let u of l)s.splice(u,1)}}}function mn(s,o){if(D("function")){let r=at(s,o,!1,!1);if(r)j.push(r)}else if(D("async")){if(e+=5,I(),D("function")){let r=at(s,o,!0,!1);if(r)j.push(r)}}else if(D("class")){let r=lt(s,o,!1);j.push(r)}else if(D("abstract")){if(e+=8,I(),D("class")){let r=lt(s,o,!0);j.push(r)}}else if(D("interface")){let r=Lt(s,o);j.push(r)}else if(D("type")){let r=Nt(s,o);j.push(r)}else if(D("enum")){let r=gt(s,o,!1);j.push(r)}else if(D("const")){let r=e;if(e+=5,I(),D("enum")){e=r+5,I();let c=gt(s,o,!0);j.push(c)}else{e=r;let c=dt(s,"const",o);for(let l=0;l<c.length;l++)if(o||!Ye)j.push(c[l]);else Z(c[l].name,c[l])}}else if(D("let")||D("var")){let r=D("let")?"let":"var",c=dt(s,r,o);for(let l=0;l<c.length;l++)if(o||!Ye)j.push(c[l]);else Z(c[l].name,c[l])}else if(D("module")){let r=mt(s,o,"module");j.push(r)}else if(D("namespace")){let r=mt(s,o,"namespace");j.push(r)}else if(D("global")){e+=6,I();let c=`declare global ${e<S&&f.charCodeAt(e)===q?Vt(" ","",!0):"{}"}`,l=Xe(s);j.push({kind:"module",name:"global",text:c,isExported:!1,moduleForm:"global",leadingComments:l,start:s,end:e})}else Ne()}}class kn{names;lengths=new Uint8Array(65);firstUnits=new Uint8Array(65536);size;constructor(M){this.names=M;for(let ie of M.keys()){if(!ie)continue;this.lengths[Math.min(ie.length,64)]=1,this.firstUnits[ie.charCodeAt(0)]=1}this.size=M.size}scan(M,ie){if(this.size===0)return!1;let J=!1,Y=0,ue=M.length;while(Y<ue){let le=M.charCodeAt(Y);if(le>=65&&le<=90||le>=97&&le<=122||le===95||le===36||le>127){let f=Y;Y++;while(Y<ue){let ee=M.charCodeAt(Y);if(ee>=65&&ee<=90||ee>=97&&ee<=122||ee>=48&&ee<=57||ee===95||ee===36||ee>127)Y++;else break}if(this.firstUnits[le]===1&&this.lengths[Math.min(Y-f,64)]===1){let ee=M.substring(f,Y),ge=this.names.get(ee);if(ge!==void 0){if(ie.add(ee),ge.kind==="function"||ge.kind==="variable")J=!0}}}else Y++}return J}}function bn(M,ie){let J=0;while(J<M.length){let Y=M.charCodeAt(J);if(Y===be||Y===ye||Y===Pe){let Ze=Y;J++;while(J<M.length)if(M.charCodeAt(J)===tt)J+=2;else if(M.charCodeAt(J++)===Ze)break;continue}if(Y===te&&M.charCodeAt(J+1)===te){J+=2;while(J<M.length&&M.charCodeAt(J)!==ve&&M.charCodeAt(J)!==Oe)J++;continue}if(Y===te&&M.charCodeAt(J+1)===$e){let Ze=M.indexOf("*/",J+2);J=Ze===-1?M.length:Ze+2;continue}if(!a(Y)){J++;continue}let ue=J++;while(J<M.length&&i(M.charCodeAt(J)))J++;let le=ue-1,f=J;while(le>=0&&He(M.charCodeAt(le)))le--;while(f<M.length&&He(M.charCodeAt(f)))f++;let ee=le>=0?M.charCodeAt(le):0,ge=f<M.length?M.charCodeAt(f):0,S=ue>=3&&M.slice(ue-3,ue)==="...";if(ge===nt||ee===Ct&&!S)continue;if(ge===ae&&(ee===q||ee===it))continue;ie.add(M.slice(ue,J))}}function Vn(M,ie,J,Y,ue){let le=new Map;if(ue){let e=0;for(let Q of M)if(Q.kind==="class"&&!Q.isExported){if(le.set(Q.name,Q),!ie.has(Q.name))ie.set(Q.name,Q)}else if(!Q.isExported&&(Q.kind==="type"||Q.kind==="interface")&&["variable","function"].includes(ie.get(Q.name)?.kind??""));else M[e++]=Q;M.length=e}let f=new Set(M),ee=new Set,ge=new Set,S=new Set;for(let e of M)if(ge.add(e.name),e.kind!=="type"&&e.kind!=="interface")S.add(e.name);let Ze=new kn(ie),Ye=new Map;for(let[e,Q]of Y){let re=ie.get(e);if(re?.kind==="variable"||re?.kind==="function")Ye.set(e,Q[0])}let j=new Set,me=new Set,Le=new Set,Z=new Set,he=(e)=>{if(Ze.scan(e.text,Le))rr(e,Z,Ye.size?{candidates:Ye,references:j}:void 0)},Ce=new Set;for(let e=0;e<M.length;e++){let Q=M[e];if(Q.kind!=="import"){if(he(Q),typeof Q.value==="string")bn(Q.value,Ce)}}for(;;){let e=[];for(let[L,ce]of ie){if(ee.has(L))continue;if((ce.kind==="function"||ce.kind==="variable"?Z:Le).has(L)||ce.kind!=="function"&&Ce.has(L)){let pe=le.get(L);if(pe){for(let Ke of[pe,ce])if(!f.has(Ke))e.push(Ke),f.add(Ke);ge.add(L)}else if(!(ce.kind==="function"||ce.kind==="variable"?S:ge).has(L)){let Ke=ce.kind==="function"?J.get(L):void 0;if(Ke)for(let de of Ke)e.push(de);else e.push(ce);if(ge.add(L),ce.kind==="function"||ce.kind==="variable")S.add(L)}ee.add(L)}}for(let[L,ce]of Y){if(!Ye.has(L)||me.has(L)||!j.has(L))continue;for(let Ee of ce)if(!f.has(Ee))e.push(Ee),f.add(Ee);me.add(L)}if(e.length===0)break;e.sort((L,ce)=>(L.start??1/0)-(ce.start??1/0));let Q=[],re=0;for(let L=0;L<M.length;L++){let ce=M[L].start??1/0;while(re<e.length&&(e[re].start??1/0)<=ce)Q.push(e[re++]);Q.push(M[L])}while(re<e.length)Q.push(e[re++]);M.length=0;for(let L=0;L<Q.length;L++)M.push(Q[L]);for(let L of e)if(L.kind!=="import"){if(he(L),typeof L.value==="string")bn(L.value,Ce)}}}
38
- export{Ii,Wa,R,F,jt};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Ie}from"./chunk-g9emajpc.js";import{readFileSync as m,statSync as w}from"fs";import{readFile as y}from"fs/promises";import{createRequire as v}from"module";import{dirname as g,isAbsolute as b,join as u,resolve as p}from"path";function l(t){let o=[t];if(!t.endsWith(".json"))o.push(`${t}.json`);o.push(u(t,"tsconfig.json"));for(let a of o)try{if(w(a).isFile())return a}catch{}return null}function E(t,o){if(b(t)||t.startsWith("."))return l(p(g(o),t));let a=v(o),n=t.startsWith("@")?/^@[^/]+\/[^/]+/.exec(t)?.[0]:t.split("/")[0];if(n)for(let d of a.resolve.paths(n)??[]){let e=l(u(d,n,"package.json"));if(!e)continue;let i=JSON.parse(m(e,"utf8"));if(t===n){if(i.tsconfig!==void 0){if(typeof i.tsconfig!=="string")throw Error(`Invalid tsconfig field in ${e}`);let r=l(p(g(e),i.tsconfig));if(!r)throw Error(`Cannot resolve tsconfig ${JSON.stringify(i.tsconfig)} from ${e}`);return r}let s=l(u(g(e),"tsconfig.json"));if(s)return s}break}for(let d of[`${t}/tsconfig.json`,t])try{let e=a.resolve(d),i=e.endsWith(".json")?l(e):null;if(i)return i}catch{}return null}async function ce(t,o={},a=new Set){let n=l(t);if(!n)return;if(a.has(n)){if(o.allowCircular)return;throw Error(`Circular tsconfig extends: ${n}`)}let d=new Set(a).add(n),e=JSON.parse(Ie(await y(n,"utf8"))),i=typeof e.extends==="string"?[e.extends]:e.extends??[];if(!Array.isArray(i)||i.some((f)=>typeof f!=="string"))throw Error(`Invalid tsconfig extends in ${n}`);let s={};for(let f of i){let c=E(f,n);if(!c)throw Error(`Cannot resolve tsconfig extends ${JSON.stringify(f)} from ${n}`);s={...s,...await ce(c,o,d)}}let r=e.compilerOptions??{};if(r.isolatedDeclarations!==void 0)s.isolatedDeclarations=r.isolatedDeclarations;if(r.baseUrl!==void 0){if(typeof r.baseUrl!=="string")throw Error(`Invalid baseUrl in ${n}`);s.baseUrl=p(g(n),r.baseUrl)}if(r.paths!==void 0){if(!r.paths||typeof r.paths!=="object"||Array.isArray(r.paths))throw Error(`Invalid paths in ${n}`);for(let[f,c]of Object.entries(r.paths))if(f.split("*").length>2||!Array.isArray(c)||c.length===0||c.some((h)=>typeof h!=="string"||h.split("*").length>2))throw Error(`Invalid path mapping ${JSON.stringify(f)} in ${n}`);s.paths=r.paths,s.pathsBasePath=g(n)}return s}
3
- export{ce};
@@ -1,8 +0,0 @@
1
- // @bun
2
- import{Re}from"./chunk-38r6thfe.js";import{e}from"./chunk-8vvryt8p.js";import{Oe,Z}from"./chunk-1t77gtcx.js";import{existsSync as x}from"fs";import{basename as O,dirname as D,extname as S,isAbsolute as v,relative as p,resolve as m}from"path";var{Glob:R}=globalThis.Bun;async function De(r,o){let s=await C(r);G(r,s);let n=s.slice(),a=await(o?o():Oe(r)),t=null;if(r.autoIncludeReExports!==!1&&n.length>0){t=await Z(n,{includeImports:!0,resolveSpecifier:a});let l=m(r.cwd,r.root),u=r.exclude||[],f=[];for(let c of t.reachable){if(n.includes(c))continue;if(!b(c))continue;if(c.endsWith(".d.ts"))continue;if(c.includes("node_modules"))continue;let j=r.outputStructure==="flat"&&s.some((E)=>a.isPackageLocal?.(E,c));if(!A(c,l)&&!j){e.warn(`Skipping auto-included source outside root: ${p(r.cwd,c)}`);continue}if(oe(c,u,l))continue;f.push(c)}if(f.length>0)n=[...n,...f],e.debug(`Auto-included ${f.length} file(s) reached via relative re-exports`)}let i=F(n,r),d=t??await Z(n,{includeImports:!0,resolveSpecifier:a}),g=await Re([...d.sources.keys()],a,r.isolatedDeclarations??!1,d.sources),h=new Set(n);for(let[l,u]of g){if(!h.has(l))continue;for(let f of u){let c=a(f,l).resolved;if(c&&!h.has(c))throw Error(`Module augmentation import ${JSON.stringify(f)} from ${l} requires a source not emitted by this package build: ${c}`)}}let y=[...g].map(([l,u])=>[l,[...u].sort()]).sort(([l],[u])=>l.localeCompare(u));return Object.freeze({entryFiles:Object.freeze(s),files:Object.freeze(n),outputBySource:i,resolver:a,reachability:t,augmentationImports:g,getResolutionFingerprint:()=>JSON.stringify({resolution:a.cacheKey?.(n),augmentations:y})})}var M=50,w=new Map;function P(r){let o=w.get(r);if(!o){if(o=new R(r),w.set(r,o),w.size>M){let s=w.keys().next().value;if(s!==void 0)w.delete(s)}}return o}function oe(r,o,s){if(!o||o.length===0)return!1;let n=p(s,r);for(let a of o){let t=P(a);if(t.match(n)||t.match(r))return!0}return!1}var k=/[*?[\]{}!]/;function G(r,o){let s=m(r.cwd,r.root),n=` root: ${s}
3
- entrypoints: ${r.entrypoints.map((t)=>JSON.stringify(t)).join(", ")||"(none)"}
4
- `+(r.exclude?.length?` exclude: ${r.exclude.map((t)=>JSON.stringify(t)).join(", ")}
5
- `:"")+"Entrypoints are resolved relative to --root. Pass several by repeating --entrypoints or separating them with commas.";if(o.length===0){if(r.entrypoints.filter((i)=>v(i)&&x(i)&&!A(i,s)).length===r.entrypoints.length)return;throw Error(`No source files matched. Nothing was generated.
6
- ${n}`)}let a=r.entrypoints.filter((t)=>{if(k.test(t))return!1;return!x(v(t)?t:m(s,t))});if(a.length>0)throw Error(`Entrypoint${a.length>1?"s":""} not found: ${a.map((t)=>JSON.stringify(t)).join(", ")}
7
- ${n}`)}async function C(r){let o=[],s=m(r.cwd,r.root),n=r.exclude||[],a=[...r.entrypoints,...r.include??[]];for(let t of a)if(v(t)&&b(t)){if(!t.includes("node_modules")){if(!A(t,s)&&r.outputStructure!=="flat")e.warn(`Skipping entrypoint outside root: ${p(r.cwd,t)}`);else if(!oe(t,n,s))o.push(t)}}else{let i=new R(t);for await(let d of i.scan({cwd:s,absolute:!0,onlyFiles:!0}))if(b(d)&&!d.includes("node_modules")){if(!oe(d,n,s))o.push(d)}}return[...new Set(o.map((t)=>m(t)))].sort()}function A(r,o){let s=p(o,r);return s!==".."&&!s.startsWith(`..${process.platform==="win32"?"\\":"/"}`)&&!v(s)}function F(r,o){let s=new Map,n=new Map;for(let a of r){let t=X(a,o),i=s.get(t);if(i&&i!==a)throw Error(`Output path collision: ${p(o.cwd,i)} and ${p(o.cwd,a)} both emit ${p(o.cwd,t)}`);s.set(t,a),n.set(a,t)}return n}function b(r){return/\.(m?tsx?|cts|jsx?|mjs|cjs|vue|stx)$/.test(r)&&!/\.d\.(?:ts|mts|cts)$/.test(r)}function X(r,o){let s=m(o.cwd,o.root),n=p(s,r),a=/\.d\.(?:ts|mts|cts)$/.test(n)?n:n.replace(/\.(m?tsx?|cts|jsx?|mjs|cjs|vue|stx)$/,(t)=>{if(t===".mts"||t===".mjs")return".d.mts";if(t===".cts"||t===".cjs")return".d.cts";return".d.ts"});if(o.outputStructure==="mirror")return m(o.cwd,o.outdir,a);else{let t=O(a);return m(o.cwd,o.outdir,t)}}function sa(r,o,s=""){let n=p(D(r),o).replace(/\\/g,"/");if(n=n.replace(/\.d\.mts$/,"").replace(/\.d\.cts$/,"").replace(/\.d\.ts$/,""),s)n+=s;if(!n.startsWith("."))n=`./${n}`;return n}function Pe(r,o,s,n){let a=X(r,o);return(t)=>{let i=s(t,r);if(!i.isRelative||!i.resolved)return{kind:"unchanged",reason:i.isRelative?"unresolved":"external",specifier:t,emittedSpecifier:t};if(/\.d\.(?:ts|mts|cts)$/.test(i.resolved)){if(o.moduleSpecifierMode!=="node")return{kind:"unchanged",reason:"preserved-declaration",specifier:t,emittedSpecifier:t};if(n&&!n.has(i.resolved))throw Error(`Local declaration ${JSON.stringify(t)} from ${r} targets an authored declaration not emitted by this package build: ${i.resolved}. Declaration-only dependencies must be delivered with the package before this importer can be emitted.`)}if(i.isAlias&&n&&!n.has(i.resolved))throw Error(`Local alias ${JSON.stringify(t)} from ${r} targets a declaration excluded from this package build: ${i.resolved}`);if(n&&!n.has(i.resolved)&&oe(i.resolved,o.exclude??[],m(o.cwd,o.root)))throw Error(`Local reference ${JSON.stringify(t)} from ${r} targets a source excluded from this package build: ${i.resolved}`);let d=i.isAlias?i.suffix??"":t.match(/[?#].*$/)?.[0]??"",g=d?t.slice(0,-d.length):t,h=S(g),y=/^(?:\.js|\.jsx|\.mjs|\.cjs)$/.test(h)?h:"";if(!y&&o.moduleSpecifierMode==="node"){let u=S(i.resolved);y=u===".mts"||u===".mjs"?".mjs":u===".cts"||u===".cjs"?".cjs":".js"}let l=X(i.resolved,o);return{kind:"local",specifier:t,resolvedSource:i.resolved,declarationOutput:l,emittedSpecifier:sa(a,l,y)+d}}}
8
- export{De,oe,A,X,sa,Pe};