cask "elemental" do
  version "7.7.0"
  sha256 "a7b4e02d5eeb591816c43007d9a9f3a498d3a9a5e248f2bfbef8550a589a17f4"

  url "https://github.com/evolvedbinary/elemental/releases/download/elemental-#{version}/elemental-#{version}.dmg",
      verified: "github.com/evolvedbinary/elemental/"
  name "elemental"
  desc "Native XML Database with XQuery and XSLT"
  homepage "https://www.elemental.xyz/"

  livecheck do
    url :url
    regex(/^elemental[._-]v?(\d+(?:\.\d+)+)$/i)
  end

  depends_on :macos

  app "Elemental.app"

  zap trash: "~/Library/Application Support/xyz.elemental"

  caveats do
    depends_on_java "21"
  end
end
