codebaseiq 0.1.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 (432) hide show
  1. package/CHANGELOG.md +481 -0
  2. package/LICENSE +202 -0
  3. package/README.md +349 -0
  4. package/dist/augment-vue-worker.js +2 -0
  5. package/dist/call-graph-evidence-gNsxjCW8.d.ts +16 -0
  6. package/dist/change-analysis-types-CCtoCHbC.d.ts +9 -0
  7. package/dist/chunk-2Q2LW5JW.js +14 -0
  8. package/dist/chunk-2X7V4HS4.js +88 -0
  9. package/dist/chunk-34WBMAYK.js +2 -0
  10. package/dist/chunk-35NLDRZC.js +2 -0
  11. package/dist/chunk-362QOSFD.js +3 -0
  12. package/dist/chunk-3IER7Q6H.js +12 -0
  13. package/dist/chunk-3JSXXYTZ.js +345 -0
  14. package/dist/chunk-3LCDIREB.js +4 -0
  15. package/dist/chunk-476NR5B7.js +2 -0
  16. package/dist/chunk-4FC325IF.js +30 -0
  17. package/dist/chunk-4WKDMDEW.js +9 -0
  18. package/dist/chunk-4XTAUQFD.js +2 -0
  19. package/dist/chunk-5PUWMSDU.js +26 -0
  20. package/dist/chunk-5VKBFZZU.js +3 -0
  21. package/dist/chunk-6BQ3DSPK.js +2 -0
  22. package/dist/chunk-6CS3UQTN.js +3 -0
  23. package/dist/chunk-6MUIJMVL.js +6 -0
  24. package/dist/chunk-6NW7MU72.js +40 -0
  25. package/dist/chunk-6OAHRI2D.js +6 -0
  26. package/dist/chunk-6YTSKJJ3.js +2 -0
  27. package/dist/chunk-7FND7D7N.js +2 -0
  28. package/dist/chunk-7MGU3HPH.js +2 -0
  29. package/dist/chunk-7NVGT435.js +2 -0
  30. package/dist/chunk-7XAN6GKB.js +2 -0
  31. package/dist/chunk-AAQQPKCU.js +2 -0
  32. package/dist/chunk-ADTBPVUZ.js +21 -0
  33. package/dist/chunk-AKB7V7TV.js +2 -0
  34. package/dist/chunk-ANFVSJWQ.js +11 -0
  35. package/dist/chunk-B2OB55RR.js +3 -0
  36. package/dist/chunk-B3UYV66Z.js +4 -0
  37. package/dist/chunk-B75HZHUP.js +2 -0
  38. package/dist/chunk-BFFZDZQV.js +2 -0
  39. package/dist/chunk-BGBBVSH4.js +2 -0
  40. package/dist/chunk-BH5F2Q4O.js +2 -0
  41. package/dist/chunk-BJ6SQAEN.js +2 -0
  42. package/dist/chunk-BMYOV5GP.js +77 -0
  43. package/dist/chunk-BVAJLC5A.js +7 -0
  44. package/dist/chunk-C6SBF2WH.js +4 -0
  45. package/dist/chunk-C74PPYLA.js +3 -0
  46. package/dist/chunk-C7QOQX32.js +8 -0
  47. package/dist/chunk-CAUCPUOF.js +7 -0
  48. package/dist/chunk-CO5R3UNA.js +2 -0
  49. package/dist/chunk-CQP3THUZ.js +7 -0
  50. package/dist/chunk-CVYSU6BX.js +16 -0
  51. package/dist/chunk-CWONGW6P.js +3 -0
  52. package/dist/chunk-DDZ7VHWV.js +20 -0
  53. package/dist/chunk-DGXRDLV5.js +2 -0
  54. package/dist/chunk-DO6WQD2T.js +3 -0
  55. package/dist/chunk-DQMDCD24.js +2 -0
  56. package/dist/chunk-DR2LURYU.js +3 -0
  57. package/dist/chunk-DRENNWRG.js +2 -0
  58. package/dist/chunk-ECQBG7PW.js +564 -0
  59. package/dist/chunk-EF2R3WNQ.js +2 -0
  60. package/dist/chunk-ELNRLMC5.js +29 -0
  61. package/dist/chunk-EMNIHCRB.js +18 -0
  62. package/dist/chunk-ENCCHKM6.js +5 -0
  63. package/dist/chunk-EZNMUY67.js +5 -0
  64. package/dist/chunk-FAJQ7LWY.js +3 -0
  65. package/dist/chunk-FDGD5AB5.js +2 -0
  66. package/dist/chunk-FETNQCFO.js +117 -0
  67. package/dist/chunk-FM5BPL4V.js +60 -0
  68. package/dist/chunk-FQKZWM4L.js +49 -0
  69. package/dist/chunk-FW53T7EB.js +2 -0
  70. package/dist/chunk-G6XFR4ZL.js +4 -0
  71. package/dist/chunk-GCHRX4YW.js +4 -0
  72. package/dist/chunk-GTIYTDRE.js +562 -0
  73. package/dist/chunk-GTXSJDCO.js +2 -0
  74. package/dist/chunk-GW6Z3WGY.js +2 -0
  75. package/dist/chunk-H3LGFZVK.js +2 -0
  76. package/dist/chunk-HKQUXIFO.js +2 -0
  77. package/dist/chunk-HOA5YGOH.js +3 -0
  78. package/dist/chunk-HPJRBHVT.js +3 -0
  79. package/dist/chunk-HRWGYWRJ.js +49 -0
  80. package/dist/chunk-I2T2LLK2.js +4 -0
  81. package/dist/chunk-ICFDQHAM.js +3 -0
  82. package/dist/chunk-ID63777H.js +4 -0
  83. package/dist/chunk-IJ4HMYBE.js +3 -0
  84. package/dist/chunk-ILMHV3KM.js +2 -0
  85. package/dist/chunk-IOP6FWIM.js +2 -0
  86. package/dist/chunk-IRQOAM5G.js +2 -0
  87. package/dist/chunk-J77SU6VA.js +38 -0
  88. package/dist/chunk-JE3WZ6II.js +2 -0
  89. package/dist/chunk-JEJLSICM.js +4 -0
  90. package/dist/chunk-JOIRNPPY.js +2 -0
  91. package/dist/chunk-JSOYNVWH.js +3 -0
  92. package/dist/chunk-KMITESMT.js +2 -0
  93. package/dist/chunk-KUW32IRO.js +2 -0
  94. package/dist/chunk-KWVHSKHK.js +31 -0
  95. package/dist/chunk-L4NRUAGJ.js +18 -0
  96. package/dist/chunk-L57ZKWVG.js +6 -0
  97. package/dist/chunk-LTA3BRZX.js +2 -0
  98. package/dist/chunk-LU3BMVH2.js +10 -0
  99. package/dist/chunk-LZYFLFEH.js +2 -0
  100. package/dist/chunk-MOVBWNIP.js +16 -0
  101. package/dist/chunk-MVB3DAEY.js +3 -0
  102. package/dist/chunk-N3IQCBCF.js +29 -0
  103. package/dist/chunk-NAUD7LCA.js +2 -0
  104. package/dist/chunk-NCZUNH3E.js +109 -0
  105. package/dist/chunk-NE6IU5ZD.js +5 -0
  106. package/dist/chunk-NEDP5RFQ.js +60 -0
  107. package/dist/chunk-NMTSZXCL.js +2 -0
  108. package/dist/chunk-NNJ2KZZG.js +4 -0
  109. package/dist/chunk-NNO6A2PO.js +2 -0
  110. package/dist/chunk-NNOKTMZT.js +20 -0
  111. package/dist/chunk-O6QTXQPJ.js +13 -0
  112. package/dist/chunk-OANDYLJQ.js +2 -0
  113. package/dist/chunk-OFBE4NGP.js +2 -0
  114. package/dist/chunk-OGTFJ3XD.js +2 -0
  115. package/dist/chunk-OL6KJP3N.js +16 -0
  116. package/dist/chunk-OLF4MA5W.js +8 -0
  117. package/dist/chunk-OTOKVOJ3.js +2 -0
  118. package/dist/chunk-OVTS4DKB.js +2 -0
  119. package/dist/chunk-OZYRSMSH.js +3 -0
  120. package/dist/chunk-P5XHIJHI.js +2 -0
  121. package/dist/chunk-PBI2LFKH.js +2 -0
  122. package/dist/chunk-PIOMTC27.js +2 -0
  123. package/dist/chunk-PTAWHLVJ.js +6 -0
  124. package/dist/chunk-PX4RYAAK.js +2 -0
  125. package/dist/chunk-PYAB5SM6.js +7 -0
  126. package/dist/chunk-Q5ELPRKQ.js +2 -0
  127. package/dist/chunk-Q65CQ4XL.js +2 -0
  128. package/dist/chunk-Q72QSKXC.js +308 -0
  129. package/dist/chunk-QCN62RTF.js +3 -0
  130. package/dist/chunk-QDCCHMVZ.js +2 -0
  131. package/dist/chunk-QHRNXP3C.js +3 -0
  132. package/dist/chunk-QKPLA6IC.js +2 -0
  133. package/dist/chunk-QOKYJ33H.js +2 -0
  134. package/dist/chunk-QW7EP6WI.js +21 -0
  135. package/dist/chunk-R2NOK63J.js +4 -0
  136. package/dist/chunk-RBAS5ZHI.js +2 -0
  137. package/dist/chunk-RDBI2RXU.js +9 -0
  138. package/dist/chunk-RKEJ6VTF.js +73 -0
  139. package/dist/chunk-RR7SX44N.js +35 -0
  140. package/dist/chunk-RU65DDUP.js +215 -0
  141. package/dist/chunk-SELM5MER.js +2 -0
  142. package/dist/chunk-SGX43S2L.js +2 -0
  143. package/dist/chunk-SMRBZ6EC.js +2 -0
  144. package/dist/chunk-SNNWPCN7.js +4 -0
  145. package/dist/chunk-ST7V3SKN.js +2 -0
  146. package/dist/chunk-SWHMHUKF.js +2 -0
  147. package/dist/chunk-SYDJMPES.js +2 -0
  148. package/dist/chunk-SZD2KF7Q.js +2 -0
  149. package/dist/chunk-T3DGWPXM.js +3 -0
  150. package/dist/chunk-TFZB6XTM.js +239 -0
  151. package/dist/chunk-TIIC3ZE7.js +2 -0
  152. package/dist/chunk-TRRC4ZJ7.js +2 -0
  153. package/dist/chunk-TXXOEMZJ.js +2 -0
  154. package/dist/chunk-UBGWN7I4.js +2 -0
  155. package/dist/chunk-UCD3H3UZ.js +5 -0
  156. package/dist/chunk-UDS562V4.js +5 -0
  157. package/dist/chunk-UNBY47BC.js +3 -0
  158. package/dist/chunk-UP3BUZR5.js +74 -0
  159. package/dist/chunk-UXM43C7T.js +3 -0
  160. package/dist/chunk-UZGZB3VB.js +3 -0
  161. package/dist/chunk-VE5AVNMP.js +2 -0
  162. package/dist/chunk-VEXUL62T.js +2 -0
  163. package/dist/chunk-VFY6Y2H6.js +61 -0
  164. package/dist/chunk-VUIYB2V3.js +2 -0
  165. package/dist/chunk-VXYS3FZD.js +23 -0
  166. package/dist/chunk-WE5RZHZ7.js +5 -0
  167. package/dist/chunk-WMPRTGH2.js +2 -0
  168. package/dist/chunk-WOQBZPIF.js +2 -0
  169. package/dist/chunk-XLQ3GLWZ.js +2 -0
  170. package/dist/chunk-XME3HPXZ.js +2 -0
  171. package/dist/chunk-XMQ23E27.js +2 -0
  172. package/dist/chunk-XWUOUWYI.js +2 -0
  173. package/dist/chunk-XZEE23VG.js +5 -0
  174. package/dist/chunk-Y6KHROC3.js +7 -0
  175. package/dist/chunk-YESXMKX3.js +3 -0
  176. package/dist/chunk-YMGZZEW4.js +2 -0
  177. package/dist/chunk-YSNONTJ2.js +2 -0
  178. package/dist/chunk-YUKYB54I.js +1 -0
  179. package/dist/chunk-YVCIMIOC.js +12 -0
  180. package/dist/chunk-Z54RD7VL.js +3 -0
  181. package/dist/chunk-ZKX2FRS6.js +15 -0
  182. package/dist/chunk-ZMI2JSX2.js +2 -0
  183. package/dist/chunk-ZV3JV5G5.js +8 -0
  184. package/dist/chunk-ZZ3MWF33.js +4 -0
  185. package/dist/chunk-ZZXSWSN6.js +2 -0
  186. package/dist/cli-context-3SNLDYBM.js +3 -0
  187. package/dist/cli-context-T3B7W6GG.js +2 -0
  188. package/dist/cli-program-YNOXO72B.js +7 -0
  189. package/dist/cli.js +3 -0
  190. package/dist/code-DlqpBDd0.d.ts +121 -0
  191. package/dist/command-descriptors-6AOUKWW7.js +346 -0
  192. package/dist/command-descriptors-ZFKJSRUP.js +344 -0
  193. package/dist/command-panels-SZONPMLJ.js +3 -0
  194. package/dist/config-types-BNoC96J3.d.ts +560 -0
  195. package/dist/db-D7sauVFH.d.ts +95 -0
  196. package/dist/direct-navigation-DP4LVMRX.js +3 -0
  197. package/dist/direct-navigation-FLUS3BT6.js +2 -0
  198. package/dist/exploration-topology-BG4v30HZ.d.ts +256 -0
  199. package/dist/file-dep-graph-Bqg3t3Px.d.ts +4 -0
  200. package/dist/file-kind-BKCVMNUf.d.ts +10 -0
  201. package/dist/frontend-behavior-evidence-EfM4_9bc.d.ts +4 -0
  202. package/dist/git-history-ChNHbfZQ.d.ts +13 -0
  203. package/dist/graph-evidence-BIFqyisO.d.ts +131 -0
  204. package/dist/health-DJaZXg8I.d.ts +340 -0
  205. package/dist/index.d.ts +183 -0
  206. package/dist/index.js +2 -0
  207. package/dist/invocation-command-descriptors-QT2JMY5J.js +3 -0
  208. package/dist/invocation-command-descriptors-YN4QJEAX.js +2 -0
  209. package/dist/next-anchor-candidates-BwMczMvX.d.ts +90 -0
  210. package/dist/output-continuation-command-2V2SL4TD.js +2 -0
  211. package/dist/output-continuation-command-65J5IP3O.js +3 -0
  212. package/dist/postinstall.js +3 -0
  213. package/dist/project-reindex-5JOKXAXT.js +2 -0
  214. package/dist/project-reindex-UQBIKO4M.js +3 -0
  215. package/dist/queries/affected.d.ts +40 -0
  216. package/dist/queries/affected.js +2 -0
  217. package/dist/queries/anchors.d.ts +123 -0
  218. package/dist/queries/anchors.js +2 -0
  219. package/dist/queries/architecture.d.ts +166 -0
  220. package/dist/queries/architecture.js +2 -0
  221. package/dist/queries/bottlenecks.d.ts +68 -0
  222. package/dist/queries/bottlenecks.js +2 -0
  223. package/dist/queries/by-kind.d.ts +27 -0
  224. package/dist/queries/by-kind.js +2 -0
  225. package/dist/queries/call-graph.d.ts +52 -0
  226. package/dist/queries/call-graph.js +2 -0
  227. package/dist/queries/change-surface.d.ts +55 -0
  228. package/dist/queries/change-surface.js +2 -0
  229. package/dist/queries/cleanup-plan.d.ts +66 -0
  230. package/dist/queries/cleanup-plan.js +2 -0
  231. package/dist/queries/co-change.d.ts +90 -0
  232. package/dist/queries/co-change.js +2 -0
  233. package/dist/queries/code.d.ts +6 -0
  234. package/dist/queries/code.js +2 -0
  235. package/dist/queries/complexity-hotspots.d.ts +61 -0
  236. package/dist/queries/complexity-hotspots.js +2 -0
  237. package/dist/queries/complexity.d.ts +74 -0
  238. package/dist/queries/complexity.js +2 -0
  239. package/dist/queries/context.d.ts +146 -0
  240. package/dist/queries/context.js +2 -0
  241. package/dist/queries/convergence.d.ts +33 -0
  242. package/dist/queries/convergence.js +2 -0
  243. package/dist/queries/coupling.d.ts +32 -0
  244. package/dist/queries/coupling.js +2 -0
  245. package/dist/queries/cycles.d.ts +66 -0
  246. package/dist/queries/cycles.js +2 -0
  247. package/dist/queries/dataflow.d.ts +77 -0
  248. package/dist/queries/dataflow.js +2 -0
  249. package/dist/queries/dead.d.ts +58 -0
  250. package/dist/queries/dead.js +2 -0
  251. package/dist/queries/decorative-checkers.d.ts +34 -0
  252. package/dist/queries/decorative-checkers.js +2 -0
  253. package/dist/queries/deep-chains.d.ts +5 -0
  254. package/dist/queries/deep-chains.js +2 -0
  255. package/dist/queries/dependence-slice.d.ts +46 -0
  256. package/dist/queries/dependence-slice.js +2 -0
  257. package/dist/queries/dependency-depth.d.ts +49 -0
  258. package/dist/queries/dependency-depth.js +2 -0
  259. package/dist/queries/deps.d.ts +15 -0
  260. package/dist/queries/deps.js +2 -0
  261. package/dist/queries/diff-impact.d.ts +165 -0
  262. package/dist/queries/diff-impact.js +2 -0
  263. package/dist/queries/doc-drift.d.ts +115 -0
  264. package/dist/queries/doc-drift.js +2 -0
  265. package/dist/queries/drift.d.ts +79 -0
  266. package/dist/queries/drift.js +2 -0
  267. package/dist/queries/duplicate-bodies.d.ts +55 -0
  268. package/dist/queries/duplicate-bodies.js +2 -0
  269. package/dist/queries/entry-map.d.ts +121 -0
  270. package/dist/queries/entry-map.js +2 -0
  271. package/dist/queries/evidence.d.ts +70 -0
  272. package/dist/queries/evidence.js +2 -0
  273. package/dist/queries/extract-candidates.d.ts +52 -0
  274. package/dist/queries/extract-candidates.js +2 -0
  275. package/dist/queries/fan.d.ts +53 -0
  276. package/dist/queries/fan.js +2 -0
  277. package/dist/queries/files.d.ts +20 -0
  278. package/dist/queries/files.js +2 -0
  279. package/dist/queries/health.d.ts +8 -0
  280. package/dist/queries/health.js +2 -0
  281. package/dist/queries/hierarchy.d.ts +21 -0
  282. package/dist/queries/hierarchy.js +2 -0
  283. package/dist/queries/hotspots.d.ts +42 -0
  284. package/dist/queries/hotspots.js +2 -0
  285. package/dist/queries/imports.d.ts +34 -0
  286. package/dist/queries/imports.js +2 -0
  287. package/dist/queries/incomplete-migration.d.ts +90 -0
  288. package/dist/queries/incomplete-migration.js +2 -0
  289. package/dist/queries/index.d.ts +180 -0
  290. package/dist/queries/index.js +2 -0
  291. package/dist/queries/isolated.d.ts +24 -0
  292. package/dist/queries/isolated.js +2 -0
  293. package/dist/queries/locality-candidates.d.ts +51 -0
  294. package/dist/queries/locality-candidates.js +2 -0
  295. package/dist/queries/members.d.ts +21 -0
  296. package/dist/queries/members.js +2 -0
  297. package/dist/queries/methods.d.ts +43 -0
  298. package/dist/queries/methods.js +2 -0
  299. package/dist/queries/not-implemented.d.ts +33 -0
  300. package/dist/queries/not-implemented.js +2 -0
  301. package/dist/queries/outline.d.ts +22 -0
  302. package/dist/queries/outline.js +2 -0
  303. package/dist/queries/passthrough-candidates.d.ts +41 -0
  304. package/dist/queries/passthrough-candidates.js +2 -0
  305. package/dist/queries/plan-context.d.ts +33 -0
  306. package/dist/queries/plan-context.js +2 -0
  307. package/dist/queries/react-component-duplicates.d.ts +39 -0
  308. package/dist/queries/react-component-duplicates.js +2 -0
  309. package/dist/queries/react-hook-candidates.d.ts +44 -0
  310. package/dist/queries/react-hook-candidates.js +2 -0
  311. package/dist/queries/react-large-component-pressure.d.ts +34 -0
  312. package/dist/queries/react-large-component-pressure.js +2 -0
  313. package/dist/queries/recent-duplicates.d.ts +79 -0
  314. package/dist/queries/recent-duplicates.js +2 -0
  315. package/dist/queries/redundant-reexports.d.ts +37 -0
  316. package/dist/queries/redundant-reexports.js +2 -0
  317. package/dist/queries/reference-neighborhood.d.ts +4 -0
  318. package/dist/queries/reference-neighborhood.js +2 -0
  319. package/dist/queries/reference-reachability.d.ts +48 -0
  320. package/dist/queries/reference-reachability.js +2 -0
  321. package/dist/queries/refs.d.ts +13 -0
  322. package/dist/queries/refs.js +2 -0
  323. package/dist/queries/self-audit.d.ts +65 -0
  324. package/dist/queries/self-audit.js +2 -0
  325. package/dist/queries/similar-chains.d.ts +48 -0
  326. package/dist/queries/similar-chains.js +2 -0
  327. package/dist/queries/similar-files.d.ts +35 -0
  328. package/dist/queries/similar-files.js +2 -0
  329. package/dist/queries/similar-signatures.d.ts +46 -0
  330. package/dist/queries/similar-signatures.js +2 -0
  331. package/dist/queries/similar.d.ts +187 -0
  332. package/dist/queries/similar.js +2 -0
  333. package/dist/queries/slice.d.ts +4 -0
  334. package/dist/queries/slice.js +2 -0
  335. package/dist/queries/source-inspection.d.ts +209 -0
  336. package/dist/queries/source-inspection.js +2 -0
  337. package/dist/queries/source-search.d.ts +85 -0
  338. package/dist/queries/source-search.js +2 -0
  339. package/dist/queries/stale-abstractions.d.ts +72 -0
  340. package/dist/queries/stale-abstractions.js +2 -0
  341. package/dist/queries/stats.d.ts +15 -0
  342. package/dist/queries/stats.js +2 -0
  343. package/dist/queries/surface.d.ts +22 -0
  344. package/dist/queries/surface.js +2 -0
  345. package/dist/queries/symbols.d.ts +14 -0
  346. package/dist/queries/symbols.js +2 -0
  347. package/dist/queries/system-map.d.ts +449 -0
  348. package/dist/queries/system-map.js +2 -0
  349. package/dist/queries/system.d.ts +21 -0
  350. package/dist/queries/system.js +2 -0
  351. package/dist/queries/test-quality.d.ts +56 -0
  352. package/dist/queries/test-quality.js +2 -0
  353. package/dist/queries/trace.d.ts +68 -0
  354. package/dist/queries/trace.js +2 -0
  355. package/dist/queries/twin-ab.d.ts +66 -0
  356. package/dist/queries/twin-ab.js +2 -0
  357. package/dist/queries/twin-drift.d.ts +119 -0
  358. package/dist/queries/twin-drift.js +2 -0
  359. package/dist/queries/unused-imports.d.ts +4 -0
  360. package/dist/queries/unused-imports.js +2 -0
  361. package/dist/queries/unused-params.d.ts +38 -0
  362. package/dist/queries/unused-params.js +2 -0
  363. package/dist/queries/value-flow.d.ts +42 -0
  364. package/dist/queries/value-flow.js +2 -0
  365. package/dist/queries/vue-component-duplicates.d.ts +43 -0
  366. package/dist/queries/vue-component-duplicates.js +2 -0
  367. package/dist/queries/vue-composable-candidates.d.ts +44 -0
  368. package/dist/queries/vue-composable-candidates.js +2 -0
  369. package/dist/queries/vue-large-view-pressure.d.ts +41 -0
  370. package/dist/queries/vue-large-view-pressure.js +2 -0
  371. package/dist/queries/wrapper-candidates.d.ts +34 -0
  372. package/dist/queries/wrapper-candidates.js +2 -0
  373. package/dist/reindex-worker.js +3 -0
  374. package/dist/reindex.d.ts +254 -0
  375. package/dist/reindex.js +298 -0
  376. package/dist/repository-text-C0Q8VYdN.d.ts +19 -0
  377. package/dist/runtime.d.ts +555 -0
  378. package/dist/runtime.js +4 -0
  379. package/dist/rust-semantic-session-server.js +2 -0
  380. package/dist/rust-semantic-session-worker.js +2 -0
  381. package/dist/rust-semantic-worker.js +2 -0
  382. package/dist/scip-cli-B7N3haxa.d.ts +67 -0
  383. package/dist/source-snippet-_wrcgmZc.d.ts +15 -0
  384. package/dist/symbol-types-BIQwfoAx.d.ts +74 -0
  385. package/dist/typescript-mailbox-worker.js +2 -0
  386. package/dist/watch-server.js +8 -0
  387. package/docs/AGENT_GUIDE.md +148 -0
  388. package/docs/AI_FAILURE_MODES.md +43 -0
  389. package/docs/API.md +40 -0
  390. package/docs/API_EVOLUTION.md +77 -0
  391. package/docs/CLI_JSON_OUTPUT.md +389 -0
  392. package/docs/COMMAND_REFERENCE.md +294 -0
  393. package/docs/CONFIGURATION_WRITE_SAFETY.md +131 -0
  394. package/docs/DETECTOR_GUIDE.md +46 -0
  395. package/docs/DURABILITY.md +159 -0
  396. package/docs/INDEX_GENERATIONS.md +167 -0
  397. package/docs/LOCK_PROTOCOL.md +133 -0
  398. package/docs/MAILBOX_LIFECYCLE.md +224 -0
  399. package/docs/REGEX_POLICY.md +36 -0
  400. package/docs/REINDEX_METADATA_COMPATIBILITY.md +104 -0
  401. package/docs/RUST_DURABLE_SESSION_PROTOCOL.md +126 -0
  402. package/docs/SECURITY_MODEL.md +125 -0
  403. package/docs/TELEMETRY_RETENTION.md +84 -0
  404. package/docs/TIME_SEMANTICS.md +77 -0
  405. package/docs/WATCH_REFRESH_REQUESTS.md +123 -0
  406. package/docs/WINDOWS_SIDECAR_RELEASE.md +424 -0
  407. package/docs/accuracy-audit-checklist.md +304 -0
  408. package/docs/accuracy-hardening-goal.md +500 -0
  409. package/docs/analyzer-inventory.md +78 -0
  410. package/docs/analyzer-validation-protocol.md +84 -0
  411. package/docs/architecture-coherence-vision.md +254 -0
  412. package/docs/assets/codebaseiq-logo-dark.svg +21 -0
  413. package/docs/assets/codebaseiq-logo.svg +24 -0
  414. package/docs/locality-analyzer-design.md +193 -0
  415. package/docs/schemas/cli-json-envelope.schema.json +237 -0
  416. package/docs/schemas/cli-output-page.schema.json +104 -0
  417. package/docs/schemas/npm-release-state.schema.json +146 -0
  418. package/docs/schemas/observation-receipt.schema.json +164 -0
  419. package/docs/schemas/project-config.schema.json +318 -0
  420. package/docs/schemas/suppression-record.schema.json +79 -0
  421. package/docs/schemas/windows-sidecar-provenance.schema.json +137 -0
  422. package/package.json +482 -0
  423. package/scripts/build-codebaseiq-windows.mjs +197 -0
  424. package/scripts/codebaseiq-windows-provenance.mjs +364 -0
  425. package/scripts/evidence-product-contract.mjs +197 -0
  426. package/scripts/verify-codebaseiq-windows.mjs +29 -0
  427. package/skills/codebaseiq/SKILL.md +75 -0
  428. package/skills/codebaseiq/agents/openai.yaml +4 -0
  429. package/skills/codebaseiq-explore/SKILL.md +34 -0
  430. package/skills/codebaseiq-explore/agents/openai.yaml +4 -0
  431. package/skills/concrete-plan/SKILL.md +79 -0
  432. package/skills/concrete-plan/agents/openai.yaml +4 -0
@@ -0,0 +1,215 @@
1
+ import{d as _n,p as ie,q as P}from"./chunk-QW7EP6WI.js";import{a as b,b as Ee,c as re,d as ve,e as je,i as Ge}from"./chunk-3IER7Q6H.js";import{a as In,b as Fn}from"./chunk-FM5BPL4V.js";import{a as Ln,b as de,c as kn,d as Rn,e as Ye,g as Pn}from"./chunk-DRENNWRG.js";import{a as Ft,f as Lt,i as kt}from"./chunk-R2NOK63J.js";import{A as v,ba as Cn,ca as Tn,h as Qe}from"./chunk-WE5RZHZ7.js";import{createHash as Ti}from"crypto";import{existsSync as Ii,mkdirSync as Fi}from"fs";import{dirname as Dn,join as Li}from"path";import Rt from"better-sqlite3";var ki="evidence.db";var Ri=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],Pt=new Set(Ri),Pi=25e4,Di=512*1024*1024,wi=6e4,Ce=new WeakMap;Fn({name:"evidence-connections",close:wn});var Ai=b("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),ji=b("evidence-project-fingerprint",{clearGroups:["whole-project"]}),F="evidence-v1",_e="version NOT LIKE 'evidence-%'";function Ze(e){return Ti("sha256").update(e).digest("hex")}function U(e,t,n){return Ai.get(e,t,()=>Ze(n))}function Oe(e){return ji.get(e,"current",()=>{try{if(!e.generation.metadataRaw)return null;let t=_n(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let n=t.metadata,r=[...n.indexedLanguages??[]].sort();return Ze(JSON.stringify({fingerprint:n.fingerprint,indexedLanguages:r,status:n.status}))}catch(t){return se("project fingerprint unavailable",t),null}})}function se(e,t){process.env.CODEBASEIQ_DEBUG&&console.error(`evidence-cache: ${e}: ${t instanceof Error?t.message:String(t)}`)}function q(e){if(Ce.has(e))return Ce.get(e)??null;let t=null;try{let n=new Rt(Li(Dn(e.config.dbPath),ki));n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 5000"),n.pragma("synchronous = NORMAL"),n.exec(`
2
+ CREATE TABLE IF NOT EXISTS file_evidence (
3
+ kind TEXT NOT NULL,
4
+ relative_path TEXT NOT NULL,
5
+ content_hash TEXT NOT NULL,
6
+ version TEXT NOT NULL,
7
+ payload TEXT NOT NULL,
8
+ PRIMARY KEY (kind, relative_path)
9
+ );
10
+ CREATE TABLE IF NOT EXISTS project_evidence (
11
+ kind TEXT NOT NULL,
12
+ cache_key TEXT NOT NULL,
13
+ project_fingerprint TEXT NOT NULL,
14
+ version TEXT NOT NULL,
15
+ payload TEXT NOT NULL,
16
+ PRIMARY KEY (kind, cache_key)
17
+ );
18
+ CREATE TABLE IF NOT EXISTS semantic_callees (
19
+ relative_path TEXT NOT NULL,
20
+ symbol TEXT NOT NULL,
21
+ content_hash TEXT NOT NULL,
22
+ deps_digest TEXT NOT NULL,
23
+ version TEXT NOT NULL,
24
+ payload TEXT NOT NULL,
25
+ PRIMARY KEY (relative_path, symbol)
26
+ );
27
+ CREATE TABLE IF NOT EXISTS semantic_references (
28
+ relative_path TEXT NOT NULL,
29
+ symbol TEXT NOT NULL,
30
+ project_fingerprint TEXT NOT NULL,
31
+ version TEXT NOT NULL,
32
+ payload TEXT NOT NULL,
33
+ PRIMARY KEY (relative_path, symbol)
34
+ );
35
+ `),t={evidence:n,shared:Oi(e.config.sharedEvidenceDbPath),readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:n.prepare(`SELECT payload FROM file_evidence
36
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${_e}
37
+ ORDER BY version DESC
38
+ LIMIT 1`),writeFileEvidence:n.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readProjectEvidence:n.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:n.prepare(`SELECT payload FROM project_evidence
39
+ WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${_e}
40
+ ORDER BY version DESC
41
+ LIMIT 1`),writeProjectEvidence:n.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:n.prepare(`SELECT payload FROM semantic_callees
42
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:n.prepare(`SELECT payload FROM semantic_callees
43
+ WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${_e}
44
+ ORDER BY version DESC
45
+ LIMIT 1`),readCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
46
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:n.prepare(`SELECT symbol, payload FROM semantic_callees
47
+ WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${_e}
48
+ ORDER BY symbol, version DESC`),writeCallees:n.prepare(`INSERT OR REPLACE INTO semantic_callees
49
+ (relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:n.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:n.prepare(`SELECT payload FROM semantic_references
50
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:n.prepare(`SELECT payload FROM semantic_references
51
+ WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${_e}
52
+ ORDER BY version DESC
53
+ LIMIT 1`),readReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
54
+ WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:n.prepare(`SELECT symbol, payload FROM semantic_references
55
+ WHERE relative_path = ? AND project_fingerprint = ? AND ${_e}
56
+ ORDER BY symbol, version DESC`),writeReferences:n.prepare(`INSERT OR REPLACE INTO semantic_references
57
+ (relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:n.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(n){se("disabled (open failed)",n)}return Ce.set(e,t),t}function K(e,t,n){se(`disabled (${t})`,n);try{wn(e)}catch(r){se("close failed while disabling",r)}Ce.set(e,null)}function wn(e){let t=Ce.get(e);if(Ce.delete(e),!t)return;let n,r;try{t.shared?.evidence.close()}catch(i){n=i}try{t.evidence.close()}catch(i){r=i}if(n!==void 0&&r!==void 0)throw new AggregateError([n,r],"Shared and project evidence connections failed to close.");if(n!==void 0)throw n;if(r!==void 0)throw r}function Oi(e){if(!e)return null;try{Fi(Dn(e),{recursive:!0});let t=new Rt(e);return t.pragma("journal_mode = WAL"),t.pragma("busy_timeout = 250"),t.pragma("synchronous = NORMAL"),t.exec(`
58
+ CREATE TABLE IF NOT EXISTS file_evidence (
59
+ kind TEXT NOT NULL,
60
+ relative_path TEXT NOT NULL,
61
+ content_hash TEXT NOT NULL,
62
+ version TEXT NOT NULL,
63
+ payload TEXT NOT NULL,
64
+ last_accessed_at INTEGER NOT NULL,
65
+ PRIMARY KEY (kind, relative_path, content_hash, version)
66
+ );
67
+ CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
68
+ ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
69
+ `),{evidence:t,readFileEvidence:t.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:t.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
70
+ VALUES (?, ?, ?, ?, ?, ?)
71
+ ON CONFLICT(kind, relative_path, content_hash, version)
72
+ DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:t.prepare(`UPDATE file_evidence
73
+ SET last_accessed_at = ?
74
+ WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
75
+ AND last_accessed_at < ?`)}}catch(t){return se("shared cache disabled (open failed)",t),null}}function Dt(e,t,n){se(`shared cache disabled (${t})`,n);try{e.shared?.evidence.close()}catch{}e.shared=null}function yu(e,t={}){if(!Ii(e))return null;let n;try{n=new Rt(e),n.pragma("busy_timeout = 50"),n.exec(`CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
76
+ ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version)`),n.pragma("wal_checkpoint(TRUNCATE)");let r=n.prepare("SELECT COUNT(*) AS count FROM file_evidence").get().count,i=t.maxRows??Pi,s=t.budgetBytes??Di,o=Number(n.pragma("page_size",{simple:!0})),a=Number(n.pragma("page_count",{simple:!0})),c=Number(n.pragma("freelist_count",{simple:!0})),l=Math.max(0,a-c)*o,u=r>0&&l>s?Math.min(r,Math.ceil((l-s)/Math.max(1,l/r))):0,p=Math.max(r-i,u);return p>0&&(n.prepare(`DELETE FROM file_evidence WHERE rowid IN (
77
+ SELECT rowid FROM file_evidence ORDER BY last_accessed_at ASC, rowid ASC LIMIT ?
78
+ )`).run(p),n.pragma("wal_checkpoint(TRUNCATE)")),{deletedRows:p,remainingRows:r-p}}catch(r){return se("shared cache maintenance skipped",r),null}finally{try{n?.close()}catch{}}}function An(e,t,n,r){let i=q(e);if(!i)return null;try{let s=i.readFileEvidence.get(t,n,r,F)??i.readLegacyFileEvidence.get(t,n,r);if(s?.payload!==void 0)return s.payload;if(!Pt.has(t)||!i.shared)return null;try{let o=i.shared.readFileEvidence.get(t,n,r,F);return o?.payload!==void 0&&Mi(i.shared,t,n,r),o?.payload??null}catch(o){return Dt(i,"file_evidence read",o),null}}catch(s){return K(e,"file_evidence read",s),null}}function Mi(e,t,n,r){let i=Date.now();try{e.touchFileEvidence.run(i,t,n,r,F,i-wi)}catch(s){se("shared file_evidence recency touch skipped",s)}}function jn(e,t,n,r,i){let s=q(e);if(s)try{if(s.writeFileEvidence.run(t,n,r,F,i),Pt.has(t)&&s.shared)try{s.shared.writeFileEvidence.run(t,n,r,F,i,Date.now())}catch(o){Dt(s,"file_evidence write",o)}}catch(o){K(e,"file_evidence write",o)}}function On(e,t){if(t.length===0)return;let n=q(e);if(n)try{n.evidence.transaction(()=>{for(let i of t)n.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,F,i.payload)})();let r=t.filter(i=>Pt.has(i.kind));if(r.length>0&&n.shared)try{n.shared.evidence.transaction(()=>{for(let i of r)n.shared.writeFileEvidence.run(i.kind,i.relativePath,i.contentHash,F,i.payload,Date.now())})()}catch(i){Dt(n,"file_evidence batch write",i)}}catch(r){K(e,"file_evidence batch write",r)}}function Mn(e,t,n,r){let i=q(e);if(!i)return null;try{return(i.readProjectEvidence.get(t,n,r,F)??i.readLegacyProjectEvidence.get(t,n,r))?.payload??null}catch(s){return K(e,"project_evidence read",s),null}}function $n(e,t,n,r,i){let s=q(e);if(s)try{s.writeProjectEvidence.run(t,n,r,F,i)}catch(o){K(e,"project_evidence write",o)}}function Su(e,t,n,r){let i=q(e);if(!i)return new Map;try{let s=i.readCalleesForFile.all(t,n,r,F),o=i.readLegacyCalleesForFile.all(t,n,r);return Bn([...o,...s])}catch(s){return K(e,"semantic_callees bulk read",s),new Map}}function xu(e,t,n){let r=q(e);if(!r)return new Map;try{let i=r.readReferencesForFile.all(t,n,F),s=r.readLegacyReferencesForFile.all(t,n);return Bn([...s,...i])}catch(i){return K(e,"semantic_references bulk read",i),new Map}}function Bn(e){let t=new Map;for(let n of e)t.set(n.symbol,n.payload);return t}function bu(e,t){if(t.length===0)return;let n=q(e);if(n)try{n.evidence.transaction(()=>{let r=new Set;for(let i of t){let s=`${i.relativePath}\0${i.contentHash}`;r.has(s)||(r.add(s),n.dropStaleCallees.run(i.relativePath,i.contentHash)),n.writeCallees.run(i.relativePath,i.symbol,i.contentHash,i.depsDigest,F,i.payload)}})()}catch(r){K(e,"semantic_callees write",r)}}function Nu(e,t){if(t.length===0)return;let n=q(e);if(n)try{n.evidence.transaction(()=>{let r=new Set;for(let i of t){let s=`${i.relativePath}\0${i.projectFingerprint}`;r.has(s)||(r.add(s),n.dropStaleReferences.run(i.relativePath,i.projectFingerprint)),n.writeReferences.run(i.relativePath,i.symbol,i.projectFingerprint,F,i.payload)}})()}catch(r){K(e,"semantic_references write",r)}}var $i=[C("source-facts",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/source-facts.ts"}),C("file-definitions",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/symbols/definition-catalog.ts"}),C("definition-exclusions",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/framework-patterns.ts"}),C("doc-path-tokens",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-products.test.ts",owner:"tests/storage/evidence-cache.test.ts"}),C("doc-path-evidence",{dependsOn:["content-hash","git-history","git-head","tool-version"],keyParts:["kind","relativePath","contentHash","trackedFiles","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/cleanup/doc-drift.ts"}),C("source-imports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),C("source-reexports",{dependsOn:["content-hash","import-resolution-fingerprint","config","tool-version"],keyParts:["kind","relativePath","contentHash","importResolutionFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/language-parsers/index.ts"}),C("source-fingerprints",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/definition-catalog.test.ts",owner:"src/queries/cleanup/similar.ts"}),C("consumer-file-usage",{dependsOn:["content-hash","project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","contentHash","projectFingerprint","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/queries/internal/consumer-evidence.ts"}),C("react-component-behavior-profiles",{dependsOn:["content-hash","tool-version"],keyParts:["kind","relativePath","contentHash","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/source/react-profile.ts"}),C("git-file-adds",{dependsOn:["git-head","git-history","tool-version"],keyParts:["kind","cacheKey","head","historyWindow","payloadVersion"],stalenessTest:"tests/storage/evidence-cache.test.ts",owner:"src/analysis/git-history.ts"}),C("typescript-reference-fragments",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-reference-fragments.test.ts",owner:"src/semantic/typescript/reference-fragment-shadow.ts"}),C("typescript-import-usage",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),C("typescript-signatures",{dependsOn:["content-hash","transitive-deps-digest","config","tool-version"],keyParts:["kind","relativePath","semanticIdentity","payloadVersion"],stalenessTest:"tests/semantic/typescript/typescript-semantic-provider.test.ts",owner:"src/semantic/shared-primitives.ts"}),et("file-dependency-graph",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","scope","projectFingerprint","payloadVersion"],stalenessTest:"tests/symbols/file-dep-graph.test.ts",owner:"src/symbols/graph/file-dep-graph.ts"}),et("semantic-import-usage",{dependsOn:["project-fingerprint","indexed-language-set","import-resolution-fingerprint","tool-version"],keyParts:["kind","relativePath","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),et("semantic-signatures",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","relativePath","symbol","projectFingerprint","language","semanticEngine","payloadVersion"],stalenessTest:"tests/semantic/rust/rust-semantic-cache-gate.test.ts",owner:"src/semantic/shared-primitives.ts"}),et("health-semantic-prewarm",{dependsOn:["project-fingerprint","indexed-language-set","tool-version"],keyParts:["kind","scope","cliVersion","projectFingerprint","payloadVersion"],stalenessTest:"tests/runtime/cli-support.test.ts",owner:"src/runtime/cli-support.ts"})];function X(e){let t=new Map;return{kind:e.kind,read(n,r,i){let s=!1,o=0,a;if(Ft()){let c=Oe(n);if(c){let l=`${c}\0${r}\0${i}`;a=t.get(l),a||(a=Lt(["evidence-product-file-read-v1",e.kind,c,r,i]),t.set(l,a))}}return kt("evidence-product.file.read",()=>{let c=An(n,e.kind,r,i);if(c===null)return null;o=c.length;try{let l=e.deserialize(c);return s=l!==null,l}catch{return null}},()=>({...a?{workIdentity:a,workOutcome:"computed"}:{},scope:"file",kind:e.kind,available:!0,hit:s,payloadBytes:o}))},write(n,r,i,s){jn(n,e.kind,r,i,e.serialize(s))},writeBatch(n,r){On(n,r.map(i=>({kind:e.kind,relativePath:i.relativePath,contentHash:i.contentHash,payload:e.serialize(i.value)})))}}}function Iu(e){let t=new Map;return{kind:e.kind,read(n,r,i){let s=!1,o=0,a;if(Ft()){let c=`${i}\0${r}`;a=t.get(c),a||(a=Lt(["evidence-product-project-read-v1",e.kind,i,r]),t.set(c,a))}return kt("evidence-product.project.read",()=>{let c=Mn(n,e.kind,r,i);if(c===null)return null;o=c.length;try{let l=e.deserialize(c);return s=l!==null,l}catch{return null}},()=>({...a?{workIdentity:a,workOutcome:"computed"}:{},scope:"project",kind:e.kind,available:!0,hit:s,payloadBytes:o}))},write(n,r,i,s){$n(n,e.kind,r,i,e.serialize(s))}}}function J(e){let t=$i.find(n=>n.kind===e);if(!t)throw new Error(`missing evidence product manifest entry for ${e}`);return t.invalidation}function C(e,t){return{scope:"file",kind:e,invalidation:{scope:"file",...t}}}function et(e,t){return{scope:"project",kind:e,invalidation:{scope:"project",...t}}}var Bi=b("source-text",{clearGroups:["whole-project","source-file"]}),Vi=b("source-lines",{clearGroups:["whole-project","source-file"]});function f(e,t){let n=t.replace(/\\/g,"/");return Bi.get(e,n,()=>{try{return Cn(e.config.projectRoot,n,{inputKind:"indexed source file"})}catch(r){if(Tn(r))return"";throw r}})}function Me(e,t){let n=t.replace(/\\/g,"/");return Vi.get(e,n,()=>{let r=f(e,n);return r?r.split(`
79
+ `):[]})}var Ui=/^\s*(?:\/\/|#|\/\*+|\*)\s*codebaseiq[\s:-]*ignore(?:[\s:-]+(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar|twin))?\b/i;function Wi(e){let t=Ui.exec(e);return t?t[1]??"":null}function Ru(e,t,n){return Vn(e,t,n).length>0}function Pu(e,t,n,r){let i=r.toLowerCase();return Vn(e,t,n).some(s=>s.toLowerCase()===i)}function Vn(e,t,n){if(n<=0)return[];let r=Me(e,t);if(r.length===0)return[];let i=[];for(let s=n-1;s>=0&&s>=n-5;s-=1){let o=(r[s]??"").trim();if(o==="")continue;let a=Wi(o);if(a!==null){i.push(a);continue}if(!o.startsWith("//")&&!o.startsWith("*")&&!o.startsWith("/*")&&!o.startsWith("@")&&!o.startsWith("#"))return i}return i}import{extname as Un}from"path";var zi={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function W(e){return zi[Un(e).toLowerCase()]??null}function oe(e){return Un(e).toLowerCase()===".vue"}import{createRequire as Hi}from"module";var _=Hi(import.meta.url),$e=null,wt=!1;function Wn(){if(wt)return null;if($e)return $e;try{return $e=_("tree-sitter"),$e}catch{return wt=!0,null}}function Ou(e){if(e==="clojure")return"reader";let t=Wn();if(!t)return"unavailable";let n=zn(e);if(!n)return"unavailable";try{return new t().setLanguage(n),"ast"}catch{return Te.add(e),"unavailable"}}var At=new Map,Te=new Set;function zn(e){if(Te.has(e))return null;let t=At.get(e);if(t)return t;let n;try{switch(e){case"rust":n=_("tree-sitter-rust");break;case"typescript":n=_("tree-sitter-typescript").typescript;break;case"tsx":n=_("tree-sitter-typescript").tsx;break;case"javascript":n=_("tree-sitter-javascript");break;case"python":n=_("tree-sitter-python");break;case"java":n=_("tree-sitter-java");break;case"kotlin":n=_("tree-sitter-kotlin");break;case"scala":n=_("tree-sitter-scala");break;case"ruby":n=_("tree-sitter-ruby");break;case"c":n=_("tree-sitter-c");break;case"cpp":n=_("tree-sitter-cpp");break;case"csharp":n=_("tree-sitter-c-sharp");break;case"php":n=_("tree-sitter-php").php;break;case"vb":{let r=_("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return Te.add(e),null}}catch{return Te.add(e),null}return At.set(e,n),n}var jt=new Map;function Mu(){$e=null,wt=!1,At.clear(),Te.clear(),jt.clear(),Xi.clear()}function qi(e){let t=jt.get(e);if(t)return t;let n=zn(e);if(!n)return null;let r=Wn();if(!r)return null;let i=new r;try{i.setLanguage(n)}catch{return Te.add(e),null}return jt.set(e,i),i}function Ki(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function me(e,t){let n=qi(e);if(!n)return null;try{return Ki(n,t)}catch{return null}}var Xi=new Map;import{posix as Ot}from"path";import{parse as Ji}from"@vue/compiler-sfc";var Qi=re("vue-sfc-units");function Ie(e,t){let n=Kn(t),r=f(e,n);return Qi.get(e,n,r,()=>Mt(e,n,r))}function Kn(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Gi(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function fe(e){return!e||e.body.length===0?0:e.body.split(`
80
+ `).length}function Mt(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let i;try{i=Ji(n,{filename:t})}catch(o){return r.errors.push(qn(o)),r}r.errors.push(...i.errors.map(qn));let{descriptor:s}=i;return s.template&&(r.template=tt(e,t,"template",s.template)),s.script&&r.scripts.push(Hn(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push(Hn(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(o=>tt(e,t,"style",o)),r.customBlocks=s.customBlocks.map(o=>tt(e,t,"custom",o)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(o=>o?.errors??[])),r}function Hn(e,t,n,r){let i=tt(e,t,"script",n);return{...i,kind:"script",setup:r,astLanguage:Gi(i.lang)}}function tt(e,t,n,r){let i=Zi(r.attrs),s=typeof i.lang=="string"?i.lang:null,o=typeof i.src=="string"?i.src:typeof r.src=="string"?r.src:void 0;if(o){let c=Yi(t,o);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:o,attrs:i,lang:s,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${o}`]};let l=f(e,c),u=l?Math.max(0,l.split(`
81
+ `).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:o,attrs:i,lang:s,body:l,startLine:0,endLine:u,errors:l?[]:[`Vue ${n} block source not found: ${c}`]}}let a=Math.max(0,r.loc.start.line-1);return{kind:n,ownerPath:t,sourcePath:t,external:!1,attrs:i,lang:s,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function Yi(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=Kn(Ot.normalize(Ot.join(Ot.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function Zi(e){return{...e}}function qn(e){return e instanceof Error?e.message:String(e)}function Be(e,t,n){let i=Mt(e,t,n).scripts.filter(o=>o.astLanguage&&o.body.length>0),s=i[0]?.astLanguage;return s?{body:i.map(o=>`${`
82
+ `.repeat(o.startLine)}${o.body}`).join(`
83
+ `),startLine:0,language:s}:null}var Xn=ve("ast-trees",{clearGroups:["whole-project","source-file"]});function $(e,t){if(oe(t))return es(e,t);let n=W(t);if(!n)return null;let r=f(e,t);return r?Xn.get(e,t,r,()=>me(n,r)):null}function Ve(e,t,n){if(oe(t)){let s=Be(e,t,n);if(!s)return null;let o=me(s.language,`
84
+ `.repeat(s.startLine)+s.body);return o?{tree:o,language:s.language}:null}let r=W(t);if(!r)return null;let i=me(r,n);return i?{tree:i,language:r}:null}function es(e,t){let n=f(e,t);return n?Xn.get(e,t,n,()=>{let r=Be(e,t,n);if(!r)return null;let i=`
85
+ `.repeat(r.startLine)+r.body;return me(r.language,i)}):null}function Fe(e,t){let n=ns(e,t);if(!n)return null;let r=ge(n);if(!r)return null;let i=rs(n);return{calleeLeaf:r,calleeQualifier:i?ts(n):void 0,calleeText:n.text,memberAccess:i,line:e.startPosition.row}}function ts(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function ns(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function rs(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function ge(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"private_property_identifier":case"shorthand_property_identifier":return e.text.replace(/^#/u,"");case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?ge(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?ge(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?ge(t):null}case"super":case"self":case"this":return null;default:return null}}function Ue(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var is=new Set(["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"]),Jn=new Set(["arrow_function","function_expression","generator_function"]);function nt(e,t){let n=os(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:Zn(n.functionNode),params:Qn(n.functionNode),paramsEndLine:Gn(n.functionNode),isLiteralPassthrough:er(n.functionNode,t)};if(!ss(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(i=>i.type==="identifier"||i.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:Zn(e),params:Qn(e),paramsEndLine:Gn(e),isLiteralPassthrough:er(e,t)}:null}function tr(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function Qn(e){let t=tr(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(Ue(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let i=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),s=r.childForFieldName("pattern");if(!i&&s&&s.type==="identifier"){n.push({name:s.text,simple:!0});continue}let o=r.namedChildren.find(a=>a.type==="identifier");n.push({name:s?.type==="identifier"?s.text:o?.text??"",simple:!1})}return n}function Gn(e){let t=tr(e);return t?t.endPosition.row:e.startPosition.row}function ss(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?is.has(e):!1}function os(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let i=Yn(r);return i?{name:n.text,definitionNode:e,functionNode:i}:null}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let i=Yn(r);return i?{name:n.text,definitionNode:e,functionNode:i}:null}return null}function Yn(e){if(Jn.has(e.type))return e;if(e.type!=="call_expression"||(e.childForFieldName("function")??e.namedChild(0))?.type!=="call_expression")return null;let r=((e.childForFieldName("arguments")??e.namedChildren.find(i=>i.type==="arguments"))?.namedChildren??[]).filter(i=>Jn.has(i.type));return r.length===1?r[0]:null}function Zn(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)Ue(r)||(n+=1);return n}function er(e,t){let n=e.namedChildren.find(p=>p.type==="block"||p.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(p=>!Ue(p));if(r.length!==1)return!1;let i=r[0],s=null;if(i.type==="return_statement"||i.type==="expression_statement"?s=i.namedChild(0)??null:t==="rust"&&(i.type==="call_expression"||i.type==="macro_invocation")&&(s=i),!s)return!1;let o=t==="python"?"call":"call_expression";if(s.type!==o)return!1;let a=s.namedChildren.find(p=>p.type==="arguments"||p.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(p=>!Ue(p)),l=e.namedChildren.find(p=>p.type==="parameters"||p.type==="formal_parameters");if(!l)return!1;let u=[];for(let p of l.namedChildren){if(p.type==="identifier"){u.push(p.text);continue}let d=p.namedChildren.find(m=>m.type==="identifier");d&&u.push(d.text)}if(c.length!==u.length)return!1;for(let p=0;p<u.length;p+=1){let d=c[p];if(d.type!=="identifier"||d.text!==u[p])return!1}return!0}var as=new Set(["identifier","type_identifier","field_identifier"]),cs=new Set(["identifier"]),ls=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),us=new Set(["rust","python"]),ps=/\{([^{}]*)\}/g,ds=/\b([A-Za-z_][\w]*)\b/g;function nr(e,t){return ms(t).has(e.type)}function rr(e,t){return us.has(t)&&e.type==="string_content"}function $t(e){let t=0;for(let r of e.values()){let i=r[r.length-1];i!==void 0&&i>t&&(t=i)}let n=new Array(t+1);for(let r=0;r<=t;r+=1)n[r]=new Set;for(let[r,i]of e)for(let s of i)n[s].add(r);return n}function ms(e){return e==="rust"?as:e==="python"?cs:ls}function ir(e,t){let n=e.startPosition.row;for(let r of e.text.matchAll(ps)){let i=r[1]??"";for(let s of i.matchAll(ds))s[1]&&t(s[1],n)}}var fs=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],gs=/^#!?\[\s*serde\s*\(/,hs=/^#!?\[\s*schemars\s*\(/,ys=/^#!?\[\s*validate\s*\(/,Ss=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function sr(e,t,n){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let r=e.childForFieldName("function")??e.namedChild(0);if(!r)return;let i=ge(r);if(!i||!Ss.has(i))return;let s=e.namedChildren.find(c=>c.type==="arguments");if(!s)return;let o=s.namedChild(0);if(!o||o.type!=="string")return;let a=o.namedChildren.find(c=>c.type==="string_fragment");a&&n.add(a.text)}function or(e,t){let n=gs.test(e),r=hs.test(e),i=ys.test(e);if(!(!n&&!r&&!i))for(let s of fs){s.lastIndex=0;let o;for(;(o=s.exec(e))!==null;){let a=o[1],c=a.split("::").pop()??a;c==="is_none"&&/\bOption\b/.test(a)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(a)||c&&t.add(c)}}}function ar(e,t){let n=new Map,r=(o,a)=>{if(o===a)return;let c=n.get(o);c||(c=new Set,n.set(o,c)),c.add(a)},i=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),s=(o,a)=>{let c=l=>{i.has(l.type)&&l.text!==a&&r(l.text,a);for(let u of l.children)c(u)};for(let l of o.children)c(l)};if(t==="rust")for(let o of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=o.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=o.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&s(c,a),o.type==="type_item"&&s(o,a)}else if(t==="python")for(let o of e.rootNode.descendantsOfType("class_definition")){let a=o.namedChildren.find(u=>u.type==="identifier")?.text;if(!a)continue;let c=o.childForFieldName("superclasses");c&&s(c,a);let l=o.namedChildren.find(u=>u.type==="block");if(l)for(let u of l.descendantsOfType("type"))for(let p of u.descendantsOfType("identifier"))p.text!==a&&r(p.text,a)}else for(let o of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=o.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&s(o,a)}return n}var xs=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),Bt=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function cr(e){let t=[],n=[],r=[],i=new Map,s=[],o=0,a=0,c=(l,u)=>{let p=i.get(l);if(!p){i.set(l,[u]);return}p[p.length-1]!==u&&p.push(u)};for(;a<e.length;){let l=e[a];if(l===`
86
+ `){o+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=it(e,a);continue}if(l==='"'){let h=ze(e,a,o);o=h.line,a=h.index;continue}if(l==="("||l==="["||l==="{"){s.push({kind:l,startLine:o,endLine:o,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let h=s.pop();h&&(h.endLine=o,bs(h,{callables:t,callSites:n,clojureMembers:r,recordIdentifier:c}),s[s.length-1]?.children.push(h)),a+=1;continue}if(Vt(l)){a+=1;continue}let u=o,p=a;for(;a<e.length&&!Ut(e[a]);)a+=1;let d=e.slice(p,a);if(!d)continue;let m={text:d,line:u};Ns(s[s.length-1],m),c(D(d),u)}return{language:"clojure",callables:t,callSites:n,clojureMembers:r,typeContainerMap:new Map,identifierLineMap:i,identifiersByLine:Ts(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function bs(e,t){if(e.kind!=="("||e.headTokens.length===0)return;let n=e.headTokens[0],r=D(n.text),i=xs.get(n.text);if(i){let o=e.headTokens[1];if(o){let a=D(o.text);t.recordIdentifier(a,o.line),t.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:o.line,isLiteralPassthrough:!1,clojureKind:i})}}if(Es(e,t),!r||Bt.has(n.text)||Bt.has(r)||r.startsWith(":"))return;let s=Cs(n.text);t.callSites.push({calleeLeaf:s.leaf,calleeQualifier:s.qualifier,calleeText:s.text,memberAccess:!1,line:n.line})}function Ns(e,t){e&&(e.headTokens.length<2&&e.headTokens.push(t),e.tokens.length<200&&e.tokens.push(t))}function Es(e,t){let n=D(e.tokens[0]?.text??"");if(n==="defprotocol"){let r=D(e.tokens[1]?.text??"");if(!r)return;for(let i of rt(e))We(t,r,"protocol",i,"protocol-method");return}if(n==="defrecord"||n==="deftype"){let r=D(e.tokens[1]?.text??"");if(!r)return;let i=n==="defrecord"?"record":"type",s=n==="defrecord"?"record-method":"type-method";for(let o of rt(e))We(t,r,i,o,s);return}if(n==="extend-type"){let r=D(e.tokens[1]?.text??"");if(!r)return;for(let i of rt(e))We(t,r,"extension",i,"extension-method");return}if(n==="extend-protocol"){let r=D(e.tokens[1]?.text??"");for(let i of rt(e)){r&&We(t,r,"extension",i,"extension-method");let s=_s(e,i.startLine);s&&s!==r&&We(t,s,"extension",i,"extension-method")}}}function rt(e){return e.children.filter(vs)}function vs(e){if(e.kind!=="(")return!1;let t=D(e.tokens[0]?.text??"");return!!(t&&!Bt.has(t)&&!t.startsWith(":"))}function We(e,t,n,r,i){let s=r.tokens[0],o=D(s?.text??"");!s||!o||(e.recordIdentifier(o,s.line),e.clojureMembers.push({ownerName:t,ownerKind:n,memberName:o,memberKind:i,startLine:r.startLine,endLine:r.endLine}))}function _s(e,t){let n=null;for(let r=2;r<e.tokens.length;r+=1){let i=e.tokens[r];if(i.line>t)break;let s=D(i.text);s&&!s.startsWith(":")&&(n=s)}return n}function D(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function Cs(e){let t=e.replace(/^#?['`~@]+/,""),n=t.lastIndexOf("/"),r=D(t);if(n<=0)return{leaf:r,text:t};let i=t.slice(0,n);return{leaf:r,qualifier:i,text:t}}function it(e,t){let n=t;for(;n<e.length&&e[n]!==`
87
+ `;)n+=1;return n}function ze(e,t,n){let r=t+1,i=n;for(;r<e.length;){let s=e[r];if(s==="\\"){r+=2;continue}if(s===`
88
+ `&&(i+=1),r+=1,s==='"')break}return{index:r,line:i}}function Vt(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function Ut(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Ts(e){let t=[];for(let[n,r]of e)for(let i of r)t[i]??=new Set,t[i].add(n);return t}var lr=6,Is=ve("source-facts",{clearGroups:["whole-project","source-file"]}),Wt=X({kind:"source-facts",invalidation:J("source-facts"),serialize:ks,deserialize:Rs});function Q(e,t){return zt(e,t).facts}function zt(e,t){let n=f(e,t);if(!n)return{facts:null};let r=Fs(e,t,n);return r?Is.get(e,t,n,()=>Ls(e,t,r,n)):{facts:null}}function Fs(e,t,n){return oe(t)?Be(e,t,n)?.language??null:W(t)}function Ls(e,t,n,r){let i=U(e,t,r),s=Wt.read(e,t,i);if(s&&s.language===n)return{facts:s};if(n==="clojure"){let c=cr(r);return Wt.write(e,t,i,c),{facts:c}}let o=$(e,t);if(!o)return{facts:null,unavailable:{language:n,reason:"parser-unavailable"}};let a=As(o,n);return Wt.write(e,t,i,a),{facts:a}}function ks(e){let t={version:lr,language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([n,r])=>[n,[...r]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function Rs(e){try{let t=JSON.parse(e);if(t.version!==lr||t.language==="clojure"&&(t.clojureMembers===void 0||t.callSites.some(r=>r.calleeText===void 0)))return null;let n=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,clojureMembers:t.clojureMembers??[],typeContainerMap:new Map(t.typeContainerMap.map(([r,i])=>[r,new Set(i)])),identifierLineMap:n,identifiersByLine:$t(n),fileIdentifiers:new Set(n.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function Ps(e,t,n,r){let i=Q(e,t);return i?ws(i,n,r)?.isLiteralPassthrough??!0:!0}function Ds(e,t){return t.relativePath.includes(".clj-kondo/hooks/")?!0:Q(e,t.relativePath)?.callables.find(r=>r.startLine===t.startLine&&r.endLine===t.endLine)?.clojureKind==="macro"}function ws(e,t,n){return e.callables.find(r=>r.startLine===t&&r.endLine===n)??null}function As(e,t){let n=[],r=[],i=new Set,s=new Set,o=new Map,a=(l,u)=>{let p=o.get(l);if(!p){o.set(l,[u]);return}p[p.length-1]!==u&&p.push(u)},c=l=>{let u=nt(l,t);u&&n.push(u);let p=Fe(l,t);p&&r.push(p),sr(l,t,s),t==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&or(l.text,i),nr(l,t)&&a(l.text,l.startPosition.row),rr(l,t)&&ir(l,a);for(let d of l.children)c(d)};return c(e.rootNode),{language:t,callables:n,callSites:r,clojureMembers:[],typeContainerMap:ar(e,t),identifierLineMap:o,identifiersByLine:$t(o),fileIdentifiers:new Set(o.keys()),rustAttrReferencedNames:i,crossLanguageDispatchNames:s}}var ur=new Set(["rust","typescript","tsx","javascript","python","clojure"]);function Ht(e,t){let n=Q(e,t);return!n||!ur.has(n.language)?null:n.callables.map(r=>({name:r.name,startLine:r.startLine,endLine:r.endLine}))}function js(e,t){let n=Q(e,t);return!n||!ur.has(n.language)?null:n.callSites}function Os(e,t){return Q(e,t)?.typeContainerMap??new Map}import{ElementTypes as $s,NodeTypes as qt,parse as Bs}from"@vue/compiler-dom";import{parse as Fp}from"@vue/compiler-sfc";var Ms=new Set(["children","className","data","e","err","error","ev","event","false","id","idx","index","item","key","null","props","res","result","state","style","true","undefined","val","value"]);function st(e){return e.length<=2||Ms.has(e)}function ot(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var Vs=re("vue-template-facts"),Us=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),Ws=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),zs=new Set(["div","span","template"]),Hs=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function at(e,t){let n=t.replace(/\\/g,"/"),r=f(e,n);return Vs.get(e,n,r,()=>qs(n,Ie(e,n).template))}function qs(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=Bs(t.body,{comments:!1})}catch{return n}let i=new Set,s=o=>{o.trim()&&i.add(o)};return dr(r.children,t.startLine,n,s),n.structuralTokens=[...i].sort(),n}function dr(e,t,n,r){for(let i of e)if(i.type===qt.ELEMENT)Ks(i,t,n,r),dr(i.children,t,n,r);else if(i.type===qt.INTERPOLATION){r("interpolation");let s=Kt(i.content);s&&mr(s,t,i.loc.start.line,n,r)}}function Ks(e,t,n,r){let i=eo(e.tag),s={tag:e.tag,normalized:i,kind:Zs(e),startLine:Le(t,e.loc.start.line),endLine:Le(t,e.loc.end.line)};s.kind==="component"?(n.componentTags.push(s),r(`component:${i}`)):s.kind==="builtin"?(n.builtinTags.push(s),r(`builtin:${i}`)):(n.nativeTags.push(s),zs.has(e.tag)||r(`native:${e.tag}`));for(let o of e.props)Xs(o,t,n,r)}function Xs(e,t,n,r){if(e.type===qt.ATTRIBUTE){let a=e.value?.content??null,c=pr("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let i=Qs(e),s=Kt(e.exp),o=pr(Js(e.name),i,s,t,e.loc.start.line,e.loc.end.line);switch(o.kind){case"prop":n.props.push(o),r(`prop:${i}`);break;case"event":n.events.push(o),r(`event:${i}`);break;case"slot":n.slots.push(o),r(`slot:${i}`);break;case"directive":n.directives.push(o),r(`directive:${i}`);break}s&&mr(s,t,e.loc.start.line,n,r)}function pr(e,t,n,r,i,s){return{kind:e,name:t,value:n,startLine:Le(r,i),endLine:Le(r,s)}}function Js(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function Qs(e){let t=Kt(e.arg);return t||e.name}function Kt(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function mr(e,t,n,r,i){for(let s of Gs(e)){let o={name:s,startLine:Le(t,n),endLine:Le(t,n)};r.expressionIdentifiers.push(o),i(`id:${s}`)}}function Gs(e){let t=new Set,n=Ys(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,i;for(;i=r.exec(n);){let s=i[0];Hs.has(s)||st(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function Ys(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function Zs(e){let t=e.tag;return e.tagType===$s.COMPONENT?"component":Us.has(t)?"builtin":Ws.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function eo(e){return ot(e,/[-_:]/)}function Le(e,t){return e+Math.max(0,t-1)}import{createRequire as po}from"module";import{existsSync as Se}from"fs";import{basename as gr,dirname as L,extname as G,join as w,relative as he,resolve as N,sep as mo}from"path";import{existsSync as Jt,readdirSync as to,statSync as no}from"fs";import{join as ke,relative as ro}from"path";function fr(e){let t=io(e)??co(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let i of t)for(let s of lo(e,i)){if(r.has(s))continue;r.add(s);let o=uo(e,s);o&&n.push(o)}return n}function io(e){let t=ke(e,"pnpm-workspace.yaml");if(!Jt(t))return null;try{return so(Qe(t,"pnpm workspace manifest"))}catch{return null}}function so(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let i=oo(r);if(!n){/^packages\s*:\s*$/.test(i.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(i);if(s){let o=ao(s[1].trim());o&&t.push(o);continue}if(i.trim()!=="")break}return t}function oo(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function ao(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function co(e){let t=ke(e,"package.json");if(!Jt(t))return null;try{let n=JSON.parse(Qe(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function lo(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let o=ke(e,t);return Xt(o)?[o]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),i=t.slice(n+1).replace(/^\//,""),s=ke(e,r||".");return Xt(s)?to(s).map(o=>ke(s,o,i)).filter(Xt):[]}function Xt(e){try{return no(e).isDirectory()}catch{return!1}}function uo(e,t){let n=ke(t,"package.json");if(!Jt(n))return null;try{let r=JSON.parse(Qe(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:ro(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var fo=Ee("indexed-paths",{clearGroups:[]}),go=Ee("indexed-path-digest",{clearGroups:[]}),ho=b("tsconfig-alias-config",{clearGroups:["whole-project"]}),yo=b("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),So=po(import.meta.url),He;function xo(){if(He!==void 0)return He;try{He=So("typescript")}catch{He=null}return He}var bo=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],No=Ee("workspace-packages",{clearGroups:["whole-project"]}),ye=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],ct=[".py",".pyi"],k=[".java",".scala",".kt",".kts"],lt=[".rs"],ut=[".rb"],pt=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],ae=[".cs",".vb"],dt=[".dart"],xe=[".php"],Re=[".clj",".cljs",".cljc"],Eo=new Set(ye),Qt=new Set(ct),hr=new Set(k),Gt=new Set(lt),Yt=new Set(ut),yr=new Set(pt),Sr=new Set(ae),Zt=new Set(dt),xr=new Set(xe),br=new Set(Re),vo=[{extensions:ye,lookup:Eo},{extensions:ct,lookup:Qt},{extensions:k,lookup:hr},{extensions:lt,lookup:Gt},{extensions:ut,lookup:Yt},{extensions:pt,lookup:yr},{extensions:ae,lookup:Sr},{extensions:dt,lookup:Zt},{extensions:xe,lookup:xr},{extensions:Re,lookup:br}];function Y(e,t){return t.has(G(e).toLowerCase())}function _o(e){return Y(e,Qt)}function Co(e){return Y(e,hr)}function To(e){return Y(e,Gt)}function Io(e){return Y(e,Yt)}function Fo(e){return Y(e,yr)}function Lo(e){return Y(e,Sr)}function Nr(e){return G(e).toLowerCase()===".vb"}function ko(e){return Y(e,Zt)}function Ro(e){return Y(e,xr)}function Po(e){return Y(e,br)}function en(e){let t=G(e).toLowerCase();for(let n of vo)if(n.lookup.has(t))return n.extensions;return ye}function Do(e){return Co(e)||Lo(e)||Ro(e)}function z(e,t,n){return _o(t)?Pe(e,t,n):To(t)?Z(e,t,n):Io(t)?mt(e,t,n):Fo(t)?ft(e,t,n):Do(t)?S(e,n.replace(/\\/g,"."),en(t)):ko(t)?gt(e,t,n):Po(t)?tn(e,n):wo(e,t,n)}function wo(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return Ao(e,t,n)??Oo(e,n);let r=L(w(e.config.projectRoot,t)),i=N(r,n),s=ee(e);for(let o of rn(i)){let a=v(he(e.config.projectRoot,o));if(s.has(a)||Se(o))return a}return v(he(e.config.projectRoot,i))}function Ao(e,t,n){let r=Wo(e,t);if(!r)return null;let i=ee(e);for(let s of jo(r,n)){let o=N(r.baseUrl,s);for(let a of rn(o)){let c=v(he(e.config.projectRoot,a));if(i.has(c)||Se(a))return c}}return null}function jo(e,t){let n=[];for(let[r,i]of Object.entries(e.paths)){let s=r.indexOf("*");if(s===-1){if(t!==r)continue;n.push(...i);continue}let o=r.slice(0,s),a=r.slice(s+1);if(!t.startsWith(o)||!t.endsWith(a)||t.length<o.length+a.length)continue;let c=t.slice(o.length,t.length-a.length);for(let l of i)n.push(l.includes("*")?l.replace("*",c):l)}return n}function Oo(e,t){let n=$o(Mo(e),t);if(!n)return null;let r=ee(e);for(let i of Bo(n)){let s=N(e.config.projectRoot,n.pkg.relativeDir,i);for(let o of rn(s)){let a=v(he(e.config.projectRoot,o));if(r.has(a)||Se(o))return a}}return null}function Mo(e){return No.get(e,()=>fr(e.config.projectRoot))}function $o(e,t){let n=null;for(let r of e){let i=null;t===r.name?i="":t.startsWith(`${r.name}/`)&&(i=t.slice(r.name.length+1)),i!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:i})}return n}function Bo(e){let t=[],n=Vo(e.pkg.exports,e.subpath);if(n){let r=Uo(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function Vo(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return Er(e[n])}function Er(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e;for(let n of["types","import","default","require","node"]){let r=Er(t[n]);if(r)return r}return null}function Uo(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function Wo(e,t){let n=v(L(t));return yo.get(e,n,()=>zo(e,n))}function zo(e,t){let n=xo();if(!n)return null;let r=N(e.config.projectRoot),i=N(r,t);for(;i===r||i.startsWith(r+mo);){for(let o of bo){let a=w(i,o);if(!Se(a))continue;let c=ho.get(e,a,()=>Ho(n,a));if(c)return c}let s=L(i);if(s===i)break;i=s}return null}function Ho(e,t){try{let n=e.readConfigFile(t,e.sys.readFile);if(n.error||!n.config)return null;let r=e.parseJsonConfigFileContent(n.config,e.sys,L(t)),i=r.options.paths;return!i||Object.keys(i).length===0?null:{baseUrl:r.options.baseUrl?N(L(t),r.options.baseUrl):L(t),paths:i}}catch{return null}}function Pe(e,t,n){let r=ee(e),i;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let o=s[1].length,a=s[2].replace(/^\./,""),c=L(w(e.config.projectRoot,t));for(let l=1;l<o;l++)c=L(c);i=a?N(c,a.replace(/\./g,"/")):c}else i=N(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of qo(i)){let o=v(he(e.config.projectRoot,s));if(r.has(o)||Se(s))return o}return null}function Z(e,t,n){if(!n)return null;let r=n.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let i=L(w(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=N(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=N(i,r.slice(6).replace(/::/g,"/")):s=N(L(i),r.slice(7).replace(/::/g,"/")),nn(e,Ko(s))}function mt(e,t,n){let r=L(w(e.config.projectRoot,t)),i=N(r,n);return nn(e,Xo(i))}function ft(e,t,n){let r=L(w(e.config.projectRoot,t)),i=[N(r,n),N(e.config.projectRoot,n),N(e.config.projectRoot,"include",n),N(e.config.projectRoot,"src",n)];return nn(e,i)}function S(e,t,n){let r=ee(e),i=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=i.replace(/\./g,"/"),o=i.split(".").pop()??i;for(let c of n){let l=`${s}${c}`,u=[...r].find(p=>p.endsWith(l));if(u)return u}for(let c of n){let l=[...r].find(u=>gr(u)===`${o}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(G(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${o}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function gt(e,t,n){let r=ee(e);if(n.startsWith("package:")){let o=n.slice(8),a=o.indexOf("/");if(a<0)return null;let c=o.slice(a+1),l=v(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let i=L(w(e.config.projectRoot,t)),s=N(i,n);for(let o of Jo(s)){let a=v(he(e.config.projectRoot,o));if(r.has(a)||Se(o))return a}return null}function tn(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=ee(e);for(let i of Re){let s=`${n}${i}`,o=[...r].find(a=>a.endsWith(s));if(o)return o}for(let i of Re){let s=[...r].find(o=>gr(o)===`${n.split("/").pop()}${i}`);if(s)return s}return null}function qo(e){let t=G(e);return Qt.has(t)?[e]:[`${e}.py`,`${e}.pyi`,w(e,"__init__.py"),w(e,"__init__.pyi")]}function nn(e,t){let n=ee(e);for(let r of t){let i=v(he(e.config.projectRoot,r));if(n.has(i)||Se(r))return i}return null}function Ko(e){let t=G(e);return Gt.has(t)?[e]:[`${e}.rs`,w(e,"mod.rs")]}function Xo(e){let t=G(e);return Yt.has(t)?[e]:[`${e}.rb`,w(e,"index.rb")]}function Jo(e){let t=G(e);return Zt.has(t)?[e]:[`${e}.dart`,e]}function rn(e){let t=G(e),n=new Set;if(t){n.add(e);for(let r of ye)n.add(e.slice(0,-t.length)+r)}else for(let r of ye)n.add(`${e}${r}`),n.add(w(e,`index${r}`));return[...n]}function ee(e){return fo.get(e,()=>new Set(je(e,{includeIgnored:!1}).map(v)))}function sn(e){return go.get(e,()=>Ze([...ee(e)].sort().join(`
89
+ `)))}var Qo=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),Go=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),Yo=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),Zo=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),ea=new Set(["catch","for","function","if","return","switch","while"]);function yt(e){let t={imports:[],functions:[],calls:[],composables:[],stores:[],reactivity:[],lifecycle:[],requests:[],macros:[],lineCount:0,externalLineCount:0,externalScriptPaths:[],unresolvedScripts:[]};for(let n of e.scripts){t.lineCount+=fe(n),n.external&&(t.externalLineCount+=fe(n),t.externalScriptPaths.push(n.sourcePath));for(let i of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:i});if(!n.body||!n.astLanguage){n.astLanguage||t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:`Unsupported Vue script language: ${n.lang??"unknown"}`});continue}t.imports.push(...ia(n));let r=me(n.astLanguage,n.body);r?na(n,r.rootNode,t):ra(n,t)}return ta(t),t.externalScriptPaths=_r(t.externalScriptPaths),t}function ta(e){e.composables=De(e,"composable"),e.stores=De(e,"store"),e.reactivity=De(e,"reactivity"),e.lifecycle=De(e,"lifecycle"),e.requests=De(e,"request"),e.macros=De(e,"macro")}function De(e,t){return _r(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function na(e,t,n){let r=new Set,i=new Set,s=o=>{let a=nt(o,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;i.has(l)||(i.add(l),n.functions.push({name:a.name,sourcePath:e.sourcePath,startLine:e.startLine+a.startLine,endLine:e.startLine+a.endLine,setup:e.setup}))}let c=Fe(o,e.astLanguage);if(c){let l=`${c.calleeLeaf}:${c.line}`;r.has(l)||(r.add(l),n.calls.push({name:c.calleeLeaf,sourcePath:e.sourcePath,line:e.startLine+c.line,categories:vr(c.calleeLeaf),setup:e.setup}))}for(let l of o.children)s(l)};s(t)}function ra(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||ea.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+ht(e.body,n.index??0),categories:vr(r),setup:e.setup})}for(let n of e.body.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\b/g)){let r=n[1];if(!r)continue;let i=e.startLine+ht(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:i,endLine:i,setup:e.setup})}for(let n of e.body.matchAll(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function\b|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/g)){let r=n[1];if(!r)continue;let i=e.startLine+ht(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:i,endLine:i,setup:e.setup})}}function ia(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),i=n[2];if(!r||!i)continue;let s=e.startLine+ht(e.body,n.index??0);for(let o of sa(r))t.push({local:o,source:i,sourcePath:e.sourcePath,line:s,setup:e.setup})}return t}function sa(e){let t=[],r=e.split(",").map(o=>o.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let i=/\{([^}]*)\}/.exec(e)?.[1];if(i)for(let o of i.split(",")){let a=o.trim();if(!a)continue;let c=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(a)?.[1];t.push(c??a.replace(/^type\s+/,"").trim())}let s=/\*\s+as\s+([A-Za-z_$][\w$]*)/.exec(e)?.[1];return s&&t.push(s),t.filter(o=>/^[A-Za-z_$][\w$]*$/.test(o))}function vr(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),Qo.has(e)&&t.push("reactivity"),Go.has(e)&&t.push("lifecycle"),Yo.has(e)&&t.push("request"),Zo.has(e)&&t.push("macro"),t}function ht(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function _r(e){return[...new Set(e)].sort()}var oa=new Set(["in","key","of"]),aa=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),ca=re("vue-component-behavior-profiles");function Cr(e,t={}){let n=Ge(e,{extensions:[".vue"]}).filter(i=>!t.scope||i.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(i=>on(e,i)).filter(i=>(t.minTemplateTokens===void 0||i.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||i.behaviorTokens.size>=t.minBehaviorTokens))}function on(e,t){let n=t.replace(/\\/g,"/"),r=f(e,n),i=ca.get(e,n,r,()=>la(e,n,r));return pa(i)}function la(e,t,n){let r=Ie(e,t),i=at(e,t),s=yt(r),o=fa(i),a=i.expressionIdentifiers.map(g=>g.name).filter(g=>!o.includes(g)).filter((g,M,pe)=>pe.indexOf(g)===M).sort(),c=i.componentTags.map(g=>g.normalized).filter((g,M,pe)=>pe.indexOf(g)===M).sort(),l=n?n.split(`
90
+ `).length:0,u=fe(r.template),p=s.lineCount,d=r.styles.reduce((g,M)=>g+fe(M),0),m=r.customBlocks.reduce((g,M)=>g+fe(M),0),{lines:h,paths:V}=ua(e,t,s);return{file:t,sfc:r,templateFacts:i,scriptFacts:s,templateTokens:new Set(i.structuralTokens),behaviorTokens:ma(i,s,a),templateBindingNames:a,templateLocalNames:o,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:u,scriptLines:p,styleLines:d,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:m,delegatedComposableLines:h,delegatedComposablePaths:V}}function ua(e,t,n){let r=new Set;for(let o of n.composables){let a=n.imports.find(l=>l.local===o);if(!a)continue;let c=z(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let i=[...r].sort();return{lines:i.reduce((o,a)=>{let c=f(e,a);return o+(c?c.split(`
91
+ `).length:0)},0),paths:i}}function pa(e){let t=da(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths,delegatedComposablePaths:[...e.delegatedComposablePaths]}}function da(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function ma(e,t,n){let r=new Set;for(let i of t.composables)r.add(`composable:${i}`);for(let i of t.stores)r.add(`store:${i}`);for(let i of t.reactivity)r.add(`reactivity:${i}`);for(let i of t.lifecycle)r.add(`lifecycle:${i}`);for(let i of t.requests)r.add(`request:${i}`);for(let i of t.macros)r.add(`macro:${i}`);for(let i of t.functions){if(aa.has(i.name))continue;r.add(`function:${i.name}`);let s=/^[a-z]+/.exec(i.name)?.[0]??null;s&&s.length>2&&s!==i.name&&r.add(`function-verb:${s}`)}for(let i of e.events)r.add(`template-event:${i.name}`);for(let i of n)r.add(`template-binding:${i}`);return r}function fa(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of ga(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of Tr(n.value))t.add(r);return[...t].sort()}function ga(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?Tr(t[1]??""):[]}function Tr(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];oa.has(r)||t.push(r)}return t}import{extname as ha}from"path";var ya=[".tsx",".jsx"],Ir=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),Sa=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),xa=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),ba=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),Na=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),Ea=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),va=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),_a=re("react-component-behavior-profiles"),Fr=X({kind:"react-component-behavior-profiles",invalidation:J("react-component-behavior-profiles"),serialize:Fa,deserialize:La});function Pr(e,t={}){let n=Ge(e,{extensions:ya}).filter(i=>!t.scope||i.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(i=>cn(e,i)).filter(i=>(t.minJsxTokens===void 0||i.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||i.behaviorTokens.size>=t.minBehaviorTokens))}function cn(e,t){let n=t.replace(/\\/g,"/"),r=f(e,n);return _a.get(e,n,r,()=>Ca(e,n,r)).map(Ia)}function Ca(e,t,n){let r=U(e,t,n),i=Fr.read(e,t,r);if(i)return i;let s=Ta(e,t);return Fr.write(e,t,r,s),s}function Ta(e,t){let n=Ra(t);if(!n)return[];let r=$(e,t);if(!r)return[];let i=Me(e,t).length;return Pa(r.rootNode,n).filter(o=>o.kind==="hook"||ln(o.bodyNode)).map(o=>{let a=$a(o.bodyNode),c=za(o.bodyNode,n);return{file:t,name:o.name,kind:o.kind,startLine:o.node.startPosition.row,endLine:o.node.endPosition.row,loc:Math.max(1,o.node.endPosition.row-o.node.startPosition.row+1),fileLines:i,jsxTokens:a.tokens,behaviorTokens:c.tokens,componentNames:te(a.componentNames),nativeTags:te(a.nativeTags),propNames:te(a.propNames),eventNames:te(a.eventNames),hookNames:te(c.hookNames),requestNames:te(c.requestNames),stateNames:te(c.stateNames),effectNames:te(c.effectNames),handlerNames:te(c.handlerNames)}})}function Ia(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function Fa(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function La(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let i=ka(r);if(!i)return null;n.push(i)}return n}catch{return null}}function ka(e){if(!ie(e))return null;let{file:t,name:n,kind:r,startLine:i,endLine:s,loc:o,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:u,nativeTags:p,propNames:d,eventNames:m,hookNames:h,requestNames:V,stateNames:g,effectNames:M,handlerNames:pe}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!St(i)||!St(s)||!St(o)||!St(a))return null;let E={jsxTokens:P(c),behaviorTokens:P(l),componentNames:P(u),nativeTags:P(p),propNames:P(d),eventNames:P(m),hookNames:P(h),requestNames:P(V),stateNames:P(g),effectNames:P(M),handlerNames:P(pe)};return Object.values(E).some(Ci=>Ci===null)?null:{file:t,name:n,kind:r,startLine:i,endLine:s,loc:o,fileLines:a,jsxTokens:new Set(E.jsxTokens),behaviorTokens:new Set(E.behaviorTokens),componentNames:E.componentNames,nativeTags:E.nativeTags,propNames:E.propNames,eventNames:E.eventNames,hookNames:E.hookNames,requestNames:E.requestNames,stateNames:E.stateNames,effectNames:E.effectNames,handlerNames:E.handlerNames}}function St(e){return typeof e=="number"&&Number.isFinite(e)}function Ra(e){let t=ha(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:W(e)}function Pa(e,t){let n=[],r=new Set,i=s=>{let o=Da(s);if(o&&(!Oa(s)||o.kind==="component")){let a=`${o.name}:${o.node.startIndex}:${o.node.endIndex}`;r.has(a)||(r.add(a),n.push(o))}for(let a of s.namedChildren)i(a)};return(t==="tsx"||t==="javascript")&&i(e),n}function Da(e){if(e.type==="class_declaration"){let s=an(e);if(!s||!/^[A-Z]/.test(s))return null;let o=wa(e);return!o||!Aa(e)&&!ln(o)?null:{name:s,kind:"component",node:e,bodyNode:o}}if(e.type==="function_declaration"){let s=an(e);return!s||!Lr(s)?null:{name:s,kind:kr(s),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),r=qe(t);if(!r||!n||!Lr(r))return null;let i=ja(n);return i?{name:r,kind:kr(r),node:e,bodyNode:i}:null}function wa(e){for(let t of e.namedChildren)if(t.type==="class_body")for(let n of t.namedChildren){if(n.type!=="method_definition")continue;if((n.childForFieldName("name")??n.namedChild(0))?.text==="render")return n}return null}function Aa(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function Lr(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function kr(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function ja(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=Ma(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(i=>i.type==="arguments")?.namedChildren.find(i=>i.type==="arrow_function"||i.type==="function_expression")??null}function Oa(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function an(e){return qe(e.childForFieldName("name")??e.namedChild(0))}function Ma(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function ln(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(ln)}function $a(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=r=>{r.type==="jsx_opening_element"||r.type==="jsx_self_closing_element"?Ba(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?Va(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let i of r.children)n(i)};return n(e),t}function Ba(e,t){let n=Ua(e),r=!1;if(n){let i=Rr(n),s=i==="Fragment"||i==="React.Fragment";r=Ja(i)&&!s,s?t.tokens.add("jsx:fragment"):r?(t.componentNames.add(i),t.tokens.add(`component:${i}`)):(t.nativeTags.add(i),t.tokens.add(`native:${i}`))}for(let i of e.namedChildren)if(i.type==="jsx_attribute"){let s=Wa(i);if(!s)continue;let o=Rr(s);if(o.startsWith("on")&&o.length>2){let a=o.slice(2).replace(/^[A-Z]/,c=>c.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else va.has(o)||(t.propNames.add(o),t.tokens.add(`${r?"prop":"native-prop"}:${o}`))}else i.type==="jsx_spread_attribute"&&t.tokens.add(Dr(i))}function Va(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(Dr(e)),wr(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of Qa(n))st(r)||t.tokens.add(`binding:${r}`)}function Dr(e){let t=/^\{\s*\.\.\.\s*([^}]+)\s*\}$/.exec(e.text)?.[1],n=e.namedChildren.find(s=>s.type!=="comment"),r=t??n?.text??"",i=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.exec(r.trim())?.[0];return i?`prop:spread:${i}`:"prop:spread"}function wr(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(wr)}function Ua(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function Wa(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function za(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},r=i=>{if(i.type==="call_expression"){let s=Fe(i,t);s&&Ha(s.calleeLeaf,n)}else if(i.type==="variable_declarator")Ka(i,n);else if(i.type==="function_declaration"){let s=an(i);s&&Ar(s,n)}for(let s of i.namedChildren)r(s)};return r(e),n}function Ha(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!Ir.has(e)&&!ba.has(e)&&t.tokens.add(`hook:${e}`)),Ir.has(e)&&t.tokens.add(`react-hook:${e}`),Sa.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),xa.has(e)&&t.tokens.add(`state-hook:${e}`),qa(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function qa(e){if(Na.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function Ka(e,t){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&r?.text.includes("useState")){let s=n.namedChildren.find(a=>qe(a)),o=qe(s);o&&(t.stateNames.add(o),t.tokens.add(`state:${o}`))}let i=qe(n);i&&Ar(i,t)}function Ar(e,t){let n=Xa(e);!n||!Ea.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function Xa(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function Ja(e){return/^[A-Z]/.test(e)||e.includes(".")}function Rr(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function qe(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function Qa(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];t.includes(r)||t.push(r)}return t}function te(e){return[...e].sort()}function _d(e){return{capability:(t,n)=>Ga(t,n),reactProfiles:(t={})=>Pr(e,t),reactProfilesForFile:t=>cn(e,t),vueProfiles:(t={})=>Cr(e,t),vueProfileForFile:t=>on(e,t),vueTemplateFacts:t=>at(e,t),vueScriptFacts:t=>yt(Ie(e,t))}}function Ga(e,t){let n=e.startsWith("react-")?"react":"vue";if(t===void 0)return{slot:e,available:!0,framework:n};let r=t.replace(/\\/g,"/").toLowerCase();return n==="react"&&!r.endsWith(".tsx")&&!r.endsWith(".jsx")?{slot:e,available:!1,framework:n,reason:"React behavior profiles are only available for .tsx and .jsx files"}:n==="vue"&&!r.endsWith(".vue")?{slot:e,available:!1,framework:n,reason:"Vue behavior facts are only available for .vue files"}:{slot:e,available:!0,framework:n}}function Ya(e,t,n={}){let r=Q(e,t);if(!r)return[];let i=[];if(n.includeCrossLanguageDispatchNames)for(let s of r.crossLanguageDispatchNames)i.push({name:s,kind:"cross-language-dispatch",occurrences:1});if(n.includeRustAttributeNames&&r.language==="rust")for(let s of r.rustAttrReferencedNames)i.push({name:s,kind:"rust-attribute",occurrences:1});return i}import{basename as Or}from"path";function H(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Za(e){return e.replace(/'''[\s\S]*?'''/g,ce).replace(/"""[\s\S]*?"""/g,ce).replace(/#.*$/gm,ce).replace(/\/\/.*$/gm,ce).replace(/\/\*[\s\S]*?\*\//g,ce).replace(/`(?:\\[\s\S]|[^`])*`/g,ce).replace(/'(?:\\.|[^'\\\r\n])*'/g,ce).replace(/"(?:\\.|[^"\\\r\n])*"/g,ce)}function Bd(e){return jr(e,{maskStrings:!1})}function Vd(e){return jr(e,{maskStrings:!0})}function jr(e,t){let n="",r=0,i=e.length;for(;r<i;){if(e[r]==="/"&&e[r+1]==="/"){let o=e.indexOf(`
92
+ `,r),a=o===-1?i:o;n+=un(e,r,a),r=a;continue}if(e[r]==="/"&&e[r+1]==="*"){let o=e.indexOf("*/",r+2),a=o===-1?i:o+2;n+=un(e,r,a),r=a;continue}let s=e[r];if(s==="`"||s==="'"||s==='"'){let o=s,a=r+1;for(;a<i;){if(e[a]==="\\"){a+=2;continue}if(e[a]===o){a+=1;break}if(o!=="`"&&e[a]===`
93
+ `)break;a+=1}n+=t.maskStrings?un(e,r,a):e.slice(r,a),r=a;continue}n+=s,r+=1}return n}function un(e,t,n){let r="";for(let i=t;i<n;i+=1)r+=e[i]===`
94
+ `?`
95
+ `:" ";return r}function ce(e){return e.replace(/[^\r\n]/g," ")}var Ud=ve("stripped-lines",{clearGroups:["whole-project","source-file"]});In({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{xt=null,Ke=""},clearFile:()=>{xt=null,Ke=""}});var xt=null,Ke="";function ec(e){return xt===e||(xt=e,Ke=Za(e)),Ke}function le(e,t,n){let r=ec(e);return`${r.slice(0,t)}${" ".repeat(n-t)}${r.slice(n)}`}function T(e,t){return new RegExp(`\\b${H(t)}\\b`,"m").test(e)}function we(e,t){let n=new Set,r=new RegExp(`\\b${H(t)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let i of e.matchAll(r)){let s=i[1];s&&n.add(s)}return[...n]}function pn(e){let t=0;for(let n of e)n==="("&&(t+=1),n===")"&&(t-=1);return t}var tc=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function I(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let s=e[i];(s==="{"||s==="["||s==="(")&&n++,(s==="}"||s==="]"||s===")")&&n--,s===","&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t}function R(e,t){for(let n of e.namedChildren)if(n.type===t)return n;return null}function x(e,t){let n=new Set,r=(i,s)=>{let o=s||t.has(i.type);!o&&tc.has(i.type)&&n.add(i.text);for(let a of i.children)r(a,o)};return r(e.rootNode,!1),n}function B(e,t,n,r,i,s,o){return{importedName:i,localName:s,sourcePath:o??S(e,r,en(t)),kind:"named",used:T(n,s),usedMembers:[]}}function y(e,t,n,r,i="named",s={}){return{importedName:e,localName:t,sourcePath:n,kind:i,used:r.has(t),usedMembers:[],isTypeOnly:s.isTypeOnly}}function ne(e,t,n,r,i="named",s=[],o={}){return{importedName:e,localName:t,sourcePath:n,kind:i,used:r,usedMembers:s,isTypeOnly:o.isTypeOnly}}function be(e,t){return{importedName:e,localName:null,sourcePath:t,kind:"side-effect",used:!0,usedMembers:[]}}function Ne(e,t,n={}){return{importedName:e,localName:n.localName??null,sourcePath:t,kind:"namespace",used:n.used??!0,usedMembers:n.usedMembers??[],isTypeOnly:n.isTypeOnly}}function A(e,t,n){let r=[];for(let i of e.matchAll(t)){let s=i[0];if(!s||typeof i.index!="number")continue;let o=le(e,i.index,i.index+s.length);for(let a of n(i,o))r.push(a)}return r}function j(e,t,n,r,i){let s=Ve(e,t,i)?.tree??null;if(s){let o=n(s);if(o)return o}return r()}function bt(e,t,n,r,i){let s=Ve(e,t,i)?.tree??null,o=W(t),a=o?n[o]:void 0;return s&&a?a(s):r()}function Mr(e,t,n){return j(e,t,r=>rc(e,t,r),()=>nc(e,t,n),n)}function nc(e,t,n){return A(n,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(r,i)=>{let s=r[1]?.trim();if(!s)return[];let o=Or(s).replace(/\.[^.]+$/,"");return[ne(s,o,ft(e,t,s),T(i,o))]})}function rc(e,t,n){let r=x(n,new Set(["preproc_include"])),i=[];for(let s of n.rootNode.descendantsOfType("preproc_include")){let o=null;for(let c of s.namedChildren){if(c.type==="system_lib_string"){o=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){o=c.namedChildren.find(u=>u.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!o)continue;let a=Or(o).replace(/\.[^.]+$/,"");i.push(y(o,a,ft(e,t,o),r))}return i}var ic=new Set([":require",":require-macros",":use"]),fn=String.raw`A-Za-z0-9_$*+!?.<>=-`;function Br(e,t,n){let r=gc(n);if(!r)return[];let i=fc(n,r.start,r.end),s=[];for(let o of r.children.slice(2)){if(o.type!=="list"||o.children.length===0)continue;let a=O(o.children[0]);if(a){if(ic.has(a)){for(let c of ac(o.children.slice(1)))s.push(...oc(e,c,i));continue}if(a===":import")for(let c of lc(o.children.slice(1)))s.push(c)}}return s}function sc(e){return e.type==="list"&&O(e.children[0])==="ns"}function oc(e,t,n){let r=tn(e,t.namespace),i=t.alias??t.namespace,s=pc(n,i),o=[{importedName:t.namespace,localName:i,sourcePath:r,kind:"namespace",used:t.refers.length>0||t.referAll||s.length>0||dc(n,t.namespace),usedMembers:s}];t.referAll&&o.push({importedName:"*",localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]});for(let a of t.refers)o.push({importedName:a,localName:a,sourcePath:r,kind:"named",used:mc(n,a),usedMembers:[]});return o}function ac(e){return e.flatMap(t=>Nt(t,null))}function Nt(e,t){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:mn(t,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&O(e.children[0])===null?e.children.flatMap(n=>Nt(n,t)):cc(e,t);if(e.type==="list"&&e.children.length>0){let n=O(e.children[0]);return n?!n||n.startsWith(":")?[]:e.children.slice(1).flatMap(r=>Nt(r,mn(t,n))):e.children.flatMap(r=>Nt(r,t))}return[]}function cc(e,t){let n=O(e.children[0]);if(!n||n.startsWith(":"))return[];let r={namespace:mn(t,n),alias:null,refers:[],referAll:!1};for(let i=1;i<e.children.length;i+=1){let s=O(e.children[i]);if(!s?.startsWith(":"))continue;let o=e.children[i+1];if((s===":as"||s===":as-alias")&&o){r.alias=O(o),i+=1;continue}s===":refer"&&o&&(O(o)===":all"?r.referAll=!0:(o.type==="vector"||o.type==="list")&&r.refers.push(...o.children.map(O).filter(uc)),i+=1)}return[r]}function lc(e){let t=[];for(let n of e){if(n.type==="atom"){let i=n.text.split(".").pop()??n.text;t.push(ne(i,i,null,!0));continue}if(n.type!=="vector")continue;let r=O(n.children[0]);if(r)for(let i of n.children.slice(1)){let s=O(i);s&&t.push(ne(`${r}.${s}`,s,null,!0))}}return t}function mn(e,t){return e?`${e}.${t}`:t}function O(e){return e?.type==="atom"?e.text:null}function uc(e){return!!(e&&!e.startsWith(":"))}function pc(e,t){let n=new Set,r=new RegExp(`${gn()}${H(t)}\\s*/\\s*([${fn}]+)`,"g");for(let i of e.matchAll(r)){let s=i[1];s&&n.add(s)}return[...n]}function dc(e,t){return new RegExp(`${gn()}${H(t)}\\s*/`,"m").test(e)}function mc(e,t){return new RegExp(`${gn()}${H(t)}(?![${fn}])`,"m").test(e)}function gn(){return`(?<![${fn}])`}function fc(e,t,n){let r="",i=0;for(;i<e.length;){if(i>=t&&i<n){r+=e[i]===`
96
+ `?`
97
+ `:" ",i+=1;continue}let s=e[i];if(s===";"){let o=it(e,i);r+=$r(e.slice(i,o)),i=o;continue}if(s==='"'){let o=ze(e,i,0).index;r+=$r(e.slice(i,o)),i=o;continue}r+=s,i+=1}return r}function gc(e){let t=0;for(;t<e.length&&(t=hn(e,t),!(t>=e.length));){let n=Et(e,t);if(!n){t+=1;continue}if(sc(n.form))return n.form;t=n.index}return null}function Et(e,t){let n=hn(e,t);if(e.startsWith("#?@",n)||e.startsWith("#?",n))return hc(e,n);if(e.startsWith("#_",n)){let i=Et(e,n+2);return i?{form:{type:"atom",text:"",start:n,end:i.index},index:i.index}:null}for(;Vt(e[n]);)n+=1;let r=e[n];return r?r==="("?dn(e,n,"list",")"):r==="["?dn(e,n,"vector","]"):r==="{"?dn(e,n,"map","}"):r==='"'?{form:{type:"atom",text:"",start:n,end:ze(e,n,0).index},index:ze(e,n,0).index}:Sc(e,n):null}function hc(e,t){let n=e.startsWith("#?@",t)?3:2,r=Et(e,t+n);return r?{form:{type:"list",children:r.form.type==="list"||r.form.type==="vector"||r.form.type==="map"?yc(r.form.children):[],start:t,end:r.index},index:r.index}:null}function yc(e){let t=[];for(let n=0;n<e.length;n+=2){let r=O(e[n]),i=e[n+1];r?.startsWith(":")&&i&&t.push(i)}return t}function dn(e,t,n,r){let i=[],s=t+1;for(;s<e.length;){if(s=hn(e,s),e[s]===r)return{form:{type:n,children:i,start:t,end:s+1},index:s+1};let o=Et(e,s);if(!o){s+=1;continue}o.form.type==="atom"&&o.form.text===""||i.push(o.form),s=o.index}return{form:{type:n,children:i,start:t,end:e.length},index:e.length}}function Sc(e,t){let n=t;for(;n<e.length&&!Ut(e[n]);)n+=1;return{form:{type:"atom",text:e.slice(t,n),start:t,end:n},index:n}}function hn(e,t){let n=t;for(;n<e.length;){let r=e[n];if(/\s|,/.test(r)){n+=1;continue}if(r===";"){n=it(e,n);continue}break}return n}function $r(e){return e.replace(/[^\r\n]/g," ")}function Vr(e,t,n){let r=[];for(let i of n.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let s=i[1]?.trim(),o=i[2]?.trim()??null,a=i[0];if(!s||!a||typeof i.index!="number")continue;let c=le(n,i.index,i.index+a.length);r.push({importedName:s,localName:o,sourcePath:gt(e,t,s),kind:o?"namespace":"side-effect",used:o?T(c,o):!0,usedMembers:o?we(c,o):[]})}return r}function Ur(e,t,n){let r=[];for(let i of n.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let s=i[1]?.trim();s&&r.push({specifier:s,sourcePath:gt(e,t,s)})}return r}function Wr(e,t,n){return bt(e,t,{csharp:r=>bc(e,t,r),vb:r=>xc(e,t,r)},()=>{let r=Nr(t)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return A(n,r,(i,s)=>{let o=i[1]?.trim();if(!o)return[];let[a,c]=o.split(/\s*=\s*/),l=!!c,u=(l?c:a)?.trim()??o,p=u.split(".").pop()??u,d=l?a?.trim()??p:p;return[B(e,t,s,u,p,d,S(e,u,ae))]})},n)}function xc(e,t,n){let r=x(n,new Set(["imports_statement"])),i=[];for(let s of n.rootNode.descendantsOfType("imports_statement")){let o=s.namedChildren.filter(d=>d.type==="namespace_name");if(o.length===0)continue;let a=o[o.length-1],c=o.length>1?o[0]:null,l=a.text,u=l.split(".").pop()??l,p=c?.text??u;i.push(y(u,p,S(e,l,ae),r,c?"namespace":"named"))}return i}function bc(e,t,n){let r=x(n,new Set(["using_directive"])),i=[];for(let s of n.rootNode.descendantsOfType("using_directive")){let o=s.namedChildren;if(o.length===0)continue;let a=null,c;o.length>=2&&o[0].type==="identifier"&&(o[1].type==="qualified_name"||o[1].type==="identifier")?(a=o[0],c=o[1]):c=o[o.length-1];let l=c.text,u=l.split(".").pop()??l,p=a?.text??u;i.push(y(u,p,S(e,l,ae),r,a?"namespace":"named"))}return i}var Nc=b("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function zr(e,t){return Nc.get(e,t,()=>{let n=new Set,r=f(e,t);if(!r)return n;let s=r.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,o=>o.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,o=>o.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,o=>o.replace(/[^\r\n]/g," "));for(let o of s.matchAll(/[A-Za-z_$][\w$]*/g))n.add(o[0]);return n})}function yn(e,t,n){return j(e,t,r=>vc(e,t,r),()=>Ec(e,t,n),n)}function Ec(e,t,n){return wc(n).flatMap(r=>Ac(e,t,r.clause,r.specifier,r.start,r.end,n))}function vc(e,t,n){let r=_c(e,t,n),i=[];for(let s of n.rootNode.descendantsOfType("import_statement"))i.push(...Cc(e,t,n,s,r));return i}function _c(e,t,n){let r=x(n,new Set(["import_statement"]));if(oe(t))for(let i of zr(e,t))r.add(i);return r}function Cc(e,t,n,r,i){let s=kc(r);if(!s)return[];let o=z(e,t,s),a=R(r,"import_clause");return a?Tc(n,a,o,i,Rc(r.text)):[be("*",o)]}function Tc(e,t,n,r,i){let s=[];for(let o of t.namedChildren)if(o.type==="identifier")s.push(Ic(o.text,n,r,i));else if(o.type==="namespace_import"){let a=Fc(e,o,n,r,i);a&&s.push(a)}else o.type==="named_imports"&&s.push(...Lc(o,n,r,i));return s}function Ic(e,t,n,r){return y("default",e,t,n,"default",{isTypeOnly:r})}function Fc(e,t,n,r,i){let o=R(t,"identifier")?.text??"";if(!o)return null;let a=Dc(e,o);return Ne("*",n,{localName:o,usedMembers:a,isTypeOnly:i,used:a.length>0||r.has(o)})}function Lc(e,t,n,r){let i=[];for(let s of e.namedChildren){if(s.type!=="import_specifier")continue;let o=s.namedChild(0),a=s.namedChild(1);if(!o)continue;let c=o.text,l=a?.text??c;i.push(y(c,l,t,n,"named",{isTypeOnly:r||Pc(s.text)}))}return i}function kc(e){let t=R(e,"string");if(!t)return null;let n=R(t,"string_fragment");return n?n.text:null}function Rc(e){return/^\s*import\s+type\b/.test(e)}function Pc(e){return/^\s*type\b/.test(e.trim())}function Dc(e,t){let n=new Set;for(let r of e.rootNode.descendantsOfType("member_expression")){let i=r.namedChild(0),s=r.namedChild(1);!i||!s||i.type!=="identifier"||i.text!==t||(s.type==="property_identifier"||s.type==="identifier")&&n.add(s.text)}return[...n]}function wc(e){let t=[],n=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of e.matchAll(n)){let s=i[0],o=i[1],a=i[2];!s||!a||typeof i.index!="number"||t.push({clause:o,specifier:a,start:i.index,end:i.index+s.length})}let r=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of e.matchAll(r)){let s=i[0],o=i[1];!s||!o||typeof i.index!="number"||t.push({clause:null,specifier:o,start:i.index,end:i.index+s.length})}return t.sort((i,s)=>i.start-s.start)}function Ac(e,t,n,r,i,s,o){let a=z(e,t,r),c=le(o,i,s);return n?jc(n).map(u=>({...u,sourcePath:a})).map(u=>{if(u.kind==="namespace"){let p=we(c,u.localName);return Ne(u.importedName,u.sourcePath,{localName:u.localName,usedMembers:p,used:p.length>0||T(c,u.localName),isTypeOnly:u.isTypeOnly})}return u.kind==="side-effect"?be(u.importedName,u.sourcePath):ne(u.importedName,u.localName??"",u.sourcePath,u.localName?T(c,u.localName):!1,u.kind,[],{isTypeOnly:u.isTypeOnly})}):[be("*",a)]}function jc(e){let t=e.trim(),n=/^type\b/.test(t),r=t.replace(/^type\s+/,""),[i,s]=Oc(r),o=[];return i&&o.push(...Hr(i,n)),s&&o.push(...Hr(s,n)),o}function Hr(e,t){let n=e.trim();if(!n)return[];if(n.startsWith("{")){let r=n.slice(1,-1).trim();return r?I(r).map(i=>{let s=i.trim(),o=t||/^type\b/.test(s),a=s.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:o}}):[]}return n.startsWith("* as ")?[{importedName:"*",localName:n.slice(5).trim(),kind:"namespace",isTypeOnly:t}]:[{importedName:"default",localName:n,kind:"default",isTypeOnly:t}]}function Oc(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r==="{"&&t++,r==="}"&&t--,r===","&&t===0)return[e.slice(0,n).trim(),e.slice(n+1).trim()]}return[e.trim(),null]}function Sn(e,t,n){let r=$(e,t);return r?Wc(e,t,r):Mc(e,t,n)}function Mc(e,t,n){return[...$c(e,t,n),...Bc(e,t,n),...Vc(e,t,n)]}function $c(e,t,n){let r=[],i=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of n.matchAll(i)){if(typeof s.index!="number")continue;let o=s[1]??"",a=s[2]??"",c=I(o).map(p=>Uc(p.trim())).filter(p=>!!p),l=Ae(n,s.index),u=Ae(n,s.index+s[0].length-1);r.push({kind:"named",sourcePath:z(e,t,a),names:c,startLine:l,endLine:u})}return r}function Bc(e,t,n){let r=[],i=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of n.matchAll(i)){if(typeof s.index!="number")continue;let o=s[2]??"",a=Ae(n,s.index),c=Ae(n,s.index+s[0].length-1);r.push({kind:"star-as",sourcePath:z(e,t,o),names:s[1]?[s[1]]:[],startLine:a,endLine:c})}return r}function Vc(e,t,n){let r=[],i=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of n.matchAll(i)){if(typeof s.index!="number")continue;let o=s[1]??"",a=Ae(n,s.index),c=Ae(n,s.index+s[0].length-1);r.push({kind:"star",sourcePath:z(e,t,o),names:[],startLine:a,endLine:c})}return r}function Uc(e){if(!e)return null;let t=e.replace(/^type\s+/,"").trim();if(!t)return null;let n=t.match(/^(\w+)\s+as\s+(\w+)$/);if(n)return n[2]??null;let r=t.match(/^(\w+)$/);return r?r[1]??null:null}function Ae(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)e.charCodeAt(r)===10&&n++;return n}function Wc(e,t,n){let r=[];for(let i of n.rootNode.descendantsOfType("export_statement")){let s=zc(e,t,i);if(s===void 0)continue;let o=i.startPosition.row,a=i.endPosition.row,c=Hc(i,s,o,a);r.push(c)}return r}function zc(e,t,n){let r=R(n,"string");if(!r)return;let i=R(r,"string_fragment");if(i)return z(e,t,i.text)}function Hc(e,t,n,r){let i=R(e,"export_clause");if(i){let o=[];for(let a of i.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&o.push((l??c).text)}return{kind:"named",sourcePath:t,names:o,startLine:n,endLine:r}}let s=R(e,"namespace_export");if(s){let o=s.namedChildren.find(a=>a.type==="identifier"||a.type==="type_identifier")?.text;return{kind:"star-as",sourcePath:t,names:o?[o]:[],startLine:n,endLine:r}}return{kind:"star",sourcePath:t,names:[],startLine:n,endLine:r}}function qr(e,t,n){return bt(e,t,{java:r=>qc(e,t,r),kotlin:r=>Kc(e,t,r),scala:r=>Xc(e,t,r)},()=>A(n,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(r,i)=>{let s=r[1]?.trim();return s?Jc(e,t,s,i):[]}),n)}function qc(e,t,n){let r=x(n,new Set(["import_declaration"])),i=[];for(let s of n.rootNode.descendantsOfType("import_declaration")){let o=s.children.some(p=>p.type==="asterisk"),c=s.namedChildren.find(p=>p.type==="scoped_identifier")??s.namedChildren.find(p=>p.type==="identifier");if(!c)continue;let l=c.text;if(o){i.push(Ne("*",S(e,l,k)));continue}let u=l.split(".").pop()??l;i.push(y(u,u,S(e,l,k),r))}return i}function Kc(e,t,n){let r=x(n,new Set(["import_header","import_list"])),i=[];for(let s of n.rootNode.descendantsOfType("import_header")){let o=s.namedChildren.find(m=>m.type==="identifier");if(!o)continue;let a=s.namedChildren.some(m=>m.type==="wildcard_import"),c=s.namedChildren.find(m=>m.type==="import_alias");if(a){i.push(Ne("*",S(e,o.text,k)));continue}let l=o.text,u=l.split(".").pop()??l,d=c?.namedChild(0)?.text??u;i.push(y(u,d,S(e,l,k),r))}return i}function Xc(e,t,n){let r=x(n,new Set(["import_declaration"])),i=[];for(let s of n.rootNode.descendantsOfType("import_declaration")){let o=s.namedChildren.find(p=>p.type==="namespace_selectors"||p.type==="namespace_wildcard"),a=s.namedChildren.filter(p=>p!==o&&(p.type==="identifier"||p.type==="stable_identifier")),c=a.map(p=>p.text).join(".");if(!c)continue;if(o?.type==="namespace_wildcard"){i.push(Ne("*",S(e,c,k)));continue}if(o?.type==="namespace_selectors"){for(let p of o.namedChildren)if(p.type==="arrow_renamed_identifier"){let[d,m]=p.namedChildren;if(!d)continue;let h=d.text,V=m?.text??h;if(h==="_")continue;i.push(y(h,V,S(e,`${c}.${h}`,k),r))}else if(p.type==="identifier"){let d=p.text;i.push(y(d,d,S(e,`${c}.${d}`,k),r))}continue}let l=a[a.length-1]?.text??c,u=a.slice(0,-1).map(p=>p.text).join(".")||c;i.push(y(l,l,S(e,u&&a.length>1?`${u}.${l}`:c,k),r))}return i}function Jc(e,t,n,r){if(n.includes("{")&&n.includes("}")){let i=n.slice(0,n.indexOf("{")).replace(/\.$/,"").trim(),s=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return I(s).flatMap(o=>{let a=o.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),u=c?.trim();if(!u||u==="_")return[];let p=(l??u.split(".").pop()??u).trim(),d=u==="_"?i:`${i}.${u}`.replace(/\.\./g,".");return[B(e,t,r,d,u,p)]})}return[B(e,t,r,n,n.split(".").pop()??n,n.split(".").pop()??n)]}function Xr(e,t,n){return j(e,t,r=>Qc(e,t,r),()=>A(n,/^[ \t]*use\s+(.+?)\s*;$/gm,(r,i)=>{let s=r[1]?.trim();return s?I(s).flatMap(o=>{let a=o.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),u=c?.trim()??a,p=u.split("\\").pop()??u,d=(l??p).trim();return[B(e,t,i,u,p,d,S(e,u.replace(/\\/g,"."),xe))]}):[]}),n)}function Qc(e,t,n){let r=x(n,new Set(["namespace_use_declaration"])),i=[],s=(o,a,c)=>{i.push(y(a,c,S(e,o.replace(/\\/g,"."),xe),r))};for(let o of n.rootNode.descendantsOfType("namespace_use_declaration")){let a=o.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=o.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:u,localName:p,qualified:d}=Kr(l,c);u&&s(d,u,p)}continue}for(let c of o.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:u,qualified:p}=Kr(c,"");l&&s(p,l,u)}}return i}function Kr(e,t){let n=e.namedChildren.find(l=>l.type==="qualified_name"),r=e.namedChildren.filter(l=>l.type==="name"),i="";n?i=n.text:r.length>=1&&(i=r[0].text);let s=n&&r.length>0?r[r.length-1]:null,o=i.split("\\").pop()??i,a=s?.text??o,c=t?`${t}\\${i}`:i;return{importedName:o,localName:a,qualified:c}}function Qr(e,t,n){return j(e,t,r=>Gc(e,t,r),()=>Zc(n).flatMap(r=>tl(e,t,r,n)),n)}function Gc(e,t,n){let r=x(n,new Set(["import_statement","import_from_statement"])),i=[];for(let s of n.rootNode.descendantsOfType("import_statement"))for(let o of s.namedChildren){let a=Jr(o);if(!a)continue;let c=Pe(e,t,a.qualifiedName);i.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:r.has(a.localName),usedMembers:[]})}for(let s of n.rootNode.descendantsOfType("import_from_statement")){let o=s.namedChild(0);if(!o)continue;let a=Yc(o);if(a===null)continue;let c=Pe(e,t,a);for(let l=1;l<s.namedChildCount;l+=1){let u=s.namedChild(l);if(u.type==="wildcard_import"){i.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let p=Jr(u);p&&i.push({importedName:p.qualifiedName,localName:p.localName,sourcePath:c,kind:"named",used:r.has(p.localName),usedMembers:[]})}}return i}function Jr(e){if(e.type==="aliased_import"){let t=e.namedChild(0),n=e.namedChild(1);return!t||!n?null:{qualifiedName:t.text,localName:n.text}}if(e.type==="dotted_name"){let t=e.text;return{qualifiedName:t,localName:t.split(".")[0]??t}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function Yc(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let t=R(e,"import_prefix")?.text??"",n=R(e,"dotted_name")?.text??"";return`${t}${n}`}return null}function Zc(e){let t=e.split(`
98
+ `),n=[],r=0;for(let i=0;i<t.length;i++){let s=t[i],o=s.trimStart(),a=r;if(r+=s.length+1,!o.startsWith("import ")&&!o.startsWith("from "))continue;let c=s,l=a+s.length,u=pn(s);for(;i+1<t.length&&(u>0||c.trimEnd().endsWith("\\"));){i++;let d=t[i];c+=`
99
+ ${d}`,l+=1+d.length,u+=pn(d),r+=d.length+1}let p=el(c);p&&n.push({...p,start:a,end:l})}return n}function el(e){let t=e.replace(/\\\s*\n/g," ").trim();if(t.startsWith("import "))return{kind:"import",module:null,clause:t.slice(7).trim()};let n=t.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!n)return null;let r=n[2].trim();return r.startsWith("(")&&r.endsWith(")")&&(r=r.slice(1,-1).trim()),{kind:"from",module:n[1],clause:r}}function tl(e,t,n,r){let i=le(r,n.start,n.end),s=n.clause.replace(/\n/g," ").trim();if(n.kind==="import")return I(s).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[u,p]=l.split(/\s+as\s+/),d=u.trim(),m=(p??d.split(".")[0]??d).trim(),h=Pe(e,t,d),V=we(i,m);return[{importedName:d,localName:m,sourcePath:h,kind:"namespace",used:T(i,m)||V.length>0,usedMembers:V}]});let o=n.module?Pe(e,t,n.module):null,a=[];for(let c of I(s)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:o,kind:"side-effect",used:!0,usedMembers:[]});continue}let[u,p]=l.split(/\s+as\s+/),d=(p??u).trim();a.push({importedName:u.trim(),localName:d,sourcePath:o,kind:"named",used:T(i,d),usedMembers:[]})}return a}import{basename as nl}from"path";function Gr(e,t,n){return j(e,t,r=>il(e,t,r),()=>rl(e,t,n),n)}function rl(e,t,n){return A(n,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(r,i)=>{let s=r[1],o=r[2];if(!s||!o)return[];let a=s==="require_relative"?mt(e,t,o):null;if(a){let c=Yr(o);return[ne(c,c,a,T(i,c))]}return[be(o,a)]})}function il(e,t,n){let r=x(n,new Set([])),i=[],s=new Set(["require","require_relative","load"]);for(let o of n.rootNode.descendantsOfType("call")){let a=o.namedChild(0);if(!a||a.type!=="identifier"||!s.has(a.text))continue;let l=o.namedChildren.find(m=>m.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let p=l.namedChildren.find(m=>m.type==="string_content")?.text;if(!p)continue;let d=a.text==="require_relative"?mt(e,t,p):null;if(d){let m=Yr(p);i.push(y(m,m,d,r))}else i.push(be(p,d))}return i}function Yr(e){return ot(nl(e).replace(/\.[^.]+$/,""),/_/)}function Zr(e,t,n){return j(e,t,r=>sl(e,t,r),()=>A(n,/^[ \t]*use\s+(.+?)\s*;$/gm,(r,i)=>{let s=r[1]?.trim();return s?ol(e,t,s,i):[]}),n)}function sl(e,t,n){let r=x(n,new Set(["use_declaration"])),i=[];for(let s of n.rootNode.descendantsOfType("use_declaration")){let o=s.namedChild(0);if(o)for(let a of Xe(o,"")){if(!a.importedName||a.importedName==="*")continue;let c=Z(e,t,a.qualifiedName)??Z(e,t,a.qualifiedName.split("::").slice(0,-1).join("::"));i.push(y(a.importedName,a.localName,c,r))}}return i}function Xe(e,t){switch(e.type){case"identifier":case"super":case"crate":{let n=e.text;return[{qualifiedName:vt(t,n),importedName:n,localName:n}]}case"self":{let n=t.split("::").filter(Boolean).pop()??"self";return[{qualifiedName:t||"self",importedName:n,localName:n}]}case"scoped_identifier":{let n=e.text,r=n.split("::").pop()??n;return[{qualifiedName:vt(t,n),importedName:r,localName:r}]}case"scoped_use_list":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let i=vt(t,n.text),s=[];for(let o of r.namedChildren)s.push(...Xe(o,i));return s}case"use_list":{let n=[];for(let r of e.namedChildren)n.push(...Xe(r,t));return n}case"use_as_clause":{let n=e.namedChild(0),r=e.namedChild(1);if(!n||!r)return[];let i=Xe(n,t),s=r.text;return i.map(o=>({...o,localName:s}))}case"use_wildcard":{let n=e.namedChild(0),r=n?n.text:"";return[{qualifiedName:vt(t,`${r}::*`),importedName:"*",localName:"*"}]}default:return[]}}function vt(e,t){return e?t?`${e}::${t}`:e:t}function ol(e,t,n,r){let i=n.trim();if(i.includes("{")&&i.includes("}")){let u=i.slice(0,i.indexOf("{")).replace(/::$/,"").trim(),p=i.slice(i.indexOf("{")+1,i.lastIndexOf("}")).trim();return I(p).flatMap(d=>{let m=d.trim();if(!m)return[];if(m==="self"){let E=u.split("::").filter(Boolean).pop();return E?[B(e,t,r,u,E,E)]:[]}let[h,V]=m.split(/\s+as\s+/),g=h?.trim();if(!g)return[];let M=(V??g.split("::").pop()??g).trim(),pe=`${u}::${g}`.replace(/::::/g,"::");return[B(e,t,r,pe,g.split("::").pop()??g,M,Z(e,t,u))]})}let[s,o]=i.split(/\s+as\s+/),a=s?.trim()??i,c=(o??a.split("::").pop()??a).trim(),l=Z(e,t,a)??Z(e,t,a.split("::").slice(0,-1).join("::"));return[B(e,t,r,a,a.split("::").pop()??a,c,l)]}function ei(e,t,n){let r=$(e,t);if(r)return al(e,t,r);let i=[];for(let s of n.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let o=s[1]?.trim();o&&i.push(...ll(e,t,o))}return i}function al(e,t,n){let r=[];for(let i of n.rootNode.descendantsOfType("use_declaration")){if(!cl(i))continue;let s=i.namedChildren.find(o=>o.type!=="visibility_modifier");if(s)for(let o of Xe(s,""))o.importedName&&r.push(xn(e,t,o.qualifiedName))}return r}function cl(e){for(let t of e.children)if(t.type==="visibility_modifier"&&t.text.startsWith("pub"))return!0;return!1}function ll(e,t,n){let r=n.trim();if(r.includes("{")&&r.includes("}")){let i=r.slice(0,r.indexOf("{")).replace(/::$/,"").trim(),s=r.slice(r.indexOf("{")+1,r.lastIndexOf("}")).trim();return I(s).flatMap(o=>{let a=o.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${i}::${c?.trim()??a}`.replace(/::::/g,"::");return[xn(e,t,l)]})}return[xn(e,t,r)]}function xn(e,t,n){return{specifier:n,sourcePath:Z(e,t,n)??Z(e,t,n.split("::").slice(0,-1).join("::"))}}function ue({language:e,extensions:t,imports:n,parseImports:r}){return{language:e,extensions:t,capabilities:{imports:n},parseImports:r}}function ti(e,t){let n=t.toLowerCase();for(let r of e)for(let i of r.extensions)if(n.endsWith(i))return r;return null}var ul={language:"javascript",extensions:ye,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:yn,parseReExports:Sn},pl=ue({language:"python",extensions:ct,imports:"ast-with-regex-fallback",parseImports:Qr}),dl=ue({language:"jvm",extensions:k,imports:"ast-dispatch-with-regex-fallback",parseImports:qr}),ml={language:"rust",extensions:lt,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Zr,parseExports:ei},fl=ue({language:"ruby",extensions:ut,imports:"ast-with-regex-fallback",parseImports:Gr}),gl=ue({language:"c/cpp",extensions:pt,imports:"ast-with-regex-fallback",parseImports:Mr}),hl=ue({language:"dotnet",extensions:ae,imports:"ast-dispatch-with-regex-fallback",parseImports:Wr}),yl={language:"dart",extensions:dt,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:Vr,parseExports:Ur},Sl=ue({language:"php",extensions:xe,imports:"ast-with-regex-fallback",parseImports:Xr}),xl=ue({language:"clojure",extensions:Re,imports:"regex-only",parseImports:Br}),ni=[ul,pl,dl,ml,fl,gl,hl,yl,Sl,xl];function _t(e){return ti(ni,e)}function af(e){return ni.find(n=>n.language===e)?.capabilities??null}var bn={clearGroups:["whole-project","source-file"]},bl=b("source-imports",bn),Nl=b("source-exports",bn),El=b("source-reexports",bn),ri=X({kind:"source-imports",invalidation:J("source-imports"),serialize:vl,deserialize:_l}),ii=X({kind:"source-reexports",invalidation:J("source-reexports"),serialize:Cl,deserialize:Tl});function si(e,t){let n=v(t);return El.get(e,n,()=>{let r=_t(n);if(!r?.parseReExports)return[];let i=f(e,n);if(!i)return[];let s=U(e,n,i),o=sn(e),a=ii.read(e,n,s);if(a?.resolutionFingerprint===o)return a.reExports;let c=r.parseReExports(e,n,i);return ii.write(e,n,s,{resolutionFingerprint:o,reExports:c}),c})}function oi(e,t){let n=v(t);return bl.get(e,n,()=>{let r=_t(n);if(!r)return[];let i=f(e,n);if(!i)return[];let s=U(e,n,i),o=sn(e),a=ri.read(e,n,s);if(a?.resolutionFingerprint===o)return a.imports;let c=r.parseImports(e,n,i);return ri.write(e,n,s,{resolutionFingerprint:o,imports:c}),c})}function hf(e,t){let n=v(t);return Nl.get(e,n,()=>{let r=_t(n);if(!r?.parseExports)return[];let i=f(e,n);return i?r.parseExports(e,n,i):[]})}function vl(e){return JSON.stringify(e)}function _l(e){try{let t=JSON.parse(e);return!ie(t)||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.imports)?null:{resolutionFingerprint:t.resolutionFingerprint,imports:t.imports}}catch{return null}}function Cl(e){return JSON.stringify(e)}function Tl(e){try{let t=JSON.parse(e);return!ie(t)||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.reExports)?null:{resolutionFingerprint:t.resolutionFingerprint,reExports:t.reExports}}catch{return null}}function Ct(e){return{forFile(t,n){return ai(e,t,n)},forFiles(t,n){let r=new Map;for(let i of t)r.set(i,ai(e,i,n));return r}}}function ai(e,t,n){let r={file:t},i=n.facts||n.identifiers;if(n.text&&(r.text=f(e,t)),n.lines&&(r.lines=Me(e,t)),n.ast&&(r.ast=$(e,t)),n.imports&&(r.imports=oi(e,t)),n.reexports&&(r.reexports=si(e,t)),i){let s=zt(e,t),o=s.facts;n.facts&&(r.facts=o),s.unavailable&&(r.sourceFactsUnavailable=s.unavailable),n.identifiers&&o&&(r.identifiers=o.fileIdentifiers,r.identifierLineMap=o.identifierLineMap)}return r}function vf(e,t){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
100
+ FROM global_symbols gs
101
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
102
+ JOIN documents d ON der.document_id = d.id
103
+ WHERE ${t.where}
104
+ ${e.pathExclusionsFor("d")}
105
+ ${li(t.orderBy)}
106
+ ${ui(t.limit)}`,...t.params??[])}function _f(e,t){return e.all(`SELECT
107
+ gs.id,
108
+ gs.symbol,
109
+ c.document_id,
110
+ MIN(c.start_line) AS start_line,
111
+ 0 AS start_char,
112
+ MAX(c.end_line) AS end_line,
113
+ 0 AS end_char,
114
+ d.relative_path,
115
+ gs.display_name,
116
+ gs.documentation
117
+ FROM global_symbols gs
118
+ JOIN mentions m ON m.symbol_id = gs.id
119
+ JOIN chunks c ON m.chunk_id = c.id
120
+ JOIN documents d ON c.document_id = d.id
121
+ WHERE m.role = 1
122
+ AND ${t.where}
123
+ ${e.pathExclusionsFor("d")}
124
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
125
+ ${li(t.orderBy)}
126
+ ${ui(t.limit)}`,...t.params??[])}function li(e){return e?`ORDER BY ${e}`:""}function ui(e){return typeof e=="number"?`LIMIT ${e}`:""}function pi(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function di(e){if(!e)return null;let t=ci(e);if(t)return t.replace(/\n/g," ");let n=e.indexOf("|");if(n===-1)return e.replace(/\n/g," ");let r=e.slice(n+1);return(ci(r)??r).replace(/\n/g," ")}function ci(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function Il(e,t={}){if(de(e.symbol)!==null)return t.includeClassMemberFallbacks===!0;let i=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(i)}function Nn(e,t,n={}){let r=new Map;for(let s of t)e.length>0&&!Il(s,{includeClassMemberFallbacks:n.includeClassMemberFallbacks})||r.set(s.id,s);for(let s of e)r.set(s.id,s);let i=[...r.values()];return n.sort?i.sort((s,o)=>s.start_line-o.start_line||s.end_line-o.end_line||s.symbol.localeCompare(o.symbol)):i}function $f(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let r=t.get(n.leaf)??[];r.push(n),t.set(n.leaf,r)}return t}var Fl=b("file-definitions",{clearGroups:["definition-catalog"]}),Ll=Ee("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),kl=b("file-function-like-definitions",{clearGroups:["definition-catalog"]}),mi=new WeakMap;function vn(e,t,n={}){return n.includeClassMemberFallbacks?En(e,t,void 0,{includeClassMemberFallbacks:!0}):Fl.get(e,t,()=>{let r=yi(e,t);if(r)return r;let i=En(e,t),s=Oe(e),o=Ct(e).forFile(t,{text:!0}).text;return s&&o&&hi.write(e,t,U(e,t,o),{projectFingerprint:s,definitions:i.map(a=>({...a}))}),i})}function Rl(e,t){return kl.get(e,t,()=>{let n=yi(e,t);return n?n.filter(r=>r.isFunctionLike):En(e,t,r=>r.isFunctionLike)})}var hi=X({kind:"file-definitions",invalidation:J("file-definitions"),serialize:Pl,deserialize:Dl});function yi(e,t){let n=Oe(e);if(!n)return null;let r=Ct(e).forFile(t,{text:!0}).text;if(!r)return null;let i=hi.read(e,t,U(e,t,r));return i?wl(i,n,t):null}function Pl(e){return JSON.stringify(e)}function Dl(e){try{let t=JSON.parse(e);return!ie(t)||typeof t.projectFingerprint!="string"||!Array.isArray(t.definitions)?null:{projectFingerprint:t.projectFingerprint,definitions:t.definitions}}catch{return null}}function wl(e,t,n){if(e.projectFingerprint!==t)return null;let r=[];for(let i of e.definitions){let s=Al(i,n);if(!s)return null;r.push(s)}return r}function Al(e,t){return!ie(e)||typeof e.symbolId!="number"||typeof e.symbol!="string"||typeof e.documentId!="number"||typeof e.startLine!="number"||typeof e.startChar!="number"&&e.startChar!==void 0||typeof e.endLine!="number"||typeof e.endChar!="number"&&e.endChar!==void 0||e.relativePath!==t||typeof e.leaf!="string"||typeof e.parentTypeName!="string"&&e.parentTypeName!==null||typeof e.isFunctionLike!="boolean"||typeof e.isTypeLike!="boolean"||typeof e.kind!="number"&&e.kind!==null||typeof e.documentation!="string"&&e.documentation!==null||typeof e.enclosingSymbol!="string"&&e.enclosingSymbol!==null?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,startChar:e.startChar,endLine:e.endLine,endChar:e.endChar,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function En(e,t,n,r={}){let i=Nn(jl(e,t),Ol(e,t),{sort:!0,includeClassMemberFallbacks:r.includeClassMemberFallbacks}).map(Si);return n&&(i=i.filter(n)),bi(e,t,i)}function jl(e,t){return e.all(`SELECT
127
+ gs.id,
128
+ gs.symbol,
129
+ der.document_id,
130
+ der.start_line,
131
+ der.start_char,
132
+ der.end_line,
133
+ der.end_char,
134
+ d.relative_path,
135
+ gs.display_name,
136
+ gs.kind,
137
+ gs.documentation,
138
+ gs.enclosing_symbol
139
+ FROM global_symbols gs
140
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
141
+ JOIN documents d ON der.document_id = d.id
142
+ WHERE d.relative_path = ?
143
+ ${e.symbolNoiseFor("gs")}
144
+ ORDER BY der.start_line, der.end_line`,t)}function Ol(e,t){return e.all(`SELECT
145
+ gs.id,
146
+ gs.symbol,
147
+ c.document_id,
148
+ MIN(c.start_line) AS start_line,
149
+ 0 AS start_char,
150
+ MAX(c.end_line) AS end_line,
151
+ 0 AS end_char,
152
+ d.relative_path,
153
+ gs.display_name,
154
+ gs.kind,
155
+ gs.documentation,
156
+ gs.enclosing_symbol
157
+ FROM global_symbols gs
158
+ JOIN mentions m ON m.symbol_id = gs.id
159
+ JOIN chunks c ON m.chunk_id = c.id
160
+ JOIN documents d ON c.document_id = d.id
161
+ WHERE d.relative_path = ?
162
+ AND m.role = 1
163
+ ${e.symbolNoiseFor("gs")}
164
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
165
+ ORDER BY start_line, end_line`,t)}function Si(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,startChar:e.start_char??0,endLine:e.end_line,endChar:e.end_char??0,relativePath:e.relative_path,leaf:Rn(e.symbol),parentTypeName:de(e.symbol),isFunctionLike:Pn(e.symbol),isTypeLike:Ye(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function Bf(e,t={}){return Ml(e,t.scope)}function Ml(e,t){return je(e,{scope:t,includeIgnored:!1}).flatMap(n=>vn(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function Vf(e,t){return je(e,{scope:t,includeIgnored:!1}).flatMap(n=>Rl(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function Uf(e,t){let n=Ll.get(e,()=>new WeakMap),r=n.get(t.symbolMatches);r||(r=new Map,n.set(t.symbolMatches,r));let i=JSON.stringify({scope:t.scope??null,sqlPrefilter:t.sqlPrefilter??null}),s=r.get(i);if(s)return[...s];let o=fi($l(e,t.scope,t.sqlPrefilter)),a=fi(Bl(e,t.scope,t.sqlPrefilter)),c=new Set([...o.keys(),...a.keys()]),l=[];for(let u of[...c].sort()){if(e.isIgnored(u))continue;let p=Nn(o.get(u)??[],a.get(u)??[],{sort:!0}).filter(d=>t.symbolMatches(d.symbol));p.length!==0&&l.push(...bi(e,u,p.map(Si)))}return r.set(i,l),[...l]}function $l(e,t,n){let r=t?"AND d.relative_path LIKE ?":"",i=n?`AND ${xi("gs",n)}`:"",s=t?[`%${t}%`]:[];return e.all(`SELECT
166
+ gs.id,
167
+ gs.symbol,
168
+ der.document_id,
169
+ der.start_line,
170
+ der.start_char,
171
+ der.end_line,
172
+ der.end_char,
173
+ d.relative_path,
174
+ gs.display_name,
175
+ gs.kind,
176
+ gs.documentation,
177
+ gs.enclosing_symbol
178
+ FROM global_symbols gs
179
+ JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
180
+ JOIN documents d ON der.document_id = d.id
181
+ WHERE 1 = 1
182
+ ${e.pathExclusionsFor("d")}
183
+ ${r}
184
+ ${i}
185
+ ${e.symbolNoiseFor("gs")}
186
+ ORDER BY d.relative_path, der.start_line, der.end_line`,...s)}function Bl(e,t,n){let r=t?"AND d.relative_path LIKE ?":"",i=n?`AND ${xi("gs",n)}`:"",s=t?[`%${t}%`]:[];return e.all(`SELECT
187
+ gs.id,
188
+ gs.symbol,
189
+ c.document_id,
190
+ MIN(c.start_line) AS start_line,
191
+ 0 AS start_char,
192
+ MAX(c.end_line) AS end_line,
193
+ 0 AS end_char,
194
+ d.relative_path,
195
+ gs.display_name,
196
+ gs.kind,
197
+ gs.documentation,
198
+ gs.enclosing_symbol
199
+ FROM global_symbols gs
200
+ JOIN mentions m ON m.symbol_id = gs.id
201
+ JOIN chunks c ON m.chunk_id = c.id
202
+ JOIN documents d ON c.document_id = d.id
203
+ WHERE m.role = 1
204
+ AND NOT EXISTS (
205
+ SELECT 1
206
+ FROM defn_enclosing_ranges existing_der
207
+ WHERE existing_der.symbol_id = gs.id
208
+ )
209
+ ${e.pathExclusionsFor("d")}
210
+ ${r}
211
+ ${i}
212
+ ${e.symbolNoiseFor("gs")}
213
+ GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
214
+ ORDER BY d.relative_path, start_line, end_line`,...s)}function Vl(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function xi(e,t){return t==="callable"?Vl(e):Ul(e)}function Ul(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function fi(e){let t=new Map;for(let n of e){let r=t.get(n.relative_path);r?r.push(n):t.set(n.relative_path,[n])}return t}function Wf(e,t,n={}){if(t.length===0)return[];let r=t.flatMap(i=>vn(e,i)).filter(i=>!e.isIgnored(i.relativePath));return n.onlyDocumented&&(r=r.filter(i=>i.documentation!==null&&i.documentation!=="")),n.sort&&(r=r.sort((i,s)=>i.relativePath.localeCompare(s.relativePath)||i.startLine-s.startLine||i.endLine-s.endLine)),r.map(i=>({startLine:i.startLine,endLine:i.endLine,symbol:i.symbol,shortName:kn(i.symbol),signature:pi(di(i.documentation)),relativePath:i.relativePath,enclosingSymbol:i.enclosingSymbol}))}function Wl(e){let t=new Map,n=e.map((r,i)=>({definition:r,index:i,span:r.endLine-r.startLine})).sort((r,i)=>r.span-i.span||r.index-i.index);for(let{definition:r}of n)for(let i=r.startLine;i<=r.endLine;i+=1)t.has(i)||t.set(i,r);return t}function zf(e,t){let n=mi.get(e);return n||(n=Wl(e),mi.set(e,n)),n.get(t)??null}function Hf(e,t){let n=vn(e,t.relative_path).find(r=>r.symbolId===t.id);return n?{symbolId:n.symbolId,symbol:n.symbol,documentId:n.documentId,startLine:n.startLine,startChar:n.startChar,endLine:n.endLine,endChar:n.endChar,relativePath:n.relativePath}:{symbolId:t.id,symbol:t.symbol,documentId:t.document_id,startLine:t.start_line,startChar:t.start_char??0,endLine:t.end_line,endChar:t.end_char??0,relativePath:t.relative_path}}function bi(e,t,n){let r=Ct(e).forFile(t,{text:!0}).text,i=Ht(e,t);return i?Jl(n,i,r):r?zl(n,r):n}function zl(e,t){let n=t.split(/\r?\n/),r=Hl(e,n),i=ql(e,r),s=Kl(i,n);return Xl(e,s)}function Hl(e,t){let n=e.some(i=>Tt(i.symbol))?nu(t):null,r=new Map;for(let i of e)r.set(i.symbolId,tu(t,n,i));return r}function ql(e,t){return e.filter(n=>Tt(n.symbol)).map(n=>({definition:n,startLine:t.get(n.symbolId)??n.startLine})).sort((n,r)=>n.startLine-r.startLine||n.definition.startLine-r.definition.startLine||n.definition.symbol.localeCompare(r.definition.symbol))}function Kl(e,t){let n=new Map;for(let r=0;r<e.length;r+=1){let i=e[r],s=e[r+1],o=s?Math.max(i.startLine,s.startLine-1):t.length-1;n.set(i.definition.symbolId,{startLine:i.startLine,endLine:ru(t,i.definition,i.startLine,o)})}return n}function Xl(e,t){return e.map(n=>{let r=t.get(n.symbolId);return r?{...n,startLine:r.startLine,endLine:r.endLine}:n})}function Jl(e,t,n=null){let r=new Map;for(let i of t){let s=r.get(i.name);s?s.push(i):r.set(i.name,[i])}return e.map(i=>{if(!eu(i)||!i.leaf)return gi(i,n);let s=r.get(i.leaf);if(!s||s.length===0)return gi(i,n);let o=n?Ql(i,s,n):null;if(o)return{...i,startLine:o.startLine,endLine:o.endLine};let a=s[0],c=Math.abs(a.startLine-i.startLine);for(let l=1;l<s.length;l+=1){let u=s[l],p=Math.abs(u.startLine-i.startLine);p<c&&(a=u,c=p)}return{...i,startLine:a.startLine,endLine:a.endLine}})}function Ql(e,t,n){let r=Gl(e.symbol);if(!r)return null;let i=n.split(/\r?\n/),s=new RegExp(`\\b${H(r)}\\b`);for(let o of t){let a=Yl(i,o.startLine);if(a&&s.test(a))return o}return null}function Gl(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function Yl(e,t){for(let n=t;n>=0;n-=1){let r=e[n]?.trim()??"";if(r){if(/^impl\b/.test(r))return Zl(e,n,t);if(/^(?:struct|enum|trait|mod)\b/.test(r))return null}}return null}function Zl(e,t,n){let r=[];for(let i=t;i<=n;i+=1){let s=e[i]??"";if(r.push(s),s.includes("{"))break}return r.join(" ")}function eu(e){return Tt(e.symbol)?!0:Ye(e.symbol)==="term"&&de(e.symbol)===null}function gi(e,t){if(!t||!e.leaf||Ye(e.symbol)!=="term"||de(e.symbol)!==null)return e;let n=H(e.leaf),r=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${n}\\b`),s=t.split(/\r?\n/).findIndex(o=>r.test(o));return s>=0?{...e,startLine:s,endLine:s}:e}function tu(e,t,n){if(!Tt(n.symbol))return n.startLine;let r=Math.max(0,Math.min(n.startLine,e.length-1));if(!t)return r;let i=t.get(n.leaf);if(!i||i.length===0)return r;let s=null;for(let o of i){let a=Math.abs(o-n.startLine);(!s||a<s.distance)&&(s={line:o,distance:a})}return s?.line??r}function nu(e){let t=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,n=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,r=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,i=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,o=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let u of c.matchAll(t))u[1]&&o(u[1],a);for(let u of c.matchAll(n))u[1]&&o(u[1],a);let l=c.match(r);l?.[1]&&o(l[1],a);for(let u of c.matchAll(i))u[1]&&o(u[1],a)}return s}function ru(e,t,n,r){let i=Math.max(n,Math.min(e.length-1,r)),s=Math.max(n,Math.min(i,t.endLine)),o=0,a=0,c=!1;for(let l=n;l<=i;l+=1){let u=iu(e[l]??"");for(let p of u)p==="{"?(o+=1,c=!0):p==="}"?o=Math.max(0,o-1):p==="("?a+=1:p===")"&&(a=Math.max(0,a-1));if(c&&o===0||!c&&a===0&&l>=s)return l}return s}function iu(e){let t="",n=null,r=!1;for(let i=0;i<e.length;i+=1){let s=e[i],o=e[i+1];if(!n&&s==="/"&&o==="/"){t+=" ".repeat(e.length-i);break}if(n){if(r){r=!1,t+=" ";continue}if(s==="\\"){r=!0,t+=" ";continue}s===n&&(n=null),t+=" ";continue}if(s==='"'||s==="'"||s==="`"){n=s,t+=" ";continue}t+=s}return t}function Tt(e){return e.includes("().")}function qf(e){let t=Ln(e);if("kind"in t)return[];let n=[];for(let r=t.descriptors.length-2;r>=0;r-=1){let i=t.descriptors[r];i?.suffix==="type"&&i.name&&n.push(i.name)}return n}var su=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function Jf(e){let t=e.toLowerCase();return su.some(n=>t.endsWith(n))}import{createRequire as ou}from"module";var Ni=ou(import.meta.url),Je,It;function au(){if(Je!==void 0)return Je;try{Je=Ni("ts-morph")}catch{Je=null}return Je}function Yf(){if(It)return It;let e=au();if(!e)return"ts-morph:unavailable";let t="unknown";try{t=Ni("ts-morph/package.json").version??"unknown"}catch{}return It=`ts-morph:${t}:typescript:${e.ts.version}`,It}function Zf(e,t){return t.map(n=>({tsconfigPath:n,project:new e.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function eg(e,t,n){return{language:"typescript",availability:()=>({available:!1,reason:e,tsconfigPath:t,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}function ng(e,t){let n=new Map(e.map(i=>[i.symbol,i])),r=new Map(e.map(i=>[i.symbolId,[]]));for(let i of t.values())for(let s of i){let o=n.get(s.targetSymbol);o&&r.get(o.symbolId).push(s.location)}for(let[i,s]of r)r.set(i,cu(s));return r}function rg(e,t,n){let r=vi(e,t),i=vi(e,n),s=[...r].filter(p=>!i.has(p)).sort(),o=[...i].filter(p=>!r.has(p)).sort(),a=Ei(e,t),c=Ei(e,n),l=[...a].filter(p=>!c.has(p)).sort(),u=[...c].filter(p=>!a.has(p)).sort();return{passed:s.length===0&&o.length===0,expectedCount:r.size,actualCount:i.size,missing:s,extra:o,callerFiles:{passed:l.length===0&&u.length===0,expectedCount:a.size,actualCount:c.size,missing:l,extra:u}}}function Ei(e,t){let n=new Set;for(let r of e)for(let i of t.get(r.symbolId)??[])i.file!==r.relativePath&&n.add(`${r.symbol}\0${i.file}`);return n}function ig(e,t,n){let r=new Set(n),i=new Map(n.map(s=>[s,[]]));for(let s of e)for(let o of t.get(s.symbolId)??[])r.has(o.file)&&i.get(o.file).push({targetSymbol:s.symbol,location:o});for(let[s,o]of i)i.set(s,lu(o));return i}function vi(e,t){let n=new Set;for(let r of e)for(let i of t.get(r.symbolId)??[])n.add(`${r.symbol}\0${i.file}\0${i.line}\0${i.column}`);return n}function cu(e){let t=new Map;for(let n of e)t.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...t.values()].sort(_i)}function lu(e){let t=new Map;for(let n of e){let{location:r}=n;t.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...t.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||_i(n.location,r.location))}function _i(e,t){return e.file.localeCompare(t.file)||e.line-t.line||e.column-t.column}export{Ze as a,U as b,Oe as c,yu as d,Su as e,xu as f,bu as g,Nu as h,X as i,Iu as j,J as k,fr as l,lo as m,Re as n,z as o,f as p,Me as q,Wi as r,Ru as s,Pu as t,H as u,Za as v,Bd as w,Vd as x,pn as y,W as z,oe as A,Ou as B,Mu as C,$ as D,ge as E,Q as F,Ps as G,Ds as H,Ht as I,js as J,Os as K,_d as L,Ya as M,vt as N,af as O,si as P,oi as Q,hf as R,su as S,Jf as T,au as U,Yf as V,Zf as W,eg as X,ng as Y,rg as Z,ig as _,Ct as $,vf as aa,_f as ba,pi as ca,di as da,Nn as ea,$f as fa,vn as ga,Bf as ha,Ml as ia,Vf as ja,Uf as ka,Wf as la,Wl as ma,zf as na,Hf as oa,qf as pa};
215
+ //# sourceMappingURL=chunk-RU65DDUP.js.map
@@ -0,0 +1,2 @@
1
+ import{k as x}from"./chunk-6CS3UQTN.js";import{a as y,e as b}from"./chunk-FETNQCFO.js";import{z as v}from"./chunk-ADTBPVUZ.js";import{e as g,j as D,k as F,r as E,t as I}from"./chunk-BMYOV5GP.js";import{a as _,d as p}from"./chunk-3LCDIREB.js";import{spawnSync as P}from"child_process";import{createHash as U}from"crypto";import{existsSync as k}from"fs";import{dirname as L,join as T}from"path";import{fileURLToPath as j}from"url";var R=g("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]}),M=E({kind:"consumer-file-usage",invalidation:I("consumer-file-usage"),serialize:Q,deserialize:W});function Le(e,n){return{forDefinitions(r,i){return B(e,n,r,i)}}}function Me(e){let n=new Map;for(let[r,i]of e)n.set(r,new Set(i.files.map(t=>t.file)));return n}function Ne(e,n,r){return w(e,n,r).partition}function B(e,n,r,i){let t=h(r.length),s=_()?F(e):null,a=s?V(r,i,s):void 0,o=a?{workIdentity:a,workOutcome:"computed"}:{};return p("consumer-evidence.product",()=>{let l=p("consumer-evidence.provenance",()=>z(e,n,r,i),()=>({...o,definitions:r.length,semantic:i.semantic,sourceFallback:i.sourceFallback!==!1})),u=new Map;t={...t,...l.counters};let c=q(r,l.sources);return p("consumer-evidence.classify",()=>{let f=Y(e,r,l.sources,c);for(let d of r){let m=f.get(d.symbolId)??$();t.realFiles+=m.partition.realConsumers.length,t.reexportOnlyFiles+=m.partition.barrelConsumers,t.importOnlyFiles+=m.partition.importOnlyConsumers,u.set(d.symbolId,{definition:d,files:m.files,semanticIncomplete:l.incompleteSymbolIds.has(d.symbolId),semanticUnavailable:l.unavailableSymbolIds.has(d.symbolId),...m.partition})}},()=>({...o,...c,realFiles:t.realFiles,reexportOnlyFiles:t.reexportOnlyFiles,importOnlyFiles:t.importOnlyFiles})),u},()=>({...o,...t}))}function V(e,n,r){let i=U("sha256").update("consumer-evidence-v3-calibrated-semantic\0").update(r).update("\0").update(n.semantic?"semantic\0":"indexed\0").update(n.sourceFallback===!1?"no-source-fallback":"source-fallback");for(let t of e.map(s=>s.symbol).sort())i.update("\0").update(t);return i.digest("hex").slice(0,24)}function h(e){return{definitions:e,indexedFiles:0,semanticFiles:0,fallbackFiles:0,totalFiles:0,realFiles:0,reexportOnlyFiles:0,importOnlyFiles:0}}function z(e,n,r,i){let t=h(r.length),s=new Map,a=new Set,o=new Set;if(S(s,t,"indexed",n.crossFileCallerMap(r,{semantic:!1})),i.semantic){let l=x(e,r);S(s,t,"semantic",l.callers);for(let u of l.incompleteSymbolIds)a.add(u);for(let u of l.unavailableSymbolIds)o.add(u)}return i.sourceFallback!==!1&&S(s,t,"source-fallback",n.sourceFallbackCallerFiles(r)),t.totalFiles=[...s.values()].reduce((l,u)=>l+u.size,0),{sources:s,counters:t,incompleteSymbolIds:a,unavailableSymbolIds:o}}function q(e,n){return{definitions:e.length,consumerFiles:[...n.values()].reduce((r,i)=>r+i.size,0),nativeAttempted:!1,nativeUsed:!1,nativeReason:"not-attempted"}}function S(e,n,r,i){let t=0;for(let[s,a]of i){let o=e.get(s);o||(o=new Map,e.set(s,o));for(let l of a){t++;let u=o.get(l)??new Set;u.add(r),o.set(l,u)}}r==="indexed"?n.indexedFiles+=t:r==="semantic"?n.semanticFiles+=t:n.fallbackFiles+=t}function Y(e,n,r,i){let t=re(e,n,r,i);return t||H(e,n,r)}function H(e,n,r){let i=new Map;for(let t of n){let s=r.get(t.symbolId)??new Map;i.set(t.symbolId,w(e,t,[...s.keys()],s))}return i}function w(e,n,r,i=new Map){let t=[],s=0,a=0,o=b(n.symbol),l=[];for(let u of r){let c;X(e,u,n.relativePath,o)?(s++,c="reexport-only"):J(e,u,o)?(a++,c="import-only"):(t.push(u),c="real"),l.push({file:u,sources:[...i.get(u)??[]],classification:c})}return{partition:{realConsumers:t,barrelConsumers:s,importOnlyConsumers:a},files:l}}function $(){return{partition:{realConsumers:[],barrelConsumers:0,importOnlyConsumers:0},files:[]}}function J(e,n,r){if(!r)return!1;let i=v(n);if(!i)return!1;let t=R.get(e,n,()=>A(e,n,i));return t.importedLeaves.has(r)&&!t.usedLeaves.has(r)}function A(e,n,r){let i=y(e).forFile(n,{text:!0,ast:!0}),t=i.text;if(!t)return G();let s=D(e,n,t),a=M.read(e,n,s);if(a)return a;let o=K(i.ast,r);return M.write(e,n,s,o),o}function K(e,n){let r=new Set,i=new Set;if(!e)return{importedLeaves:r,usedLeaves:i};let t=n==="rust"?new Set(["use_declaration"]):n==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),s=(a,o)=>{let l=o||t.has(a.type);(a.type==="identifier"||a.type==="type_identifier"||a.type==="property_identifier"||a.type==="field_identifier")&&(l?r.add(a.text):i.add(a.text));for(let u of a.children)s(u,l)};return s(e.rootNode,!1),{importedLeaves:r,usedLeaves:i}}function G(){return{importedLeaves:new Set,usedLeaves:new Set}}function Q(e){return JSON.stringify({importedLeaves:[...e.importedLeaves],usedLeaves:[...e.usedLeaves]})}function W(e){try{let n=JSON.parse(e);return!Array.isArray(n.importedLeaves)||!Array.isArray(n.usedLeaves)?null:{importedLeaves:new Set(n.importedLeaves.filter(r=>typeof r=="string")),usedLeaves:new Set(n.usedLeaves.filter(r=>typeof r=="string"))}}catch{return null}}function X(e,n,r,i){if(!i)return!1;let t=y(e).forFile(n,{lines:!0,reexports:!0}),s=t.lines??[];if(s.length===0)return!1;let a=t.reexports??[];return O(s,a,i)}function O(e,n,r){if(e.length===0||n.length===0)return!1;let i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(`\\b${i}\\b`),s=0;for(let a=0;a<e.length;a++){if(!t.test(e[a]??""))continue;if(s++,!n.find(l=>l.startLine<=a&&a<=l.endLine))return!1}return s>0}var Z="CODEBASEIQ_NATIVE_CONSUMER_CLASSIFY",ee="CODEBASEIQ_NATIVE_KERNELS_BIN",ne="CODEBASEIQ_NATIVE_CONSUMER_CLASSIFY_MIN_FILES",N=1e3,ie=5e3,te=64*1024*1024,C;function re(e,n,r,i){let t=process.env[Z]?.toLowerCase();if(t!=="1"&&t!=="true")return i.nativeReason=t==="0"||t==="false"?"disabled":"opt-in-required",null;if(i.consumerFiles<fe())return i.nativeReason="below-threshold",null;let s=me();if(!s)return i.nativeReason="binary-missing",null;i.nativeAttempted=!0;let a=se(e,n,r),o=P(s,["consumer-classify"],{input:JSON.stringify(a),encoding:"utf8",timeout:ie,maxBuffer:te,windowsHide:!0});if(o.status!==0||o.error)return i.nativeReason=o.error?`spawn-error:${o.error.message}`:`exit-${o.status??"null"}`,null;try{let l=JSON.parse(o.stdout),u=ae(l,n);return u?(i.nativeUsed=!0,i.nativeReason="used",u):(i.nativeReason="invalid-response",null)}catch{return i.nativeReason="invalid-json",null}}function se(e,n,r){let i=new Map,t=[];for(let o of n){let l=b(o.symbol),c=[...(r.get(o.symbolId)??new Map).entries()].map(([f,d])=>{let m=i.get(f)??new Set;return l&&m.add(l),i.set(f,m),{file:f,sources:[...d]}});t.push({symbol_id:o.symbolId,leaf:l,consumer_files:c})}let s={},a={};for(let[o,l]of i){let u=v(o);if(u){let f=R.get(e,o,()=>A(e,o,u));s[o]={imported_leaves:[...f.importedLeaves],used_leaves:[...f.usedLeaves]}}let c=oe(e,o,l);c.length>0&&(a[o]=c)}return{definitions:t,file_usages:s,reexport_only_leaves:a}}function oe(e,n,r){if(r.size===0)return[];let i=y(e).forFile(n,{lines:!0,reexports:!0}),t=i.lines??[],s=i.reexports??[];return t.length===0||s.length===0?[]:[...r].filter(a=>O(t,s,a))}function ae(e,n){if(!Array.isArray(e.entries)||e.entries.length!==n.length)return null;let r=new Set(n.map(t=>t.symbolId)),i=new Map;for(let t of e.entries){let s=le(t);if(!s||!r.has(s.symbol_id))return null;i.set(s.symbol_id,{partition:{realConsumers:s.real_consumers,barrelConsumers:s.barrel_consumers,importOnlyConsumers:s.import_only_consumers},files:s.files})}for(let t of r)if(!i.has(t))return null;return i}function le(e){if(!e||typeof e!="object")return null;let n=e;if(typeof n.symbol_id!="number"||!Array.isArray(n.real_consumers)||typeof n.barrel_consumers!="number"||typeof n.import_only_consumers!="number"||!Array.isArray(n.files)||!n.real_consumers.every(i=>typeof i=="string"))return null;let r=[];for(let i of n.files){if(!i||typeof i!="object")return null;let t=i;if(typeof t.file!="string"||!Array.isArray(t.sources)||!t.sources.every(ue)||!ce(t.classification))return null;r.push({file:t.file,sources:t.sources,classification:t.classification})}return{symbol_id:n.symbol_id,real_consumers:n.real_consumers,barrel_consumers:n.barrel_consumers,import_only_consumers:n.import_only_consumers,files:r}}function ue(e){return e==="indexed"||e==="semantic"||e==="source-fallback"}function ce(e){return e==="real"||e==="reexport-only"||e==="import-only"}function fe(){let e=process.env[ne];if(!e)return N;let n=Number(e);return Number.isFinite(n)&&n>=0?n:N}function me(){if(C!==void 0)return C;let e=process.env[ee],n=process.platform==="win32"?"codebaseiq-kernels.exe":"codebaseiq-kernels";return C=[...e?[e]:[],...de().map(i=>T(i,"target","release",n))].find(i=>k(i))??null,C}function de(){let e=new Set,n=L(j(import.meta.url));for(let r=0;r<5;r++)e.add(n),n=L(n);return[...e]}export{Le as a,Me as b,Ne as c,J as d};
2
+ //# sourceMappingURL=chunk-SELM5MER.js.map
@@ -0,0 +1,2 @@
1
+ import{SymbolInformation_Kind as e}from"@c4312/scip";var n=new Map(Object.entries(e).filter(([t,r])=>Number.isInteger(Number(t))&&typeof r=="string").map(([t,r])=>[Number(t),r])),i=new Map([...n.entries()].map(([t,r])=>[r.toLowerCase(),t]));function a(t){return n.get(t)??"Unknown"}function u(){return[e.Function,e.Method,e.Macro,e.Constructor,e.Getter,e.Setter,e.StaticMethod,e.SingletonMethod,e.AbstractMethod,e.ProtocolMethod,e.TraitMethod]}function c(){return[e.Class,e.Interface,e.Struct,e.Trait,e.Type,e.TypeAlias,e.Enum,e.Union,e.Protocol]}export{n as a,i as b,a as c,u as d,c as e};
2
+ //# sourceMappingURL=chunk-SGX43S2L.js.map
@@ -0,0 +1,2 @@
1
+ import{a as R}from"./chunk-VE5AVNMP.js";import{d as Y,e as U,f as H,m as z}from"./chunk-CVYSU6BX.js";import{c as K,t as T,u as X}from"./chunk-FETNQCFO.js";import{f as k,j as N,k as E,p as A}from"./chunk-O6QTXQPJ.js";import{C as w}from"./chunk-ADTBPVUZ.js";import{u as G}from"./chunk-BMYOV5GP.js";import{C as V,F as q,d as M}from"./chunk-NNJ2KZZG.js";var J=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap;function Ve(t,e){let n=ee.get(t);n||(n=new Map,ee.set(t,n));let i=n.get(e);if(i)return i;let r=w(t,e)?.rootNode;if(!r)return n.set(e,[]),[];let o=new Set;I(r,c=>{if(c.type!=="call_expression")return;let p=c.childForFieldName("function")??c.namedChild(0),s=/^([A-Za-z_$][\w$]*(?:\.Service)?)\.of$/u.exec(p?.text.replace(/\s+/gu,"")??"");s&&o.add(s[1])});let m=A(t,e).filter(c=>!!c.sourcePath),u=new Set;for(let c of o){let p=/^([A-Za-z_$][\w$]*)\.Service$/u.exec(c);if(p){for(let s of m)s.localName===p[1]&&u.add(s.sourcePath);continue}if(c==="Service"){T(t,e).some(s=>s.leaf==="Service")&&u.add(e);for(let s of m)(s.localName??s.importedName)==="Service"&&u.add(s.sourcePath)}}let l=B([...u]).sort();return n.set(e,l),l}function qe(t,e,n={}){let r=E(t,e)?.filter(a=>!n.ranges||n.ranges.some(d=>a.line>=d.startLine&&a.line<=d.endLine));if(!r)return{targets:[],unresolvedCallsites:0};let o=A(t,e).filter(a=>!!a.sourcePath),m=_e(G(t,e)??""),u=w(t,e)?.rootNode??null,l=u?pe(u):ie(),c=new Map,p=H(t),s=[],f=0;for(let a of r){if(!a.memberAccess)continue;let d=Y(e,p.get(a.calleeLeaf)??[]);if(n.excludeIndexedTargets!==!1&&U(t,e,d,!0,a.calleeQualifier))continue;let h=a.calleeQualifier,L=Pe(t,e,a,o);if(L){s.push(L);continue}let S=de(t,e,a,o,ge(l,a.calleeQualifier,a.line));if(S.length>0){s.push(...S);continue}let x=he(t,e,a);if(x.length>0){s.push(...x);continue}let y=h?m.get(h)??h:null,P=(y?B(o.filter(g=>(g.localName??g.importedName)===y).map(g=>g.sourcePath)):[]).flatMap(g=>{let v=c.get(g);return v||(v=N(t,g)??[],c.set(g,v)),v.filter(b=>b.name===a.calleeLeaf).map(b=>({file:g,callable:b}))});if(P.length!==1){f+=1;continue}let _=P[0];s.push({calleeLeaf:a.calleeLeaf,line:a.line,sourceFile:e,targetFile:_.file,targetStartLine:_.callable.startLine,targetEndLine:_.callable.endLine,resolution:"direct-import-receiver",strength:"candidate"})}return{targets:s,unresolvedCallsites:f}}function de(t,e,n,i,r){let o=n.calleeQualifier;if(!o||!/^[A-Za-z_$][\w$]*$/u.test(o))return[];if(r.size!==1)return[];let m=[...r][0],u=B(i.filter(p=>p.localName===m||p.importedName===m).map(p=>p.sourcePath));if(u.length!==1)return[];let l=u[0],c=xe(t,l,n.calleeLeaf);return c.map(p=>({calleeLeaf:p.name,line:n.line,sourceFile:e,targetFile:p.file,targetStartLine:p.startLine,targetEndLine:p.endLine,serviceFile:l,resolutionAlternativeCount:c.length,resolution:"imported-service-object-member",strength:"candidate"}))}function ie(){return{declarations:new Map,callbacks:[]}}function pe(t){let e=ie();return I(t,n=>{if(n.type==="variable_declarator"){let l=n.childForFieldName("name")??n.namedChild(0),c=n.childForFieldName("value")??n.namedChild(1);if(l?.type!=="identifier"||!c)return;let p=new Set;if(I(c,s=>{if(s.type!=="member_expression")return;let f=s.childForFieldName("object")??s.namedChild(0),a=s.childForFieldName("property")??s.namedChild(1);f?.type==="identifier"&&a?.text==="Service"&&p.add(f.text)}),p.size===1){let s=e.declarations.get(l.text)??[];s.push({line:n.startPosition.row,alias:[...p][0]}),e.declarations.set(l.text,s)}return}if(!["arrow_function","function_expression","generator_function"].includes(n.type))return;let i=n.childForFieldName("parameters")??n.childForFieldName("parameter");if(!i)return;let r=n.parent;for(;r&&r.type!=="call_expression";)r=r.parent;if(!r)return;let o=r.childForFieldName("function")??r.namedChild(0),m=/^([A-Za-z_$][\w$]*)\.Service\.use$/u.exec(o?.text??"");if(!m)return;let u=new Set;I(i,l=>{l.type==="identifier"&&u.add(l.text)}),u.size!==0&&e.callbacks.push({startLine:n.startPosition.row,endLine:n.endPosition.row,receivers:u,alias:m[1]})}),e}function ge(t,e,n){if(!e||!/^[A-Za-z_$][\w$]*$/u.test(e))return new Set;let i=new Set((t.declarations.get(e)??[]).filter(r=>r.line<=n).map(r=>r.alias));for(let r of t.callbacks)r.startLine<=n&&r.endLine>=n&&r.receivers.has(e)&&i.add(r.alias);return i}function he(t,e,n){let i=n.calleeQualifier;if(!i||!/^[A-Za-z_$][\w$]*$/u.test(i))return[];let r=w(t,e)?.rootNode;if(!r)return[];let o=ye(t,e,r,n.line,n.calleeLeaf,i),m=o?Se(o,i):null;if(!m)return[];if(!Le(m))return[];let u=(N(t,e)??[]).filter(a=>a.startLine<=m.startPosition.row&&a.endLine>=m.endPosition.row).sort((a,d)=>a.endLine-a.startLine-(d.endLine-d.startLine))[0];if(!u)return[];let l=T(t,e).filter(a=>a.isFunctionLike&&a.leaf===u.name);if(l.length!==1)return[];let c=l[0],p=ne.get(t);p||(p=new Map,ne.set(t,p));let s=`${c.symbol}\0${n.calleeLeaf}`,f=p.get(s);if(!f){let a=[];for(let d of z(t,c)){let h=w(t,d.file)?.rootNode;if(!h)continue;let L=h.descendantsOfType("call_expression").filter(y=>y.startPosition.row>d.line||y.endPosition.row<d.line?!1:(y.childForFieldName("function")??y.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<[^<>]*>$/u,"").match(/[A-Za-z_$][\w$]*$/u)?.[0]===c.leaf);if(L.length!==1)continue;let x=L[0].childForFieldName("arguments")?.namedChildren.find(y=>F(y).type==="object");if(x)for(let y of F(x).namedChildren){if(y.type==="shorthand_property_identifier"&&y.text===n.calleeLeaf){a.push(...D(t,d.file,n.calleeLeaf,y,y));continue}if(y.type!=="pair")continue;let $=y.childForFieldName("key")??y.namedChild(0),P=y.childForFieldName("value")??y.namedChild(1);O($?.text)!==n.calleeLeaf||!P||a.push(...D(t,d.file,n.calleeLeaf,P,y))}}f=a.filter((d,h,L)=>L.findIndex(S=>S.file===d.file&&S.startLine===d.startLine&&S.endLine===d.endLine&&S.name===d.name)===h),p.set(s,f)}return f.map(a=>({calleeLeaf:a.name,line:n.line,sourceFile:e,targetFile:a.file,targetStartLine:a.startLine,targetEndLine:a.endLine,resolutionAlternativeCount:f.length,resolution:"factory-callback-member",strength:f.length===1?"exact":"candidate"}))}function ye(t,e,n,i,r,o){let m=te.get(t);m||(m=new Map,te.set(t,m));let u=m.get(e);if(!u){u=new Map;for(let l of n.descendantsOfType("call_expression")){let c=l.childForFieldName("function")??l.namedChild(0),p=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(c?.text.replace(/\s+/gu,"")??"");if(p)for(let s=l.startPosition.row;s<=l.endPosition.row;s+=1){let f=`${s}\0${p[1]}\0${p[2]}`,a=u.get(f);(!a||l.endIndex-l.startIndex<a.endIndex-a.startIndex)&&u.set(f,l)}}m.set(e,u)}return u.get(`${i}\0${o}\0${r}`)??null}function Le(t){return t.descendantsOfType("return_statement").some(e=>{let n=e.childForFieldName("argument")??e.namedChild(0);return!!(n&&F(n).type==="object")})}function Se(t,e){let n=t.parent;for(;n;){if(/(?:function|method|lambda)/u.test(n.type)||n.type==="arrow_function"){let i=n.childForFieldName("parameters")??n.childForFieldName("parameter"),r=!1;if(i&&I(i,o=>{o.type==="identifier"&&o.text===e&&(r=!0)}),r)return n}n=n.parent}return null}function D(t,e,n,i,r){if(i.type==="identifier")return(N(t,e)??[]).filter(l=>l.name===i.text).map(l=>({...l,file:e}));let o=j(t,e,i.text);if(o.length>0)return o;if(!Z(i))return[];let u=(N(t,e)??[]).filter(l=>l.startLine>=r.startPosition.row&&l.endLine<=r.endPosition.row&&(l.name===n||l.name.startsWith("source@"))).sort((l,c)=>l.endLine-l.startLine-(c.endLine-c.startLine))[0];return[u?{...u,file:e}:{name:n,file:e,startLine:r.startPosition.row,endLine:r.endPosition.row}]}function xe(t,e,n){let i=re.get(t);i||(i=new Map,re.set(t,i));let r=`${e}\0${n}`,o=i.get(r);if(o)return o;let m=Ne(t,e).flatMap(u=>be(t,u,e,n));return i.set(r,m),m}function be(t,e,n,i){let r=w(t,e)?.rootNode,o=N(t,e)??[];if(!r)return[];let m=ve(t,e,n);if(m.size===0)return[];let u=new Set,l=[],c=[],p=[];return I(r,f=>{if(Ce(f,m)){if(f.type==="pair"){let a=f.childForFieldName("key")??f.namedChild(0),d=f.childForFieldName("value")??f.namedChild(1);if(O(a?.text)!==i||!d)return;if(d.type==="identifier")u.add(d.text);else if(Z(d))l.push({name:i,startLine:f.startPosition.row,endLine:f.endPosition.row});else{let h=we(t,e,d.text),L=j(t,e,d.text);if(h.length>0)p.push(...h);else if(L.length>0)p.push(...L);else{let S=Ie(f);S&&c.push(S)}}return}f.type==="shorthand_property_identifier"&&f.text===i&&u.add(i)}}),[...o.filter(f=>u.has(f.name)).map(f=>({...f,file:e})),...l.map(f=>({...f,file:e})),...c.map(f=>({...f,file:e})),...p].filter((f,a,d)=>d.findIndex(h=>h.file===f.file&&h.name===f.name&&h.startLine===f.startLine&&h.endLine===f.endLine)===a)}function Ce(t,e){let n=t,i=null;for(;n;){if(n.type==="object"&&(i=n),n.type==="call_expression"){if(!i)return!1;let r=n.childForFieldName("function")??n.namedChild(0);return r?e.has(r.text.replace(/\.of$/u,""))&&r.text.endsWith(".of"):!1}n=n.parent}return!1}function Ne(t,e){let n=J.get(t);n||(n=new Map,J.set(t,n));let i=n.get(e);if(i)return i;let r=new Set([e]),o=T(t,e).filter(u=>u.leaf==="Service"&&u.isTypeLike);for(let u of o)for(let l of z(t,u))r.add(l.file);let m=[...r].sort();return n.set(e,m),m}function ve(t,e,n){let i=new Set;M(e,n)&&i.add("Service");for(let r of A(t,e)){if(!r.sourcePath||!M(r.sourcePath,n))continue;if(r.kind==="namespace"&&r.localName){i.add(`${r.localName}.Service`);continue}(r.importedName==="default"?r.localName:r.importedName)==="Service"?i.add(r.localName??r.importedName):r.localName&&r.importedName!=="default"&&i.add(`${r.localName}.Service`)}return i}function j(t,e,n){let i=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n.replace(/\s+/gu,""));if(!i)return[];let r=w(t,e)?.rootNode;if(!r)return[];let o=ae(r,i[1]),m=o?se(o):null;if(!m)return[];let u=m.childForFieldName("function")??m.namedChild(0),l=u?oe(t,e,u.text):[];if(l.length!==1)return[];let c=l[0],p=w(t,c.relativePath)?.rootNode;if(!p)return[];let s=le(p,c.startLine,c.endLine);if(!s)return[];let f=[];for(let a of s.descendantsOfType("return_statement")){let d=a.childForFieldName("argument")??a.namedChild(0);if(!d)continue;let h=F(d);if(h.type==="object")for(let L of h.namedChildren){if(L.type==="shorthand_property_identifier"&&L.text===i[2]){for(let y of N(t,c.relativePath)??[])y.name===i[2]&&f.push({...y,file:c.relativePath});continue}if(L.type!=="pair")continue;let S=L.childForFieldName("key")??L.namedChild(0),x=L.childForFieldName("value")??L.namedChild(1);if(!(O(S?.text)!==i[2]||!x))if(x.type==="identifier")for(let y of N(t,c.relativePath)??[])y.name===x.text&&f.push({...y,file:c.relativePath});else Z(x)&&f.push({name:i[2],startLine:L.startPosition.row,endLine:L.endPosition.row,file:c.relativePath})}}return f.filter((a,d,h)=>h.findIndex(L=>L.file===a.file&&L.name===a.name&&L.startLine===a.startLine&&L.endLine===a.endLine)===d)}function we(t,e,n){let i=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n.replace(/\s+/gu,""));if(!i)return[];let r=w(t,e)?.rootNode;if(!r)return[];let o=ae(r,i[1]),m=o?se(o):null,u=m?.childForFieldName("function")??m?.namedChild(0),l=u?oe(t,e,u.text):[];if(l.length!==1||!m)return[];let c=l[0],p=w(t,c.relativePath)?.rootNode;if(!p)return[];let s=le(p,c.startLine,c.endLine);if(!s)return[];let f=new Set,a=s.childForFieldName("parameters")??s.childForFieldName("parameter");if(a&&I(a,g=>{g.type==="identifier"&&f.add(g.text)}),f.size===0)return[];let d=j(t,e,n);if(d.length===0)return[];let h=(N(t,c.relativePath)??[]).filter(g=>g.startLine>=c.startLine&&g.endLine<=c.endLine),L=(E(t,c.relativePath)??[]).filter(g=>g.line>=c.startLine&&g.line<=c.endLine),S=new Set,x=d.map(g=>({name:g.name,startLine:g.startLine,endLine:g.endLine})),y=new Set;for(;x.length>0&&y.size<32;){let g=x.shift(),v=`${g.name}\0${g.startLine}\0${g.endLine}`;if(!y.has(v)){y.add(v);for(let b of L.filter(C=>C.line>=g.startLine&&C.line<=g.endLine)){if(b.memberAccess&&b.calleeQualifier&&f.has(b.calleeQualifier)){S.add(b.calleeLeaf);continue}if(b.memberAccess)continue;let C=h.filter(me=>me.name===b.calleeLeaf);C.length===1&&x.push(C[0])}}}if(S.size===0)return[];let P=m.childForFieldName("arguments")?.namedChildren.find(g=>F(g).type==="object");if(!P)return[];let _=[];for(let g of F(P).namedChildren){if(g.type==="shorthand_property_identifier"&&S.has(g.text)){_.push(...D(t,e,g.text,g,g));continue}if(g.type!=="pair")continue;let v=g.childForFieldName("key")??g.namedChild(0),b=g.childForFieldName("value")??g.namedChild(1),C=O(v?.text);!C||!S.has(C)||!b||_.push(...D(t,e,C,b,g))}return _.filter((g,v,b)=>b.findIndex(C=>C.file===g.file&&C.name===g.name&&C.startLine===g.startLine&&C.endLine===g.endLine)===v)}function ae(t,e){for(let n of t.descendantsOfType("variable_declarator"))if((n.childForFieldName("name")??n.namedChild(0))?.text===e)return n.childForFieldName("value")??n.namedChild(1);return null}function se(t){return t.type==="call_expression"?t:t.descendantsOfType("call_expression")[0]??null}function oe(t,e,n){let i=n.replace(/\s+/gu,"").replace(/<[^<>]*>$/u,""),r=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(i);if(r){let s=A(t,e).filter(d=>d.localName===r[1]&&d.sourcePath);if(s.length!==1||!s[0].sourcePath)return[];let f=s[0].sourcePath,a=R(t,f,r[2]).filter(d=>d.isFunctionLike);return a.length>0?a:(N(t,f)??[]).filter(d=>d.name===r[2]).map(d=>({...d,relativePath:f}))}if(!/^[A-Za-z_$][\w$]*$/u.test(i))return[];let o=T(t,e).filter(s=>s.leaf===i&&s.isFunctionLike);if(o.length>0)return o;let m=(N(t,e)??[]).filter(s=>s.name===i).map(s=>({...s,relativePath:e}));if(m.length>0)return m;let u=A(t,e).filter(s=>s.localName===i&&s.sourcePath&&s.kind!=="namespace");if(u.length!==1||!u[0].sourcePath)return[];let l=u[0].sourcePath,c=u[0].importedName==="default"?i:u[0].importedName,p=R(t,l,c).filter(s=>s.isFunctionLike);return p.length>0?p:(N(t,l)??[]).filter(s=>s.name===c).map(s=>({...s,relativePath:l}))}function le(t,e,n){let i=null;return I(t,r=>{!/(?:function|method|lambda)/u.test(r.type)&&r.type!=="arrow_function"||r.startPosition.row>e||r.endPosition.row<n||(!i||r.endIndex-r.startIndex<i.endIndex-i.startIndex)&&(i=r)}),i}function Z(t){return["arrow_function","function_expression","generator_function"].includes(t.type)||t.descendantsOfType(["arrow_function","function_expression","generator_function"]).length>0}function Ie(t){let e=t.parent;for(;e;){if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0);if(n?.type==="identifier")return{name:n.text,startLine:e.startPosition.row,endLine:e.endPosition.row}}e=e.parent}return null}function O(t){return t?t.replace(/^(?:['"])(.*)(?:['"])$/u,"$1"):null}function Pe(t,e,n,i){let r=/^this\.([A-Za-z_$][\w$]*)$/u.exec(n.calleeQualifier??"");if(!r)return null;let o=w(t,e)?.rootNode;if(!o)return null;let m=$e(o,n.line);if(!m)return null;let u=new Set;if(I(m,h=>{if(h.type!=="assignment_expression")return;let L=h.childForFieldName("left")??h.namedChild(0),S=h.childForFieldName("right")??h.namedChild(h.namedChildCount-1);if(L?.text.replace(/\s+/gu,"")!==`this.${r[1]}`||!S)return;let x=F(S);if(x.type!=="new_expression")return;let $=(x.childForFieldName("constructor")??x.namedChild(0))?.text.match(/[A-Za-z_$][\w$]*$/u)?.[0];$&&u.add($)}),u.size!==1)return null;let l=[...u][0],c=i.filter(h=>h.localName===l);if(c.length!==1)return null;let p=c[0].importedName==="default"?l:c[0].importedName,s=c[0].importedName==="default"?R(t,c[0].sourcePath,l):[],f=s.length===1?s[0].leaf:p,a=T(t,c[0].sourcePath).filter(h=>h.isFunctionLike&&h.leaf===n.calleeLeaf&&K(h.symbol)===f);if(a.length!==1)return null;let d=a[0];return{calleeLeaf:n.calleeLeaf,line:n.line,sourceFile:e,targetFile:d.relativePath,targetStartLine:d.startLine,targetEndLine:d.endLine,targetSymbol:d.symbol,resolution:"constructed-member-receiver",strength:"exact"}}function $e(t,e){let n=[];return I(t,i=>{["class","class_declaration","class_definition"].includes(i.type)&&i.startPosition.row<=e&&i.endPosition.row>=e&&n.push(i)}),n.sort((i,r)=>i.endPosition.row-i.startPosition.row-(r.endPosition.row-r.startPosition.row))[0]??null}function F(t){let e=t;for(;["parenthesized_expression","as_expression","type_assertion","satisfies_expression"].includes(e.type)&&e.namedChildCount===1;)e=e.namedChild(0);return e}function I(t,e){e(t);for(let n of t.namedChildren)I(n,e)}function _e(t){let e=new Map,n=/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*([A-Za-z_$][\w$]*)\s*;/gu;for(let i of t.matchAll(n)){let r=i[1],o=i[2];r&&o&&e.set(r,o)}return e}function B(t){let e=[];for(let n of t)e.some(i=>M(i,n))||e.push(n);return e}import{existsSync as Ae}from"fs";import{SymbolRole as Te}from"@c4312/scip";import{deserializeSCIP as Fe}from"@c4312/scip";function ce(t,e){return Fe(q(t,{inputKind:e,maxBytes:V}))}var W=new WeakMap;function nt(t,e,n,i){let r=k(t,e),o=(r?.callSites??[]).filter(a=>a.line>=n&&a.line<=i);if(!r||o.length===0)return{available:!!r,targets:[],resolvedCallsites:0,unresolvedCallsites:0};let m=Q(t);if(!m)return{available:!1,targets:[],resolvedCallsites:0,unresolvedCallsites:o.length};let u=(m.byFile.get(e)??[]).filter(a=>a.sourceLine>=n&&a.sourceLine<=i).map(a=>({...a,calleeLeaf:a.definition.leaf})),l=ue(o.map(a=>({line:a.line,leaf:a.calleeLeaf}))),c=ue(u.map(a=>({line:a.sourceLine,leaf:a.calleeLeaf}))),p=new Set([...l].flatMap(([a,d])=>c.get(a)===d?[a]:[])),s=u.filter(a=>p.has(fe(a.sourceLine,a.calleeLeaf))),f=[...p].reduce((a,d)=>a+(l.get(d)??0),0);return{available:!0,targets:s,resolvedCallsites:f,unresolvedCallsites:Math.max(0,o.length-f)}}function rt(t,e,n,i){let r=Q(t);return r?{available:!0,targets:(r.byFile.get(e)??[]).filter(o=>o.sourceLine>=n&&o.sourceLine<=i)}:{available:!1,targets:[]}}function it(t,e,n,i){let r=Q(t);return r?{available:!0,targets:(r.byFile.get(e)??[]).filter(o=>o.sourceLine>=n&&o.sourceLine<=i&&Re(t,o.definition)).map(o=>({...o,calleeLeaf:o.definition.leaf}))}:{available:!1,targets:[]}}function Q(t){if(W.has(t))return W.get(t)??null;let e=Me(t);return W.set(t,e),e}function Me(t){if(!t.generation.indexPath||!Ae(t.generation.indexPath))return null;try{let e=X(t),n=new Map(e.map(o=>[o.symbol,o])),i=ce(t.generation.indexPath,"SCIP source-range call-target index"),r=new Map;for(let o of i.documents??[]){let m=o.relativePath;if(!m||t.isIgnored(m))continue;let u=[];for(let l of o.occurrences??[]){if(!l.symbol||(l.symbolRoles&Te.Definition)!==0)continue;let c=n.get(l.symbol),p=l.range?.[0];!c||!Number.isInteger(p)||u.push({sourceLine:p,definition:c})}r.set(m,u)}return{byFile:r}}catch{return null}}function Re(t,e){if(!e.isFunctionLike)return!1;let n=k(t,e.relativePath);return!n||n.callables.some(i=>i.name===e.leaf&&i.startLine===e.startLine&&i.endLine===e.endLine)?!0:De(e)}function De(t){let e=t.documentation;if(!e)return!1;let n=t.leaf.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`\\bfunction\\s+${n}\\s*(?:<[^>]*>)?\\s*\\(`,"u").test(e)||new RegExp(`\\b(?:const|let|var)\\s+${n}\\s*:\\s*(?:<[^>]*>\\s*)?\\([^\\n]*\\)\\s*=>`,"u").test(e)}function ue(t){let e=new Map;for(let n of t){let i=fe(n.line,n.leaf);e.set(i,(e.get(i)??0)+1)}return e}function fe(t,e){return`${t}\0${e}`}export{Ve as a,qe as b,nt as c,rt as d,it as e,Re as f};
2
+ //# sourceMappingURL=chunk-SMRBZ6EC.js.map