Khamenai. The nuclear program was really just a hedge against Saddam. Once he fell there was not a need for a nuclear weapons program.
Also Iran assumed that U.S. could never sanction Iranian oil or put true economic pressure on Iran. They couldn’t foresee fracking technology.
As I said multiple times, Iran needed a leader like Mao or Khomeini that truly wanted to stand up to Western imperialism and instead got a Gorbachev whose heart really wasn’t in conflict or fighting kinetic wars.
As I said, Iran was its own worst enemy with its self sabotage. Until Iran gets a true leader in power (Mojtaba is not that leader) then Iran can never be truly great. You need the type of leader that rebuilds the system and carries respect and admiration.