Ab initio study of the hygroscopic properties of borate crystals