Thymolphthalein is an acid-base indicator that is colorless below pH 9.3 and blue above pH 10.5. The synthesis of thymolphthalein involves the reaction of pthalic anhydride with two equivalents of thymol (2-isopropyl-5-methylphenol) in an acidic medium.

Write a mechanism for the reaction.