Brazil midfielder Arthur will leave Barcelona and join Juventus from next season, with Miralem Pjanic expected to move the opposite way.