Thermodynamic and kinetic study of lactonization and protonation