cask "lehreroffice" do
  version "2026.3.1"
  sha256 :no_check

  url "https://www.cmi-bildung.ch/lo/dateien/easy/lo_desktop_macos.dmg"
  name "LehrerOffice"
  desc "Education software"
  homepage "https://www.cmi-bildung.ch/"

  livecheck do
    url "https://www.cmi-bildung.ch/lo/dateien/easy/lo_version.txt"
    regex(/(\d+(?:\.\d+)+)/i)
  end

  depends_on :macos

  app "LehrerOffice.app"

  zap delete: "/Library/Application Support/LehrerOffice",
      trash:  [
        "~/Documents/LehrerOffice",
        "~/Library/Saved Application State/ch.rothsoft.lehreroffice.desktop.savedState",
      ]

  caveats do
    requires_rosetta
  end
end
