#!/usr/bin/env python3
from __future__ import annotations

import argparse
import tkinter as tk

from safety_judge.ui import SafetyJudgeApp


def main() -> None:
    parser = argparse.ArgumentParser(description="Safety Judge V13")
    parser.add_argument("--background", action="store_true", help="start live protection with the window hidden")
    parser.add_argument("--profile", default="", help="profile ID to open in background mode")
    args = parser.parse_args()

    root = tk.Tk()
    app = SafetyJudgeApp(
        root,
        start_background=args.background,
        startup_profile_id=args.profile,
    )
    root._safety_judge_app = app  # type: ignore[attr-defined]
    root.mainloop()


if __name__ == "__main__":
    main()
