Theory of potentiometric titration of polyelectrolytes: a discrete-site model for hyaluronic acid