scip-query 0.15.0 → 0.16.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 (321) hide show
  1. package/CHANGELOG.md +4 -1
  2. package/README.md +148 -66
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/chunk-2EU6WVR3.js +3 -0
  5. package/dist/chunk-2HFXPIBT.js +2 -0
  6. package/dist/chunk-2LGPMYS2.js +35 -0
  7. package/dist/chunk-2Y7YX54K.js +16 -0
  8. package/dist/chunk-363TZ64I.js +2 -0
  9. package/dist/chunk-3I34FZ6R.js +2 -0
  10. package/dist/chunk-3LAKH6BV.js +2 -0
  11. package/dist/chunk-3M2UCPFS.js +3 -0
  12. package/dist/chunk-3OPIMH42.js +2 -0
  13. package/dist/{chunk-QZOAOLLZ.js → chunk-3YAZH3JU.js} +2 -2
  14. package/dist/chunk-5P26M63Y.js +2 -0
  15. package/dist/{chunk-72FR7KEZ.js → chunk-5TVNLPUM.js} +14 -12
  16. package/dist/chunk-5UKDCXVC.js +5 -0
  17. package/dist/{chunk-R7U2I55B.js → chunk-5XDNFOAH.js} +2 -2
  18. package/dist/chunk-62Y3PC27.js +4 -0
  19. package/dist/chunk-6DNE65QS.js +40 -0
  20. package/dist/{chunk-N2OTJWC2.js → chunk-6EVORGCB.js} +2 -2
  21. package/dist/chunk-6GZ7LM7S.js +2 -0
  22. package/dist/chunk-753JWTUH.js +3 -0
  23. package/dist/chunk-7II7NFRV.js +4 -0
  24. package/dist/{chunk-M7EEHYSU.js → chunk-7RAS466A.js} +2 -2
  25. package/dist/chunk-A46JTKTM.js +5 -0
  26. package/dist/{chunk-2XRXEIRK.js → chunk-AAMZRDJT.js} +2 -2
  27. package/dist/chunk-AMPN2VMF.js +3 -0
  28. package/dist/{chunk-6XA4LDHY.js → chunk-B3X6KU75.js} +2 -2
  29. package/dist/chunk-BFWVHD2P.js +16 -0
  30. package/dist/chunk-BVHP2B4D.js +61 -0
  31. package/dist/{chunk-BUNDZ6K2.js → chunk-BVUA3GZC.js} +2 -2
  32. package/dist/{chunk-EDSD3VJK.js → chunk-CKIAEVGM.js} +2 -2
  33. package/dist/chunk-CM4EZLW4.js +2 -0
  34. package/dist/chunk-CS3FXTUC.js +2 -0
  35. package/dist/chunk-CVBS2FD4.js +2 -0
  36. package/dist/chunk-D5OXYOJP.js +7 -0
  37. package/dist/chunk-DA34GNNO.js +29 -0
  38. package/dist/chunk-DKK2H4D7.js +7 -0
  39. package/dist/chunk-EBSSCVR4.js +5 -0
  40. package/dist/{chunk-OXTM2RX3.js → chunk-EVCSXWER.js} +2 -2
  41. package/dist/chunk-FFIYGYQR.js +67 -0
  42. package/dist/chunk-G4KQ7S74.js +20 -0
  43. package/dist/{chunk-44P4SJFN.js → chunk-GWWYLYD3.js} +2 -2
  44. package/dist/chunk-HGUNWXJX.js +2 -0
  45. package/dist/chunk-HLRWOFXC.js +9 -0
  46. package/dist/{chunk-YQKECTPV.js → chunk-IRIM3SUR.js} +2 -2
  47. package/dist/chunk-JHK2DMUQ.js +4 -0
  48. package/dist/chunk-JQ2PCFZW.js +3 -0
  49. package/dist/chunk-JRFCWCOD.js +16 -0
  50. package/dist/chunk-JXAJDINF.js +2 -0
  51. package/dist/chunk-K32ZOW3P.js +2 -0
  52. package/dist/{chunk-3H5OSDF7.js → chunk-KI4WPR7Q.js} +2 -2
  53. package/dist/{chunk-43GKP6LI.js → chunk-KP2DJY7D.js} +2 -2
  54. package/dist/{chunk-YTVKPJXW.js → chunk-L27UIF3E.js} +2 -2
  55. package/dist/chunk-LT6AHYVY.js +18 -0
  56. package/dist/chunk-MCNWCJYL.js +11 -0
  57. package/dist/{chunk-K6UI6EBZ.js → chunk-MZB3DTHW.js} +2 -2
  58. package/dist/chunk-NLRWGGPY.js +8 -0
  59. package/dist/chunk-NLVKD45E.js +13 -0
  60. package/dist/chunk-OO6S4ECV.js +112 -0
  61. package/dist/{chunk-QYOPMTZ6.js → chunk-OYGKBDAD.js} +2 -2
  62. package/dist/chunk-P5QZILZ4.js +2 -0
  63. package/dist/chunk-P5XHIJHI.js +2 -0
  64. package/dist/chunk-PCCMMI2M.js +3 -0
  65. package/dist/{chunk-2TPCIPYA.js → chunk-Q65QYKU7.js} +2 -2
  66. package/dist/{chunk-K7SPOJHZ.js → chunk-QB7NRST4.js} +2 -2
  67. package/dist/{chunk-7JZRFDCU.js → chunk-QSNG3NHQ.js} +2 -2
  68. package/dist/chunk-QVZSWLLZ.js +2 -0
  69. package/dist/chunk-RLB7FZKR.js +10 -0
  70. package/dist/{chunk-KYB7FPXT.js → chunk-RPMT6MTX.js} +2 -2
  71. package/dist/chunk-RQWNF2RM.js +2 -0
  72. package/dist/chunk-RYFIRFYJ.js +4 -0
  73. package/dist/{chunk-QARYU7R3.js → chunk-S2FZILCF.js} +2 -2
  74. package/dist/{chunk-HV27H2V2.js → chunk-S3IXCXW2.js} +2 -2
  75. package/dist/{chunk-TYCZ7S4I.js → chunk-S5MTSES5.js} +2 -2
  76. package/dist/chunk-S5RZQA6V.js +2 -0
  77. package/dist/{chunk-PEHDARNC.js → chunk-SEEJPIWG.js} +2 -2
  78. package/dist/chunk-SOCS3467.js +2 -0
  79. package/dist/chunk-U6BJVXWQ.js +2 -0
  80. package/dist/chunk-UO4IADXJ.js +38 -0
  81. package/dist/{chunk-ZEO4CXQR.js → chunk-VLSI5MYU.js} +2 -2
  82. package/dist/chunk-VSQRU3AP.js +2 -0
  83. package/dist/chunk-VYQY75NA.js +2 -0
  84. package/dist/{chunk-NOKUZU56.js → chunk-VZCR3VQY.js} +2 -2
  85. package/dist/chunk-W3ZVRLCH.js +2 -0
  86. package/dist/chunk-WA64GKWB.js +20 -0
  87. package/dist/chunk-WFRZGMWJ.js +71 -0
  88. package/dist/chunk-WN6XEYVX.js +2 -0
  89. package/dist/chunk-XAEU4ROB.js +101 -0
  90. package/dist/chunk-XBPAJASV.js +2 -0
  91. package/dist/{chunk-GY3HAWUA.js → chunk-XC6PUFNN.js} +2 -2
  92. package/dist/chunk-Y42DMR6F.js +6 -0
  93. package/dist/chunk-YCVYOV4A.js +7 -0
  94. package/dist/{chunk-WPZPB42I.js → chunk-YD37KSEK.js} +2 -2
  95. package/dist/{chunk-V5W7H7V4.js → chunk-YFEJIYWH.js} +2 -2
  96. package/dist/chunk-YSUD2S7T.js +3 -0
  97. package/dist/{chunk-KJCDEDQW.js → chunk-ZEKBAMCN.js} +2 -2
  98. package/dist/chunk-ZHGUZKJL.js +2 -0
  99. package/dist/cli.js +587 -312
  100. package/dist/{config-types-aCgyLrvE.d.ts → config-types-SVkUIufk.d.ts} +8 -2
  101. package/dist/{db-DwCdT3rv.d.ts → db-CS0TuVH6.d.ts} +1 -1
  102. package/dist/{git-history-Dao3_Pu9.d.ts → git-history-ChNHbfZQ.d.ts} +2 -1
  103. package/dist/{health-nJUidasZ.d.ts → health-Btal3mQi.d.ts} +4 -4
  104. package/dist/index.d.ts +7 -5
  105. package/dist/index.js +1 -19
  106. package/dist/queries/affected.d.ts +2 -2
  107. package/dist/queries/affected.js +1 -1
  108. package/dist/queries/bottlenecks.d.ts +8 -2
  109. package/dist/queries/bottlenecks.js +1 -1
  110. package/dist/queries/by-kind.d.ts +2 -2
  111. package/dist/queries/by-kind.js +1 -1
  112. package/dist/queries/call-graph.d.ts +2 -2
  113. package/dist/queries/call-graph.js +1 -1
  114. package/dist/queries/change-surface.d.ts +2 -2
  115. package/dist/queries/change-surface.js +1 -1
  116. package/dist/queries/cleanup-plan.d.ts +2 -2
  117. package/dist/queries/cleanup-plan.js +1 -1
  118. package/dist/queries/co-change.d.ts +4 -3
  119. package/dist/queries/co-change.js +1 -1
  120. package/dist/queries/code.d.ts +2 -2
  121. package/dist/queries/code.js +1 -1
  122. package/dist/queries/complexity-hotspots.d.ts +3 -3
  123. package/dist/queries/complexity-hotspots.js +1 -1
  124. package/dist/queries/complexity.d.ts +5 -4
  125. package/dist/queries/complexity.js +1 -1
  126. package/dist/queries/convergence.d.ts +2 -2
  127. package/dist/queries/convergence.js +1 -1
  128. package/dist/queries/coupling.d.ts +2 -2
  129. package/dist/queries/coupling.js +1 -1
  130. package/dist/queries/cycles.d.ts +2 -2
  131. package/dist/queries/cycles.js +1 -1
  132. package/dist/queries/dataflow.d.ts +2 -2
  133. package/dist/queries/dataflow.js +1 -1
  134. package/dist/queries/dead.d.ts +12 -3
  135. package/dist/queries/dead.js +1 -1
  136. package/dist/queries/decorative-checkers.d.ts +2 -2
  137. package/dist/queries/decorative-checkers.js +1 -1
  138. package/dist/queries/deep-chains.d.ts +8 -3
  139. package/dist/queries/deep-chains.js +1 -1
  140. package/dist/queries/deps.d.ts +2 -2
  141. package/dist/queries/deps.js +1 -1
  142. package/dist/queries/diff-gate.d.ts +5 -4
  143. package/dist/queries/diff-gate.js +1 -1
  144. package/dist/queries/diff-impact.d.ts +3 -3
  145. package/dist/queries/diff-impact.js +1 -1
  146. package/dist/queries/doc-drift.d.ts +4 -2
  147. package/dist/queries/doc-drift.js +1 -1
  148. package/dist/queries/drift.d.ts +2 -2
  149. package/dist/queries/drift.js +1 -1
  150. package/dist/queries/duplicate-bodies.d.ts +3 -3
  151. package/dist/queries/duplicate-bodies.js +1 -1
  152. package/dist/queries/extract-candidates.d.ts +2 -2
  153. package/dist/queries/extract-candidates.js +1 -1
  154. package/dist/queries/fan.d.ts +11 -5
  155. package/dist/queries/fan.js +1 -1
  156. package/dist/queries/files.d.ts +2 -2
  157. package/dist/queries/health.d.ts +3 -3
  158. package/dist/queries/health.js +1 -1
  159. package/dist/queries/hierarchy.d.ts +2 -2
  160. package/dist/queries/hierarchy.js +1 -1
  161. package/dist/queries/hotspots.d.ts +2 -2
  162. package/dist/queries/hotspots.js +1 -1
  163. package/dist/queries/imports.d.ts +2 -2
  164. package/dist/queries/imports.js +1 -1
  165. package/dist/queries/incomplete-migration.d.ts +3 -3
  166. package/dist/queries/incomplete-migration.js +1 -1
  167. package/dist/queries/index.d.ts +5 -5
  168. package/dist/queries/index.js +1 -1
  169. package/dist/queries/isolated.d.ts +2 -2
  170. package/dist/queries/isolated.js +1 -1
  171. package/dist/queries/locality-candidates.d.ts +2 -2
  172. package/dist/queries/locality-candidates.js +1 -1
  173. package/dist/queries/members.d.ts +2 -2
  174. package/dist/queries/members.js +1 -1
  175. package/dist/queries/methods.d.ts +2 -2
  176. package/dist/queries/methods.js +1 -1
  177. package/dist/queries/not-implemented.d.ts +2 -2
  178. package/dist/queries/not-implemented.js +1 -1
  179. package/dist/queries/outline.d.ts +2 -2
  180. package/dist/queries/outline.js +1 -1
  181. package/dist/queries/passthrough-candidates.d.ts +3 -3
  182. package/dist/queries/passthrough-candidates.js +1 -1
  183. package/dist/queries/plan-context.d.ts +4 -4
  184. package/dist/queries/plan-context.js +1 -1
  185. package/dist/queries/react-component-duplicates.d.ts +4 -2
  186. package/dist/queries/react-component-duplicates.js +1 -1
  187. package/dist/queries/react-hook-candidates.d.ts +4 -2
  188. package/dist/queries/react-hook-candidates.js +1 -1
  189. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  190. package/dist/queries/react-large-component-pressure.js +1 -1
  191. package/dist/queries/recent-duplicates.d.ts +4 -2
  192. package/dist/queries/recent-duplicates.js +1 -1
  193. package/dist/queries/redundant-reexports.d.ts +2 -2
  194. package/dist/queries/redundant-reexports.js +1 -1
  195. package/dist/queries/refs.d.ts +2 -2
  196. package/dist/queries/refs.js +1 -1
  197. package/dist/queries/self-audit.d.ts +2 -2
  198. package/dist/queries/self-audit.js +1 -1
  199. package/dist/queries/similar-chains.d.ts +2 -2
  200. package/dist/queries/similar-chains.js +1 -1
  201. package/dist/queries/similar-files.d.ts +2 -2
  202. package/dist/queries/similar-files.js +1 -1
  203. package/dist/queries/similar-signatures.d.ts +2 -2
  204. package/dist/queries/similar-signatures.js +1 -1
  205. package/dist/queries/similar.d.ts +2 -2
  206. package/dist/queries/similar.js +1 -1
  207. package/dist/queries/slice.d.ts +2 -2
  208. package/dist/queries/slice.js +1 -1
  209. package/dist/queries/stale-abstractions.d.ts +2 -2
  210. package/dist/queries/stale-abstractions.js +1 -1
  211. package/dist/queries/stats.d.ts +2 -2
  212. package/dist/queries/surface.d.ts +2 -2
  213. package/dist/queries/surface.js +1 -1
  214. package/dist/queries/symbols.d.ts +2 -2
  215. package/dist/queries/symbols.js +1 -1
  216. package/dist/queries/system.d.ts +2 -2
  217. package/dist/queries/system.js +1 -1
  218. package/dist/queries/test-quality.d.ts +2 -2
  219. package/dist/queries/test-quality.js +1 -1
  220. package/dist/queries/trace.d.ts +2 -2
  221. package/dist/queries/trace.js +1 -1
  222. package/dist/queries/twin-ab.d.ts +2 -2
  223. package/dist/queries/twin-ab.js +1 -1
  224. package/dist/queries/twin-drift.d.ts +2 -2
  225. package/dist/queries/twin-drift.js +1 -1
  226. package/dist/queries/unused-imports.d.ts +2 -2
  227. package/dist/queries/unused-imports.js +1 -1
  228. package/dist/queries/unused-params.d.ts +2 -2
  229. package/dist/queries/unused-params.js +1 -1
  230. package/dist/queries/vue-component-duplicates.d.ts +4 -2
  231. package/dist/queries/vue-component-duplicates.js +1 -1
  232. package/dist/queries/vue-composable-candidates.d.ts +4 -2
  233. package/dist/queries/vue-composable-candidates.js +1 -1
  234. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  235. package/dist/queries/vue-large-view-pressure.js +1 -1
  236. package/dist/queries/wrapper-candidates.d.ts +2 -2
  237. package/dist/queries/wrapper-candidates.js +1 -1
  238. package/dist/reindex-worker.js +256 -12
  239. package/dist/reindex.d.ts +29 -3
  240. package/dist/reindex.js +251 -22
  241. package/dist/runtime.d.ts +8 -4
  242. package/dist/runtime.js +2 -2
  243. package/dist/rust-semantic-session-server.js +2 -0
  244. package/dist/rust-semantic-session-worker.js +2 -0
  245. package/dist/rust-semantic-worker.js +2 -0
  246. package/dist/{scip-cli-DeAbuJ2b.d.ts → scip-cli-BKL-26TZ.d.ts} +2 -2
  247. package/dist/{symbol-types-DaoeXKUt.d.ts → symbol-types-BgWU6lhL.d.ts} +2 -0
  248. package/dist/watch-server.js +42 -0
  249. package/docs/AGENT_GUIDE.md +110 -34
  250. package/docs/AI_FAILURE_MODES.md +8 -3
  251. package/docs/COMMAND_REFERENCE.md +10 -6
  252. package/docs/REGEX_POLICY.md +3 -1
  253. package/docs/accuracy-audit-checklist.md +300 -0
  254. package/docs/accuracy-hardening-goal.md +493 -54
  255. package/docs/analyzer-inventory.md +31 -23
  256. package/docs/analyzer-validation-ledger.md +51 -21
  257. package/package.json +2 -1
  258. package/scripts/build-scip-windows.mjs +7 -7
  259. package/skills/_shared/SKILL.md +20 -19
  260. package/skills/scip-calibrate/SKILL.md +4 -2
  261. package/skills/scip-hyper-optimization/SKILL.md +5 -1
  262. package/skills/scip-query/SKILL.md +1 -1
  263. package/skills/scip-setup/SKILL.md +104 -4
  264. package/skills/scip-verify/SKILL.md +20 -14
  265. package/dist/chunk-27HMTUJE.js +0 -3
  266. package/dist/chunk-27XEGMCT.js +0 -7
  267. package/dist/chunk-3AMWF6V5.js +0 -3
  268. package/dist/chunk-4SCMYKD6.js +0 -2
  269. package/dist/chunk-5AAAEZ2Z.js +0 -2
  270. package/dist/chunk-5JRMZMLM.js +0 -2
  271. package/dist/chunk-5VY3RIEI.js +0 -38
  272. package/dist/chunk-6JUAGXR4.js +0 -4
  273. package/dist/chunk-6KDOYKCB.js +0 -40
  274. package/dist/chunk-6KMTPNZL.js +0 -3
  275. package/dist/chunk-7COVQPQQ.js +0 -9
  276. package/dist/chunk-7S5E7KWT.js +0 -2
  277. package/dist/chunk-7TVFPOD7.js +0 -102
  278. package/dist/chunk-A6KSEIRN.js +0 -61
  279. package/dist/chunk-AAMURYOK.js +0 -4
  280. package/dist/chunk-BP7S6V3M.js +0 -20
  281. package/dist/chunk-BRBF3E5X.js +0 -35
  282. package/dist/chunk-BZXE3HO4.js +0 -6
  283. package/dist/chunk-CXQQOXSI.js +0 -10
  284. package/dist/chunk-EVZSAR3S.js +0 -2
  285. package/dist/chunk-GMOEX7EV.js +0 -2
  286. package/dist/chunk-GNG622H3.js +0 -3
  287. package/dist/chunk-GUDKRIGW.js +0 -7
  288. package/dist/chunk-GULVO6NF.js +0 -43
  289. package/dist/chunk-HZZQKNVE.js +0 -2
  290. package/dist/chunk-I4R3SNMR.js +0 -2
  291. package/dist/chunk-IMQFJ53K.js +0 -2
  292. package/dist/chunk-ISLWJ4PY.js +0 -10
  293. package/dist/chunk-IUSSGHJO.js +0 -2
  294. package/dist/chunk-J5WVNZ6O.js +0 -2
  295. package/dist/chunk-JJUX2OAP.js +0 -2
  296. package/dist/chunk-JZBGTSAB.js +0 -13
  297. package/dist/chunk-K5N5RNGM.js +0 -2
  298. package/dist/chunk-KSJ544IV.js +0 -5
  299. package/dist/chunk-LY7NMOBW.js +0 -2
  300. package/dist/chunk-N23FT4EZ.js +0 -2
  301. package/dist/chunk-NCVFKOLB.js +0 -2
  302. package/dist/chunk-PESEPWZO.js +0 -2
  303. package/dist/chunk-PMY4UFGV.js +0 -2
  304. package/dist/chunk-Q7PWDXL5.js +0 -5
  305. package/dist/chunk-QVGFVRKD.js +0 -2
  306. package/dist/chunk-R5336VHZ.js +0 -2
  307. package/dist/chunk-RLB6SG25.js +0 -2
  308. package/dist/chunk-SFDVBARK.js +0 -2
  309. package/dist/chunk-TG7QSYCJ.js +0 -2
  310. package/dist/chunk-UHPWZCYQ.js +0 -3
  311. package/dist/chunk-URSSPS5H.js +0 -2
  312. package/dist/chunk-WIBFXSYB.js +0 -6
  313. package/dist/chunk-WMO2VZZK.js +0 -3
  314. package/dist/chunk-WS3Z6W3M.js +0 -65
  315. package/dist/chunk-X3DTIEMU.js +0 -18
  316. package/dist/chunk-X5C43YVI.js +0 -2
  317. package/dist/chunk-X7CHWTZ2.js +0 -72
  318. package/dist/chunk-XDESMVOL.js +0 -4
  319. package/dist/chunk-XZBLZHXL.js +0 -16
  320. package/dist/chunk-YBGC7HTY.js +0 -3
  321. package/dist/chunk-ZMGBWSFZ.js +0 -2
@@ -0,0 +1,9 @@
1
+ import{a as _}from"./chunk-P5XHIJHI.js";import{d as P,v as M,x as v}from"./chunk-WFRZGMWJ.js";import{execFileSync as U}from"child_process";var j=2e3,S=50,J=64,Y=8,V=3,W=2160*60*60,X=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i,Z=3,Q=/#\d+|\b[A-Z][A-Z0-9]+-\d+\b/g,q=/^([a-z][a-z0-9-]+)(?:\([^)]+\))?!?:/i;function ee(e){let t=P(e,{clearGroups:["whole-project"]});return(n,i)=>{let r=H(n.config.projectRoot);if(!r)return null;let o=t.has(n)?t.get(n,()=>({head:"",value:null})):null;return o&&o.head===r?o.value:(t.invalidate(n),t.get(n,()=>({head:r,value:i(n.config.projectRoot,r)})).value)}}function F(e){let t=P(e,{clearGroups:["whole-project"]});return(n,i,r)=>{let o=H(n.config.projectRoot);if(!o)return null;let a=t.has(n)?t.get(n,()=>({head:"",values:new Map})):null;(!a||a.head!==o)&&t.invalidate(n);let c=t.get(n,()=>({head:o,values:new Map}));if(c.values.has(i))return c.values.get(i)??null;let u=r(n.config.projectRoot,o);return c.values.set(i,u),u}}var te=F("git-commit-history");function ne(e,t={}){let n=t.historyMode??"bounded";return{capability:i=>ie(e,i),commitHistory:()=>x(e,n),fileChurn:()=>se(e,n),changeAmplification:()=>ae(e,n),trackedFiles:()=>le(e),fileAddRecords:()=>me(e,n),coChangePairs:(i={})=>be(e,i,n),coChangePairsForFiles:(i,r={})=>L(e,i,r,n),directionalCoChangePairsForFiles:(i,r={})=>ye(e,i,r,n)}}function x(e,t="bounded"){return te(e,y(t),(n,i)=>re(n,i,t))}function ie(e,t){let n=H(e.config.projectRoot);return n?{slot:t,available:!0,head:n}:{slot:t,available:!1,head:null,reason:"git history is unavailable for this project"}}function H(e){try{return C(e,["rev-parse","HEAD"]).trim()||null}catch{return null}}function C(e,t){return U("git",["-C",e,...t],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function re(e,t,n){let i;try{i=C(e,["log","--no-merges","--name-only",...R(n),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}return{head:t,...w(i,S)}}function oe(e){return X.test(e.subject)}function se(e,t){let n=x(e,t);if(!n)return null;let i=new Map;for(let r of n.commits){let o=oe(r);for(let a of r.files){let c=i.get(a)??{changes:0,fixChanges:0,lastChangedAt:0};c.changes+=1,o&&(c.fixChanges+=1),r.timestamp>c.lastChangedAt&&(c.lastChangedAt=r.timestamp),i.set(a,c)}}return i}function ae(e,t){let n=x(e,t);if(!n||n.commits.length===0)return null;let i=n.commits.map(r=>r.files.length).filter(r=>r>0).sort((r,o)=>r-o);return i.length===0?null:{medianFilesPerCommit:D(i,.5),p90FilesPerCommit:D(i,.9),commitsAnalyzed:i.length}}function D(e,t){let n=Math.min(e.length-1,Math.floor(e.length*t));return e[n]}var ce=ee("git-tracked-files");function le(e){return ce(e,t=>{try{let n=C(t,["ls-files"]);return new Set(n.split(`
2
+ `).map(i=>i.trim()).filter(i=>i!==""))}catch{return null}})}var ue=F("git-file-adds"),O="__git__/file-adds",k=M({kind:"git-file-adds",invalidation:v("git-file-adds"),serialize:ge,deserialize:fe});function _e(e){return ne(e).fileAddRecords()}function me(e,t){let n=y(t);return ue(e,n,(i,r)=>de(e,i,r,t))}function de(e,t,n,i){let r=k.read(e,I(i),n);if(r)return r;let o=he(t,i);return o&&k.write(e,I(i),n,o),o}function ge(e){return JSON.stringify([...e.entries()])}function fe(e){if(!e)return null;try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=new Map;for(let i of t){if(!Array.isArray(i)||i.length!==2||typeof i[0]!="string")return null;let r=i[1];if(!r||typeof r.commitsAgo!="number"||!Number.isFinite(r.commitsAgo)||typeof r.addedAt!="number"||!Number.isFinite(r.addedAt))return null;n.set(i[0],{commitsAgo:r.commitsAgo,addedAt:r.addedAt})}return n}catch{return null}}function he(e,t){let n;try{n=C(e,["log","--no-merges","--find-renames","--name-status",...R(t),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let i=new Map,r=new Map,o=-1;for(let a of n.split("")){if(a.trim()==="")continue;o+=1;let c=a.indexOf(`
3
+ `),u=c>=0?a.slice(0,c):a,[,m]=u.split("\0"),h=Number(m)||0;if(!(c<0))for(let l of a.slice(c+1).split(`
4
+ `)){let s=pe(l);if(!s)continue;if(s.status==="R"&&s.from&&s.to){let p=r.get(s.to)??new Set([s.to]);r.set(s.from,p);continue}if(s.status!=="A"||!s.to)continue;let d={commitsAgo:o,addedAt:h};i.set(s.to,d);for(let p of r.get(s.to)??[])i.set(p,d)}}return i}function pe(e){let t=e.trim().split(" "),n=t[0]??"";if(!n)return null;let i=n[0]??"";if(i==="R"){let o=t[1],a=t[2];return o&&a?{status:i,from:o,to:a}:null}let r=t[1];return r?{status:i,to:r}:null}var z=F("git-co-change-pairs"),Ce=F("git-directional-co-change-pairs");function be(e,t,n){let i=`all\0${y(n)}\0${T(t)}`,r=z(e,i,()=>{let o=x(e,n);return o?G(o,t):null});return r&&[...r]}function L(e,t,n,i){if(t.size===0)return[];let r=`files\0${y(i)}\0${N(t)}\0${T(n)}`,o=z(e,r,()=>{let a=x(e,i);return a?G(a,n,t):null});return o&&[...o]}function ye(e,t,n,i){if(t.size===0)return[];let r=n.maxFilesPerCommit??S;if(t.size>J)return L(e,t,n,i);let o=`directional\0${y(i)}\0${N(t)}\0${T({...n,maxFilesPerCommit:r})}`,a=Ce(e,o,(c,u)=>{let m=Ae(c,u,t,r,i);return m?G(m,n,t):null});return a&&[...a]}function T(e){let t=e.minTogether??4,n=e.minConfidence??.6,i=e.maxFilesPerCommit??S;return`${t}\0${n}\0${i}`}function N(e){return[...e].sort().join("\0")}function G(e,t,n){let{minTogether:i=4,minConfidence:r=.6,maxFilesPerCommit:o=S}=t,a=new Map,c=new Map,u=e.newestAnalyzedAt??0;for(let l of e.commits){let s=[...new Set(l.files)].sort();if(s.length>o)continue;e.newestAnalyzedAt===void 0&&l.timestamp>u&&(u=l.timestamp);let d=Fe(s),p=n===void 0||s.some(g=>n.has(g));for(let g of s)a.set(g,(a.get(g)??0)+1);if(p)for(let g=0;g<s.length;g++)for(let b=g+1;b<s.length;b++){if(n&&!n.has(s[g])&&!n.has(s[b]))continue;let A=`${s[g]}\0${s[b]}`,f=c.get(A)??{together:0,focusedTogether:0,broadTogether:0,lastTogetherAt:0,timestamps:[],subjects:[]};f.together+=1,d?f.broadTogether+=1:f.focusedTogether+=1,l.timestamp>f.lastTogetherAt&&(f.lastTogetherAt=l.timestamp),f.timestamps.push(l.timestamp),f.subjects.push(l.subject),c.set(A,f)}}let m=[],h=u-W;for(let[l,s]of c){let d=s.together;if(d<i)continue;let[p,g]=l.split("\0"),b=a.get(p)??d,A=a.get(g)??d,f=Math.max(d/b,d/A);if(f<r)continue;let $=s.broadTogether/d,E=s.timestamps.filter(K=>K>=h).length;m.push({fileA:p,fileB:g,together:d,confidence:f,changesA:b,changesB:A,focusedTogether:s.focusedTogether,broadTogether:s.broadTogether,broadCommitRatio:$,lastTogetherAt:s.lastTogetherAt,recentTogether:E,commitScope:Pe(s.broadTogether,d),recency:E>0?"recent":"stale",subjectContext:He(s.subjects)})}return m.sort((l,s)=>s.together-l.together||s.confidence-l.confidence||l.fileA.localeCompare(s.fileA)),m}function Ae(e,t,n,i,r){let o;try{o=xe(e,r)}catch{return null}if(o.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:0};let a;try{a=C(e,["log","--no-merges","--format=%H",...R(r),"--",...[...n].sort()])}catch{return null}let c=new Set(o.map(s=>s.hash)),u=a.split(`
5
+ `).map(s=>s.trim()).filter(s=>s!==""&&c.has(s)),m=Se(e,o,i);if(u.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:m};let h;try{h=C(e,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...u])}catch{return null}let l=w(h,i);return{head:t,...l,newestAnalyzedAt:m}}function xe(e,t){return C(e,["log","--no-merges","--format=%H%x00%ct",...R(t)]).split(`
6
+ `).map(i=>i.trim()).filter(i=>i!=="").map(i=>{let[r,o]=i.split("\0");return{hash:r??"",timestamp:Number(o)||0}}).filter(i=>i.hash!=="")}function R(e){return e==="full"?[]:["-n",String(B())]}function B(){return _(process.env.SCIP_QUERY_GIT_HISTORY_MAX_COMMITS)??j}function y(e){return e==="full"?"full":`bounded:${B()}`}function I(e){let t=y(e);return t===`bounded:${j}`?O:`${O}:${t}`}function Se(e,t,n){for(let r=0;r<t.length;r+=20){let o=t.slice(r,r+20),a;try{a=C(e,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...o.map(u=>u.hash)])}catch{return t[0]?.timestamp??0}let c=w(a,n);if(c.commits.length>0)return c.commits[0].timestamp}return 0}function w(e,t){let n=[],i=0;for(let r of e.split("")){if(r.trim()==="")continue;let o=r.indexOf(`
7
+ `),a=o>=0?r.slice(0,o):r,[c,u,m]=a.split("\0");if(!c||!u)continue;let h=o>=0?r.slice(o+1).split(`
8
+ `).map(l=>l.trim()).filter(l=>l!==""):[];if(h.length>t){i+=1;continue}n.push({hash:c,timestamp:Number(u)||0,subject:m??"",files:h})}return{commits:n,skippedBulkCommits:i}}function Fe(e){return e.length>=Y?!0:Re(e).size>=V}function Re(e){let t=new Set;for(let n of e){let i=n.indexOf("/");t.add(i>=0?n.slice(0,i):".")}return t}function Pe(e,t){return e===0?"focused":e/t>=.5?"broad-sweep":"mixed"}function He(e){let t=new Set,n=[],i=[];for(let r of e){!i.includes(r)&&i.length<Z&&i.push(r);for(let o of Te(r))t.add(o);for(let o of r.match(Q)??[])n.includes(o)||n.push(o)}return{subjectLabels:[...t].sort(),issueRefs:n,sampleSubjects:i,externalIssueLabelStatus:"unavailable"}}function Te(e){let t=new Set,n=q.exec(e)?.[1]?.toLowerCase();return n&&t.add(Ge(n)),/\b(?:feat|feature)\b/i.test(e)&&t.add("feature"),/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i.test(e)&&t.add("fix"),/\b(?:docs?|documentation|guide|readme)\b/i.test(e)&&t.add("docs"),/\brefactor(?:ing|ed)?\b/i.test(e)&&t.add("refactor"),/\btests?\b/i.test(e)&&t.add("test"),/\b(?:release|version|v\d+\.\d+)\b/i.test(e)&&t.add("release"),/\bchore\b/i.test(e)&&t.add("chore"),/\bbuild\b/i.test(e)&&t.add("build"),/\bci\b/i.test(e)&&t.add("ci"),/\bperf(?:ormance)?\b/i.test(e)&&t.add("perf"),[...t]}function Ge(e){return e==="feat"?"feature":e}export{ne as a,C as b,_e as c};
9
+ //# sourceMappingURL=chunk-HLRWOFXC.js.map
@@ -1,4 +1,4 @@
1
- import{b as m}from"./chunk-K7SPOJHZ.js";import{k as o}from"./chunk-7TVFPOD7.js";function h(t,l){let s=m(t,l);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let d=s.map(()=>"?").join(", "),i=t.all(`SELECT relative_path FROM documents
1
+ import{b as m}from"./chunk-QB7NRST4.js";import{x as o}from"./chunk-OO6S4ECV.js";function h(t,l){let s=m(t,l);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let d=s.map(()=>"?").join(", "),i=t.all(`SELECT relative_path FROM documents
2
2
  WHERE relative_path IN (${d})
3
3
  ORDER BY relative_path`,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e)),n=o(t,i,{onlyDocumented:!0,sort:!0}).map(({relativePath:e,...c})=>c),a=t.all(`SELECT DISTINCT d2.relative_path
4
4
  FROM mentions m
@@ -32,4 +32,4 @@ import{b as m}from"./chunk-K7SPOJHZ.js";import{k as o}from"./chunk-7TVFPOD7.js";
32
32
  WHERE d2.relative_path IN (${d})
33
33
  AND d1.relative_path NOT IN (${d})
34
34
  ORDER BY d1.relative_path`,...s,...s).map(e=>e.relative_path).filter(e=>!t.isIgnored(e));return{files:i,symbols:n,dependsOn:a,dependedOnBy:r}}export{h as a};
35
- //# sourceMappingURL=chunk-YQKECTPV.js.map
35
+ //# sourceMappingURL=chunk-IRIM3SUR.js.map
@@ -0,0 +1,4 @@
1
+ import{appendFileSync as w,mkdirSync as N}from"fs";import{createHash as F,randomUUID as k}from"crypto";import{dirname as x}from"path";import{performance as s}from"perf_hooks";var y="SCIP_QUERY_PROFILE",g="SCIP_QUERY_PROFILE_OUT",m="SCIP_QUERY_PROFILE_COMMAND",O="SCIP_QUERY_PROFILE_CACHE_STATE",u="SCIP_QUERY_PROFILE_RUN_ID",l="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY",p="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY_KIND",E=[y,g,m,O,u,l,p],L=new Set(E),I=new Set,_=new Map,P=!1;function a(){let e=process.env[y];return e==="1"||e==="true"}function T(){return process.env[g]}function R(){return process.env[m]}function h(){return process.env[O]}function v(){let e=process.env[u];if(e)return e;if(!a())return;let n=k();return process.env[u]=n,n}function M(){return process.env[l]}function C(e){let n=M();if(n)return n;if(!a())return;let t=v();if(!t)return;let o=e.projectFingerprint?"published-project":"run-only",r=S(["profile-workload-v1",e.toolVersion,e.command,e.projectFingerprint??t]);return process.env[l]=r,process.env[p]=o,r}function S(e){return F("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function V(){return Object.fromEntries(E.flatMap(e=>{let n=process.env[e];return n===void 0?[]:[[e,n]]}))}function A(e){for(let n of E)delete process.env[n];for(let[n,t]of Object.entries(e))L.has(n)&&t!==null&&(process.env[n]=t)}function Y(e,n,t){if(!a())return n();let o=s.now();try{let r=n();return d({type:"span",name:e,durationMs:Math.round(s.now()-o),ok:!0,...f(t)??{}}),r}catch(r){throw d({type:"span",name:e,durationMs:Math.round(s.now()-o),ok:!1,error:r instanceof Error?r.message:String(r),...f(t)??{}}),r}}async function j(e,n,t){if(!a())return n();let o=s.now();try{let r=await n();return d({type:"span",name:e,durationMs:Math.round(s.now()-o),ok:!0,...f(t)??{}}),r}catch(r){throw d({type:"span",name:e,durationMs:Math.round(s.now()-o),ok:!1,error:r instanceof Error?r.message:String(r),...f(t)??{}}),r}}function d(e,n=T()){let t=D(e),o={timestamp:new Date().toISOString(),pid:process.pid,runId:v(),command:R(),cacheState:h(),...t,...e},r=`${JSON.stringify(o)}
2
+ `;if(n)try{let i=x(n);I.has(i)||(N(i,{recursive:!0}),I.add(i)),w(n,r);return}catch(i){P||(P=!0,process.stderr.write(`[profile] failed to write ${n}: ${i instanceof Error?i.message:String(i)}
3
+ `));return}a()&&process.stderr.write(r)}function D(e){let n=M()??C({command:R()??"unknown",toolVersion:"unknown",projectFingerprint:null});if(!n)return{};let t=process.env[p],o=typeof e.name=="string"?e.name:void 0;if(!o)return{workloadIdentity:n,workloadIdentityKind:t};let r=o.split(/[.:]/,1)[0]??o,i=`${n}\0${o}`,c=_.get(i);return c||(c=S(["profile-subsystem-v1",n,o]),_.set(i,c)),{workloadIdentity:n,workloadIdentityKind:t,subsystem:r,subsystemWorkIdentity:c}}function f(e){return typeof e=="function"?e():e}export{a,S as b,V as c,A as d,Y as e,j as f,d as g};
4
+ //# sourceMappingURL=chunk-JHK2DMUQ.js.map
@@ -0,0 +1,3 @@
1
+ import{a as ce}from"./chunk-2HFXPIBT.js";import{b as ae}from"./chunk-B75HZHUP.js";import{a as N}from"./chunk-3I34FZ6R.js";import{b as Y,e as Q,f as ee,g as te}from"./chunk-NLRWGGPY.js";import{c as P}from"./chunk-UO4IADXJ.js";import{h as oe}from"./chunk-2Y7YX54K.js";import{a as ne,b as ie,c as re,k as se}from"./chunk-DA34GNNO.js";import{B as E,d as Z,e as $,g as J,h as K,i as q,j as G,k as V,w as X}from"./chunk-OO6S4ECV.js";import{p as H}from"./chunk-NLVKD45E.js";import{B as z,E as x,c as w}from"./chunk-MCNWCJYL.js";import{a as S}from"./chunk-64MNV6AB.js";import{b as L,h as B,s as b,v as U,x as j,y as I,z as W}from"./chunk-WFRZGMWJ.js";var _=new WeakMap,le=U({kind:"definition-exclusions",invalidation:j("definition-exclusions"),serialize:e=>JSON.stringify(e),deserialize:we});function de(e,t){let n=z(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let r=I(e,t);if(!r)return[];let o=B(e,t,r),c=le.read(e,t,o);if(c)return c;let u=n==="rust"?Me(e,t):Te(e,t);return le.write(e,t,o,u),u}function we(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=t.map(Ie);return n.some(i=>i===null)?null:n}catch{return null}}function Ie(e){if(!e||typeof e!="object")return null;let t=e;if(typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"||t.containerName!==void 0&&typeof t.containerName!="string")return null;let n=t.disposition===void 0?qe(t.reason):t.disposition;return n!=="exclude"&&n!=="implicit-usage"?null:{startLine:t.startLine,endLine:t.endLine,reason:t.reason,disposition:n,...t.containerName?{containerName:t.containerName}:{}}}var fe=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),Pe=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,Ne=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function Te(e,t){let n=I(e,t);if(!n||!ke(n))return[];let i=x(e,t);if(!i)return[];let r=_.get(i);if(r)return r;let o=!1,c=i.rootNode;for(let l of c.namedChildren){if(l.type!=="expression_statement")continue;let d=l.namedChild(0);if(!d||d.type!=="call_expression")continue;let s=d.namedChild(0);if(!s)continue;let a=s.type==="member_expression"?s.namedChild(s.namedChildCount-1)?.text:s.text;if(a&&fe.has(a)){o=!0;break}}let u=[];o&&u.push({startLine:0,endLine:c.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)",disposition:"exclude"});for(let l of c.namedChildren){let d=null,s=null;if(l.type==="function_declaration")d=l.namedChild(0)?.text??null,s=l;else if(l.type==="export_statement"){let a=l.namedChild(0);a?.type==="function_declaration"&&(d=a.namedChild(0)?.text??null,s=a)}else if(l.type==="lexical_declaration"){let a=l.namedChild(0);if(a?.type==="variable_declarator"){let m=a.namedChild(0)?.text,p=a.namedChild(1);m&&(p?.type==="arrow_function"||p?.type==="function_expression")&&(d=m,s=a)}}d&&/^use[A-Z]/.test(d)&&s&&u.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:"React custom hook (use*)",disposition:"exclude"})}return u.push(...me(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),_.set(i,u),u}function ke(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of fe)if(e.includes(n)){t=!0;break}return t&&Pe.test(e)?!0:e.includes("use")&&Ne.test(e)}var Ae=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Fe(e){return Ae.test(e)}function me(e,t,n){let i=[],r=o=>{if(t.has(o.type)&&o.parent){let u=o.parent.children,l=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===o.startIndex&&u[d].type===o.type){l=d;break}if(l>0)for(let d=l-1;d>=0;d-=1){let s=u[d];if(n.has(s.type)){if(Fe(s.text)){i.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"scip-query suppression comment",disposition:"exclude"});break}continue}if(!(s.type==="attribute_item"||s.type==="inner_attribute_item"))break}}for(let c of o.namedChildren)r(c)};return r(e.rootNode),i}function Me(e,t){let n=x(e,t);if(!n)return[];let i=_.get(n);if(i)return i;let r=[],o=Oe(n);return o?(_.set(n,o),o):(pe(n.rootNode,r,!1,!1),r.push(...me(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),r.push(...Je(n.rootNode)),_.set(n,r),r)}function Oe(e){return Ge(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)",disposition:"exclude"}]:null}function pe(e,t,n,i){let r=n,o=i;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)",disposition:"implicit-usage"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(o=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)",disposition:"implicit-usage"})),e.type==="function_item"||e.type==="function_signature_item"?Be(e,t,n,i):i&&$e(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)",disposition:"implicit-usage"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?Ue(e,t,n):e.type==="mod_item"&&T(e).some(c=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(c))&&(r=!0);for(let c of e.namedChildren)pe(c,t,r,o)}function Be(e,t,n,i){let r=T(e),o=null;i?o={reason:"trait impl method (dynamic dispatch)",disposition:"implicit-usage"}:n&&(o={reason:"inside #[cfg(test)] mod",disposition:"exclude"});for(let c of r){if(ye(c)){o={reason:"#[allow(dead_code)]",disposition:"exclude"};break}let u=He(c);if(u){o=u;break}}o&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:o.reason,disposition:o.disposition})}function Ue(e,t,n){let i=T(e),r=e.namedChildren.find(o=>o.type==="type_identifier")?.text;i.some(Ze)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(...)] - generated impl may access fields",disposition:"implicit-usage",containerName:r}),i.some(ye)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",disposition:"exclude",containerName:r}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",disposition:"exclude",containerName:r})}function T(e){let t=e.parent;if(!t)return[];let n=t.children,i=-1;for(let o=0;o<n.length;o+=1)if(n[o].startIndex===e.startIndex&&n[o].type===e.type){i=o;break}if(i<=0)return[];let r=[];for(let o=i-1;o>=0;o-=1){let c=n[o];if(c.type==="attribute_item"||c.type==="inner_attribute_item")r.push(c.text);else{if(c.type==="line_comment"||c.type==="block_comment")continue;break}}return r}var je=new Set(["test","bench","tokio::test","async_std::test"]),We=new Set(["no_mangle","export_name","link_name","used","macro_export","proc_macro","proc_macro_derive","proc_macro_attribute"]),ze=new Set(["allow","warn","deny","forbid","cfg","cfg_attr","doc","inline","cold","must_use","deprecated","repr","derive","automatically_derived","non_exhaustive","path","link","link_section","global_allocator","panic_handler"]);function He(e){if(/#\[\s*cfg\s*\(\s*test\s*\)/.test(e))return{reason:"#[cfg(test)]",disposition:"exclude"};let t=Ke(e);return t?je.has(t)?{reason:`#[${t}]`,disposition:"exclude"}:We.has(t)?{reason:`Rust ABI/export attribute #[${t}]`,disposition:"implicit-usage"}:ze.has(t)?null:{reason:`Rust attribute macro #[${t}]`,disposition:"implicit-usage"}:null}function Ze(e){return/#\[\s*derive\s*\(/.test(e)}function ye(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function $e(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Je(e){let t=Ve(e);if(t.size===0)return[];let n=[];for(let i of e.descendantsOfType("mod_item")){let r=i.childForFieldName("name")?.text;r&&t.has(r)&&n.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:'attribute `with = "..."` module - body may be invoked via reflection',disposition:"implicit-usage",containerName:r})}return n}function Ke(e){let t=/^#!?\[\s*([A-Za-z_][A-Za-z0-9_]*(?:\s*::\s*[A-Za-z_][A-Za-z0-9_]*)*)/.exec(e);return t?t[1].replace(/\s+/g,""):null}function qe(e){return e==="#[tauri::command]"||e==="#[command]"||e==="#[wasm_bindgen]"||e==="#[no_mangle]"||e==="#[napi]"||e==="#[pyfunction]"||e==="#[pymethod]"||e==="#[pyo3]"||e==="#[doc(hidden)]"||e.startsWith("trait ")||e.startsWith("#[derive(<reflective>)]")||e.startsWith("#[derive(...)]")||e.startsWith('serde `with = "')||e.startsWith('attribute `with = "')||e.startsWith("Rust attribute macro #[")||e.startsWith("Rust ABI/export attribute #[")?"implicit-usage":"exclude"}function Ge(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var ue=/\bwith\s*=\s*"([^"]+)"/g;function Ve(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){ue.lastIndex=0;let i;for(;(i=ue.exec(n.text))!==null;){let r=i[1],o=r.split("::").pop()??r;o&&t.add(o)}}return t}function be(e){let t=k(e);return(n,i,r,o)=>t(n,i,r,o)?.disposition==="exclude"}function k(e){let t=new Map,n=i=>{let r=t.get(i);if(r)return r;let o=de(e,i),c=new Map;for(let u of o){if(!u.containerName)continue;let l=c.get(u.containerName)??[];l.push(u),c.set(u.containerName,l)}return r={ranges:o,containers:c},t.set(i,r),r};return(i,r,o,c)=>{let u=n(i),l=[];for(let s of u.ranges)r>=s.startLine&&r<=s.endLine&&l.push(s);let d=new Set;c&&d.add(c);for(let s of E(o))d.add(s);for(let s of d){let a=u.containers.get(s);a&&l.push(...a)}return Xe(l)}}function Xe(e){if(e.length===0)return null;let n=e.find(i=>i.disposition==="exclude")??e[0];return{disposition:n.disposition,reason:n.reason}}function Ct(e,t={}){L(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function ge(e,t,n={}){L(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function he(e,t){if(t.isIgnoredPath(e.relativePath))return y("ignored-file");if(q(e.symbol))return y("module-like-symbol");if(!R(e.symbol))return y("non-value-symbol");if(!e.isFunctionLike&&e.enclosingSymbol&&R(e.enclosingSymbol))return y("nested-non-callable-value");if(!t.includeTests&&!Ye(e.relativePath))return y("test-file");if(!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName))return y("excluded-file-region");let n=$(e.symbol);if(n==="<constructor>")return y("implicit-constructor");if(e.symbol.startsWith("scip-python ")){if(n==="__all__")return y("python-runtime-metadata");if(/^__[^_].*__$/.test(n))return y("python-protocol-member")}return t.isDeclarationOnlyCallable()?y("declaration-only-callable"):t.isFrameworkContractCallable()?y("framework-contract-member"):G(e.symbol)?y("rust-trait-impl-member"):V(e.symbol)?y("rust-test-module"):!t.includeMembers&&!Qe(e)?y("member"):e.endLine-e.startLine+1<t.minLoc?y("below-min-loc"):{accepted:!0}}function Ye(e){return Y(e)!=="test"}function y(e){return{accepted:!1,rejectionReason:e}}function R(e){return K(e)||e.endsWith("().")||e.endsWith(".")}function Qe(e){return J(e.symbol)||E(e.symbol).length===0}function xe(){return new Map}function _e(e,t,n){let i=new Map;for(let r of ne(e,n))e.isIgnored(r.relative_path)||t.has(r.relative_path)||v(i,r.symbol_id,r.relative_path,r.ref_count,"scip-mention");return i}function Se(e,t,n,i={}){let r=new Set;if(i.conservative||n.size===0){for(let o of re(e,t))r.add(o.symbol_id);return r}for(let o of ie(e,t))e.isIgnored(o.relative_path)||n.has(o.relative_path)||r.add(o.symbol_id);return r}function A(e,t){let n=e.get(t);if(!n)return!1;for(let i of n.values())if(i.occurrences>0)return!0;return!1}function C(e,t,n){let i=e.get(t);if(!i)return!1;for(let[r,o]of i)if(r!==n&&o.occurrences>0)return!0;return!1}function Ee(e){return e?.occurrences??0}function v(e,t,n,i,r="source-fallback"){if(i<=0)return;let o=Ce(e,t,n);o.occurrences+=i,o.sources.add(r)}function Re(e,t,n,i,r){if(i<=0)return;let o=Ce(e,t,n);o.occurrences=Math.max(i,o.occurrences),o.sources.add(r)}function Ce(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let r=i.get(n);return r||(r={occurrences:0,sources:new Set},i.set(n,r)),r}var et=1e3,tt=300;function Xt(e,t={}){let{scope:n,minLoc:i=1,includeTests:r=!1,skipBarrels:o=!1,includeMembers:c=!1,deadCodeOnly:u=!1,scanLimit:l,semantic:d=!0}=t,s=0,a=b("dead.candidates",()=>{let f=ae(nt(e,{scope:n,minLoc:i,includeTests:r,includeMembers:c}),l);return s=f.length,f},()=>({definitions:s})),m=0,p=o?b("dead.inactive-barrels",()=>{let f=new Set(Q(e));return m=f.size,f},()=>({paths:m})):new Set,F=0,g=u?xe():b("dead.mention-reference-counts",()=>{let f=_e(e,p,a.map(D=>D.symbolId));return F=f.size,f},()=>({definitions:a.length,symbolsWithReferences:F})),M=0,De=u?b("dead.mentioned-symbol-ids",()=>{let f=Se(e,a.map(D=>D.symbolId),p,{conservative:p.size===0});return M=f.size,f},()=>({definitions:a.length,referencedSymbols:M})):new Set,h=u?a.filter(f=>!De.has(f.symbolId)):a.filter(f=>!C(g,f.symbolId,f.relativePath));u?b("dead.source-fallback.dead-code-only",()=>lt(e,h,g,{inactiveBarrelPaths:p}),()=>({definitions:h.length,testReferencesIncluded:!0})):b("dead.source-fallback.ast",()=>ct(e,h,g,{inactiveBarrelPaths:p}),()=>({definitions:h.length,testReferencesIncluded:!0}));let O=u?h.filter(f=>!A(g,f.symbolId)):h.filter(f=>!C(g,f.symbolId,f.relativePath));b("dead.caller-map-supplement",()=>pt(e,O,g,{inactiveBarrelPaths:p,includeSemantic:!u&&d}),()=>({definitions:O.length,semantic:!u&&d}));let Le=u?h.filter(f=>!A(g,f.symbolId)):a;return at(e,st(Le,g))}function nt(e,t){let n=be(e),i=[];for(let r of X(e,{scope:t.scope,symbolMatches:R,sqlPrefilter:"function-like"}))he(r,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:c=>e.isIgnored(c),isExcludedRegion:n,isDeclarationOnlyCallable:()=>rt(e,r),isFrameworkContractCallable:()=>ce(e,r)}).accepted&&i.push(r);return i}var it=["method_signature","abstract_method_signature","call_signature","construct_signature"];function rt(e,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let n=x(e,t.relativePath);if(n)return n.rootNode.descendantsOfType([...it]).some(r=>r.startPosition.row<=t.startLine&&r.endPosition.row>=t.endLine);let i=W(e,t.relativePath).slice(t.startLine,t.endLine+1).join(`
2
+ `).trim();return i.endsWith(";")&&!i.includes("=>")&&!i.includes("{")}function st(e,t){return e.map(n=>ot(n,t)).filter(n=>n.cross_file_refs===0).sort((n,i)=>i.loc-n.loc||n.relative_path.localeCompare(i.relative_path)||n.start_line-i.start_line)}function ot(e,t){let n=t.get(e.symbolId)??new Map,i=Ee(n.get(e.relativePath)),r=0;for(let[o,c]of n)o!==e.relativePath&&(r+=c.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,parent_type_name:e.parentTypeName,same_file_refs:i,cross_file_refs:r}}function at(e,t){let n=k(e),i=[],r=0,o=0,c=0,u=0,l=0,d=0;for(let s of t){if(e.isIgnored(s.relative_path))continue;if(ee(e,s.relative_path)){u++;continue}if(te(e,s.symbol,s.relative_path)){l++;continue}let a=n(s.relative_path,s.start_line,s.symbol,s.parent_type_name),m=a?.disposition==="implicit-usage"?a.reason:void 0,p=m?"implicit-usage":s.same_file_refs===0?"dead-code":"file-internal";p==="dead-code"?r++:p==="file-internal"?o++:c++,d+=s.loc,i.push({relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line,loc:s.loc,symbol:s.symbol,shortName:Z(s.symbol),sameFileRefs:s.same_file_refs,kind:p,...m?{implicitUsageReason:m}:{}})}return{symbols:i,counts:{total:i.length,deadCode:r,fileInternal:o,implicitUsage:c,loc:d},applicability:{entrySurfaceExcluded:u,externalRootExcluded:l,implicitUsageSignals:c},totalCount:i.length,deadCodeCount:r,fileInternalCount:o,implicitUsageCount:c,totalLoc:d}}function ct(e,t,n,i){if(t.length===0)return;let r=new N(e),o=new Set(t.map(l=>l.symbolId)),c=new Set(t.map(l=>l.leaf).filter(Boolean)),u=new Set(r.sourceFiles());for(let l of S(e))u.add(l);r.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:c,skipPath:l=>i.inactiveBarrelPaths.has(l)},l=>{o.has(l.target.symbolId)&&(ft(e,l)||v(n,l.target.symbolId,l.sourceFile,mt(l),"source-fallback"))})}function lt(e,t,n,i){if(t.length===0)return;let r=new N(e),o=ut(t),c=new Set(r.sourceFiles());for(let s of S(e))c.add(s);let u=new Set(o.keys()),l=new Map,d=s=>{let a=l.get(s);return a||(a=oe(e,s),l.set(s,a)),a};r.scanSourceReferences({paths:c,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:s=>i.inactiveBarrelPaths.has(s),resolveTargets:({sourceFile:s,name:a,kind:m})=>{let p=o.get(a);return p?dt(s,a,p,()=>d(s),{permissive:m!=="cross-language-dispatch"}):[]},afterPath:s=>{l.delete(s),ge(e,s)}},s=>{let a=s.kind==="identifier"&&s.sourceFile===s.target.relativePath?Math.max(0,s.occurrences-1):s.occurrences;s.kind==="identifier"&&ve(e,{sourceFile:s.sourceFile,name:s.name,target:s.target,occurrences:a})||v(n,s.target.symbolId,s.sourceFile,a,"source-fallback")})}function ut(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let i=t.get(n.leaf)??[];i.push(n),t.set(n.leaf,i)}return t}function dt(e,t,n,i,r){let o=n.filter(d=>d.relativePath===e);if(o.length>0)return o;if(!r.permissive&&n.length===1)return[...n];let c=i(),u=c.get(t);if(u)for(let d of u){let s=n.filter(a=>w(d,a.relativePath));if(s.length>0)return s}let l=new Set;for(let d of c.values())for(let s of d)l.add(s);for(let d of l){let s=n.filter(a=>w(d,a.relativePath));if(s.length>0&&s.length===n.length)return s}return r.permissive?[...n]:[]}function ft(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&ve(e,t)}function mt(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function ve(e,t){return t.occurrences>1?!1:H(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function pt(e,t,n,i){let r=i.includeSemantic!==!1,o=r&&t.length>=et&&S(e).length>=tt,c=(s,a)=>{a===s.relativePath||e.isIgnored(a)||i.inactiveBarrelPaths.has(a)||Re(n,s.symbolId,a,1,"caller-map")};if(o?b("dead.caller-map.per-symbol-non-semantic",()=>{for(let s of t){let a=P(e,s,{semantic:!1});for(let m of a)c(s,m.file)}},()=>({definitions:t.length,semantic:!1})):b("dead.caller-map.per-symbol",()=>{for(let s of t){let a=P(e,s,{semantic:r});if(a.length!==0)for(let m of a)c(s,m.file)}},()=>({definitions:t.length,semantic:r})),!o)return;let u=0,l=b("dead.caller-map.semantic-candidates",()=>{let s=t.filter(a=>!C(n,a.symbolId,a.relativePath));return u=s.length,s},()=>({definitions:t.length,semanticCandidates:u}));if(l.length===0)return;let d=se(e,l);for(let s of l){let a=d.get(s.symbolId);if(a)for(let m of a)c(s,m)}}export{Ct as a,Xt as b};
3
+ //# sourceMappingURL=chunk-JQ2PCFZW.js.map
@@ -0,0 +1,16 @@
1
+ import{b as x,j as k}from"./chunk-FFIYGYQR.js";import he from"better-sqlite3";import{existsSync as bn}from"fs";import{dirname as yn,join as xn,resolve as ye}from"path";import G from"better-sqlite3";import{execFileSync as K}from"child_process";import{existsSync as X,readdirSync as J,readFileSync as B}from"fs";import{extname as m,join as I}from"path";import{readdirSync as we}from"fs";import{execFileSync as Ae}from"child_process";import{extname as De,join as _e}from"path";var H=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],v=[".vue"],V=[".tsx",".jsx"],E=[".vue"],je=[...V,...E],$e=new Set(V),Ue=new Set(E),W=new Set(H.map(e=>e.toLowerCase())),He=[...W].sort().join(","),C=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);var We=x("source-files",{clearGroups:[]});function ze(e={}){return{id:"auxiliary-documents",facts:["auxiliary-document"],run:n=>q({projectRoot:n.projectRoot,dbPath:n.dbPath,extensions:e.extensions,onStatus:n.onStatus})}}function q(e){let n=new Set((e.extensions??v).map(i=>i.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!X(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=k(e.projectRoot),t=Y(e.projectRoot,n).filter(i=>!r.isIgnored(i)),o=new G(e.dbPath);try{let i=Q(o,t),s=o.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
2
+ VALUES (?, ?, NULL, ?)`),u=o.transaction(l=>{let d=0;for(let f of l){if(i.has(f))continue;let p=B(I(e.projectRoot,f),"utf-8"),U=s.run(Z(f),f,p);d+=Number(U.changes)}return d})(t),c={scanned:t.length,inserted:u,existing:t.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{o.close()}}function Y(e,n){let r=z(e,n);if(r)return r;let t=[],o=i=>{let s=i?I(e,i):e,a;try{a=J(s,{withFileTypes:!0})}catch{return}for(let u of a){if(C.has(u.name))continue;let c=i?`${i}/${u.name}`:u.name;if(u.isDirectory()){o(c);continue}n.has(m(u.name).toLowerCase())&&t.push(c)}};return o(""),t.sort()}function z(e,n){try{return K("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}).split(`
3
+ `).filter(t=>t&&n.has(m(t).toLowerCase())).sort()}catch{return null}}function Q(e,n){let r=new Set,t=500;for(let o=0;o<n.length;o+=t){let i=n.slice(o,o+t),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let a of s)r.add(a.relative_path)}return r}function Z(e){return m(e).toLowerCase()===".vue"?"vue":m(e).replace(/^\./,"").toLowerCase()||"source"}import{readFileSync as en,writeFileSync as nn}from"fs";function tn(e,n){let r=Date.now(),t=e.run(n);return{stageId:e.id,facts:e.facts,durationMs:Date.now()-r,result:t}}function ee(){return{"missing-source-file":0,"missing-service-script":0,"no-definition":0,"same-file-definition":0,"unindexed-definition":0}}function S(){return{skippedReferences:0,skippedReferenceReasons:ee(),skippedReferenceSamples:[]}}function T(e,n){e.skippedReferences+=n.skippedReferences;for(let r of Object.keys(e.skippedReferenceReasons)){e.skippedReferenceReasons[r]+=n.skippedReferenceReasons[r];for(let t of n.skippedReferenceSamples.filter(o=>o.reason===r))e.skippedReferenceSamples.filter(i=>i.reason===r&&i.sourceFile===t.sourceFile).length<2&&e.skippedReferenceSamples.push(t)}}import{createRequire as ne}from"module";import{existsSync as te,readFileSync as b}from"fs";import{dirname as L,extname as re,join as F,relative as oe,resolve as cn}from"path";import{pathToFileURL as ie}from"url";function O(e,n){let{vueCore:r,ts:t,volarTs:o}=se(e),{parsed:i,vueOptions:s}=ae(r,t,n),a=L(n),u=r.createVueLanguagePlugin(t,i.options,s,p=>p),c=ue(r,t,u),l=ce(a,i),{languageServiceHost:d}=o.createLanguageServiceHost(t,t.sys,c,p=>p,l),f=t.createLanguageService(d);return{ts:t,language:c,languageService:f,fileNames:i.fileNames,configDir:a}}function se(e){let n=ne(ie(F(e,"package.json")).href);return{vueCore:R(n,"@vue/language-core",e),ts:R(n,"typescript",e),volarTs:R(n,"@volar/typescript",e)}}function ae(e,n,r){let t=n.readConfigFile(r,n.sys.readFile);if(t.error||!t.config)throw new Error(`Failed to read ${r}`);let i=e.createParsedCommandLine(n,n.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(i.globalTypesPath=e.createGlobalTypesWriter(i,n.sys.writeFile)),{parsed:n.parseJsonConfigFileContent(t.config,n.sys,L(r),void 0,r,void 0,e.getAllExtensions(i).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:n.ScriptKind.Deferred}))),vueOptions:i}}function ue(e,n,r){let t={},o=e.createLanguage([r],new Map,i=>{if(!te(i))return;let s=b(i,"utf-8");t.current?.scripts.set(i,n.ScriptSnapshot.fromString(s),r.getLanguageId(i)??fe(i))});return t.current=o,o}function ce(e,n){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>n.options,getScriptFileNames:()=>n.fileNames,getProjectReferences:()=>n.projectReferences,getProjectVersion:()=>"0"}}function R(e,n,r){try{return e(n)}catch(t){throw(typeof t=="object"&&t!==null&&"code"in t?t.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${n} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:t}):t}}function w(e,n,r){let t=le(e);return o=>{if(!o.name)return null;let i=g(n,o.fileName),s=r.get(o.fileName);if(!s)return null;let a=r.positionAt(s,o.textSpan.start),u=t.get(i);if(!u)return null;let c=u.starts.find(d=>d.line===a.line&&d.displayName===o.name);if(c)return c.symbolId;let l=u.containingByLine.get(a.line);return l&&l.displayName===o.name?l.symbolId:de(u.starts,a.line,2,o.name)}}function le(e){let n=e.prepare(`
4
+ SELECT
5
+ d.relative_path AS relativePath,
6
+ der.start_line AS startLine,
7
+ der.end_line AS endLine,
8
+ der.symbol_id AS symbolId,
9
+ gs.display_name AS displayName
10
+ FROM defn_enclosing_ranges der
11
+ JOIN documents d ON d.id = der.document_id
12
+ JOIN global_symbols gs ON gs.id = der.symbol_id
13
+ ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
14
+ `).all(),r=new Map;for(let t of n){let o=r.get(t.relativePath);o||(o={containingByLine:new Map,starts:[]},r.set(t.relativePath,o)),o.starts.push({line:t.startLine,symbolId:t.symbolId,displayName:t.displayName});for(let i=t.startLine;i<=t.endLine;i++)o.containingByLine.set(i,{symbolId:t.symbolId,displayName:t.displayName})}for(let t of r.values())t.starts.sort((o,i)=>o.line-i.line);return r}function de(e,n,r,t){let o=0,i=e.length-1;for(;o<=i;){let a=Math.floor((o+i)/2);e[a].line<n?o=a+1:i=a-1}let s=null;for(let a of[i,o]){let u=e[a];if(!u||u.displayName!==t)continue;let c=Math.abs(u.line-n);c>r||(!s||c<s.distance)&&(s={distance:c,symbolId:u.symbolId})}return s?.symbolId??null}function N(e,n){let r=me(n),t=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),o=new Map;return{get(i){if(o.has(i))return o.get(i)??null;let s=Se(t,r,n,i);return o.set(i,s),s}}}function A(e,n,r,t,o){if(e.fileName.endsWith(".vue")){let i=t.language.scripts.get(e.fileName),s=i?.generated?.languagePlugin.typescript?.getServiceScript(i.generated.root)?.code;if(i&&s){let a=t.language.maps.get(s,i);if(h(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(o)?r.get(e.fileName):null}return n(e)}function*P(e){let n=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),t;for(;t=n.exec(e);){let o=t[0];r.has(o)||(yield{text:o,start:t.index,end:t.index+o.length})}}function D(e,n){for(let[r]of e.toGeneratedLocation(n,t=>!!t.navigation))return r;return null}function h(e,n){let r=e;for(let[t]of r.toSourceLocation(n,o=>!!o.navigation))return t;return null}function ge(e,n){let r=0,t=e.lineStarts.length-1;for(;r<=t;){let i=Math.floor((r+t)/2);e.lineStarts[i]<=n?r=i+1:t=i-1}let o=Math.max(0,t);return{line:o,character:n-e.lineStarts[o]}}function _(e,n){return g(e,n).startsWith("node_modules/")}function g(e,n){return oe(e,n).replaceAll("\\","/")}function fe(e){switch(re(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function M(){let e=new Map;return{get(n){if(e.has(n))return e.get(n)??null;try{let r=b(n,"utf-8"),t={text:r,lineStarts:pe(r)};return e.set(n,t),t}catch{return e.set(n,null),null}},positionAt:ge}}function pe(e){let n=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&n.push(r+1);return n}function me(e){try{let n=JSON.parse(b(F(e,"package.json"),"utf-8"));return{name:n.name??"workspace",version:n.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function Se(e,n,r,t){let o=g(r,t),i=Re(n.name,n.version,o);return e.get(i)?.id??null}function Re(e,n,r){let t=r.split("/").map(o=>`\`${o.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${n} ${t}/default.`}function Vn(e){let n=ye(e.projectRoot,e.tsconfig),r=new he(e.dbPath,{readonly:!0});try{let t=xe({db:r,projectRoot:e.projectRoot,configPath:n,vueSymbolLookup:N(r,e.projectRoot)});return ke({vueFiles:e.vueFiles??[],tasks:e.tasks,...t})}finally{r.close()}}function xe(e){let n=M();return{projectRoot:e.projectRoot,context:O(e.projectRoot,e.configPath),symbolLookup:w(e.db,e.projectRoot,n),vueSymbolLookup:e.vueSymbolLookup,sourceReader:n}}function ke(e){let n=[],r=S(),t=e.tasks??e.vueFiles.map(o=>({fileName:o,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let o of t){let i=ve(e,o);n.push(...i.occurrences),T(r,i)}return{occurrences:n,...r}}function ve(e,n){let r=e.sourceReader.get(n.fileName);if(!r)return j(e.projectRoot,n,"missing-source-file");let t=e.context.language.scripts.get(n.fileName),o=t?.generated?.languagePlugin.typescript?.getServiceScript(t.generated.root)?.code;if(!t||!o)return j(e.projectRoot,n,"missing-service-script");let i=e.context.language.maps.get(o,t),s=g(e.projectRoot,n.fileName),a=[...P(r.text)],u={tokens:a.filter(c=>c.start>=n.startOffset&&c.start<n.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:Te(a),processedStarts:new Set};return Ve({...e,fileName:n.fileName,sourceInfo:r,sourceFile:s,map:i,tokenContext:u})}function Ve(e){let n=[],r=S();for(let t of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(t.start)||Ee(e.sourceInfo.text,t.start))continue;let o=D(e.map,t.start);if(o===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,o+1)??[]).find(l=>!_(e.projectRoot,l.fileName));if(!s){y(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,"no-definition");continue}let a=g(e.projectRoot,s.fileName),u=Ce(e.sourceFile,t.text,a);if(u){y(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,u);continue}let c=A(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(c===null){y(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,"unindexed-definition");continue}$(n,e.sourceReader,e.sourceInfo,e.sourceFile,t,a,c),e.tokenContext.processedStarts.add(t.start),Ie(n,e,t,o,a,c)}return{occurrences:n,...r}}function Ee(e,n){let r=e.lastIndexOf(`
15
+ `,n-1)+1,t=e.slice(r,n);return/\bfrom\s+['"][^'"]*$/.test(t)||/\bimport\s*\(\s*['"][^'"]*$/.test(t)}function Ce(e,n,r){return r===e?"same-file-definition":r.endsWith(".vue")&&n!==r.split("/").at(-1)?.replace(/\.vue$/,"")?"unindexed-definition":null}function j(e,n,r){let t=S();return n.countFileSkip&&(t.skippedReferences=1,t.skippedReferenceReasons[r]=1,t.skippedReferenceSamples.push({sourceFile:g(e,n.fileName),sourceLine:0,sourceStartChar:0,sourceEndChar:0,token:"",reason:r})),{occurrences:[],...t}}function y(e,n,r,t,o,i){if(e.skippedReferences++,e.skippedReferenceReasons[i]++,e.skippedReferenceSamples.filter(a=>a.reason===i&&a.sourceFile===t).length>=2)return;let s=n.positionAt(r,o.start);e.skippedReferenceSamples.push({sourceFile:t,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+o.text.length,token:o.text,reason:i})}function Ie(e,n,r,t,o,i){if(!((n.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let s of Le(n.context.languageService,n.fileName,t+1,n.map,r,n.tokenContext.tokenByStart)){if(n.tokenContext.processedStarts.has(s))continue;let a=n.tokenContext.tokenByStart.get(s);a&&($(e,n.sourceReader,n.sourceInfo,n.sourceFile,a,o,i),n.tokenContext.processedStarts.add(s))}}function $(e,n,r,t,o,i,s){let a=n.positionAt(r,o.start);e.push({sourceFile:t,sourceLine:a.line,sourceStartChar:a.character,sourceEndChar:a.character+o.text.length,sourceToken:o.text,definitionFile:i,symbolId:s})}function Te(e){let n=new Map;for(let r of e)n.set(r.text,(n.get(r.text)??0)+1);return n}function Le(e,n,r,t,o,i){let s=e.getDocumentHighlights?.(n,r,[n])??[],a=[];for(let u of s)if(u.fileName===n)for(let c of u.highlightSpans){let l=Fe(t,c.textSpan.start,i,o.text);l!==null&&a.push(l)}return a}function Fe(e,n,r,t){let o=r.get(n);if(o?.text===t)return o.start;let i=h(e,n);if(i===null)return null;let s=r.get(i);return s?.text===t?s.start:null}export{ze as a,tn as b,Vn as c};
16
+ //# sourceMappingURL=chunk-JRFCWCOD.js.map
@@ -0,0 +1,2 @@
1
+ import{b}from"./chunk-QB7NRST4.js";import{m as d,x as f}from"./chunk-OO6S4ECV.js";function S(a,g){let p=b(a,g),i=f(a,p,{sort:!0});if(i.length===0)return[];let o=i.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,signature:e.signature,children:[]})),s=new Map;for(let e of o)s.set(e.symbol,e);let c=[];for(let e=0;e<i.length;e++){let r=i[e],n=o[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of o)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!d(t.symbol,n.symbol))continue;let u=t.endLine-t.startLine;u<m&&(m=u,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
2
+ //# sourceMappingURL=chunk-JXAJDINF.js.map
@@ -0,0 +1,2 @@
1
+ import{a as R}from"./chunk-ZHGUZKJL.js";import{a as D}from"./chunk-3OPIMH42.js";import{a as g}from"./chunk-S5RZQA6V.js";import{a as F}from"./chunk-3LAKH6BV.js";import{a as y}from"./chunk-HLRWOFXC.js";import{e as f}from"./chunk-A46JTKTM.js";import{j as d}from"./chunk-OO6S4ECV.js";import{M as h}from"./chunk-MCNWCJYL.js";var A=.7,S=.62,C=.45;function J(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:o}=t,s=y(i,{historyMode:t.historyMode}).fileAddRecords();if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let r=P(s,e);if(r.size===0)return{available:!0,windowCommits:e,findings:[]};let b=B(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:o,scope:a,semantic:t.semantic,focusFiles:Number.isFinite(n)?void 0:r}).map(l=>O(l,s,e)).filter(l=>l!==null);b.sort((l,c)=>(l.kind===c.kind?0:l.kind==="echo"?-1:1)||c.similarity-l.similarity||l.echoFile.localeCompare(c.echoFile)||l.echoSymbol.localeCompare(c.echoSymbol)||l.domain.localeCompare(c.domain));let p=b.slice(0,n).map(M);return{available:!0,windowCommits:e,findings:p,rootCauseGroups:N(p)}}function B(i,t){let e=K(t.limit),n=[...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??A,limit:e,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles})],a=h(i,{scope:t.scope});return a.react&&n.push(...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),a.vue&&n.push(...x(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...T(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),n}function k(i,t){return f(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles}).filter(e=>!d(e.symbolA)&&!d(e.symbolB)).map(e=>({domain:"callable",basis:e.similarityBasis??"callees",symbolA:e.shortNameA,fileA:e.fileA,symbolB:e.shortNameB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:e.sharedCallees,sharedCallees:e.sharedCallees}))}function E(i,t){return u(i,t,{query:g,domain:"react-component",basis:"jsx-structure",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["component",e.sharedComponents],["tag",e.sharedNativeTags],["prop",e.sharedProps],["event",e.sharedEvents],["binding",e.sharedBindings]]})}function u(i,t,e){return e.query(i,t).filter(n=>n.fileA!==n.fileB).filter(n=>e.acceptPair?.(n)??!0).map(n=>({domain:e.domain,basis:e.basis,symbolA:e.symbolA(n),fileA:n.fileA,symbolB:e.symbolB(n),fileB:n.fileB,similarity:n.similarity,sharedEvidence:G(...e.evidenceBuckets(n)),sharedCallees:[]}))}function L(i,t){return u(i,t,{query:F,domain:"react-hook",basis:"react-behavior",symbolA:e=>e.componentA,symbolB:e=>e.componentB,acceptPair:w,evidenceBuckets:e=>[["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]]})}var I=new Set(["useCallback","useEffect","useLayoutEffect","useMemo","useMutation","useQueries","useQuery","useQueryClient","useReducer","useRef","useState"]);function w(i){return i.sharedHooks.some(t=>!I.has(t))||i.sharedState.length>0||i.sharedHandlers.length>0||i.sharedHandlerVerbs.length>=2}function x(i,t){return u(i,t,{query:D,domain:"vue-component",basis:"vue-template",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["component",e.sharedComponents],["prop",e.sharedProps],["event",e.sharedEvents],["directive",e.sharedDirectives],["slot",e.sharedSlots],["identifier",e.sharedIdentifiers]]})}function T(i,t){return u(i,t,{query:R,domain:"vue-composable",basis:"vue-behavior",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["composable",e.sharedComposables],["store",e.sharedStores],["reactivity",e.sharedReactivity],["lifecycle",e.sharedLifecycle],["request",e.sharedRequests],["function",e.sharedFunctions],["action",e.sharedFunctionVerbs],["binding",e.sharedBindings],["template-event",e.sharedTemplateEvents]]})}function P(i,t){let e=new Set;for(let[n,a]of i)a.commitsAgo<=t&&e.add(n);return e}function O(i,t,e){let n=t.get(i.fileA)?.commitsAgo??null,a=t.get(i.fileB)?.commitsAgo??null,o=n!==null&&n<=e,s=a!==null&&a<=e;if(!o&&!s)return null;if(o&&s){let r=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:r?i.symbolA:i.symbolB,echoFile:r?i.fileA:i.fileB,echoAgeCommits:(r?n:a)??0,establishedSymbol:r?i.symbolB:i.symbolA,establishedFile:r?i.fileB:i.fileA,establishedAgeCommits:r?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}return{kind:"echo",domain:i.domain,basis:i.basis,echoSymbol:o?i.symbolA:i.symbolB,echoFile:o?i.fileA:i.fileB,echoAgeCommits:(o?n:a)??0,establishedSymbol:o?i.symbolB:i.symbolA,establishedFile:o?i.fileB:i.fileA,establishedAgeCommits:o?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}function M(i){let t=v(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function v(i){if(i.kind==="echo")return["echo",i.domain,i.basis,i.establishedSymbol].join(":");let t=i.sharedEvidence.slice().sort().join("|"),e=[i.echoSymbol,i.establishedSymbol].sort().join("|");return["twin",i.domain,i.basis,t||e].join(":")}function N(i){let t=new Map;for(let[e,n]of i.entries()){let a=n.rootCauseKey??v(n),o=n.groupKey??`recent-duplicate:${a}`,s=t.get(o);s||(s={groupKey:o,rootCauseKey:a,kind:n.kind,domain:n.domain,basis:n.basis,count:0,maxSimilarity:n.similarity,findingIndexes:[],echoFiles:new Set,establishedFile:n.kind==="echo"?n.establishedFile:void 0,establishedSymbol:n.kind==="echo"?n.establishedSymbol:void 0,relatedFiles:new Set,sharedEvidence:new Set,recommendation:H(n)},t.set(o,s)),s.count+=1,s.maxSimilarity=Math.max(s.maxSimilarity,n.similarity),s.findingIndexes.push(e),s.echoFiles.add(n.echoFile),s.relatedFiles.add(n.echoFile),s.relatedFiles.add(n.establishedFile);for(let r of n.sharedEvidence)s.sharedEvidence.add(r)}return[...t.values()].map(e=>({...e,echoFiles:[...e.echoFiles].sort(),relatedFiles:[...e.relatedFiles].sort(),sharedEvidence:[...e.sharedEvidence].sort().slice(0,16)})).sort((e,n)=>n.count-e.count||n.maxSimilarity-e.maxSimilarity||e.groupKey.localeCompare(n.groupKey))}function H(i){return i.kind==="echo"?"Review the established side once, then migrate or delete every echo in this group.":"Pick one owner for the new twins and consolidate the group before the copies diverge."}function K(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function G(...i){let t=[],e=new Set;for(let[n,a]of i)for(let o of a){let s=`${n}:${o}`;e.has(s)||(e.add(s),t.push(s))}return t}function m(i){return(i.split("/").pop()??i).replace(/\.[^.]+$/,"")}export{J as a};
2
+ //# sourceMappingURL=chunk-K32ZOW3P.js.map
@@ -1,2 +1,2 @@
1
- import{c as m}from"./chunk-B75HZHUP.js";import{a as g,c as b}from"./chunk-5VY3RIEI.js";import{q as y}from"./chunk-GULVO6NF.js";import{a as c}from"./chunk-27HMTUJE.js";import{d as r}from"./chunk-X5C43YVI.js";function v(l,t,n={}){let o=c(l,t);if(!o)return null;let a=[{file:o.relativePath,line:o.startLine}],s=y(l,o,{semantic:n.semantic}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:f,consumers:i}=S(l,o,s,{semantic:n.semantic!==!1});return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:a.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:f.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:i.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function S(l,t,n,o){let a=m(g(l,t,{limit:30,semantic:o.semantic}).map(i=>({symbol:i.symbol,file:i.file}))),s=m(b(l,t,{limit:30,semantic:o.semantic})),f=s.length>0?s:m(n.map(i=>({symbol:i.enclosingSymbol==="(top-level)"?i.file:i.enclosingSymbol,file:i.file})));return{producers:a,consumers:f}}export{v as a};
2
- //# sourceMappingURL=chunk-3H5OSDF7.js.map
1
+ import{c as m}from"./chunk-B75HZHUP.js";import{a as g,c as b}from"./chunk-UO4IADXJ.js";import{m as y}from"./chunk-2Y7YX54K.js";import{a as c}from"./chunk-YSUD2S7T.js";import{d as r}from"./chunk-OO6S4ECV.js";function v(l,t,n={}){let o=c(l,t);if(!o)return null;let a=[{file:o.relativePath,line:o.startLine}],s=y(l,o,{semantic:n.semantic}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:f,consumers:i}=S(l,o,s,{semantic:n.semantic!==!1});return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:a.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:f.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:i.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function S(l,t,n,o){let a=m(g(l,t,{limit:30,semantic:o.semantic}).map(i=>({symbol:i.symbol,file:i.file}))),s=m(b(l,t,{limit:30,semantic:o.semantic})),f=s.length>0?s:m(n.map(i=>({symbol:i.enclosingSymbol==="(top-level)"?i.file:i.enclosingSymbol,file:i.file})));return{producers:a,consumers:f}}export{v as a};
2
+ //# sourceMappingURL=chunk-KI4WPR7Q.js.map
@@ -1,3 +1,3 @@
1
- import{a as d}from"./chunk-27HMTUJE.js";import{b as g,d as m}from"./chunk-X5C43YVI.js";function _(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
1
+ import{a as d}from"./chunk-YSUD2S7T.js";import{b as g,d as m}from"./chunk-OO6S4ECV.js";function _(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
2
2
  WHERE id = ? LIMIT 1`,a.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],e=t.enclosing_symbol,r=1,c=new Set([t.symbol]);for(;e&&!c.has(e)&&r<20;){c.add(e);let s=n.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",e);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:r}),e=s.enclosing_symbol,r++}if(o.length>1)return o;let y=g(t.symbol);if("kind"in y)return o;let l=y.descriptors;if(l.length<=1)return o;let b=[o[0]];for(let s=l.length-2,h=1;s>=0;s--,h++){let p=l.slice(0,s+1).map(i=>i.suffix==="method"?`${i.name}()`:i.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");b.push({symbol:p,shortName:p,depth:h})}return b}export{_ as a};
3
- //# sourceMappingURL=chunk-43GKP6LI.js.map
3
+ //# sourceMappingURL=chunk-KP2DJY7D.js.map
@@ -1,2 +1,2 @@
1
- import{a as f}from"./chunk-IMQFJ53K.js";import{a as h}from"./chunk-27HMTUJE.js";import{e as s,g as u}from"./chunk-X5C43YVI.js";import{f as d}from"./chunk-JZBGTSAB.js";import{x as c}from"./chunk-ISLWJ4PY.js";import{basename as p}from"path";function N(r,o){let t=h(r,o);if(!t)return[];let e=s(t.symbol),a=new f(r).definitionsForFile(t.relativePath).filter(n=>u(n.symbol)),l=a.filter(n=>n.parentTypeName===e||n.symbol.includes(e)),m=(l.length>0?l:L(p(t.relativePath))===e?a.filter(n=>n.symbol.includes("<invalid-global-code>")):[]).map(n=>({startLine:n.startLine,endLine:n.endLine,name:s(n.symbol)}));return c(t.relativePath)!=="clojure"?m:b(m,M(r,t))}function L(r){return r.replace(/\.[^.]+$/,"")}function M(r,o){let t=s(o.symbol);return t?(d(r,o.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({startLine:e.startLine,endLine:e.endLine,name:e.memberName})):[]}function b(r,o){let t=new Map;for(let e of[...r,...o])t.set(`${e.name}:${e.startLine}:${e.endLine}`,e);return[...t.values()].sort((e,i)=>e.startLine-i.startLine||e.endLine-i.endLine)}export{N as a};
2
- //# sourceMappingURL=chunk-YTVKPJXW.js.map
1
+ import{a as f}from"./chunk-3I34FZ6R.js";import{a as h}from"./chunk-YSUD2S7T.js";import{e as s,g as u}from"./chunk-OO6S4ECV.js";import{f as d}from"./chunk-NLVKD45E.js";import{B as c}from"./chunk-MCNWCJYL.js";import{basename as p}from"path";function N(r,o){let t=h(r,o);if(!t)return[];let e=s(t.symbol),a=new f(r).definitionsForFile(t.relativePath).filter(n=>u(n.symbol)),l=a.filter(n=>n.parentTypeName===e||n.symbol.includes(e)),m=(l.length>0?l:L(p(t.relativePath))===e?a.filter(n=>n.symbol.includes("<invalid-global-code>")):[]).map(n=>({startLine:n.startLine,endLine:n.endLine,name:s(n.symbol)}));return c(t.relativePath)!=="clojure"?m:b(m,M(r,t))}function L(r){return r.replace(/\.[^.]+$/,"")}function M(r,o){let t=s(o.symbol);return t?(d(r,o.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({startLine:e.startLine,endLine:e.endLine,name:e.memberName})):[]}function b(r,o){let t=new Map;for(let e of[...r,...o])t.set(`${e.name}:${e.startLine}:${e.endLine}`,e);return[...t.values()].sort((e,i)=>e.startLine-i.startLine||e.endLine-i.endLine)}export{N as a};
2
+ //# sourceMappingURL=chunk-L27UIF3E.js.map
@@ -0,0 +1,18 @@
1
+ import{a as S}from"./chunk-3I34FZ6R.js";import{b as D}from"./chunk-NLRWGGPY.js";import{h as v}from"./chunk-DA34GNNO.js";import{p as y}from"./chunk-NLVKD45E.js";import{a as b}from"./chunk-64MNV6AB.js";import p from"path";var w={analysis:new Set(["domain","source","storage","symbols"]),core:new Set(["analysis","domain","resolution","source","storage","symbols"]),domain:new Set([]),instrumentation:new Set([]),"language-parsers":new Set(["core","domain","resolution","source","storage"]),queries:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage","symbols"]),reindex:new Set(["domain","language-parsers","resolution","runtime","semantic","source","storage","symbols"]),resolution:new Set(["domain","source","storage","symbols"]),runtime:new Set(["core","domain","language-parsers","queries","reindex","resolution","semantic","source","storage","symbols","tla"]),semantic:new Set(["core","domain","language-parsers","reindex","resolution","runtime","source","storage","symbols"]),source:new Set(["core","domain","resolution","storage"]),storage:new Set(["analysis","domain","queries","source"]),symbols:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage"]),tla:new Set(["core","domain","queries","source","storage","symbols"])};function f(e){let t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t.length<=1?"(root)":t.length>=3&&["src","lib","app","server","client"].includes(t[0])?`${t[0]}/${t[1]}`:t[0]}function h(e,n){if(e===n)return"ok";let t=g(e),i=g(n);return t&&i?!m(t)||!m(i)?null:P(t,i)?"ok":"violation":E(e,n)}function k(e,n){let t=g(f(e)),i=g(f(n));return!!t&&!!i&&m(t)&&m(i)}function R(e,n){let t=g(e),i=g(n);return!!t&&!!i&&(!m(t)||!m(i))}function g(e){return/^src\/([^/]+)$/.exec(e)?.[1]??null}function P(e,n){return n==="instrumentation"||n==="domain"?!0:e==="domain"?!1:w[e]?.has(n)??!1}function m(e){return Object.hasOwn(w,e)}function E(e,n){if(n==="shared")return"ok";let t={app:new Set(["core","shared","ui"]),core:new Set(["shared"]),infra:new Set(["core","shared"]),ui:new Set(["core","shared"])};return t[e]?t[e].has(n)?"ok":"violation":null}function re(e,n){let{scope:t,minDeviation:i=5,limit:r=50}=n??{},a=n?.semantic!==!1,c=n?.includePatternDeviations===!0,s=new S(e).fileDependencyGraph(t),l=F([...I(e,s,{scope:t,semantic:a}),...M(s),...c?N(s,i):[]]);return r<=0||l.results.length<=r?l:{...l,results:l.results.slice(0,r),totalResults:l.results.length}}function I(e,n,t){let i=T(e,t.scope),r=[],a=new Set;for(let[o,s]of n){if(d(o))continue;let l=i.get(o)??new Set;for(let u of s)d(u)||l.has(u)||_(e,o,u,t)||(r.push({file:o,dep:u}),a.add(o))}a.size>0&&B(e,i,{paths:[...a]});let c=[];for(let{file:o,dep:s}of r)(i.get(o)??new Set).has(s)||c.push({file:o,kind:"unused-import",description:`Depends on ${s} but references none of its symbols`,dep:s,actionTier:"direct",evidenceReasons:[`dependency edge exists from ${o} to ${s}`,"no semantic, source, type-only, side-effect, or Vue-template usage survived the conservative skip gates"],recommendation:"Remove the unused import or dependency edge after running the project checks."});return c}function _(e,n,t,i){return J(e,n,t)||z(e,n,t)||V(t)||W(e,n,t)||K(t)?!0:i.semantic&&C(e,n,t)}function M(e){let n=[],t=U(e);for(let[i,r]of e){if(d(i))continue;let a=f(i);for(let c of r){if(d(c))continue;let o=f(c);if(a===o)continue;let s=h(a,o),l=s===null&&R(a,o),u=s?"explicit":l?"unknown-layer":"inferred";if((l?"violation":s??t.get(`${a}->${o}`))==="violation"){let $=u==="explicit"?"direct":"signal";n.push({file:i,kind:"layer-violation",description:`Imports from ${o}/ (${c}) \u2014 may cross architectural boundary`,dep:c,detail:`${a}/ should not depend on ${o}/`,actionTier:$,policyBasis:u,evidenceReasons:[`dependency edge exists from ${i} to ${c}`,O(u,a,o)],recommendation:u==="explicit"?"Move the dependency behind an allowed layer boundary or document a policy change.":u==="unknown-layer"?"Add a layer policy entry before treating this as a boundary violation.":"Review whether this is a real boundary break or an intentional exception before moving code."})}}}return n}function O(e,n,t){return e==="explicit"?`explicit layer policy rejects ${n}/ -> ${t}/`:e==="unknown-layer"?`source layer policy has no entry for ${n}/ -> ${t}/`:`rare cross-layer edge ${n}/ -> ${t}/ is inferred as a violation`}function N(e,n){let t=[];for(let[i,r]of A(e)){let a=r.filter(o=>!d(o));if(a.length<n)continue;let c=L(e,a);for(let o of a)for(let s of e.get(o)??[])d(s)||(c.get(s)??0)===1&&p.dirname(s)!==i&&p.dirname(s)!==p.dirname(i)&&(k(o,s)||t.push({file:o,kind:"pattern-deviation",description:`Only file in ${i}/ that depends on ${s}`,dep:s,actionTier:"signal",evidenceReasons:[`${a.length} sibling file(s) in ${i}/ were compared`,`${o} is the only non-skipped sibling depending on ${s}`],recommendation:"Review sibling ownership before changing this import; unique dependency shape can be intentional specialization."}))}return t}function F(e){return{results:e,unusedImports:e.filter(n=>n.kind==="unused-import").length,layerViolations:e.filter(n=>n.kind==="layer-violation").length,patternDeviations:e.filter(n=>n.kind==="pattern-deviation").length}}function A(e){let n=new Map;for(let t of e.keys()){let i=p.dirname(t),r=n.get(i);r||(r=[],n.set(i,r)),r.push(t)}return n}function L(e,n){let t=new Map;for(let i of n)for(let r of e.get(i)??[])d(r)||t.set(r,(t.get(r)??0)+1);return t}function T(e,n){let t=new Map;return j(e,t,n),t}function j(e,n,t){for(let i of q(e,t))x(e,n,i.from_file,i.to_file)}function q(e,n){let t=n?"AND d1.relative_path LIKE ?":"",i=n?[`%${n}%`]:[];return e.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents d1 ON c.document_id = d1.id
5
+ JOIN global_symbols gs ON m.symbol_id = gs.id
6
+ JOIN (
7
+ SELECT m2.symbol_id, c2.document_id
8
+ FROM mentions m2
9
+ JOIN chunks c2 ON m2.chunk_id = c2.id
10
+ WHERE m2.role = 1
11
+ GROUP BY m2.symbol_id
12
+ ) sym_def ON sym_def.symbol_id = gs.id
13
+ JOIN documents d2 ON sym_def.document_id = d2.id
14
+ WHERE d1.id != d2.id
15
+ AND m.role != 1
16
+ ${e.pathExclusionsFor("d1","d2")}
17
+ ${t}`,...i)}function B(e,n,t={}){new S(e).scanSourceReferences({paths:t.paths??b(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},r=>{r.target.relativePath!==r.sourceFile&&(e.isIgnored(r.target.relativePath)||x(e,n,r.sourceFile,r.target.relativePath))})}function x(e,n,t,i){if(e.isIgnored(t)||e.isIgnored(i))return;let r=n.get(t);r||(r=new Set,n.set(t,r)),r.add(i)}function U(e){let n=new Map;for(let[i,r]of e){if(d(i))continue;let a=f(i);for(let c of r){if(d(c))continue;let o=f(c);if(a===o||h(a,o))continue;let s=`${a}->${o}`;n.set(s,(n.get(s)??0)+1)}}let t=new Map;for(let[i,r]of n)t.set(i,r<=2?"violation":"ok");return t}function V(e){return e.includes("types")||e.endsWith(".d.ts")}function C(e,n,t){let i=v(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.some(r=>r.isUsed)}function J(e,n,t){let i=y(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.some(r=>r.used)}function z(e,n,t){let i=y(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.every(r=>r.isTypeOnly===!0)}function K(e){return e.endsWith(".vue")}function W(e,n,t){let i=y(e,n).filter(r=>r.sourcePath===t);return i.length===0?!1:i.every(r=>r.kind==="side-effect"||r.kind==="namespace"&&r.usedMembers.length===0&&!r.used)}function d(e){let n=D(e);return!!(n==="entry"||n==="barrel"||n==="test"||n==="worker"||H(p.basename(e)))}function H(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{re as a};
18
+ //# sourceMappingURL=chunk-LT6AHYVY.js.map
@@ -0,0 +1,11 @@
1
+ import{a as q}from"./chunk-64MNV6AB.js";import{c as I,d as M,e as L,f as ke,g as Te,h as _e,o as Le,p as y,v as Fe,x as Pe,y as g,z as Ee}from"./chunk-WFRZGMWJ.js";import{isAbsolute as jt,relative as Vt}from"path";function we(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function v(e){return e.replace(/\\/g,"/")}function Bo(e,t){return we(e)===we(t)}function Io(e,t){let n=Vt(e,t);return n===""||!n.startsWith("..")&&!jt(n)}import{existsSync as ce,readFileSync as le,readdirSync as Bt,statSync as It}from"fs";import{join as w,relative as $t}from"path";function Ae(e){let t=Ot(e)??zt(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let o of t)for(let s of Mt(e,o)){if(r.has(s))continue;r.add(s);let i=qt(e,s);i&&n.push(i)}return n}function Ot(e){let t=w(e,"pnpm-workspace.yaml");if(!ce(t))return null;try{return Dt(le(t,"utf8"))}catch{return null}}function Dt(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let o=Wt(r);if(!n){/^packages\s*:\s*$/.test(o.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(o);if(s){let i=Ut(s[1].trim());i&&t.push(i);continue}if(o.trim()!=="")break}return t}function Wt(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function Ut(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function zt(e){let t=w(e,"package.json");if(!ce(t))return null;try{let n=JSON.parse(le(t,"utf8"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function Mt(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let i=w(e,t);return ae(i)?[i]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),o=t.slice(n+1).replace(/^\//,""),s=w(e,r||".");return ae(s)?Bt(s).map(i=>w(s,i,o)).filter(ae):[]}function ae(e){try{return It(e).isDirectory()}catch{return!1}}function qt(e,t){let n=w(t,"package.json");if(!ce(n))return null;try{let r=JSON.parse(le(n,"utf8"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:$t(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}import{extname as Re}from"path";var Xt={".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 X(e){return Xt[Re(e).toLowerCase()]??null}function je(e){return Re(e).toLowerCase()===".vue"}import{createRequire as Ht}from"module";var d=Ht(import.meta.url),H=null,Ve=!1;function Jt(){if(Ve)return null;if(H)return H;try{return H=d("tree-sitter"),H}catch{return Ve=!0,null}}var Be=new Map,J=new Set;function Zt(e){if(J.has(e))return null;let t=Be.get(e);if(t)return t;let n;try{switch(e){case"rust":n=d("tree-sitter-rust");break;case"typescript":n=d("tree-sitter-typescript").typescript;break;case"tsx":n=d("tree-sitter-typescript").tsx;break;case"javascript":n=d("tree-sitter-javascript");break;case"python":n=d("tree-sitter-python");break;case"java":n=d("tree-sitter-java");break;case"kotlin":n=d("tree-sitter-kotlin");break;case"scala":n=d("tree-sitter-scala");break;case"ruby":n=d("tree-sitter-ruby");break;case"c":n=d("tree-sitter-c");break;case"cpp":n=d("tree-sitter-cpp");break;case"csharp":n=d("tree-sitter-c-sharp");break;case"php":n=d("tree-sitter-php").php;break;case"vb":{let r=d("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return J.add(e),null}}catch{return J.add(e),null}return Be.set(e,n),n}var Ie=new Map;function Gt(e){let t=Ie.get(e);if(t)return t;let n=Zt(e);if(!n)return null;let r=Jt();if(!r)return null;let o=new r;try{o.setLanguage(n)}catch{return J.add(e),null}return Ie.set(e,o),o}function Qt(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function $(e,t){let n=Gt(e);if(!n)return null;try{return Qt(n,t)}catch{return null}}import{posix as ue}from"path";import{parse as Kt}from"@vue/compiler-sfc";var Yt=L("vue-sfc-units");function A(e,t){let n=De(t),r=g(e,n);return Yt.get(e,n,r,()=>pe(e,n,r))}function De(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function en(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function F(e){return!e||e.body.length===0?0:e.body.split(`
2
+ `).length}function pe(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let o;try{o=Kt(n,{filename:t})}catch(i){return r.errors.push(Oe(i)),r}r.errors.push(...o.errors.map(Oe));let{descriptor:s}=o;return s.template&&(r.template=Z(e,t,"template",s.template)),s.script&&r.scripts.push($e(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push($e(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(i=>Z(e,t,"style",i)),r.customBlocks=s.customBlocks.map(i=>Z(e,t,"custom",i)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(i=>i?.errors??[])),r}function $e(e,t,n,r){let o=Z(e,t,"script",n);return{...o,kind:"script",setup:r,astLanguage:en(o.lang)}}function Z(e,t,n,r){let o=nn(r.attrs),s=typeof o.lang=="string"?o.lang:null,i=typeof o.src=="string"?o.src:typeof r.src=="string"?r.src:void 0;if(i){let c=tn(t,i);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:i,attrs:o,lang:s,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${i}`]};let l=g(e,c),f=l?Math.max(0,l.split(`
3
+ `).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:i,attrs:o,lang:s,body:l,startLine:0,endLine:f,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:o,lang:s,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function tn(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=De(ue.normalize(ue.join(ue.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function nn(e){return{...e}}function Oe(e){return e instanceof Error?e.message:String(e)}function We(e,t,n){let o=pe(e,t,n).scripts.filter(i=>i.astLanguage&&i.body.length>0),s=o[0]?.astLanguage;return s?{body:o.map(i=>`${`
4
+ `.repeat(i.startLine)}${i.body}`).join(`
5
+ `),startLine:0,language:s}:null}var Ue=ke("ast-trees",{clearGroups:["whole-project","source-file"]});function ze(e,t){if(je(t))return rn(e,t);let n=X(t);if(!n)return null;let r=g(e,t);return r?Ue.get(e,t,r,()=>$(n,r)):null}function rn(e,t){let n=g(e,t);return n?Ue.get(e,t,n,()=>{let r=We(e,t,n);if(!r)return null;let o=`
6
+ `.repeat(r.startLine)+r.body;return $(r.language,o)}):null}import{readdirSync as on}from"fs";import{execFileSync as sn}from"child_process";import{extname as G,join as an}from"path";var cn=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],us=[".vue"],Me=[".tsx",".jsx"],qe=[".vue"],ln=[...Me,...qe],un=new Set(Me),pn=new Set(qe),Xe=new Set(cn.map(e=>e.toLowerCase())),fn=[...Xe].sort().join(","),He=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function O(e,t={}){let n=t.includeIndexed??!0,r=t.includeAuxiliary??!0,o=t.extensions?.map(c=>c.toLowerCase()),s=o?new Set(o):Xe,i=o?[...s].sort().join(","):fn,a=`${n?"1":"0"}|${r?"1":"0"}|${i}`;return mn.get(e,a,()=>{let c=new Set;if(n)for(let l of q(e,{includeIgnored:!1}))s.has(G(l).toLowerCase())&&c.add(l);if(r)for(let l of dn(e.config.projectRoot,s))e.isIgnored(l)||n&&c.has(l)||c.add(l);return[...c].sort()})}function ps(e,t={}){let n=!1,r=!1;for(let o of O(e,{extensions:ln})){if(t.scope&&!o.includes(t.scope))continue;let s=G(o).toLowerCase();if(n||=un.has(s),r||=pn.has(s),n&&r)break}return{react:n,vue:r}}var mn=I("source-files",{clearGroups:[]});function dn(e,t){return gn(e,t)??Sn(e,t)}function gn(e,t){try{let n=sn("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,stdio:["ignore","pipe","ignore"]}),r=new Set;for(let o of n.split(`
7
+ `)){let s=o.trim();s&&(hn(s)||t.has(G(s).toLowerCase())&&r.add(s))}return r}catch{return null}}function hn(e){return e.split("/").some(t=>He.has(t))}function Sn(e,t){let n=new Set,r=o=>{let s=o?an(e,o):e,i;try{i=on(s,{withFileTypes:!0})}catch{return}for(let a of i)if(!He.has(a.name)){if(a.isDirectory()){r(o?`${o}/${a.name}`:a.name);continue}t.has(G(a.name).toLowerCase())&&n.add(o?`${o}/${a.name}`:a.name)}};return r(""),n}import{extname as Nn}from"path";function K(e,t){let n=yn(e,t);if(!n)return null;let r=Q(n);return r?{calleeLeaf:r,memberAccess:xn(n),line:e.startPosition.row}:null}function yn(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 xn(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function Q(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"shorthand_property_identifier":return e.text;case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?Q(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?Q(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?Q(t):null}case"super":case"self":case"this":return null;default:return null}}var vn=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 Y(e){return e.length<=2||vn.has(e)}var bn=[".tsx",".jsx"],Je=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),Cn=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),kn=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),Tn=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),_n=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),Ln=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),Fn=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),Pn=L("react-component-behavior-profiles"),Ze=Fe({kind:"react-component-behavior-profiles",invalidation:Pe("react-component-behavior-profiles"),serialize:Rn,deserialize:jn});function Ye(e,t={}){let n=O(e,{extensions:bn}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(o=>me(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function me(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return Pn.get(e,n,r,()=>En(e,n,r)).map(An)}function En(e,t,n){let r=_e(e,t,n),o=Ze.read(e,t,r);if(o)return o;let s=wn(e,t);return Ze.write(e,t,r,s),s}function wn(e,t){let n=Bn(t);if(!n)return[];let r=ze(e,t);if(!r)return[];let o=Ee(e,t).length;return In(r.rootNode,n).filter(i=>i.kind==="hook"||de(i.bodyNode)).map(i=>{let a=Mn(i.bodyNode),c=Zn(i.bodyNode,n);return{file:t,name:i.name,kind:i.kind,startLine:i.node.startPosition.row,endLine:i.node.endPosition.row,loc:Math.max(1,i.node.endPosition.row-i.node.startPosition.row+1),fileLines:o,jsxTokens:a.tokens,behaviorTokens:c.tokens,componentNames:C(a.componentNames),nativeTags:C(a.nativeTags),propNames:C(a.propNames),eventNames:C(a.eventNames),hookNames:C(c.hookNames),requestNames:C(c.requestNames),stateNames:C(c.stateNames),effectNames:C(c.effectNames),handlerNames:C(c.handlerNames)}})}function An(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 Rn(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function jn(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let o=Vn(r);if(!o)return null;n.push(o)}return n}catch{return null}}function Vn(e){if(!Le(e))return null;let{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:f,nativeTags:u,propNames:N,eventNames:V,hookNames:se,requestNames:ie,stateNames:m,effectNames:b,handlerNames:B}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!ee(o)||!ee(s)||!ee(i)||!ee(a))return null;let S={jsxTokens:y(c),behaviorTokens:y(l),componentNames:y(f),nativeTags:y(u),propNames:y(N),eventNames:y(V),hookNames:y(se),requestNames:y(ie),stateNames:y(m),effectNames:y(b),handlerNames:y(B)};return Object.values(S).some(Rt=>Rt===null)?null:{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:new Set(S.jsxTokens),behaviorTokens:new Set(S.behaviorTokens),componentNames:S.componentNames,nativeTags:S.nativeTags,propNames:S.propNames,eventNames:S.eventNames,hookNames:S.hookNames,requestNames:S.requestNames,stateNames:S.stateNames,effectNames:S.effectNames,handlerNames:S.handlerNames}}function ee(e){return typeof e=="number"&&Number.isFinite(e)}function Bn(e){let t=Nn(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:X(e)}function In(e,t){let n=[],r=new Set,o=s=>{let i=$n(s);if(i&&(!Un(s)||i.kind==="component")){let a=`${i.name}:${i.node.startIndex}:${i.node.endIndex}`;r.has(a)||(r.add(a),n.push(i))}for(let a of s.namedChildren)o(a)};return(t==="tsx"||t==="javascript")&&o(e),n}function $n(e){if(e.type==="class_declaration"){let s=fe(e);if(!s||!/^[A-Z]/.test(s))return null;let i=On(e);return!i||!Dn(e)&&!de(i)?null:{name:s,kind:"component",node:e,bodyNode:i}}if(e.type==="function_declaration"){let s=fe(e);return!s||!Ge(s)?null:{name:s,kind:Qe(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=D(t);if(!r||!n||!Ge(r))return null;let o=Wn(n);return o?{name:r,kind:Qe(r),node:e,bodyNode:o}:null}function On(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 Dn(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function Ge(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function Qe(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function Wn(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=zn(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(o=>o.type==="arguments")?.namedChildren.find(o=>o.type==="arrow_function"||o.type==="function_expression")??null}function Un(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 fe(e){return D(e.childForFieldName("name")??e.namedChild(0))}function zn(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function de(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(de)}function Mn(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"?qn(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?Xn(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of r.children)n(o)};return n(e),t}function qn(e,t){let n=Hn(e),r=!1;if(n){let o=Ke(n),s=o==="Fragment"||o==="React.Fragment";r=er(o)&&!s,s?t.tokens.add("jsx:fragment"):r?(t.componentNames.add(o),t.tokens.add(`component:${o}`)):(t.nativeTags.add(o),t.tokens.add(`native:${o}`))}for(let o of e.namedChildren)if(o.type==="jsx_attribute"){let s=Jn(o);if(!s)continue;let i=Ke(s);if(i.startsWith("on")&&i.length>2){let a=i.slice(2).replace(/^[A-Z]/,c=>c.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else Fn.has(i)||(t.propNames.add(i),t.tokens.add(`${r?"prop":"native-prop"}:${i}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add(et(o))}function Xn(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(et(e)),tt(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of tr(n))Y(r)||t.tokens.add(`binding:${r}`)}function et(e){let t=/^\{\s*\.\.\.\s*([^}]+)\s*\}$/.exec(e.text)?.[1],n=e.namedChildren.find(s=>s.type!=="comment"),r=t??n?.text??"",o=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.exec(r.trim())?.[0];return o?`prop:spread:${o}`:"prop:spread"}function tt(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(tt)}function Hn(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 Jn(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 Zn(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},r=o=>{if(o.type==="call_expression"){let s=K(o,t);s&&Gn(s.calleeLeaf,n)}else if(o.type==="variable_declarator")Kn(o,n);else if(o.type==="function_declaration"){let s=fe(o);s&&nt(s,n)}for(let s of o.namedChildren)r(s)};return r(e),n}function Gn(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!Je.has(e)&&!Tn.has(e)&&t.tokens.add(`hook:${e}`)),Je.has(e)&&t.tokens.add(`react-hook:${e}`),Cn.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),kn.has(e)&&t.tokens.add(`state-hook:${e}`),Qn(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function Qn(e){if(_n.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function Kn(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=>D(a)),i=D(s);i&&(t.stateNames.add(i),t.tokens.add(`state:${i}`))}let o=D(n);o&&nt(o,t)}function nt(e,t){let n=Yn(e);!n||!Ln.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function Yn(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 er(e){return/^[A-Z]/.test(e)||e.includes(".")}function Ke(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function D(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 tr(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 C(e){return[...e].sort()}function W(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var nr=new Set(["function_declaration","method_definition","method_signature","function_signature"]);function at(e,t){let n=or(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:st(n.functionNode),params:rt(n.functionNode),paramsEndLine:ot(n.functionNode),isLiteralPassthrough:it(n.functionNode,t)};if(!rr(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(o=>o.type==="identifier"||o.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:st(e),params:rt(e),paramsEndLine:ot(e),isLiteralPassthrough:it(e,t)}:null}function ct(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function rt(e){let t=ct(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(W(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let o=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),s=r.childForFieldName("pattern");if(!o&&s&&s.type==="identifier"){n.push({name:s.text,simple:!0});continue}let i=r.namedChildren.find(a=>a.type==="identifier");n.push({name:s?.type==="identifier"?s.text:i?.text??"",simple:!1})}return n}function ot(e){let t=ct(e);return t?t.endPosition.row:e.startPosition.row}function rr(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?nr.has(e):!1}function or(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);return!n||!r||r.type!=="arrow_function"&&r.type!=="function_expression"?null:{name:n.text,definitionNode:e,functionNode:r}}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);return!n||!r||r.type!=="arrow_function"&&r.type!=="function_expression"?null:{name:n.text,definitionNode:e,functionNode:r}}return null}function st(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)W(r)||(n+=1);return n}function it(e,t){let n=e.namedChildren.find(u=>u.type==="block"||u.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(u=>!W(u));if(r.length!==1)return!1;let o=r[0],s=null;if(o.type==="return_statement"||o.type==="expression_statement"?s=o.namedChild(0)??null:t==="rust"&&(o.type==="call_expression"||o.type==="macro_invocation")&&(s=o),!s)return!1;let i=t==="python"?"call":"call_expression";if(s.type!==i)return!1;let a=s.namedChildren.find(u=>u.type==="arguments"||u.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(u=>!W(u)),l=e.namedChildren.find(u=>u.type==="parameters"||u.type==="formal_parameters");if(!l)return!1;let f=[];for(let u of l.namedChildren){if(u.type==="identifier"){f.push(u.text);continue}let N=u.namedChildren.find(V=>V.type==="identifier");N&&f.push(N.text)}if(c.length!==f.length)return!1;for(let u=0;u<f.length;u+=1){let N=c[u];if(N.type!=="identifier"||N.text!==f[u])return!1}return!0}var sr=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),ir=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),ar=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),cr=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),lr=new Set(["catch","for","function","if","return","switch","while"]);function ne(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+=F(n),n.external&&(t.externalLineCount+=F(n),t.externalScriptPaths.push(n.sourcePath));for(let o of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:o});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(...mr(n));let r=$(n.astLanguage,n.body);r?pr(n,r.rootNode,t):fr(n,t)}return ur(t),t.externalScriptPaths=ut(t.externalScriptPaths),t}function ur(e){e.composables=R(e,"composable"),e.stores=R(e,"store"),e.reactivity=R(e,"reactivity"),e.lifecycle=R(e,"lifecycle"),e.requests=R(e,"request"),e.macros=R(e,"macro")}function R(e,t){return ut(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function pr(e,t,n){let r=new Set,o=new Set,s=i=>{let a=at(i,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;o.has(l)||(o.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=K(i,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:lt(c.calleeLeaf),setup:e.setup}))}for(let l of i.children)s(l)};s(t)}function fr(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||lr.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+te(e.body,n.index??0),categories:lt(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 o=e.startLine+te(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,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 o=e.startLine+te(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}}function mr(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),o=n[2];if(!r||!o)continue;let s=e.startLine+te(e.body,n.index??0);for(let i of dr(r))t.push({local:i,source:o,sourcePath:e.sourcePath,line:s,setup:e.setup})}return t}function dr(e){let t=[],r=e.split(",").map(i=>i.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let o=/\{([^}]*)\}/.exec(e)?.[1];if(o)for(let i of o.split(",")){let a=i.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(i=>/^[A-Za-z_$][\w$]*$/.test(i))}function lt(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),sr.has(e)&&t.push("reactivity"),ir.has(e)&&t.push("lifecycle"),ar.has(e)&&t.push("request"),cr.has(e)&&t.push("macro"),t}function te(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 ut(e){return[...new Set(e)].sort()}import{ElementTypes as gr,NodeTypes as ge,parse as hr}from"@vue/compiler-dom";import{parse as $s}from"@vue/compiler-sfc";function pt(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var Sr=L("vue-template-facts"),yr=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),xr=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"]),vr=new Set(["div","span","template"]),Nr=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 re(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return Sr.get(e,n,r,()=>br(n,A(e,n).template))}function br(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=hr(t.body,{comments:!1})}catch{return n}let o=new Set,s=i=>{i.trim()&&o.add(i)};return mt(r.children,t.startLine,n,s),n.structuralTokens=[...o].sort(),n}function mt(e,t,n,r){for(let o of e)if(o.type===ge.ELEMENT)Cr(o,t,n,r),mt(o.children,t,n,r);else if(o.type===ge.INTERPOLATION){r("interpolation");let s=he(o.content);s&&dt(s,t,o.loc.start.line,n,r)}}function Cr(e,t,n,r){let o=Er(e.tag),s={tag:e.tag,normalized:o,kind:Pr(e),startLine:j(t,e.loc.start.line),endLine:j(t,e.loc.end.line)};s.kind==="component"?(n.componentTags.push(s),r(`component:${o}`)):s.kind==="builtin"?(n.builtinTags.push(s),r(`builtin:${o}`)):(n.nativeTags.push(s),vr.has(e.tag)||r(`native:${e.tag}`));for(let i of e.props)kr(i,t,n,r)}function kr(e,t,n,r){if(e.type===ge.ATTRIBUTE){let a=e.value?.content??null,c=ft("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let o=_r(e),s=he(e.exp),i=ft(Tr(e.name),o,s,t,e.loc.start.line,e.loc.end.line);switch(i.kind){case"prop":n.props.push(i),r(`prop:${o}`);break;case"event":n.events.push(i),r(`event:${o}`);break;case"slot":n.slots.push(i),r(`slot:${o}`);break;case"directive":n.directives.push(i),r(`directive:${o}`);break}s&&dt(s,t,e.loc.start.line,n,r)}function ft(e,t,n,r,o,s){return{kind:e,name:t,value:n,startLine:j(r,o),endLine:j(r,s)}}function Tr(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function _r(e){let t=he(e.arg);return t||e.name}function he(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function dt(e,t,n,r,o){for(let s of Lr(e)){let i={name:s,startLine:j(t,n),endLine:j(t,n)};r.expressionIdentifiers.push(i),o(`id:${s}`)}}function Lr(e){let t=new Set,n=Fr(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,o;for(;o=r.exec(n);){let s=o[0];Nr.has(s)||Y(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function Fr(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 Pr(e){let t=e.tag;return e.tagType===gr.COMPONENT?"component":yr.has(t)?"builtin":xr.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function Er(e){return pt(e,/[-_:]/)}function j(e,t){return e+Math.max(0,t-1)}import{createRequire as wr}from"module";import{existsSync as E}from"fs";import{basename as gt,dirname as h,extname as k,join as x,relative as P,resolve as p,sep as Ar}from"path";var Rr=M("indexed-paths",{clearGroups:[]}),jr=M("indexed-path-digest",{clearGroups:[]}),Vr=I("tsconfig-alias-config",{clearGroups:["whole-project"]}),Br=I("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),Ir=wr(import.meta.url),U;function $r(){if(U!==void 0)return U;try{U=Ir("typescript")}catch{U=null}return U}var Or=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],Dr=M("workspace-packages",{clearGroups:["whole-project"]}),z=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],ht=[".py",".pyi"],St=[".java",".scala",".kt",".kts"],yt=[".rs"],xt=[".rb"],vt=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],Nt=[".cs",".vb"],bt=[".dart"],Ct=[".php"],oe=[".clj",".cljs",".cljc"],Wr=new Set(z),Se=new Set(ht),kt=new Set(St),ye=new Set(yt),xe=new Set(xt),Tt=new Set(vt),_t=new Set(Nt),ve=new Set(bt),Lt=new Set(Ct),Ft=new Set(oe),Ur=[{extensions:z,lookup:Wr},{extensions:ht,lookup:Se},{extensions:St,lookup:kt},{extensions:yt,lookup:ye},{extensions:xt,lookup:xe},{extensions:vt,lookup:Tt},{extensions:Nt,lookup:_t},{extensions:bt,lookup:ve},{extensions:Ct,lookup:Lt},{extensions:oe,lookup:Ft}];function T(e,t){return t.has(k(e).toLowerCase())}function zr(e){return T(e,Se)}function Mr(e){return T(e,kt)}function qr(e){return T(e,ye)}function Xr(e){return T(e,xe)}function Hr(e){return T(e,Tt)}function Jr(e){return T(e,_t)}function Ys(e){return k(e).toLowerCase()===".vb"}function Zr(e){return T(e,ve)}function Gr(e){return T(e,Lt)}function Qr(e){return T(e,Ft)}function Kr(e){let t=k(e).toLowerCase();for(let n of Ur)if(n.lookup.has(t))return n.extensions;return z}function Yr(e){return Mr(e)||Jr(e)||Gr(e)}function Pt(e,t,n){return zr(t)?fo(e,t,n):qr(t)?mo(e,t,n):Xr(t)?go(e,t,n):Hr(t)?ho(e,t,n):Yr(t)?So(e,n.replace(/\\/g,"."),Kr(t)):Zr(t)?yo(e,t,n):Qr(t)?xo(e,n):eo(e,t,n)}function eo(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return to(e,t,n)??ro(e,n);let r=h(x(e.config.projectRoot,t)),o=p(r,n),s=_(e);for(let i of be(o)){let a=v(P(e.config.projectRoot,i));if(s.has(a)||E(i))return a}return v(P(e.config.projectRoot,o))}function to(e,t,n){let r=lo(e,t);if(!r)return null;let o=_(e);for(let s of no(r,n)){let i=p(r.baseUrl,s);for(let a of be(i)){let c=v(P(e.config.projectRoot,a));if(o.has(c)||E(a))return c}}return null}function no(e,t){let n=[];for(let[r,o]of Object.entries(e.paths)){let s=r.indexOf("*");if(s===-1){if(t!==r)continue;n.push(...o);continue}let i=r.slice(0,s),a=r.slice(s+1);if(!t.startsWith(i)||!t.endsWith(a)||t.length<i.length+a.length)continue;let c=t.slice(i.length,t.length-a.length);for(let l of o)n.push(l.includes("*")?l.replace("*",c):l)}return n}function ro(e,t){let n=so(oo(e),t);if(!n)return null;let r=_(e);for(let o of io(n)){let s=p(e.config.projectRoot,n.pkg.relativeDir,o);for(let i of be(s)){let a=v(P(e.config.projectRoot,i));if(r.has(a)||E(i))return a}}return null}function oo(e){return Dr.get(e,()=>Ae(e.config.projectRoot))}function so(e,t){let n=null;for(let r of e){let o=null;t===r.name?o="":t.startsWith(`${r.name}/`)&&(o=t.slice(r.name.length+1)),o!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:o})}return n}function io(e){let t=[],n=ao(e.pkg.exports,e.subpath);if(n){let r=co(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function ao(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return Et(e[n])}function Et(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=Et(t[n]);if(r)return r}return null}function co(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function lo(e,t){let n=v(h(t));return Br.get(e,n,()=>uo(e,n))}function uo(e,t){let n=$r();if(!n)return null;let r=p(e.config.projectRoot),o=p(r,t);for(;o===r||o.startsWith(r+Ar);){for(let i of Or){let a=x(o,i);if(!E(a))continue;let c=Vr.get(e,a,()=>po(n,a));if(c)return c}let s=h(o);if(s===o)break;o=s}return null}function po(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,h(t)),o=r.options.paths;return!o||Object.keys(o).length===0?null:{baseUrl:r.options.baseUrl?p(h(t),r.options.baseUrl):h(t),paths:o}}catch{return null}}function fo(e,t,n){let r=_(e),o;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let i=s[1].length,a=s[2].replace(/^\./,""),c=h(x(e.config.projectRoot,t));for(let l=1;l<i;l++)c=h(c);o=a?p(c,a.replace(/\./g,"/")):c}else o=p(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of vo(o)){let i=v(P(e.config.projectRoot,s));if(r.has(i)||E(s))return i}return null}function mo(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 o=h(x(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=p(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=p(o,r.slice(6).replace(/::/g,"/")):s=p(h(o),r.slice(7).replace(/::/g,"/")),Ne(e,No(s))}function go(e,t,n){let r=h(x(e.config.projectRoot,t)),o=p(r,n);return Ne(e,bo(o))}function ho(e,t,n){let r=h(x(e.config.projectRoot,t)),o=[p(r,n),p(e.config.projectRoot,n),p(e.config.projectRoot,"include",n),p(e.config.projectRoot,"src",n)];return Ne(e,o)}function So(e,t,n){let r=_(e),o=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),i=o.split(".").pop()??o;for(let c of n){let l=`${s}${c}`,f=[...r].find(u=>u.endsWith(l));if(f)return f}for(let c of n){let l=[...r].find(f=>gt(f)===`${i}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(k(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${i}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function yo(e,t,n){let r=_(e);if(n.startsWith("package:")){let i=n.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),l=v(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let o=h(x(e.config.projectRoot,t)),s=p(o,n);for(let i of Co(s)){let a=v(P(e.config.projectRoot,i));if(r.has(a)||E(i))return a}return null}function xo(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=_(e);for(let o of oe){let s=`${n}${o}`,i=[...r].find(a=>a.endsWith(s));if(i)return i}for(let o of oe){let s=[...r].find(i=>gt(i)===`${n.split("/").pop()}${o}`);if(s)return s}return null}function vo(e){let t=k(e);return Se.has(t)?[e]:[`${e}.py`,`${e}.pyi`,x(e,"__init__.py"),x(e,"__init__.pyi")]}function Ne(e,t){let n=_(e);for(let r of t){let o=v(P(e.config.projectRoot,r));if(n.has(o)||E(r))return o}return null}function No(e){let t=k(e);return ye.has(t)?[e]:[`${e}.rs`,x(e,"mod.rs")]}function bo(e){let t=k(e);return xe.has(t)?[e]:[`${e}.rb`,x(e,"index.rb")]}function Co(e){let t=k(e);return ve.has(t)?[e]:[`${e}.dart`,e]}function be(e){let t=k(e),n=new Set;if(t){n.add(e);for(let r of z)n.add(e.slice(0,-t.length)+r)}else for(let r of z)n.add(`${e}${r}`),n.add(x(e,`index${r}`));return[...n]}function _(e){return Rr.get(e,()=>new Set(q(e,{includeIgnored:!1}).map(v)))}function ei(e){return jr.get(e,()=>Te([..._(e)].sort().join(`
8
+ `)))}var ko=new Set(["in","key","of"]),To=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),_o=L("vue-component-behavior-profiles");function wt(e,t={}){let n=O(e,{extensions:[".vue"]}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(o=>Ce(e,o)).filter(o=>(t.minTemplateTokens===void 0||o.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function Ce(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n),o=_o.get(e,n,r,()=>Lo(e,n,r));return Po(o)}function Lo(e,t,n){let r=A(e,t),o=re(e,t),s=ne(r),i=Ao(o),a=o.expressionIdentifiers.map(m=>m.name).filter(m=>!i.includes(m)).filter((m,b,B)=>B.indexOf(m)===b).sort(),c=o.componentTags.map(m=>m.normalized).filter((m,b,B)=>B.indexOf(m)===b).sort(),l=n?n.split(`
9
+ `).length:0,f=F(r.template),u=s.lineCount,N=r.styles.reduce((m,b)=>m+F(b),0),V=r.customBlocks.reduce((m,b)=>m+F(b),0),{lines:se,paths:ie}=Fo(e,t,s);return{file:t,sfc:r,templateFacts:o,scriptFacts:s,templateTokens:new Set(o.structuralTokens),behaviorTokens:wo(o,s,a),templateBindingNames:a,templateLocalNames:i,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:f,scriptLines:u,styleLines:N,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:V,delegatedComposableLines:se,delegatedComposablePaths:ie}}function Fo(e,t,n){let r=new Set;for(let i of n.composables){let a=n.imports.find(l=>l.local===i);if(!a)continue;let c=Pt(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let o=[...r].sort();return{lines:o.reduce((i,a)=>{let c=g(e,a);return i+(c?c.split(`
10
+ `).length:0)},0),paths:o}}function Po(e){let t=Eo(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 Eo(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 wo(e,t,n){let r=new Set;for(let o of t.composables)r.add(`composable:${o}`);for(let o of t.stores)r.add(`store:${o}`);for(let o of t.reactivity)r.add(`reactivity:${o}`);for(let o of t.lifecycle)r.add(`lifecycle:${o}`);for(let o of t.requests)r.add(`request:${o}`);for(let o of t.macros)r.add(`macro:${o}`);for(let o of t.functions){if(To.has(o.name))continue;r.add(`function:${o.name}`);let s=/^[a-z]+/.exec(o.name)?.[0]??null;s&&s.length>2&&s!==o.name&&r.add(`function-verb:${s}`)}for(let o of e.events)r.add(`template-event:${o.name}`);for(let o of n)r.add(`template-binding:${o}`);return r}function Ao(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of Ro(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of At(n.value))t.add(r);return[...t].sort()}function Ro(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?At(t[1]??""):[]}function At(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];ko.has(r)||t.push(r)}return t}function gi(e){return{capability:(t,n)=>jo(t,n),reactProfiles:(t={})=>Ye(e,t),reactProfilesForFile:t=>me(e,t),vueProfiles:(t={})=>wt(e,t),vueProfileForFile:t=>Ce(e,t),vueTemplateFacts:t=>re(e,t),vueScriptFacts:t=>ne(A(e,t))}}function jo(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}}export{we as a,v as b,Bo as c,Io as d,Ae as e,Mt as f,z as g,ht as h,St as i,yt as j,xt as k,vt as l,Nt as m,bt as n,Ct as o,oe as p,Ys as q,Kr as r,Pt as s,fo as t,mo as u,go as v,ho as w,So as x,yo as y,xo as z,ei as A,X as B,je as C,We as D,ze as E,K as F,Q as G,at as H,pt as I,us as J,He as K,O as L,ps as M,gi as N};
11
+ //# sourceMappingURL=chunk-MCNWCJYL.js.map
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-B75HZHUP.js";import{l as u}from"./chunk-WS3Z6W3M.js";function P(e){let t=m(e.profile?.name),r=()=>{let d=e.candidates(),a=e.filterCandidate?d.filter(e.filterCandidate):d,C=e.orderCandidates?[...a].sort(e.orderCandidates):a,i=o(C,e.scanLimit);t={pipeline:e.profile?.name,loadedCandidates:d.length,filteredCandidates:a.length,scannedCandidates:i.length,evaluatedCandidates:0,matchedResults:0,emittedResults:0,scanLimitApplied:i.length<a.length,resultLimitApplied:!1};let f=e.prepare?.(i)??void 0,n=[];for(let c of i){t.evaluatedCandidates+=1;let s=e.evaluate(c,f);s&&n.push(s)}t.matchedResults=n.length,e.orderResults&&n.sort(e.orderResults);let l=typeof e.limit=="number"?n.slice(0,e.limit):n;return t.emittedResults=l.length,t.resultLimitApplied=l.length<n.length,e.onProfile?.({...t}),l};return e.profile?u(`candidate-pipeline:${e.profile.name}`,r,()=>({...p(e.profile?.metadata),...t})):r()}function m(e){return{pipeline:e,loadedCandidates:0,filteredCandidates:0,scannedCandidates:0,evaluatedCandidates:0,matchedResults:0,emittedResults:0,scanLimitApplied:!1,resultLimitApplied:!1}}function p(e){return typeof e=="function"?e():e??{}}export{P as a};
2
- //# sourceMappingURL=chunk-K6UI6EBZ.js.map
1
+ import{b as o}from"./chunk-B75HZHUP.js";import{s as u}from"./chunk-WFRZGMWJ.js";function P(e){let t=m(e.profile?.name),r=()=>{let d=e.candidates(),a=e.filterCandidate?d.filter(e.filterCandidate):d,C=e.orderCandidates?[...a].sort(e.orderCandidates):a,i=o(C,e.scanLimit);t={pipeline:e.profile?.name,loadedCandidates:d.length,filteredCandidates:a.length,scannedCandidates:i.length,evaluatedCandidates:0,matchedResults:0,emittedResults:0,scanLimitApplied:i.length<a.length,resultLimitApplied:!1};let f=e.prepare?.(i)??void 0,n=[];for(let c of i){t.evaluatedCandidates+=1;let s=e.evaluate(c,f);s&&n.push(s)}t.matchedResults=n.length,e.orderResults&&n.sort(e.orderResults);let l=typeof e.limit=="number"?n.slice(0,e.limit):n;return t.emittedResults=l.length,t.resultLimitApplied=l.length<n.length,e.onProfile?.({...t}),l};return e.profile?u(`candidate-pipeline:${e.profile.name}`,r,()=>({...p(e.profile?.metadata),...t})):r()}function m(e){return{pipeline:e,loadedCandidates:0,filteredCandidates:0,scannedCandidates:0,evaluatedCandidates:0,matchedResults:0,emittedResults:0,scanLimitApplied:!1,resultLimitApplied:!1}}function p(e){return typeof e=="function"?e():e??{}}export{P as a};
2
+ //# sourceMappingURL=chunk-MZB3DTHW.js.map
@@ -0,0 +1,8 @@
1
+ import{a as k}from"./chunk-G4KQ7S74.js";import{a as T,e as x,s as R}from"./chunk-OO6S4ECV.js";import{o as w}from"./chunk-NLVKD45E.js";import{b as l}from"./chunk-MCNWCJYL.js";import{a as S}from"./chunk-64MNV6AB.js";import{d as g,z as _}from"./chunk-WFRZGMWJ.js";import{existsSync as d,readFileSync as B,readdirSync as $}from"fs";import{join as p}from"path";var H={files:new Set,pathPrefixes:[]},y=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,K=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,A=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],Y=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),q=4,J=g("package-surface",{clearGroups:["whole-project"]});function Q(t){return J.get(t,()=>Z(t.config.projectRoot))}function E(t,e){let r=Q(t);return r.files.has(e)?!0:r.pathPrefixes.some(s=>e.startsWith(s))}function Z(t){let e=new Set,r=[];for(let{manifest:s,packageRoot:i}of z(t))for(let n of tt(s))et(t,i,n,e,r);return e.size===0&&r.length===0?H:{files:e,pathPrefixes:r}}function z(t){let e=[],r=O(t,"");return r&&e.push({manifest:r,packageRoot:""}),D(t,"",e,0),e}function D(t,e,r,s){if(s>=q)return;let i=p(t,e);if(d(i))for(let n of $(i,{withFileTypes:!0})){if(!n.isDirectory()||Y.has(n.name))continue;let a=e?`${e}/${n.name}`:n.name,o=O(t,a);o&&r.push({manifest:o,packageRoot:a}),D(t,a,r,s+1)}}function O(t,e){try{let r=B(p(t,e,"package.json"),"utf-8"),s=JSON.parse(r);return s&&typeof s=="object"?s:null}catch{return null}}function tt(t){let e=[];for(let s of["main","module","types","browser"])typeof t[s]=="string"&&e.push(t[s]);let r=t.bin;if(typeof r=="string")e.push(r);else if(r&&typeof r=="object")for(let s of Object.values(r))typeof s=="string"&&e.push(s);return F(t.exports,e),e}function F(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let r of Object.values(t))F(r,e)}function et(t,e,r,s,i){let n=r.replace(/\\/g,"/").replace(/^\.\//,"");if(n===""||n.startsWith(".."))return;let a=n.indexOf("*");if(a>=0){let c=n.slice(0,a);for(let u of j(c))u!==""&&i.push(f(e,u));return}let o=n.replace(K,"");for(let c of j(o)){c===o&&c===n&&s.add(f(e,n));for(let u of A)rt(t,s,e,c+u)}s.add(f(e,n))}function j(t){let e=[t];return y.test(t)&&(e.push(t.replace(y,"src/")),e.push(t.replace(y,""))),e}function rt(t,e,r,s){let i=f(r,s);if(e.add(i),!s.startsWith("src/")||d(p(t,i)))return;let n=A.find(P=>s.endsWith(P));if(!n)return;let a=s.slice(0,-n.length);st(t,e,r,a,n);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),u=a.slice(o+1);for(let P of N(t,r,c,`${u}${n}`))e.add(P)}function st(t,e,r,s,i){let n=f(r,`${s}/index${i}`);d(p(t,n))&&e.add(n)}function N(t,e,r,s){let i=p(t,e,r);if(!d(i))return[];let n=[];for(let a of $(i,{withFileTypes:!0})){let o=`${r}/${a.name}`;a.isDirectory()?n.push(...N(t,e,o,s)):a.isFile()&&a.name===s&&n.push(f(e,o))}return n}function f(t,e){return t?`${t}/${e}`:e}import{existsSync as h,readFileSync as nt,readdirSync as it}from"fs";import{dirname as at,join as b}from"path";var ot={rootFiles:new Set,sourcePrefixes:[]},ct=new Set([".git",".scipquery","node_modules","target"]),ut=6,ft=g("rust-library-surface",{clearGroups:["whole-project"]});function L(t,e,r){if(!r.endsWith(".rs")||!pt(lt(t),r))return!1;let s=R(t,r).find(i=>i.symbol===e);return s?St(_(t,r)[s.startLine]??""):!1}function lt(t){return ft.get(t,()=>gt(t.config.projectRoot))}function gt(t){let e=new Set,r=new Set;for(let s of dt(t)){let i=b(t,s,"Cargo.toml"),n=nt(i,"utf8"),a=ht(n),o=f(s,"src/lib.rs"),c=a?f(s,a):!bt(n)&&h(b(t,o))?o:null;if(!c)continue;e.add(c);let u=at(c).replaceAll("\\","/");r.add(u==="."?"":`${u}/`)}return e.size===0?ot:{rootFiles:e,sourcePrefixes:[...r].sort()}}function pt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:mt(e)?!1:t.sourcePrefixes.some(r=>e.startsWith(r)):!1}function St(t){return/^\s*pub\s+(?!\()/.test(t)}function dt(t){if(!h(t))return[];let e=[];return C(t,"",e,0),e}function C(t,e,r,s){let i=b(t,e);if(h(i)&&(h(b(i,"Cargo.toml"))&&r.push(e),!(s>=ut)))for(let n of it(i,{withFileTypes:!0})){if(!n.isDirectory()||ct.has(n.name))continue;let a=e?`${e}/${n.name}`:n.name;C(t,a,r,s+1)}}function ht(t){let e=!1;for(let r of t.split(`
2
+ `)){let s=r.replace(/\s+#.*$/,"").trim(),i=/^\[([^\]]+)\]$/.exec(s);if(i){e=i[1]==="lib";continue}if(!e)continue;let n=/^path\s*=\s*["']([^"']+)["']/.exec(s)?.[1];if(n)return n.replaceAll("\\","/").replace(/^\.\//,"")}return null}function bt(t){let e=!1;for(let r of t.split(`
3
+ `)){let s=r.replace(/\s+#.*$/,"").trim(),i=/^\[([^\]]+)\]$/.exec(s);if(i){e=i[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(s))return!0}return!1}function mt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}function m(t){let e=l(t);return Mt(e)?"test":It(e)?"worker":vt(e)?"entry":Vt(e)?"barrel":"source"}function Pt(t){return m(t)==="barrel"}function I(t){return xt.get(t,()=>{let r=S(t,{includeIgnored:!1}).filter(a=>{let o=m(a);return o==="entry"||o==="worker"});if(r.length===0)return new Set;let s=k(t),i=new Set,n=new Set;for(;r.length>0;){let a=r.shift();if(!i.has(a)){i.add(a),m(a)==="barrel"&&n.add(a);for(let o of s.get(a)??[])i.has(o)||r.push(o)}}return n})}var xt=g("live-barrels",{clearGroups:["whole-project"]});function yt(t,e){return I(t).has(l(e))}function ce(t){let e=I(t);return S(t,{includeIgnored:!1}).filter(r=>Pt(r)&&!e.has(r)&&!Et(t,r))}function Et(t,e){let r=l(e),s=T(t).forFile(r,{facts:!0}).facts?.callables;return s&&s.length>0?!0:(t.get(`SELECT COUNT(*) AS n
4
+ FROM defn_enclosing_ranges der
5
+ JOIN documents d ON d.id = der.document_id
6
+ WHERE d.relative_path = ?
7
+ AND der.end_line - der.start_line >= 2`,r)?.n??0)>0}function ue(t,e){let r=l(e),s=m(e);return s==="entry"||s==="worker"||Nt(r)||yt(t,r)}function fe(t,e,r){let s=l(r);if(E(t,s)||wt(t,e,s)||L(t,e,s)||Ft(e,s))return!0;let i=t.config.entryRoots;return i?!!(i.files?.some(n=>l(n)===s)||i.pathPrefixes?.some(n=>s.startsWith(l(n)))||i.qualifiedVars?.some(n=>Xt(e,n))||i.symbolPatterns?.some(n=>{try{return new RegExp(n).test(e)}catch{return!1}})):!1}var _t=g("package-surface-reachability",{clearGroups:["whole-project"]});function wt(t,e,r){let s=kt(t).get(r);return s===void 0?!1:s===null||s.has(x(e))}function kt(t){return _t.get(t,()=>{let e=new Map,r=[];for(let s of S(t,{includeIgnored:!1}))E(t,s)&&(e.set(s,null),r.push(s));for(;r.length>0;){let s=r.shift(),i=e.get(s);if(i!==void 0)for(let n of w(t,s)){if(!n.sourcePath||t.isIgnored(n.sourcePath))continue;let a=Tt(i,n);a!==void 0&&Rt(e,n.sourcePath,a)&&r.push(n.sourcePath)}}return e})}function Tt(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return;let r=e.names.filter(s=>t.has(s));return r.length>0?new Set(r):void 0}function Rt(t,e,r){if(!t.has(e))return t.set(e,r),!0;let s=t.get(e);if(s===void 0)return!1;if(s===null||r===null)return s===null?!1:(t.set(e,null),!0);let i=!1;for(let n of r)s.has(n)||(s.add(n),i=!0);return i}var v=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),jt=new Set(["default","generateMetadata","generateStaticParams"]),$t=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),At=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),Dt=new Set(["load","actions","entries",...v]),Ot=new Set(["default"]);function Ft(t,e){let r=x(t);return r===""?!1:V(e)?v.has(r):X(e)?jt.has(r):W(e)?$t.has(r):G(e)?At.has(r):U(e)?Dt.has(r):Ct(e)?Ot.has(r):!1}function Nt(t){return V(t)||X(t)||W(t)||Lt(t)||G(t)||U(t)}function V(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function X(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function W(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Lt(t){let e="(?:middleware|proxy|instrumentation)\\.(?:ts|js|mts|mjs)";return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function G(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function U(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function Ct(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function Mt(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function It(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function vt(t){let e=t.split("/"),r=e[e.length-1]??t;return r==="cli.ts"||r==="cli.js"||r==="postinstall.ts"||r==="postinstall.js"||r==="main.ts"||r==="main.js"||r==="main.rs"||r==="main.go"||r==="main.py"||r==="build.rs"||r==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:r==="index.ts"||r==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:e.length<=2:!1}function Vt(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function Xt(t,e){let r=e.lastIndexOf("/");if(r<0)return!1;let s=e.slice(0,r),i=e.slice(r+1);return t.includes(M(s)+"/")&&t.includes(M(i)+".")}function M(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{E as a,m as b,Pt as c,yt as d,ce as e,ue as f,fe as g};
8
+ //# sourceMappingURL=chunk-NLRWGGPY.js.map
@@ -0,0 +1,13 @@
1
+ import{A as Se,B as Q,C as G,D as He,E,F as Je,G as xe,H as Ke,I as Xe,b as ne,g as Oe,h as Me,i as _,j as ve,k as $e,l as Ue,m as B,n as qe,o as H,p as Be,q as ze,r as Ve,s as A,t as J,u as L,v as fe,w as de,x as S,y as ge,z as We}from"./chunk-MCNWCJYL.js";import{a as De,c as q,f as re,h as W,o as he,v as K,x as X,y as k}from"./chunk-WFRZGMWJ.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ft(e){return e.replace(/'''[\s\S]*?'''/g,w).replace(/"""[\s\S]*?"""/g,w).replace(/#.*$/gm,w).replace(/\/\/.*$/gm,w).replace(/\/\*[\s\S]*?\*\//g,w).replace(/`(?:\\[\s\S]|[^`])*`/g,w).replace(/'(?:\\.|[^'\\\r\n])*'/g,w).replace(/"(?:\\.|[^"\\\r\n])*"/g,w)}function zn(e){return Qe(e,{maskStrings:!1})}function Vn(e){return Qe(e,{maskStrings:!0})}function Qe(e,r){let t="",n=0,s=e.length;for(;n<s;){if(e[n]==="/"&&e[n+1]==="/"){let i=e.indexOf(`
2
+ `,n),a=i===-1?s:i;t+=ye(e,n,a),n=a;continue}if(e[n]==="/"&&e[n+1]==="*"){let i=e.indexOf("*/",n+2),a=i===-1?s:i+2;t+=ye(e,n,a),n=a;continue}let o=e[n];if(o==="`"||o==="'"||o==='"'){let i=o,a=n+1;for(;a<s;){if(e[a]==="\\"){a+=2;continue}if(e[a]===i){a+=1;break}if(i!=="`"&&e[a]===`
3
+ `)break;a+=1}t+=r.maskStrings?ye(e,n,a):e.slice(n,a),n=a;continue}t+=o,n+=1}return t}function ye(e,r,t){let n="";for(let s=r;s<t;s+=1)n+=e[s]===`
4
+ `?`
5
+ `:" ";return n}function w(e){return e.replace(/[^\r\n]/g," ")}var Wn=re("stripped-lines",{clearGroups:["whole-project","source-file"]});De({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{se=null,Y=""},clearFile:()=>{se=null,Y=""}});var se=null,Y="";function At(e){return se===e||(se=e,Y=Ft(e)),Y}function j(e,r,t){let n=At(e);return`${n.slice(0,r)}${" ".repeat(t-r)}${n.slice(t)}`}function x(e,r){return new RegExp(`\\b${O(r)}\\b`,"m").test(e)}function z(e,r){let t=new Set,n=new RegExp(`\\b${O(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function be(e){let r=0;for(let t of e)t==="("&&(r+=1),t===")"&&(r-=1);return r}var Lt=new Set(["identifier","type_identifier","field_identifier"]),kt=new Set(["identifier"]),wt=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),jt=new Set(["rust","python"]),Dt=/\{([^{}]*)\}/g,Ot=/\b([A-Za-z_][\w]*)\b/g;function Ge(e,r){return Mt(r).has(e.type)}function Ye(e,r){return jt.has(r)&&e.type==="string_content"}function Ne(e){let r=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>r&&(r=s)}let t=new Array(r+1);for(let n=0;n<=r;n+=1)t[n]=new Set;for(let[n,s]of e)for(let o of s)t[o].add(n);return t}function Mt(e){return e==="rust"?Lt:e==="python"?kt:wt}function Ze(e,r){let t=e.startPosition.row;for(let n of e.text.matchAll(Dt)){let s=n[1]??"";for(let o of s.matchAll(Ot))o[1]&&r(o[1],t)}}var vt=[/\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],$t=/^#!?\[\s*serde\s*\(/,Ut=/^#!?\[\s*schemars\s*\(/,qt=/^#!?\[\s*validate\s*\(/,Bt=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function et(e,r,t){if(r!=="typescript"&&r!=="tsx"&&r!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let s=xe(n);if(!s||!Bt.has(s))return;let o=e.namedChildren.find(c=>c.type==="arguments");if(!o)return;let i=o.namedChild(0);if(!i||i.type!=="string")return;let a=i.namedChildren.find(c=>c.type==="string_fragment");a&&t.add(a.text)}function tt(e,r){let t=$t.test(e),n=Ut.test(e),s=qt.test(e);if(!(!t&&!n&&!s))for(let o of vt){o.lastIndex=0;let i;for(;(i=o.exec(e))!==null;){let a=i[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&&r.add(c)}}}function rt(e,r){let t=new Map,n=(i,a)=>{if(i===a)return;let c=t.get(i);c||(c=new Set,t.set(i,c)),c.add(a)},s=r==="python"?new Set(["identifier"]):new Set(["type_identifier"]),o=(i,a)=>{let c=l=>{s.has(l.type)&&l.text!==a&&n(l.text,a);for(let p of l.children)c(p)};for(let l of i.children)c(l)};if(r==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=i.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&o(c,a),i.type==="type_item"&&o(i,a)}else if(r==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let a=i.namedChildren.find(p=>p.type==="identifier")?.text;if(!a)continue;let c=i.childForFieldName("superclasses");c&&o(c,a);let l=i.namedChildren.find(p=>p.type==="block");if(l)for(let p of l.descendantsOfType("type"))for(let u of p.descendantsOfType("identifier"))u.text!==a&&n(u.text,a)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=i.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&o(i,a)}return t}var zt=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),Ie=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 nt(e){let r=[],t=[],n=[],s=new Map,o=[],i=0,a=0,c=(l,p)=>{let u=s.get(l);if(!u){s.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)};for(;a<e.length;){let l=e[a];if(l===`
6
+ `){i+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=ie(e,a);continue}if(l==='"'){let h=ee(e,a,i);i=h.line,a=h.index;continue}if(l==="("||l==="["||l==="{"){o.push({kind:l,startLine:i,endLine:i,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let h=o.pop();h&&(h.endLine=i,Vt(h,{callables:r,callSites:t,clojureMembers:n,recordIdentifier:c}),o[o.length-1]?.children.push(h)),a+=1;continue}if(Ce(l)){a+=1;continue}let p=i,u=a;for(;a<e.length&&!Pe(e[a]);)a+=1;let m=e.slice(u,a);if(!m)continue;let f={text:m,line:p};Wt(o[o.length-1],f),c(N(m),p)}return{language:"clojure",callables:r,callSites:t,clojureMembers:n,typeContainerMap:new Map,identifierLineMap:s,identifiersByLine:Qt(s),fileIdentifiers:new Set(s.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function Vt(e,r){if(e.kind!=="("||e.headTokens.length===0)return;let t=e.headTokens[0],n=N(t.text),s=zt.get(t.text);if(s){let i=e.headTokens[1];if(i){let a=N(i.text);r.recordIdentifier(a,i.line),r.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:i.line,isLiteralPassthrough:!1,clojureKind:s})}}if(Ht(e,r),!n||Ie.has(t.text)||Ie.has(n)||n.startsWith(":"))return;let o=Xt(t.text);r.callSites.push({calleeLeaf:o.leaf,calleeQualifier:o.qualifier,calleeText:o.text,memberAccess:!1,line:t.line})}function Wt(e,r){e&&(e.headTokens.length<2&&e.headTokens.push(r),e.tokens.length<200&&e.tokens.push(r))}function Ht(e,r){let t=N(e.tokens[0]?.text??"");if(t==="defprotocol"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of oe(e))Z(r,n,"protocol",s,"protocol-method");return}if(t==="defrecord"||t==="deftype"){let n=N(e.tokens[1]?.text??"");if(!n)return;let s=t==="defrecord"?"record":"type",o=t==="defrecord"?"record-method":"type-method";for(let i of oe(e))Z(r,n,s,i,o);return}if(t==="extend-type"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of oe(e))Z(r,n,"extension",s,"extension-method");return}if(t==="extend-protocol"){let n=N(e.tokens[1]?.text??"");for(let s of oe(e)){n&&Z(r,n,"extension",s,"extension-method");let o=Kt(e,s.startLine);o&&o!==n&&Z(r,o,"extension",s,"extension-method")}}}function oe(e){return e.children.filter(Jt)}function Jt(e){if(e.kind!=="(")return!1;let r=N(e.tokens[0]?.text??"");return!!(r&&!Ie.has(r)&&!r.startsWith(":"))}function Z(e,r,t,n,s){let o=n.tokens[0],i=N(o?.text??"");!o||!i||(e.recordIdentifier(i,o.line),e.clojureMembers.push({ownerName:r,ownerKind:t,memberName:i,memberKind:s,startLine:n.startLine,endLine:n.endLine}))}function Kt(e,r){let t=null;for(let n=2;n<e.tokens.length;n+=1){let s=e.tokens[n];if(s.line>r)break;let o=N(s.text);o&&!o.startsWith(":")&&(t=o)}return t}function N(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function Xt(e){let r=e.replace(/^#?['`~@]+/,""),t=r.lastIndexOf("/"),n=N(r);if(t<=0)return{leaf:n,text:r};let s=r.slice(0,t);return{leaf:n,qualifier:s,text:r}}function ie(e,r){let t=r;for(;t<e.length&&e[t]!==`
7
+ `;)t+=1;return t}function ee(e,r,t){let n=r+1,s=t;for(;n<e.length;){let o=e[n];if(o==="\\"){n+=2;continue}if(o===`
8
+ `&&(s+=1),n+=1,o==='"')break}return{index:n,line:s}}function Ce(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function Pe(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Qt(e){let r=[];for(let[t,n]of e)for(let s of n)r[s]??=new Set,r[s].add(t);return r}var st=3,Gt=re("source-facts",{clearGroups:["whole-project","source-file"]}),_e=K({kind:"source-facts",invalidation:X("source-facts"),serialize:tr,deserialize:rr});function T(e,r){return Yt(e,r).facts}function Yt(e,r){let t=k(e,r);if(!t)return{facts:null};let n=Zt(e,r,t);return n?Gt.get(e,r,t,()=>er(e,r,n,t)):{facts:null}}function Zt(e,r,t){return G(r)?He(e,r,t)?.language??null:Q(r)}function er(e,r,t,n){let s=W(e,r,n),o=_e.read(e,r,s);if(o&&o.language===t)return{facts:o};if(t==="clojure"){let c=nt(n);return _e.write(e,r,s,c),{facts:c}}let i=E(e,r);if(!i)return{facts:null,unavailable:{language:t,reason:"parser-unavailable"}};let a=ir(i,t);return _e.write(e,r,s,a),{facts:a}}function tr(e){let r={version:st,language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([t,n])=>[t,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(r)}function rr(e){try{let r=JSON.parse(e);if(r.version!==st||r.language==="clojure"&&(r.clojureMembers===void 0||r.callSites.some(n=>n.calleeText===void 0)))return null;let t=new Map(r.identifierLineMap);return{language:r.language,callables:r.callables,callSites:r.callSites,clojureMembers:r.clojureMembers??[],typeContainerMap:new Map(r.typeContainerMap.map(([n,s])=>[n,new Set(s)])),identifierLineMap:t,identifiersByLine:Ne(t),fileIdentifiers:new Set(t.keys()),rustAttrReferencedNames:new Set(r.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(r.crossLanguageDispatchNames)}}catch{return null}}function nr(e,r,t,n){let s=T(e,r);return s?or(s,t,n)?.isLiteralPassthrough??!0:!0}function sr(e,r){return r.relativePath.includes(".clj-kondo/hooks/")?!0:T(e,r.relativePath)?.callables.find(n=>n.startLine===r.startLine&&n.endLine===r.endLine)?.clojureKind==="macro"}function or(e,r,t){return e.callables.find(n=>n.startLine===r&&n.endLine===t)??null}function ir(e,r){let t=[],n=[],s=new Set,o=new Set,i=new Map,a=(l,p)=>{let u=i.get(l);if(!u){i.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)},c=l=>{let p=Ke(l,r);p&&t.push(p);let u=Je(l,r);u&&n.push(u),et(l,r,o),r==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&tt(l.text,s),Ge(l,r)&&a(l.text,l.startPosition.row),Ye(l,r)&&Ze(l,a);for(let m of l.children)c(m)};return c(e.rootNode),{language:r,callables:t,callSites:n,clojureMembers:[],typeContainerMap:rt(e,r),identifierLineMap:i,identifiersByLine:Ne(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:o}}var ot=new Set(["rust","typescript","tsx","javascript","python","clojure"]);function ar(e,r){let t=T(e,r);return!t||!ot.has(t.language)?null:t.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function cr(e,r){let t=T(e,r);return!t||!ot.has(t.language)?null:t.callSites}function lr(e,r){return T(e,r)?.typeContainerMap??new Map}function pr(e,r,t={}){let n=T(e,r);if(!n)return[];let s=[];if(t.includeCrossLanguageDispatchNames)for(let o of n.crossLanguageDispatchNames)s.push({name:o,kind:"cross-language-dispatch",occurrences:1});if(t.includeRustAttributeNames&&n.language==="rust")for(let o of n.rustAttrReferencedNames)s.push({name:o,kind:"rust-attribute",occurrences:1});return s}import{basename as it}from"path";var ur=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function y(e){let r=[],t=0,n=0;for(let s=0;s<e.length;s++){let o=e[s];(o==="{"||o==="["||o==="(")&&t++,(o==="}"||o==="]"||o===")")&&t--,o===","&&t===0&&(r.push(e.slice(n,s)),n=s+1)}return r.push(e.slice(n)),r}function b(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function g(e,r){let t=new Set,n=(s,o)=>{let i=o||r.has(s.type);!i&&ur.has(s.type)&&t.add(s.text);for(let a of s.children)n(a,i)};return n(e.rootNode,!1),t}function R(e,r,t,n,s,o,i){return{importedName:s,localName:o,sourcePath:i??S(e,n,Ve(r)),kind:"named",used:x(t,o),usedMembers:[]}}function d(e,r,t,n,s="named",o={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function F(e,r,t,n,s="named",o=[],i={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n,usedMembers:o,isTypeOnly:i.isTypeOnly}}function M(e,r){return{importedName:e,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function v(e,r,t={}){return{importedName:e,localName:t.localName??null,sourcePath:r,kind:"namespace",used:t.used??!0,usedMembers:t.usedMembers??[],isTypeOnly:t.isTypeOnly}}function I(e,r,t){let n=[];for(let s of e.matchAll(r)){let o=s[0];if(!o||typeof s.index!="number")continue;let i=j(e,s.index,s.index+o.length);for(let a of t(s,i))n.push(a)}return n}function C(e,r,t,n){let s=E(e,r);if(s){let o=t(s);if(o)return o}return n()}function ae(e,r,t,n){let s=E(e,r),o=Q(r),i=o?t[o]:void 0;return s&&i?i(s):n()}function at(e,r,t){return C(e,r,n=>fr(e,r,n),()=>mr(e,r,t))}function mr(e,r,t){return I(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,s)=>{let o=n[1]?.trim();if(!o)return[];let i=it(o).replace(/\.[^.]+$/,"");return[F(o,i,de(e,r,o),x(s,i))]})}function fr(e,r,t){let n=g(t,new Set(["preproc_include"])),s=[];for(let o of t.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(p=>p.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=it(i).replace(/\.[^.]+$/,"");s.push(d(i,a,de(e,r,i),n))}return s}var dr=new Set([":require",":require-macros",":use"]),Te=String.raw`A-Za-z0-9_$*+!?.<>=-`;function lt(e,r,t){let n=_r(t);if(!n)return[];let s=Pr(t,n.start,n.end),o=[];for(let i of n.children.slice(2)){if(i.type!=="list"||i.children.length===0)continue;let a=P(i.children[0]);if(a){if(dr.has(a)){for(let c of hr(i.children.slice(1)))o.push(...Sr(e,c,s));continue}if(a===":import")for(let c of yr(i.children.slice(1)))o.push(c)}}return o}function gr(e){return e.type==="list"&&P(e.children[0])==="ns"}function Sr(e,r,t){let n=We(e,r.namespace),s=r.alias??r.namespace,o=Nr(t,s),i=[{importedName:r.namespace,localName:s,sourcePath:n,kind:"namespace",used:r.refers.length>0||r.referAll||o.length>0||Ir(t,r.namespace),usedMembers:o}];r.referAll&&i.push({importedName:"*",localName:null,sourcePath:n,kind:"side-effect",used:!0,usedMembers:[]});for(let a of r.refers)i.push({importedName:a,localName:a,sourcePath:n,kind:"named",used:Cr(t,a),usedMembers:[]});return i}function hr(e){return e.flatMap(r=>ce(r,null))}function ce(e,r){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:Ee(r,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&P(e.children[0])===null?e.children.flatMap(t=>ce(t,r)):xr(e,r);if(e.type==="list"&&e.children.length>0){let t=P(e.children[0]);return t?!t||t.startsWith(":")?[]:e.children.slice(1).flatMap(n=>ce(n,Ee(r,t))):e.children.flatMap(n=>ce(n,r))}return[]}function xr(e,r){let t=P(e.children[0]);if(!t||t.startsWith(":"))return[];let n={namespace:Ee(r,t),alias:null,refers:[],referAll:!1};for(let s=1;s<e.children.length;s+=1){let o=P(e.children[s]);if(!o?.startsWith(":"))continue;let i=e.children[s+1];if((o===":as"||o===":as-alias")&&i){n.alias=P(i),s+=1;continue}o===":refer"&&i&&(P(i)===":all"?n.referAll=!0:(i.type==="vector"||i.type==="list")&&n.refers.push(...i.children.map(P).filter(br)),s+=1)}return[n]}function yr(e){let r=[];for(let t of e){if(t.type==="atom"){let s=t.text.split(".").pop()??t.text;r.push(F(s,s,null,!0));continue}if(t.type!=="vector")continue;let n=P(t.children[0]);if(n)for(let s of t.children.slice(1)){let o=P(s);o&&r.push(F(`${n}.${o}`,o,null,!0))}}return r}function Ee(e,r){return e?`${e}.${r}`:r}function P(e){return e?.type==="atom"?e.text:null}function br(e){return!!(e&&!e.startsWith(":"))}function Nr(e,r){let t=new Set,n=new RegExp(`${Fe()}${O(r)}\\s*/\\s*([${Te}]+)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function Ir(e,r){return new RegExp(`${Fe()}${O(r)}\\s*/`,"m").test(e)}function Cr(e,r){return new RegExp(`${Fe()}${O(r)}(?![${Te}])`,"m").test(e)}function Fe(){return`(?<![${Te}])`}function Pr(e,r,t){let n="",s=0;for(;s<e.length;){if(s>=r&&s<t){n+=e[s]===`
9
+ `?`
10
+ `:" ",s+=1;continue}let o=e[s];if(o===";"){let i=ie(e,s);n+=ct(e.slice(s,i)),s=i;continue}if(o==='"'){let i=ee(e,s,0).index;n+=ct(e.slice(s,i)),s=i;continue}n+=o,s+=1}return n}function _r(e){let r=0;for(;r<e.length&&(r=Ae(e,r),!(r>=e.length));){let t=le(e,r);if(!t){r+=1;continue}if(gr(t.form))return t.form;r=t.index}return null}function le(e,r){let t=Ae(e,r);if(e.startsWith("#?@",t)||e.startsWith("#?",t))return Rr(e,t);if(e.startsWith("#_",t)){let s=le(e,t+2);return s?{form:{type:"atom",text:"",start:t,end:s.index},index:s.index}:null}for(;Ce(e[t]);)t+=1;let n=e[t];return n?n==="("?Re(e,t,"list",")"):n==="["?Re(e,t,"vector","]"):n==="{"?Re(e,t,"map","}"):n==='"'?{form:{type:"atom",text:"",start:t,end:ee(e,t,0).index},index:ee(e,t,0).index}:Tr(e,t):null}function Rr(e,r){let t=e.startsWith("#?@",r)?3:2,n=le(e,r+t);return n?{form:{type:"list",children:n.form.type==="list"||n.form.type==="vector"||n.form.type==="map"?Er(n.form.children):[],start:r,end:n.index},index:n.index}:null}function Er(e){let r=[];for(let t=0;t<e.length;t+=2){let n=P(e[t]),s=e[t+1];n?.startsWith(":")&&s&&r.push(s)}return r}function Re(e,r,t,n){let s=[],o=r+1;for(;o<e.length;){if(o=Ae(e,o),e[o]===n)return{form:{type:t,children:s,start:r,end:o+1},index:o+1};let i=le(e,o);if(!i){o+=1;continue}i.form.type==="atom"&&i.form.text===""||s.push(i.form),o=i.index}return{form:{type:t,children:s,start:r,end:e.length},index:e.length}}function Tr(e,r){let t=r;for(;t<e.length&&!Pe(e[t]);)t+=1;return{form:{type:"atom",text:e.slice(r,t),start:r,end:t},index:t}}function Ae(e,r){let t=r;for(;t<e.length;){let n=e[t];if(/\s|,/.test(n)){t+=1;continue}if(n===";"){t=ie(e,t);continue}break}return t}function ct(e){return e.replace(/[^\r\n]/g," ")}function pt(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=j(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:ge(e,r,o),kind:i?"namespace":"side-effect",used:i?x(c,i):!0,usedMembers:i?z(c,i):[]})}return n}function ut(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:ge(e,r,o)})}return n}function mt(e,r,t){return ae(e,r,{csharp:n=>Ar(e,r,n),vb:n=>Fr(e,r,n)},()=>{let n=ze(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return I(t,n,(s,o)=>{let i=s[1]?.trim();if(!i)return[];let[a,c]=i.split(/\s*=\s*/),l=!!c,p=(l?c:a)?.trim()??i,u=p.split(".").pop()??p,m=l?a?.trim()??u:u;return[R(e,r,o,p,u,m,S(e,p,B))]})})}function Fr(e,r,t){let n=g(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,l=a.text,p=l.split(".").pop()??l,u=c?.text??p;s.push(d(p,u,S(e,l,B),n,c?"namespace":"named"))}return s}function Ar(e,r,t){let n=g(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1];let l=c.text,p=l.split(".").pop()??l,u=a?.text??p;s.push(d(p,u,S(e,l,B),n,a?"namespace":"named"))}return s}var Lr=q("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function ft(e,r){return Lr.get(e,r,()=>{let t=new Set,n=k(e,r);if(!n)return t;let o=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))t.add(i[0]);return t})}function Le(e,r,t){return C(e,r,n=>wr(e,r,n),()=>kr(e,r,t))}function kr(e,r,t){return Vr(t).flatMap(n=>Wr(e,r,n.clause,n.specifier,n.start,n.end,t))}function wr(e,r,t){let n=jr(e,r,t),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))s.push(...Dr(e,r,t,o,n));return s}function jr(e,r,t){let n=g(t,new Set(["import_statement"]));if(G(r))for(let s of ft(e,r))n.add(s);return n}function Dr(e,r,t,n,s){let o=Ur(n);if(!o)return[];let i=A(e,r,o),a=b(n,"import_clause");return a?Or(t,a,i,s,qr(n.text)):[M("*",i)]}function Or(e,r,t,n,s){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(Mr(i.text,t,n,s));else if(i.type==="namespace_import"){let a=vr(e,i,t,n,s);a&&o.push(a)}else i.type==="named_imports"&&o.push(...$r(i,t,n,s));return o}function Mr(e,r,t,n){return d("default",e,r,t,"default",{isTypeOnly:n})}function vr(e,r,t,n,s){let i=b(r,"identifier")?.text??"";if(!i)return null;let a=zr(e,i);return v("*",t,{localName:i,usedMembers:a,isTypeOnly:s,used:a.length>0||n.has(i)})}function $r(e,r,t,n){let s=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let c=i.text,l=a?.text??c;s.push(d(c,l,r,t,"named",{isTypeOnly:n||Br(o.text)}))}return s}function Ur(e){let r=b(e,"string");if(!r)return null;let t=b(r,"string_fragment");return t?t.text:null}function qr(e){return/^\s*import\s+type\b/.test(e)}function Br(e){return/^\s*type\b/.test(e.trim())}function zr(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function Vr(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function Wr(e,r,t,n,s,o,i){let a=A(e,r,n),c=j(i,s,o);return t?Hr(t).map(p=>({...p,sourcePath:a})).map(p=>{if(p.kind==="namespace"){let u=z(c,p.localName);return v(p.importedName,p.sourcePath,{localName:p.localName,usedMembers:u,used:u.length>0||x(c,p.localName),isTypeOnly:p.isTypeOnly})}return p.kind==="side-effect"?M(p.importedName,p.sourcePath):F(p.importedName,p.localName??"",p.sourcePath,p.localName?x(c,p.localName):!1,p.kind,[],{isTypeOnly:p.isTypeOnly})}):[M("*",a)]}function Hr(e){let r=e.trim(),t=/^type\b/.test(r),n=r.replace(/^type\s+/,""),[s,o]=Jr(n),i=[];return s&&i.push(...dt(s,t)),o&&i.push(...dt(o,t)),i}function dt(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let n=t.slice(1,-1).trim();return n?y(n).map(s=>{let o=s.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:i}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function Jr(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function ke(e,r,t){let n=E(e,r);return n?Zr(e,r,n):Kr(e,r,t)}function Kr(e,r,t){return[...Xr(e,r,t),...Qr(e,r,t),...Gr(e,r,t)]}function Xr(e,r,t){let n=[],s=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",c=y(i).map(u=>Yr(u.trim())).filter(u=>!!u),l=V(t,o.index),p=V(t,o.index+o[0].length-1);n.push({kind:"named",sourcePath:A(e,r,a),names:c,startLine:l,endLine:p})}return n}function Qr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[2]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star-as",sourcePath:A(e,r,i),names:[],startLine:a,endLine:c})}return n}function Gr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star",sourcePath:A(e,r,i),names:[],startLine:a,endLine:c})}return n}function Yr(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function V(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function Zr(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=en(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=tn(s,o,i,a);n.push(c)}return n}function en(e,r,t){let n=b(t,"string");if(!n)return;let s=b(n,"string_fragment");if(s)return A(e,r,s.text)}function tn(e,r,t,n){let s=b(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&i.push((l??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}return b(e,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:t,endLine:n}:{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}function gt(e,r,t){return ae(e,r,{java:n=>rn(e,r,n),kotlin:n=>nn(e,r,n),scala:n=>sn(e,r,n)},()=>I(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,s)=>{let o=n[1]?.trim();return o?on(e,r,o,s):[]}))}function rn(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let l=c.text;if(i){s.push(v("*",S(e,l,_)));continue}let p=l.split(".").pop()??l;s.push(d(p,p,S(e,l,_),n))}return s}function nn(e,r,t){let n=g(t,new Set(["import_header","import_list"])),s=[];for(let o of t.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(f=>f.type==="identifier");if(!i)continue;let a=o.namedChildren.some(f=>f.type==="wildcard_import"),c=o.namedChildren.find(f=>f.type==="import_alias");if(a){s.push(v("*",S(e,i.text,_)));continue}let l=i.text,p=l.split(".").pop()??l,m=c?.namedChild(0)?.text??p;s.push(d(p,m,S(e,l,_),n))}return s}function sn(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push(v("*",S(e,c,_)));continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,f]=u.namedChildren;if(!m)continue;let h=m.text,$=f?.text??h;if(h==="_")continue;s.push(d(h,$,S(e,`${c}.${h}`,_),n))}else if(u.type==="identifier"){let m=u.text;s.push(d(m,m,S(e,`${c}.${m}`,_),n))}continue}let l=a[a.length-1]?.text??c,p=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push(d(l,l,S(e,p&&a.length>1?`${p}.${l}`:c,_),n))}return s}function on(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),p=c?.trim();if(!p||p==="_")return[];let u=(l??p.split(".").pop()??p).trim(),m=p==="_"?s:`${s}.${p}`.replace(/\.\./g,".");return[R(e,r,n,m,p,u)]})}return[R(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function ht(e,r,t){return C(e,r,n=>an(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),p=c?.trim()??a,u=p.split("\\").pop()??p,m=(l??u).trim();return[R(e,r,s,p,u,m,S(e,p.replace(/\\/g,"."),H))]}):[]}))}function an(e,r,t){let n=g(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push(d(a,c,S(e,i.replace(/\\/g,"."),H),n))};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=St(l,c);p&&o(m,p,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:p,qualified:u}=St(c,"");l&&o(u,l,p)}}return s}function St(e,r){let t=e.namedChildren.find(l=>l.type==="qualified_name"),n=e.namedChildren.filter(l=>l.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function yt(e,r,t){return C(e,r,n=>cn(e,r,n),()=>pn(t).flatMap(n=>mn(e,r,n,t)))}function cn(e,r,t){let n=g(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=xt(i);if(!a)continue;let c=J(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=ln(i);if(a===null)continue;let c=J(e,r,a);for(let l=1;l<o.namedChildCount;l+=1){let p=o.namedChild(l);if(p.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=xt(p);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function xt(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function ln(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=b(e,"import_prefix")?.text??"",t=b(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function pn(e){let r=e.split(`
11
+ `),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,l=a+o.length,p=be(o);for(;s+1<r.length&&(p>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
12
+ ${m}`,l+=1+m.length,p+=be(m),n+=m.length+1}let u=un(c);u&&t.push({...u,start:a,end:l})}return t}function un(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function mn(e,r,t,n){let s=j(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return y(o).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[p,u]=l.split(/\s+as\s+/),m=p.trim(),f=(u??m.split(".")[0]??m).trim(),h=J(e,r,m),$=z(s,f);return[{importedName:m,localName:f,sourcePath:h,kind:"namespace",used:x(s,f)||$.length>0,usedMembers:$}]});let i=t.module?J(e,r,t.module):null,a=[];for(let c of y(o)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[p,u]=l.split(/\s+as\s+/),m=(u??p).trim();a.push({importedName:p.trim(),localName:m,sourcePath:i,kind:"named",used:x(s,m),usedMembers:[]})}return a}import{basename as fn}from"path";function bt(e,r,t){return C(e,r,n=>gn(e,r,n),()=>dn(e,r,t))}function dn(e,r,t){return I(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,s)=>{let o=n[1],i=n[2];if(!o||!i)return[];let a=o==="require_relative"?fe(e,r,i):null;if(a){let c=Nt(i);return[F(c,c,a,x(s,c))]}return[M(i,a)]})}function gn(e,r,t){let n=g(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let l=i.namedChildren.find(f=>f.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(f=>f.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?fe(e,r,u):null;if(m){let f=Nt(u);s.push(d(f,f,m,n))}else s.push(M(u,m))}return s}function Nt(e){return Xe(fn(e).replace(/\.[^.]+$/,""),/_/)}function It(e,r,t){return C(e,r,n=>Sn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?hn(e,r,o,s):[]}))}function Sn(e,r,t){let n=g(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of te(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=L(e,r,a.qualifiedName)??L(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push(d(a.importedName,a.localName,c,n))}}return s}function te(e,r){switch(e.type){case"identifier":case"super":case"crate":{let t=e.text;return[{qualifiedName:pe(r,t),importedName:t,localName:t}]}case"self":{let t=r.split("::").filter(Boolean).pop()??"self";return[{qualifiedName:r||"self",importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:pe(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=pe(r,t.text),o=[];for(let i of n.namedChildren)o.push(...te(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...te(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=te(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:pe(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function pe(e,r){return e?r?`${e}::${r}`:e:r}function hn(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let p=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return y(u).flatMap(m=>{let f=m.trim();if(!f)return[];if(f==="self"){let me=p.split("::").filter(Boolean).pop();return me?[R(e,r,n,p,me,me)]:[]}let[h,$]=f.split(/\s+as\s+/),U=h?.trim();if(!U)return[];let Et=($??U.split("::").pop()??U).trim(),Tt=`${p}::${U}`.replace(/::::/g,"::");return[R(e,r,n,Tt,U.split("::").pop()??U,Et,L(e,r,p))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),l=L(e,r,a)??L(e,r,a.split("::").slice(0,-1).join("::"));return[R(e,r,n,a,a.split("::").pop()??a,c,l)]}function Ct(e,r,t){let n=E(e,r);if(n)return xn(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...bn(e,r,i))}return s}function xn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!yn(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of te(o,""))i.importedName&&n.push(we(e,r,i.qualifiedName))}return n}function yn(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function bn(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[we(e,r,l)]})}return[we(e,r,n)]}function we(e,r,t){return{specifier:t,sourcePath:L(e,r,t)??L(e,r,t.split("::").slice(0,-1).join("::"))}}function D({language:e,extensions:r,imports:t,parseImports:n}){return{language:e,extensions:r,capabilities:{imports:t},parseImports:n}}function Pt(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var Nn={language:"javascript",extensions:Oe,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Le,parseReExports:ke},In=D({language:"python",extensions:Me,imports:"ast-with-regex-fallback",parseImports:yt}),Cn=D({language:"jvm",extensions:_,imports:"ast-dispatch-with-regex-fallback",parseImports:gt}),Pn={language:"rust",extensions:ve,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:It,parseExports:Ct},_n=D({language:"ruby",extensions:$e,imports:"ast-with-regex-fallback",parseImports:bt}),Rn=D({language:"c/cpp",extensions:Ue,imports:"ast-with-regex-fallback",parseImports:at}),En=D({language:"dotnet",extensions:B,imports:"ast-dispatch-with-regex-fallback",parseImports:mt}),Tn={language:"dart",extensions:qe,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:pt,parseExports:ut},Fn=D({language:"php",extensions:H,imports:"ast-with-regex-fallback",parseImports:ht}),An=D({language:"clojure",extensions:Be,imports:"regex-only",parseImports:lt}),Ln=[Nn,In,Cn,Pn,_n,Rn,En,Tn,Fn,An];function ue(e){return Pt(Ln,e)}var je={clearGroups:["whole-project","source-file"]},kn=q("source-imports",je),wn=q("source-exports",je),jn=q("source-reexports",je),_t=K({kind:"source-imports",invalidation:X("source-imports"),serialize:Dn,deserialize:On}),Rt=K({kind:"source-reexports",invalidation:X("source-reexports"),serialize:Mn,deserialize:vn});function Xo(e,r){let t=ne(r);return jn.get(e,t,()=>{let n=ue(t);if(!n?.parseReExports)return[];let s=k(e,t);if(!s)return[];let o=W(e,t,s),i=Se(e),a=Rt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.reExports;let c=n.parseReExports(e,t,s);return Rt.write(e,t,o,{resolutionFingerprint:i,reExports:c}),c})}function Qo(e,r){let t=ne(r);return kn.get(e,t,()=>{let n=ue(t);if(!n)return[];let s=k(e,t);if(!s)return[];let o=W(e,t,s),i=Se(e),a=_t.read(e,t,o);if(a?.resolutionFingerprint===i)return a.imports;let c=n.parseImports(e,t,s);return _t.write(e,t,o,{resolutionFingerprint:i,imports:c}),c})}function Go(e,r){let t=ne(r);return wn.get(e,t,()=>{let n=ue(t);if(!n?.parseExports)return[];let s=k(e,t);return s?n.parseExports(e,t,s):[]})}function Dn(e){return JSON.stringify(e)}function On(e){try{let r=JSON.parse(e);return!he(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.imports)?null:{resolutionFingerprint:r.resolutionFingerprint,imports:r.imports}}catch{return null}}function Mn(e){return JSON.stringify(e)}function vn(e){try{let r=JSON.parse(e);return!he(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.reExports)?null:{resolutionFingerprint:r.resolutionFingerprint,reExports:r.reExports}}catch{return null}}export{O as a,Ft as b,zn as c,Vn as d,be as e,T as f,Yt as g,nr as h,sr as i,ar as j,cr as k,lr as l,pr as m,pe as n,Xo as o,Qo as p,Go as q};
13
+ //# sourceMappingURL=chunk-NLVKD45E.js.map