import re
from pathlib import Path

html_path = Path(r"C:\Projects\FreeExile\client\webapp\index.html")
html = html_path.read_text(encoding="utf-8")

onclicks = re.findall(r'onclick=["\']([^"\']+)["\']', html)
print(f"Total onclick handlers in index.html: {len(onclicks)}")
fns = set()
for o in onclicks:
    fn_name = o.split("(")[0].strip()
    if fn_name:
        fns.add(fn_name)
print(f"Unique functions invoked by onclick ({len(fns)}):")
for f in sorted(fns):
    print(f"  - {f}")
