cask "wpsoffice" do
  arch arm: "arm64", intel: "x64"

  version "12.1.26032,0024.21300060"
  sha256 :no_check

  url "https://wdl1.pcfg.cache.wpscdn.com/wpsdl/macwpsoffice/download/installer/i18n/WPSOffice_#{arch}_#{version.csv.second}.dmg",
      verified: "wdl1.pcfg.cache.wpscdn.com/"
  name "WPS Office"
  desc "All-in-one office suite"
  homepage "https://www.wps.com/office/mac/"

  livecheck do
    skip "No version information available"
  end

  conflicts_with cask: "wpsoffice-cn"
  depends_on :macos

  app "wpsoffice.app"

  uninstall quit: "com.kingsoft.wpsoffice.mac.global"

  zap trash: [
    "~/Library/Application Scripts/com.kingsoft.wpsoffice.mac.global",
    "~/Library/Containers/com.kingsoft.wpsoffice.mac.global",
  ]
end
