Arsenal agree a deal in principle worth up to 38.5m euros (£32.67m) to sign Spain midfielder Mikel Merino from Real Sociedad.