cask "mindmaster-cn" do
  version "13.0.13,5379"
  sha256 "b94f8d9596325306ed476f856f329c74c370405e7c664c37c68b2631268dc476"

  url "https://cc-download.edrawsoft.cn/cbs_down/mindmaster_cn_full#{version.csv.second}.dmg"
  name "MindMaster"
  name "亿图脑图MindMaster"
  desc "Mind mapping software"
  homepage "https://www.edrawsoft.cn/mindmaster/"

  livecheck do
    url "https://www.edrawsoft.cn/download/"
    regex(/href=.*?mindmaster[._-]cn[._-]full(\d+)\.dmg.*?版本v?(\d+(?:\.\d+)+)/im)
    strategy :page_match do |page, regex|
      match = page.match(regex)
      next if match.blank?

      "#{match[2]},#{match[1]}"
    end
  end

  depends_on :macos

  app "亿图脑图MindMaster.app"

  caveats do
    requires_rosetta
  end

  # No zap stanza required
end
